Omron C200HX Operation Manual page 202

Hide thumbs Also See for C200HX:
Table of Contents

Advertisement

Data Movement
Stack Operation
(C=9000 to 9999)
Example of Stack Operation
00001
Flags
184
When the execution condition is OFF, DIST(80) is not executed. When the
execution condition is ON, DIST(80) operates a stack from DBs to
DBs+C–9000. DBs is the stack pointer, so S is copied to the word indicated by
DBs and DBs is incremented by 1. The Negative Flag also changes.
Digits of C:
3 2 1 0
Data can be added to the stack until it is full. DIST(80) is normally used together
with COLL(81), which can be set to read from the stack on a FIFO or LIFO basis.
Refer to 5-16-7 DATA COLLECT – COLL(81) for details.
In the following example, the content of C (LR 10) is 9010, and DIST(80) is used
to write the numerical data #00FF to the 10-word stack from HR 20 to HR 29.
During the first cycle when IR 00001 is ON, the data is written to DBs+1 (HR 21)
and the stack pointer is incremented by 1. In the second cycle the data is written
to DBs+2 (HR 22) and the stack pointer is incremented, and so on.
DIST(80)
# 00FF
HR 20
LR 10
After one
execution
HR 20
Stack pointer
0 0 0
HR 21
0 0 F
HR 22
Stack area
HR 29
ER:
The content of C is not BCD or 6655<C<9000.
When C≤6655, DBs and DBs+C are not in the same data area.
When C≥9000, DBs and DBs+C–9000 are not in the same data area.
Indirectly addressed DM word is non-existent. (Content of ∗DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the content of S is zero; otherwise OFF.
Specifies the stack length (000 to 999).
A value of 9 indicates stack operation.
Address
Instruction
Operands
00000
LD
00001
DIST(80)
#
HR
LR
After two
executions
HR 20
1
0 0 0
HR 21
Stack pointer
F
0 0 F
incremented
HR 22
0 0 F
HR 29
Section 5-16
00001
00FF
20
10
2
F
F

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200hgC200he

Table of Contents