![background image](http://html.mh-extra.com/html/mitsubishi-electric/melsec-iq-f-fx5/melsec-iq-f-fx5_programming-manual_239114398.webp)
396
8 APPLICATION INSTRUCTION
8.4 Structuring Instruction
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. (
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
3340H
After the FOR instruction is executed, the END or GOEND instruction is executed before the NEXT instruction is executed.
3361H
When the FOR instruction is nested, the 17th level is executed.
33E3H
A program is written where the nesting of the FOR to NEXT instructions exceeds 16 levels.
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
Page 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 17: ...15 CONTENTS ...
Page 24: ...22 MEMO ...
Page 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Page 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Page 1107: ...I 1105 MEMO ...
Page 1111: ......