User`s manual
11-10 Motion Mate™ DSM314 for Series 90™-30 PLCs User's Manual
–
January 2001 GFK-1742A
11
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. For our example, we are using 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 times 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 11-
2.
Actual_Position_1
4000
500 ms
Digital_Output1_1
OFF
ON
Figure 11-2. Timer Output Based Upon Position Example
Timer Output Based Upon Position Local Logic Program