![Mitsubishi Electric MELSEC FX3G Programming Manual Download Page 253](http://html.mh-extra.com/html/mitsubishi-electric/melsec-fx3g/melsec-fx3g_programming-manual_239083253.webp)
251
FX
3G
/FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
8 Program Flow – FNC 00 to FNC 09
8.10 FNC 09 – NEXT / End a FOR/NEXT Loop
1
Int
roduct
ion
2
O
ver
view
3
In
str
uc
tion
Li
st
4
D
evices
in D
etail
5
Spec
ified t
he
D
evice &
C
onst
ant
6
Bef
ore
Pr
ogr
am
m
ing
7
B
asic
In
st
ru
ct
io
n
8
FN
C
00-FN
C
09
P
rogr
am
F
low
9
FN
C
10
-FN
C
19
Mo
ve
&
Co
mp
are
10
FNC2
0-F
NC2
9
Ar
ith.
&
Logic
O
per
ation
Caution
1. Limitation in the number of nesting
FOR-NEXT loop can be nested up to 5 levels.
Errors
1. Watchdog timer error
When FOR-NEXT loop is repeated many times, the operation cycle (D8010) is too long, and a watchdog
timer error may occur. In such a case, change the watchdog timer time or reset the watchdog timer.
→
For details on changing the watchdog timer time, refer to Subsection 37.2.2.
→
For resetting the watchdog timer, refer to WDT (FNC 07) instruction.
2. Examples of wrong programs
The following programs are regarded as errors.
FOR
1st
level
FOR
FOR
NEXT
NEXT
NEXT
2nd
level
3rd
level
FOR
1st
level
FOR
FOR
NEXT
NEXT
NEXT
2nd
level
1st
level
When NEXT instruction does not exist
FOR
When NEXT instruction is located before FOR
instruction
FOR
When number of FOR instructions is not
equivalent to the number of NEXT instructions
NEXT
FOR
←
Not programmed
FOR
NEXT
When NEXT instruction is located after FEND or
END instruction
FOR
FEND
END
NEXT
NEXT
NEXT
NEXT
←
Not programmed