
User Manual
Chapter 11
GFK-1742F
Jan 2020
Local Logic Tutorial
283
Programmable Limit Switch Local Logic Program
The motion program segment corresponding with the above local logic program is shown
below.
Programmable Limit Switch Example Motion Program Segment
11.6.4
Trigger Output Based Upon Position Program Example
The following example illustrates a method to use Local Logic to trigger a timed output
based upon the current motor position. The reader should note that the timer
implementation uses a counter within the program. The counter counts the number of
times the program has been executed since the counter was last reset. Since local logic
programs are executed every position loop sample period, the counter time period is based
upon this period. This example uses digital servos, which have 2 mSec position loop sample
periods. Therefore, the counter will count in 2 mSec increments. For other configurations,
consult Chapter 1 for the position loop sample periods. Additionally, Local Logic allows the
program to write a variable multiple time within a program. The last state that the variable
is in at program completion is the one written to the output (refer to Chapter 12, section on
Local Logic Outputs/Commands). This is important in the following program. The second
IF-THEN-END_IF block turns the digital output for axis 1 (Digital_Output1_1) on when actual
position for axis 1 (Actual_Position_1) is greater than 4000 regardless of the current timer
value (P008). However, the last IF-THEN-END_IF block in the program checks the current
timer value (P008) and turns the digital output 1 for axis 1 (Digitial_Output_1) off if the
timer exceeds 500. The application is shown pictorially in Figure 140.