L9_FIN: First In
(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
NOTE:
The L9_FIN procedure produces a first-in queue. It copies source data from a 16-bit Boolean sequence located in %M or %MW memory, depending on the respective procedure, to the first - or top - word in a queue of words located in %MW memory. After all words in the queue have been filled, no additional source data can be copied to the queue.
NOTE: When the queue is filled, use the L9_FOUT procedure to clear the last - or bottom - word in the queue.
The LENGTH value determines the number of words in the destination queue. The SOURCE parameter defines the location of the first bit in the source 16-bit Boolean sequence. The QUEUE parameter defines the 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 word is the first - or top - word in the queue.
The operation begins when the input to the ENABLE pin is turned ON. The queue pointer’s initial value is 0, and increments by 1 each time source data is copied to the queue. Source data is always copied to the memory word at the top of the queue. If the top word holds previously copied source data, that data is transferred to the next memory word in the queue, and so on for every memory word in the queue. When the queue pointer value equals the LENGTH value, the queue is filled and no additional source data can be added to the queue.
L9_FIN 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.
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
SOURCE
ANY_ARRAY_UINT or ANY_ARRAY_EBOOL
%M, %I, %IW, %MW
The source data to be entered into the queue. The source can be a single word of type UINT or an ARRAY[1..16] OF EBOOL.
Middle
IN/OUT
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.
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.