Chapter 4. Ladder Diagram (LD) Programming
GFK-2950C February 2018 113
Operands
Only the FOR_LOOP function requires operands.
The index variable. When the loop has completed, this
value is undefined.
Note: Changing the value of the index variable within
the scope of the FOR loop is not recommended.
All except constants, flow,
and variables in %S - %SC
All except variables in %S -
%SC
All except variables in %S -
%SC
The increment value. (Default: 1.)
The value for %M00001 (START) is 1 and the value for %M00017
(END) is 10. The INDEX (%R00001) increments by the value of the INC
operand (which is assumed to be 1 when omitted) starting at 1 until
it reaches the ending value 10. The ADD function of the loop is
executed 10 times, adding the current value of I1 (%R00001), which
will vary from 1 to 10, to the value of I2 (%R00002).
The value for %T00001 (START) is -100 and the value for %T00017
(END) is 100. The INDEX (%R00001) increments by tens, starting
at -100 until it reaches it end value of +100. The EQ function of the
loop tries to execute 21 times, with the INDEX (%R00001) being
equal to -100, –90, –80, –70, –60, –50, –40, –30, –20, –10, 0, 10, 20,
30, 40, 50, 60, 70, 80, 90, and 100. However, when the INDEX
(%R00001) is 0, the EXIT statement is enabled and power flow jumps
directly to the statement after the END_FOR statement.