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

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Table Data Processing Instructions
Description
Flags
Precautions
Examples
LIFO(634) reads the data from the address indicated by the stack pointer (the
newest word of data in the stack), decrements the stack pointer by one, and
outputs the data to D. The word that was read is left unchanged.
PLC memory
address
TB
Stack
TB+1
pointer
TB+2
TB+3
Use LIFO(634) in combination with PUSH(632). After PUSH(632) has been
used to write data into a stack, LIFO(634) can be used to read data from the
stack on a last-in first-out basis. After data is stored by PUSH(632), the stack
pointer indicates the address next to the last data.
Name
Label
Error Flag
ER
The stack must be defined in advance with SSET(630).
When CIO 0.00 is ON in the following example, LIFO(634) reads the content
of the word indicated by the stack pointer (D6) and writes that data to D300.
0.00
D0
D300
Stack
pointer
Last word
in stack
TB
Newest
TB+1
data
TB+2
m–1
TB+3
Stack
pointer
m–1
The pointer is
Reading
decremented.
Operation
ON if the contents of the stack pointer (TB+3 and TB+2) is
less than or equal to the PLC memory address of first
word in the data region of the stack (TB+4).
(This is a stack underflow error.)
OFF in all other cases.
TB:
D0
PLC memory address
D1
of last word in stack
D2
Stack pointer
D3
D4
D5
D6
–1
D7
D8
D9
Section 3-16
PLC memory
address
m–1
A is left unchanged.
577

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents