Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 1040

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Block Programming Instructions
Examples
Conditional block branching can be used within a loop, but the entire branch
operation must be within the loop.
Correct:
LOOP(809)
IF(802)
IF(802)
IEND(804)
IEND(804)
LEND(810)
NOP processing will be performed if LOOP(809) is not executed.
An error will occur and the Error Flag will turn ON if a Loop Control Instruction
is not in a block program.
When CIO 0.00 is ON in the following example, the block program is exe-
cuted. After "A" is executed, "B" and the IORF(184) after it will be executed
repeatedly until CIO 0.01 is ON, at which time C will be executed and the
block program will end.
0.00
0
0.01
Address
000220
000201
.
.
000210
.
.
000220
000221
.
.
000220
Incorrect:
LOOP(809)
IF(802)
IF(802)
IEND(804)
LEND(810)
IEND(804)
Execution
Execution
Execution
condition
condition
condition
ON
OFF
OFF
Repeating
Instruction
LD
BPRG
A
LOOP
B
IORF
LEND
C
BEND
Section 3-30
Operand
0.00
0
.
.
---
.
.
.
.
0000
0000
0.01
.
.
---
1007

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents