Omron CJ - INSTRUCTIONS Reference Manual page 1163

Table of Contents

Advertisement

Example Programming
Data Collection Operation
The leftmost byte of D200 is 0, so COLLC(567) performs the Data Collection Operation.
When CIO 0.00 is ON in the following example, the contents of D110 (D100 + 10) will be copied to
D300 if the content of D200 is 10 (0010 BCD). The contents of other words can be copied to D300 by
changing the offset in D200.
0.00
COLLC
Bs
D100
Of
D200
D300
D
FIFO Stack Operation
The leftmost byte of Of is 9, so COLLC(567) performs the FIFO Stack Operation.
When CIO 0.00 is ON in the following example, COLLC(567) allocates a 10 word stack area (since the
rightmost 3 digits of Of are #010) between D100 and D109. At the same time, the contents of D101 (Bs
+1) are copied to D300. Finally, the stack pointer is decremented by 1.
0.00
COLLC
Bs
#9010
Of
D
LIFO Stack Operation
The leftmost byte of Of is 8, so COLLC(567) performs the LIFO Stack Operation.
When CIO 0.00 is ON in the following example, COLLC(567) allocates a 10 word stack area (since the
rightmost 3 digits of Of are #010) between D100 and D109. At the same time, the contents of the
source word (D100 + stack pointer) are copied to D300. Finally, the stack pointer is decremented by 1.
0.00
COLLC
Bs
#8010
Of
D
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Bs:
D100
D101
D110
Allocated stack
Stack area
D100
D100
D101
D102
D300
D109
Allocated stack
Stack area
D100
D100
D101
D102
D300
D109
Offset +10 words
Copied by COLLC(567).
Of 9
010
After 1
FIFO
Stack area
Read
Stack
0 0 0 2
pointer
1 2 3 4
Stack
5 6 7 8
data area
D300
Of 8
010
After 1
LIFO
Stack area
Read
Stack
0 0 0 2
pointer
1 2 3 4
Stack
5 6 7 8
data area
D300
3. Instructions
D200
0
0
1
0
4-digit BCD
D300
st
nd
execution
After 2
execution
Stack area
0 0 0 0
0 0 0 1
5 6 7 8
5 6 7 8
1 2 3 4
st
nd
execution
After 2
execution
Stack area
0 0 0 0
0 0 0 1
1 2 3 4
1 2 3 4
5 6 7 8
3
1125

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents