Omron SYSMAC CS/CJ Series Programming Manual page 277

Table of Contents

Advertisement

Index Registers
Processing
Table
Tables with one-
process-
word records
ing
(Range instruc-
tions)
Tables with multiple-word
records
(Record-table instructions)
Stack Processing
Pointer address
(The above diagram shows
the status of the pointer
data before data is added.)
256
Basic pro-
Find values such as the checksum, a
cessing
particular value, the maximum value,
or minimum value in the range.
Special
Perform various other table process-
processing
ing such as comparisons or sorting.
Process data in records that are sev-
eral words long.
Stack instructions act on specially defined data tables called stacks. Data can
be drawn from a stack on a first-in first-out (FIFO) or last-in first-out (LIFO)
basis.
A particular region of I/O memory must be defined as a stack. The first words
of the stack indicate the length of the stack and contain the stack pointer. The
stack pointer is incremented each time that data is written to the stack to indi-
cate the next address where data should be stored.
A
Pointer address
A
Stack
region
Note Actually, the first two words of the stack contain the PLC memory address of
the last word in the stack and the next word contains the stack pointer.
FIFO (First-in First-out) Processing
The following diagram shows the operation of a first-in first-out (FIFO) stack.
Pointer address
A
B
C
X
Purpose
FCS(180), SRCH(181), MAX(182),
MIN(183), and SUM(184)
Combine Index Registers with instruc-
tions such as SRCH(181), MAX(182),
MIN(183), and comparison instruc-
tions.
Combine Index Registers with instruc-
tions such as DIM(631), SETR(635),
GETR(636), and comparison instruc-
tions.
B
Pointer address
A
B
Reads the oldest word of data stored
A
in the stack. Each time that a word is
read, the pointer is decremented by one
to indicate the next address for storage.
Section 6-2
Instructions
C
Pointer address
A
B
C

Advertisement

Table of Contents
loading

Table of Contents