Specifications
7. Application Instructions
© DELTA ELECTRONICS, INC. ALL RIGHTS RESERVED
7-12
Program Example
WDT
X0
300ms program
END
150ms program
150ms program
END
Watchdog timer reset
Dividing the program to
two parts so that both
parts' scan time are
less than 200 ms
Ϩʳ Program used when the setting of watchdog timer is 200ms and the
period of time from 0 to END (FEND) instruction is 300ms.
08 FOR
S Nested loop begins
Bit device Word device
Device
Operand
X Y M S K H KnX KnY KnM KnS T C D E F
S
ϨϨϨϨϨϨϨϨϨϨϨ
09 NEXT
Nested loop ends
FOR and NEXT instructions are used when “ n” nested loops are
needed.
“ n” may be specified as 1 to 32767.
When it is not desired to execute the FOR to NEXT instructions, use
the CJ command.
Up to four levels of nested FOR loops are allowed.
For example, loop A operates 3 times but within this loop there is
nested loop, B. For every completed cycle of loop A, the loop B will be
completed executed 4 times. Therefore, the numbers of loop B
operation will be 3 x 4=12 times (A x B).
B
FOR
FOR
K3
K4
NEXT
NEXT
A
If there are too many loops, the processing time will be executed.
Program Example
CJ
NEXT
FOR
K3
INC D0
Y10
D0
D1
D0MOV
MOV K0
X7
M0
M0
X10
P6