1. Jump command BREAK

1. Jump command BREAK

1.1. Instruction description

When the input condition is turned on, if the instruction is inside the FOR loop, it will jump out of the FOR loop and continue executing the instruction after NEXT. If this instruction is inside the STL-STLE block, it will jump out of this STL block and continue executing instructions after STLE.

When using this instruction in situations where both FOR loop and STL block exist, the current FOR loop will be exited.

1.2. The valid operands of the instruction

Input/Output Data Type operand Description

1.3. Example 1:FOR loop

Command table:

NETWORK 000

LD X000

FOR K100 // Start of FOR loop, loop 100 times.

NETWORK 001

LD X001

INC D0 D0 // Each loop accumulates D0 once.

NETWORK 002

LD X002

BREAK // X002 is ON, it jumps out of the FOR loop.

NETWORK 003

NEXT

BREAK11

图1 BREAK11

BREAK12

图2 BREAK12

1.4. Example 2:STL block

command table:

NETWORK 000

STL S0

NETWORK 001

LD X000

BREAK // If X0 is ON, jump out of the STL block.

NETWORK 002

LD X001

OUT Y0 // If the above instruction does not jump out, continue executing the instruction here.

NETWORK 003

STLE

BREAK21

图3 BREAK21

BREAK22

图4 BREAK22