The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
1

Notice

Instruction Behavior

The NEXT instruction behaves as follows:

  • Instructions within the bounds of the FOR ~ NEXT instruction are executed n times.
    • When the loop ends, the instruction after the NEXT instruction is executed.
  • Nesting FOR ~ NEXT instructions is possible up to 16 nests.
  • The FOR ~ NEXT instructions must be used in pairs.

Excessive Use

If the FOR ~ NEXT instructions are used excessively, the scan time increases. The system might be overloaded causing the CPU to shut down or initialize.

Ladder Diagram Examples

NEXT

The NEXT instruction defines the end of the corresponding FOR instruction.

The NEXT instruction defines the end of the corresponding FOR instruction.

- The order of execution is as follows:
  • The order of execution is as follows:
    1. The INCP D100 instruction will increase the data register, D100, by 1 every second.
    2. The INCP D0 instruction will increase the data register, D0, by 1 every second.
    3. Step 1 and step 2 will repeat 500 times.
      • After 500 times in the loop, 1 scan is finished.
    4. After 500 times in the loop, the DECP D200 instruction will resume execution.