Omron SYSMAC CJ - REFERENCE MANUAL 08-2008 Reference Manual page 745

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

Advertisement

Table Data Processing Instructions
Description
1,2,3...
Flags
Precautions
Examples
Area
Data Registers
Index Registers
Indirect addressing
using Index Registers
SSET(630) secures a stack with N words beginning at TB and ending at
TB+(N–1). The first two words of the stack (TB+1 and TB) contain the 8-digit
hexadecimal PLC memory address of the last word in the stack. The next two
words (TB+3 and TB+2) contain the stack pointer. The stack pointer is the
PLC memory address of the next word in the stack that will be overwritten by
PUSH(632); its initial value is the address of TB+4.
SSET(630) automatically initializes the data region of the stack (TB+4 through
TB+(N–1)) to zeroes. The following diagram shows the basic structure of a
stack.
Last word
in stack
Stack
pointer
SSET(630) just establishes and initializes a stack. Use the following instruc-
tions to store in the stack and read data from the stack.
1. PUSH(632) stores data in the stack one word at a time.
2. FIFO(633) and LIFO(634) read data from the stack. FIFO(633) reads the
first word that was stored; LIFO(634) reads the last word that was stored.
3. The stack pointer value in the stack control word is automatically updated
when PUSH(632), FIFO(633), or LIFO(634) is executed. Normally, users
need not be concerned about the stack control word. When accessing the
contents of the stack other than by using the above instructions, set the
stack pointer value using the Index Register (IR) for indirect referencing.
Name
Label
Error Flag
ER
The minimum value for the number of words in the stack (N) is 5 because N
includes the four words that contain the pointer to the last word in the stack
and the stack pointer. An error will occur if N is not in the range 0005 to FFFF.
When CIO 000000 is ON in the following example, SSET(630) secures a 10-
word stack from D00000 to D00009. D00000 and D00001 contain the PLC
memory address of the last word in the stack. D00002 and D00003 contain
the stack pointer. The stack itself begins in D00004.
TB
---
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
PC memory
address
TB
m+(N–1)
TB+1
TB+2
TB+3
Operation
ON if N is not within the specified range of 0005 to FFFF.
OFF in all other cases.
Section 3-17
N
DR0 to DR15
N words
in stack
m+(N–1)
705

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cs seriesSysmac one nsj seriesSysmac cj series

Table of Contents