Omron CJ - INSTRUCTIONS Reference Manual page 1162

Table of Contents

Advertisement

3. Instructions
Note In C-series PLCs, the DATA COLLECT (COLL) instruction will cause the Error Flag to go ON if the content of an
indirectly addressed DM word (*DM) is not BCD, or the DM area boundary is exceeded.
COLLC(567) will not cause the Error Flag to go ON in these cases.
• The Negative Flag will turn ON if the MSB in the transferred data is ON.
Function
Data Collection Operation
COLLC(567) copies the source word (calculated by
adding Of to Bs) to the destination word. The same
COLLC(567) instruction can be used to collect data
from various source words in the data area by
changing the value of Of.
Stack read operation
• FIFO Stack Read Operation
If the leftmost digit of Of is 9, COLLC(567) will
operate as a FIFO stack instruction (FIFO stands for
First-In-First-Out). In this case, the rightmost 3 digits
of Of specify the size of the stack.
COLLC(567) copies the data from the oldest word
recorded in the stack to D. The source word is Bs + 1.
After the data is copied, the stack pointer is
decremented by 1.
• LIFO Stack Read Operation
If the leftmost digit of Of is 8, COLLC(567) will
operate as a LIFO stack instruction (LIFO stands for
Last-In-First-Out). In this case, the rightmost 3 digits
of Of specify the size of the stack.
COLLC(567) copies the data most recently recorded
in the stack to D. The source word is Bs + the stack
pointer (content of Bs). After the data is copied, the
stack pointer is decremented by 1.
In either case (method), S1 is a stack pointer.
• When FIFO is used, data is read from S1+1.
• When LILO is used, data is read from S1 + (stack pointer).
• In either case (method), the stack pointer value is automatically decremented by 1 each time data is
read from the stack area.
Note Once DISTC(566) has been executed with Stack Push Operation to allocate a stack area, always specify
that same length stack area in the COLLC(567) instructions. Operation will be unreliable if a different stack
area size is specified in the COLLC(567) instructions.
Hint
• Use DISTC(566) to write stack data to the stack area.
• The same COLLC(567) instruction can be used to collect data from various source words in the data
area by changing the value of Of.
Precaution
• Be sure that the offset or stack size specified by Of does not exceed the end of the data area when
added to Bs.
1124
Bs
Bs+n
FIFO
Data is copied from Bs + 1.
Stack area
Stack
Bs
pointer
Bs+1
Stack
data area
LIFO
Data is copied from Bs + stack pointer.
Stack area
Stack
Bs
pointer
Bs+1
Stack
Bs+
data area
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Of
m
Of
9
Size of
m words
stack area
D
m
Of
8
Size of
m words
stack area
D

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents