Lifo Read - GE PACSystems RX7i Cpu Programmer's Reference Manual

Hide thumbs Also See for PACSystems RX7i:
Table of Contents

Advertisement

Chapter 4. Ladder Diagram (LD) Programming
4.9.5

LIFO Read

The Last-In-First-Out (LIFO) Read (LIFO_RD) function moves data out
of tables. Values are always moved out of the top of the table. If the
pointer reaches the last location and the table becomes full, LIFO_RD
must be used to remove the entry at the pointer location and
decrement the pointer by one. LIFO_RD is used in conjunction with the
LIFO_WRT function, which increments the pointer and writes entries
into the table.
1. LIFO_RD copies data indicated by the pointer to output parameter Q. Additional program logic
must then be used to place the data in the input reference.
2. LIFO_RD decrements the pointer by one.
3. Steps 1 and 2 are repeated each time the instruction is executed, until the table is empty (PTR =
LEN).
The pointer does not wrap around when the table is full.
When LIFO_RD receives power flow, the data at the pointer location is copied to output Q, then the
pointer is decremented. If this causes the pointer location to become 0, the output EM is set ON, i.e.,
EM indicates whether or not the table is empty. If the table is empty when LIFO_RD receives power
flow, no read occurs. The pointer always indicates the last item entered into the table.
LIFO_RD passes power to the right if the pointer was in range for an element to be read.
Note: A LIFO table is a stack. A FIFO table is a queue.
Operands for LIFO Read
Note: For each mnemonic, use the corresponding data type for the TB and Q operands. For
example, LIFO_RD_DINT requires TB and Q to be DINT variables.
Parameter
Length (??)
TB (must be the same
type as Q)
PTR
EM
Q (must be the same
type as TB)
Example for LIFO Read
PRODUCT is a LIFO table with 100 word-sized elements. When
the enabling input PACK_IT is ON, the data item at the top of the
table is copied into the reference indicated by the nickname
CART. The reference identified by STK_PTR contains the table
pointer. Output coil EMPTY indicates when the table is empty.
182
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
Description
1  Length  32,767.
The elements in the table
Pointer. Index of the next
element to read.
Energized when the last
element of the table is read
The element read from the
table
Allowed Operands
Constant
All except constants
All except constants, S - SC, and data flow No
Power flow
All except constants and S. SA, SB, SC
allowed only for WORD, DWORD.
Mnemonics:
LIFO_RD_DINT
LIFO_RD_DWORD
LIFO_RD_INT
LIFO_RD_UINT
LIFO_RD_WORD
Optional
No
No
No
No
GFK-2950C

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pacsystems rx3iPacsystems rsti-ep

Table of Contents