EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 198

Omron CP - PROGRAMMING MANUAL 05-2007
1175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
165
Sequence Control Instructions Section 3-4
FOR-NEXT loops can be nested up to 15 levels. In the example below, pro-
gram sections A, B, and C are executed as follows:
A
B B C, A B B C, and A B B C
Use BREAK(514) to escape from a FOR-NEXT loop. Several BREAK(514)
instructions (the number of levels nested) are required to escape from nested
loops. The remaining instructions in the loop after BREAK(514) are processed
as NOP(000) instructions.
Alternative Looping Methods
There are two ways to repeat a program section until a given execution condi-
tion is input.
1,2,3... 1. FOR-NEXT Loop with BREAK
Start a FOR-NEXT loop with a maximum of N repetitions. Program
BREAK(514) within the loop with the desired execution condition. The loop
will end before N repetitions if the execution condition is input.
&3
&2
12
&3
&2
&3
Breaks FOR-NEXT loop 2.
Breaks FOR-NEXT loop 1.
Escapes from
loop when
condition a is
ON.
Remaining
instructions are
processed as
NOP(000).

Table of Contents

Related product manuals