Omron CQM1H - PROGRAM Programming Manual page 299

Programmable controllers; inner boards
Table of Contents

Advertisement

Data Movement Instructions
00000
Stack Operation
00000
IR 001
IR 216
DM 0000
DM 0001
DM 0002
DM 0003
DM 0004
DM 0005
Flags
274
@DIST(80)
#00FF
HR 10
LR 10
LR 10
3 0 0
When bits 12 to 15 of C=9, DIST(80) can be used for a stack operation. The
other 3 digits of C specify the number of words in the stack (000 to 999). The
content of DBs is the stack pointer.
When the execution condition is OFF, DIST(80) is not executed. When the
execution condition is ON, DIST(80) copies the content of S to DBs+1+the
content of DBs. In other words, 1 and the content of DBs are added to DBs to
determine the destination word. The content of DBs is then incremented by 1.
Note
1. DIST(80) will be executed every cycle unless the differentiated form
(@DIST(80)) is used or DIST(80) is used with DIFU(13) or DIFD(14).
2. Be sure to initialize the stack pointer before using DIST(80) as a stack op-
eration.
Example
The following example shows how to use DIST(80) to create a stack between
DM 0001 and DM 0005. DM 0000 acts as the stack pointer.
@DIST(80)
001
DM 0000
216
FFFF
9005
0000
First execution
0000
0000
0000
Stack pointer
incremented
0000
0000
ER:
The offset or stack length in the control word is not BCD.
Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
During stack operation, the value of the stack pointer+1 exceeds the
length of the stack.
#00FF
5
0 0 F
F
DM 0000
0001
DM 0001
FFFF
DM 0002
0000
DM 0003
0000
DM 0004
0000
DM 0005
0000
Section 5-18
Address Instruction
00000
LD
00001
@DIST(80)
#
HR
LR
HR 10
0 0 0
0
HR 15
0 0 F
F
Address Instruction
00000
LD
00001
@DIST(80)
DM
DM 0000
Second
DM 0001
execution
DM 0002
DM 0003
Stack pointer
DM 0004
incremented
DM 0005
Operands
00000
00FF
10
10
Operands
00000
001
0000
216
0002
FFFF
FFFF
0000
0000
0000

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