340
7 APPLICATION INSTRUCTION
7.4 Structuring instruction
7.4 Structuring instruction
FOR to NEXT
FOR, NEXT
When the processing between the FOR and NEXT instructions is executed (n) times without any condition, the processing of
the step following the NEXT instruction is executed.
■Descriptions, ranges, and data types
■Applicable devices
• When the processing between the FOR and NEXT instructions is executed (n) times without any condition, the processing
of the step following the NEXT instruction is executed.
• In (n), any of 1 to 32767 can be specified. If any of -32768 to 0 is specified, the processing of (n)=1 is applied.
• To skip the processing between the FOR and NEXT instructions, jump the program execution with the CJ instruction.
• Up to 16 FOR instructions can be nested.
Ladder diagram Structured text
Not supported
Operand Description Range Data type Data type (label)
(n) Number of repetitions of the loop between FOR and NEXT
instructions
1 to 32767 16-bit signed binary ANY16
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(n)
FOR
NEXT
(n)
Repetition program