Installation manual
Publication 1747-RM001G-EN-P - November 2008
Data Handling Instructions 5-25
FIFO and LIFO Instructions
Overview
FIFO (First in First out) instructions load words into a file and unload them in
the same order as they were loaded. The first word in is the first word out.
LIFO (Last in First out) instructions load words into a file and unload them in
the opposite order as they were loaded. The last word in is the first word out.
Entering Parameters
Enter the following parameters when programming these instructions.
• Source is a word address or constant (-32,768 to 32,767) that becomes
the next value in the stack
• Destination is a word address that stores the value that exits from the
stack
• FIFO/LIFO is the address of the stack. It must be an indexed word
address in the bit, input, output, or integer file.
• Length specifies the maximum number of words in the stack. This is
128 words. Address the length value by mnemonic (LEN).
• Position is the next available location where the instruction loads data
into the stack. This value changes after each load or unload operation.
Address the position value by mnemonic (POS).
• Control is a control file address. The status bits, the stack length, and
the position value are stored in this element. Use the same control file
address for the associated FFL and FFU instructions; use the same
control file address for the associated LFL and LFU instructions. Do
not use the control file address for any other instruction.
Status bits of the control structure are addressed by mnemonic. These include:
• Empty Bit EM (bit 12) is set by the processor to indicate the stack is
empty.
• Done Bit DN (bit 13) is set by the processor to indicate the stack is full.
This inhibits loading the stack.
• FFU/LFU Enable Bit EU (bit 14) is set on a false-to-true transition of
the FFU/LFU rung and is reset on a true-to-false transition.
• FFL/LFL Enable Bit EN (bit 15) is set on a false-to-true transition of
the FFL/LFL rung and is reset on a true-to-false transition.
Table 5.18 Instruction Function
This Instruction Unloads the Value from
FIFO’s FFU First word
LIFO’s LFU The last word entered