Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 602

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Table Data Processing Instructions
Description
1,2,3...
Flags
Precautions
Area
DM Area
Indirect DM addresses
in binary
Indirect DM addresses
in BCD
Constants
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.
TB
TB+1
TB+2
Last word
TB+3
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.
TB
D0 to D32767
@ D0 to @ D32767
*D0 to *D32767
---
---
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
PLC memory
address
m+(N–1)
N words
in stack
m+(N–1)
Operation
ON if N is not within the specified range of 0005 to FFFF.
OFF in all other cases.
Section 3-16
N
#0005 to #FFFF (binary) or
&5 to &65,535
DR0 to DR15
569

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents