![Omron CJ1G-CPU series Programming Manual Download Page 278](http://html1.mh-extra.com/html/omron/cj1g-cpu-series/cj1g-cpu-series_programming-manual_742489278.webp)
257
Index Registers
Section 6-2
LIFO (Last-in First-out) Processing
The following diagram shows the operation of a last-in first-out (LIFO) stack.
Manipulating Specific Table Data
Individual entries in a table can be read, writing, inserted, or deleted. The fol-
lowing diagram shows an example for reading.
Counting Table Data
The following diagram shows how data can be counted in a data table.
Stack Instructions
The following table lists the stack instructions and their functions. Typical
applications for stacks would be processing shelf information for automatic
warehousing systems, processing test results, and managing information on
workpieces on a conveyor.
Instruction
Function
SSET(630)
Defines a stack region.
PUSH(632)
Stores data in the next available word in the stack.
FIFO(633)
Reads data from the stack on a first-in first-out basis.
LIFO(634)
Reads data from the stack on a last-in first-out basis.
SREAD(639)
Read a specific entry from the table (CS1-H, CJ1-H, or CJ1M CPU
Units only).
SWRITE(640) Writes a specific entry to the table (CS1-H, CJ1-H, or CJ1M CPU
Units only).
SINS(641)
Inserts a specific entry in the table (CS1-H, CJ1-H, or CJ1M CPU
Units only).
SDEL(642)
Deletes a specific entry from the table (CS1-H, CJ1-H, or CJ1M CPU
Units only).
SNUM(638)
Counts the number of entries in the table (CS1-H, CJ1-H, or CJ1M
CPU Units only).
A
B
Pointer address
X
Reads most recent word of data stored
in the stack. Each time that a word is
read, the pointer is decremented by one
to indicate the ne
Data at the position that was read
remains unchanged.
xt address for storage.
X
V
W
1
A
V
B
W
X
V
−
n
Pointer address
Read
Data is read from a specific offset from
the point address in the table.
Manipulating specific table data can be
used, for example, in tracing items on a
conveyor.
An offset from the point
address is specified.
A
N
B
W
X
V
Pointer address
Counts all entries
from one before the
pointer address.
The number of entries in the data table
are counted from just before the pointer
address to the beginning of the table.
This can be used, for example, to count
the number of items on a conveyor.
Summary of Contents for CJ1G-CPU series
Page 3: ...iv...
Page 5: ...vi...
Page 21: ...xxii Conformance to EC Directives 6...
Page 169: ...148 Task Control Instructions Section 3 32...
Page 203: ...182 Programming Device Operations for Tasks Section 4 4...
Page 253: ...232 Using File Memory Section 5 3...
Page 337: ...316 Other Functions Section 6 11...
Page 347: ......
Page 369: ......
Page 373: ......
Page 379: ......
Page 381: ...360 Revision History...