Omron CJ - PROGRAMMING MANUAL 08-2008 Programming Manual page 324

Programmable controllers
Hide thumbs Also See for CJ - PROGRAMMING MANUAL 08-2008:
Table of Contents

Advertisement

Index Registers
286
Counting Table Data
The following diagram shows how data can be counted in a data table.
Pointer address
A
B
V
W
X
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
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.
SWRITE(640) Writes a specific entry to the table.
SINS(641)
Inserts a specific entry in the table.
SDEL(642)
Deletes a specific entry from the table.
SNUM(638)
Counts the number of entries in the table.
Example 1:
This example defines a stack from D00000 to D00014 (which can store 10
words of data), stores data in the stack, and reads data from the stack.
(LIFO(634) reads the last word stored in the stack.)
ON for 1 cycle when
operation starts.
P_First_Cycle
Execution condition
a
Execution condition
b
Example 2:
This example defines a stack from D00000 to D00014 (which can store 10
words of data), finds the words in the stack that match a specified value, and
deletes all of the matching words.
The number of entries in the data table
are counted from just before the pointer
Counts all entries
address to the beginning of the table.
from one before the
This can be used, for example, to count
pointer address.
the number of items on a conveyor.
N
Function
SSET
D00000
&14
@PUSH
D00000
D00100
@LIFO
D00000
D00101
Section 6-2
When the First Cycle Flag is
ON, SSET(630) defines a stack
in words D00000 to D00014.
When execution condition "a" is
ON, PUSH(632) stores the data
from D00100 into the stack.
When execution condition "b" is
ON, LIFO(634) reads the last
word stored in the stack and
writes that data to D00101.

Advertisement

Table of Contents
loading

Table of Contents