242
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
Programming Manual - Basic & Applied Instruction Edition
8 Program Flow – FNC 00 to FNC 09
8.10 FNC 09 – NEXT / End a FOR/NEXT Loop
8.10 FNC 09 – NEXT / End a FOR/NEXT Loop
Outline
NEXT instruction specifies the end position of the loop.
1. Instruction format
2. Set data
3. Applicable devices
Explanation of function and operation
The loop between FOR and NEXT instructions is repeated "n" times (which is specified by the source data).
After the loop is repeated by the specified number of times, steps after NEXT instruction are executed.
Related instruction
NEXT instruction and FOR (FNC 08) instruction are set as a pair in programming.
Caution
1. Limitation in the number of nesting
FOR-NEXT loop can be nested up to 5 levels.
Operand type Description Data type
– There is no set data. –
Oper-
and
Type
Bit Devices Word Devices Others
System User Digit Specification System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
XYMTCSD.b KnX KnY KnM KnS T C D R U\G V Z Modify K H E ""P
– There are no applicable devices.
FNC 09
NEXT
NEXT
Mnemonic Operation Condition
Continuous
Operation
Independent Inst.
1 step
This instruction is the independent type, and
does not require drive contact.
FNC 08
FOR
FNC 09
NEXT
Repeated " "
times.
S
S
FNC 08
FOR
1st
level
2nd
level
3rd
level
1st
level
2nd
level
1st
level
FNC 08
FOR
FNC 08
FOR
FNC 09
NEXT
FNC 09
NEXT
FNC 09
NEXT
FNC 09
NEXT
FNC 09
NEXT
FNC 09
NEXT
FNC 08
FOR
FNC 08
FOR
FNC 08
FOR