Topic: DMD0466 LIFOUNLOAD - Unload Last In / First Out |
|
The Unload Last In / First Out (LIFOUNLOAD) instruction used to retrieve data from a LIFO Queue that was placed there by a corresponding Load Last In / First Out (LIFOLOAD) instruction. This instruction will retrieve the last (newest) data point that was stored in the User Block, copy that data to the Destination location, clear that memory location in the User Block, then move the Queue's pointer to the next newest location.
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
Queue Control Structure is the data structure this instruction will use to manage the process of retrieving data from the user data block. This should be the same Queue Control Structure that is used by the LIFOLOAD instruction to load data into the LIFO Queue.
User Block is the user-created data block that contains the LIFO Queue's data.
Destination is the memory location where the data retrieved from the LIFO will be stored. This should be the same type as the data in the user block.
Load on Input Leg selects which power-flow conditions will cause this instruction to load the value:
|
|
Status Display:If the LIFO Queue contains more then 7 items the status display of this instruction will show the first 3 and the last 3 locations.
If the LIFO queue's User Block contains one of the simple types (Bit, Byte, Word, DWord, Real) or contains only Strings, the Memory View is a convenient way to see the contents of the User Block.
If the LIFO Queue's User Block contains structures the Data View can be used to view the contents of each element in the block.
|
|
Queue Control Structure Fields:
.Depth is the number of data values stored in the Queue.
.Head is the location in the Queue where the data will be stored when a Load FIFO or Load LIFO instruction is executed, and where data will be read from when an Unload LIFO instruction is executed.
.Tail is the location in the Queue where the data will be read from when the Unload FIFO instruction is executed.
.Empty will be ON when none of the locations in the Queue are being used. An attempt to unload a value when the Queue is empty will not be processed and so this will not generate a Warning message.
.Full will be ON when all of the locations in the Queue have been used. Any attempt to load a value when the Queue is full will fail; no data in the user data block will be overwritten, but a Warning message will be generated.
|
|
See Also:LIFOLOAD - Load Last In / First Out
LIFOUNLOAD - Unload Last In / First Out
|
|
Related Topics:FIFOLOAD - Load First In / First Out
FIFOUNLOAD - Unload First In / First Out
|
|
Example:
|
|