User`s manual
Local Logic Tutorial
GFK-1742A Chapter 11 Local Logic Tutorial 11-5
11
isolates bits 1,3,14, and 16 from CTL_1_to_32 and places the result in P001.
The next statement performs a bitwise test to see if any of the bits in the least significant byte are
set. The test value corresponds to a binary value as follows:
16#F = 2#1111
Thus the statement
IF P001 BWAND 16#F THEN
performs a bitwise test with the least significant byte of P001 and if any of the bits in the least
significant byte are set to a logical true (value = 1) then statements in the IF block are evaluated.
In our example, since we have masked CTL_1_to_32 in the previous statement, the IF condition
only tests bit 1 and bit 3 of CTL_1_to_32.
Local Logic / PLC / Motion Program Communication
The Local Logic program or host PLC communicates with the motion program using parameters,
CTL bits and Motion Program Block Numbers. The usage of these methods are:
•
Parameter Data
– The Parameter data (P000-P255) are accessible from Local Logic, host
PLC, and Motion Programs. The Parameter data are similar to variables in a program. For
example, a motion program can DWELL a period of time that is determined by a parameter.
The Local Logic program or the host PLC can write the parameter that determines the DWELL
time in motion program.
•
CTL Bits
– CTL Bits allow the Local Logic program or host PLC to signal the Motion
Program to start an event. For example CTL bits are used to control Motion Program flow
with the JUMP command.
•
Motion Program Block Numbers
– The Motion Program (when block numbers are used
within the Motion Program) makes the current block number available to the Local Logic
program or host PLC. The current Block number can be used within the Local Logic program
or host PLC to make an action occur only during a specific Motion Program section.
The signaling constructs between programs (PLC, Motion, and Local Logic) allows them to
interact and perform operation between programs. These signaling constructs are important for the
programming examples that follow. For additional information on the PLC to motion program
communications and program interactions the reader should consult chapter 5 and Chapter 7.
Local Logic Programming Examples
The preceding sections introduced the base local logic language constructs. To illustrate these
concepts, the following sections contain program examples. These programs are for illustration
only and do not necessarily represent functional applications. Additional details concerning the
available local logic statements, variables and constructs are contained in Chapter 12 and Chapter
13.