DL205 User Manual, 4th Edition, Rev. B
5–180
Chapter 5: Standard RLL Instructions - Program Control
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
For/Next (FOR) (NEXT)
The For and Next instructions are used to execute a
section of ladder logic between the For and Next
instruction a specified numbers of times. When the For
instruction is enabled, the program will loop the specified
number of times. If the For instruction is not energized
the section of ladder logic between the For and Next
instructions is not executed.
For/Next instructions cannot be nested. Up to 64
For/Next loops may be used in a program. If the
maximum number of For / Next loops is exceeded, error
E413 will occur. The normal I/O update and CPU
housekeeping is suspended while executing the For/Next
loop. The program scan can increase significantly,
depending on the amount of times the logic between the
For and Next instruction is executed. With the exception
of immediate I/O instructions, I/O will not be updated
until the program execution is completed for that scan.
Depending on the length of time required to complete
the program execution, it may be necessary to reset the
watch dog timer inside of the For/Next loop using the
RSTWT instruction.
A
aaa
FOR
230
2
4
0
2
5
0
-1
2
6
0
ý
þ
þ
þ
NEXT
Operand Data Type
DL240 Range
DL250-1 Range
DL260 Range
A
aaa
aaa
aaa
V-memory V
All (See page 3 - 54)
All (See page 3 - 55)
All (See page 3 - 56)
Constant K
1-9999
1-9999
1-9999
DS
Used
HPP Used