Omron CQM1H - PROGRAM Programming Manual page 301

Programmable controllers; inner boards
Table of Contents

Advertisement

Data Movement Instructions
00000
LIFO Stack Operation
276
Note COLL(81) will be executed every cycle unless the differentiated form
(@COLL(81)) is used or COLL(81) is used with DIFU(13) or DIFD(14).
Example
The following example shows how to use COLL(81) to create a stack between
DM 0001 and DM 0005. DM 0000 acts as the stack pointer.
When IR 00000 goes from OFF to ON, COLL(81) shifts the contents of DM
0002 to DM 0005 down by one address, and shifts the data from DM 0001 to
IR 001. The content of the stack pointer (DM 0000) is then decremented by
one.
@COLL(81)
DM 0000
216
001
IR 216
9005
DM 0000
0005
DM 0001
AAAA
DM 0002
BBBB
DM 0003
CCCC
DM 0004
DDDD
DM 0005
EEEE
When bits 12 to 15 of C=8, COLL(81) can be used for an LIFO stack opera-
tion. The other 3 digits of C specify the number of words in the stack (000 to
999). The content of SBs is the stack pointer.
When the execution condition is ON, COLL(81) copies the data from the word
indicated by the stack pointer (SBs+the content of SBs) to the destination
word (D). The content of the stack pointer (SBs) is then decremented by one.
The stack pointer is the only word changed in the stack.
Note COLL(81) will be executed every cycle unless the differentiated form
(@DIST(80)) is used or DIST(80) is used with DIFU(13) or DIFD(14).
Address Instruction
00000
00001
Stack pointer
DM 0000
0004
decremented
DM 0001
BBBB
DM 0002
CCCC
DM 0003
DDDD
DM 0004
EEEE
DM 0005
EEEE
Section 5-18
Operands
LD
00000
@COLL(81)
DM
0000
216
001
IR 001
AAAA

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents

Save PDF