Chapter 6 Instruction Details
XBC E-Type Main Unit 6-288 Ve r. 1
6.39 Loop Instruction
6.39.1 FOR, NEXT
Instruction
Step
P M K F L T C S Z D.x
R.x
U N D R
O - -
Operand Description Data Type
n Number of times to execute FOR~NEXT WORD
1) FOR~NEXT
(1) PLC meeting FOR in RUN mode will execute the process between FOR and NEXT instructions for “n”
times and then the next step of NEXT instruction.
(2) 1 ~ 65535 is available for “n”.
(3) NESTING of FOR~NEXT up to 16 times is possible. If this is exceeded, program downloading will be
unavailable.
(4) BREAK instruction can be used as another method to escape from FOR~NEXT loop.
(5) Since scan time may be longer than expected, use WDT instruction to not exceed WDT setting limit.
2) Program Example
PLC executes FOR~NEXT for 2 times in RUN mode.