Omron CJ - INSTRUCTIONS Reference Manual page 1106

Table of Contents

Advertisement

3. Instructions
Example Programming
0.00
0.02
The following example shows two different
block programs controlled by CIO 0.00 and
CIO 0.02.
The first block executes one of two additions
depending on the status of CIO 0.01. This
block is executed when CIO 0.00 is ON. If CIO
0.01 is ON, 1 is added to the contents of CIO
1. If CIO 0.01 is OFF, 2 is added to the
contents of CIO 1. In either case, the result is
placed in D0.
1068
0
IF(802)
0.01
+B(404)
1
#0001
D0
ELSE(803)
+B(404)
1
#0002
D0
IEND(804)
BEND(801)
1
0.03
LD
AND
0.04
IF(802)
+B(404)
1200
2
D10
CY
IF(802)
MOV(030)
#0001
D11
IEND(804)
ELSE(803)
SET(016)
3.01
IEND(804)
BEND(801)
Coding
Address
Instruction
Operands
000200
LD
000201
BPRG(096)
000202
IF(802)
000203
+B(404)
000204
ELSE(803)
000205
+B(404)
000206
IEND(804)
000207
BEND(801)
000208
LD
000209
BPRG(096)
000210
LD
000211
AND
000212
IF(802)
000213
+B(404)
000214
IF(802)
000215
MOV(030)
000216
IEND(804)
000217
ELSE(803)
000218
SET(016)
000219
IEND(804)
000220
BEND(801)
The second block is executed when CIO 0.02 is
ON and shows nesting two levels. If CIO 0.03
and CIO 0.04 are both ON, the contents of CIO
1200 and CIO 2 are added and the result is
placed in D10 and then 0001 is moved into D11
based on the status of CY. If either CIO 0.03 or
CIO 0.04 is OFF, then the entire addition
operation is skipped and CIO 3.01 is turned
ON.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
0.00
0
0.01
---
1
#0001
D0
---
---
1
#0002
D0
---
---
0.02
1
0.03
0.04
---
---
1200
2
D10
A50004
---
#0001
D11
---
---
3.01
---
---

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents