DL205 User Manual, 4th Edition, Rev. D
5-180
Chapter 5: Standard RLL Instructions
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 time can increase
significantly, depending on the number 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 watchdog timer inside of
the For/Next loop using the RSTWT instruction.
A aaa
FOR
230
240
250-1
260
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