L9_FOUT: First Out
(Original Document)
Naming
Name in LL984 Editor
Function Block Name
name of legacy 984 instruction
name in other tools and editors like:
  • Type Library Browser
  • Data Editor
  • Animation Tables
  • Search Results
Function Description
The L9_FOUT first-out procedure works together with a first-in procedure (L9_FIN) to produce a first-in first-out (FIFO) queue. It moves the bit pattern of the memory word at the bottom of a full queue to a destination 16-bit Boolean sequence.
NOTE: Be sure to place the L9_FOUT procedure in front of your first-in procedure in your FIFO sequence. This ensures removal of the oldest data from a full queue before the newest data is added. If, instead, you place the first-in procedure in front of the L9_FOUT procedure, your attempt to enter new data into a full queue will be ignored.
The LENGTH value determines the number of words in the source queue. The QUEUE parameter defines the %MW memory location of the queue pointer. The queue pointer contains the number of filled words in the queue. The word contiguous to and following the pointer is the first - or top - word in the queue. The source word for the L9_FOUT procedure is the last - or bottom - word in the filled queue. The DEST parameter defines the %M or %MW memory location, depending on the respective procedure, of the first Boolean in the destination 16-bit Boolean sequence.
The operation begins when the input to the ENABLE pin is turned ON. The queue pointer’s initial value must equal the LENGTH value, indicating the queue is filled. Source data is always moved from the memory word at the bottom of the queue. The pointer decrements by 1 upon successful completion of the L9_FOUT operation.
L9_FOUT can activate 3 outputs. The OUT output turns ON upon the successful completion of the operation. The FULL output turns ON when the queue is filled. The EMPTY output turns ON when the queue is empty.
NOTE: The L9_FOUT procedure will not write to and change the state of any BOOL that has been forced in the Control Expert Animation Table.
Representation
Parameters
Input Pin
Name
Data Type
Address Range
Meaning
Top
ENABLE
OFF to ON initiates the operation.
Node
Node Type
Name
Data Type
Address Range
Meaning
Top
IN
QUEUE
ANY_ARRAY_UINT
%MW
The queue pointer followed by the queue array declared as ARRAY[1..(1+LENGTH] OF UINT
(1+LENGTH is represented as a constant.
The value from the end of the queue - at the top position - is the value to be read out into the destination.
Middle
IN/OUT
DEST
ANY_ARRAY_UINT or ANY_ARRAY_EBOOL
%M, %MW
The destination data to be entered into the queue. The source can be a single word of type UINT or an ARRAY[1..16] OF BOOL.
Bottom
IN
LENGTH
UINT
1...100
The number of words to be included in the queue.
Valid range: 1 to 100.
Output Pin
Name
Data Type
Address Range
Meaning
Top
OUT
BOOL
ON indicates the operation succeeded. (Echoes the status of the ENABLE input).
Middle
FULL
BOOL
ON indicates the queue is full.
Bottom
EMPTY
BOOL
ON indicates the queue is empty.