Table Data Processing Instructions - Omron CJ - REFERENCE MANUAL 10-2009 Reference Manual

Table of Contents

Advertisement

Table Data Processing Instructions

Table Data Processing Instructions
All of these instructions define or operate on a group of words. The group of words in a stack are defined by
SSET(630), the group of words in a record-table are defined by DIM(631), and the group of words used in a
range instruction are defined independently in each instruction.
Group
Stack
Operate FIFO (first-in first-out) or LIFO (last-in first-out)
data tables.
Record-table
Operate tables of data made up of records. (Record size
is user-defined.)
Range
Operates on a range of words to find values such as the
checksum, a particular value, the maximum value, or
minimum value in the range.
Stack Instructions
Stack instructions act on specially defined data tables called stacks. The first two words of the stack
contain the PLC memory address of the last word in the stack and the second two words contain the
stack pointer (the PLC memory address of the word that will be overwritten by the next PUSH(632)
instruction).
The following diagram shows the basic structure of a stack.
Stack region
PC memory address of the
last word in the stack
PC memory address of the
next data word (stack pointer)
End of stack
PUSH(632)
Stores data in the address indicated by the stack pointer and increments the pointer by one.
Pointer
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Purpose
Words in
stack region
Data region
Stack
Pointer
Instructions
SSET(630), PUSH(632), FIFO(633), LIFO(634), SREAD(639),
SWRIT(640), SINS(641), SDEL(642), and SNUM(638)
DIM(631), SETR(635), and GETR(636)
FCS(180), SRCH(181), MAX(182), MIN(183), SUM(184), and
SWAP(637)
Example
Stack region
D0
0001
D1
000F
D2
0001
D3
0004
D4
Pointer
D15
Stack
A
3. Instructions
3
PC memory
address
16 words
541

Advertisement

Table of Contents
loading

Table of Contents