Delta AS Series Programming Manual page 699

Hide thumbs Also See for AS Series:
Table of Contents

Advertisement

AS Ser ies Pro gra mm in g M anu al
API
Instruction code
1301
Symbol
Explanation
1.
This instruction executes the program between the FOR and NEXT instructions N times, where N is the value in S
specified for the FOR instruction (API 1300). After the program between the FOR and NEXT instructions is
executed N times, the program following the NEXT instruction is executed. The instruction FOR specifies the
number of times the program between the FOR and NEXT instructions is executed.
2.
N must be between 1–32,767. If N is less than 1, the instruction processes it as 1.
3.
If you do not want to execute the program between the FOR and NEXT instructions, you can skip it with the CJ
instruction (API 0400).
4.
The following conditions result in errors.
The NEXT instruction is prior to the FOR instruction.
_6
The FOR instruction exists, but the NEXT instruction does not exist.
The NEXT instruction follows the FEND or END instruction.
The number of times the FOR instruction is used in the program is different from the number of times the
NEXT instruction is used in the program.
5.
The FOR and NEXT instructions support the nested program structure. There can be at most 32 levels of nested
program structures. If a loop is executed many times, it takes more time for the PLC to scan the program, and the
watchdog timer error may occur. You can use the WDT instruction (API 1900) to resolve the problem.
6 - 4 2 0
NEXT
Operand
Pulse instruction
16-bit instruction
Function
Ending a nested loop
32-bit instruction
AS

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents