
7 APPLICATION INSTRUCTION
7.4 Structuring instruction
341
7
Precautions
• The FOR-NEXT loop can be nested up to 16 levels.
• The FOR-NEXT loop cannot be interrupted by the I, IRET, SRET, RET, FEND, or END instruction.
• When FOR-NEXT loop is repeated many times, the operation cycle is too long, and a watchdog timer error may occur. In
such a case, change the watchdog timer time or reset the watchdog timer.
• The following programs are regarded as errors.
Operation error
• To terminate the FOR to NEXT instruction loop halfway, use the BREAK instruction. (
Forcibly terminating the FOR to NEXT instruction loop)
When the NEXT instruction is located before FOR
No NEXT instruction
When the number of FOR instructions is not equivalent to the number of
NEXT instructions
When the NEXT instruction is located after the FEND or END instruction
Error code
(SD0/SD8067)
Description
3340
After the FOR instruction is executed, the END or GOEND instruction is executed before the NEXT instruction is executed.
3361
When the FOR instruction is nested, the 17th level is executed.
FOR
FOR
FOR
NEXT
NEXT
NEXT
FOR
FOR
FOR
NEXT
NEXT
NEXT
3rd level
2nd level
1st level
2nd level
1st level
1st level
FOR
NEXT
FOR
NEXT
Not programmed
FOR
NEXT
NEXT
FOR
Not programmed
FOR
NEXT
FEND
NEXT
END
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......