Specifications

SIMATIC Instructions
9-151
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Here are some guidelines for using the FOR/NEXT loop:
If you enable the FOR/NEXT loop, it continues the looping process until it
finishes the iterations, unless you change the final value from within the loop
itself. You can change the values while the FOR/NEXT is in the looping
process.
When the loop is enabled again, it copies the initial value into the index value
(current loop number). The FOR/NEXT instruction resets itself the next time it is
enabled.
Use the FOR/NEXT instructions to delineate a loop that is repeated for the
specified count. Each FOR instruction requires a NEXT instruction. You can nest
FOR/NEXT loops (place a FOR/NEXT loop within a FOR/NEXT loop) to a depth of
eight.