Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 1085

Table of Contents

Advertisement

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.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
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)
#0001
000204
ELSE(803)
000205
+B(404)
#0002
000206
IEND(804)
000207
BEND(801)
000208
LD
000209
BPRG(096)
000210
LD
000211
AND
000212
IF(802)
000213
+B(404)
000214
IF(802)
A50004
000215
MOV(030)
#0001
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.
3. Instructions
0.00
0
0.01
---
1
D0
---
---
1
D0
3
---
---
0.02
1
0.03
0.04
---
---
1200
2
D10
---
D11
---
---
3.01
---
---
1049

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CJ - REFERENCE MANUAL 02-2010 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents