LFU (LIFO unload)

The LFU instruction unloads data (8 bit, 18 bit, 32 bit, 64 bit) from a user-created one-dimensional array called LIFO stack. LFU and LFL instructions are used in pairs.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the L20E, L50E, and L70E controllers.
LFU
LFU
LFU parameters
Parameter
Parameter Type
Data Type
Description
Execute
Input
BOOL
Instruction block enable.
  • TRUE: If rising edge is detected, start the LFU operation.
  • FALSE: Rising edge is not detected.
Dest
Input
ANY_ELEMENTARY
Holds the value that exists in the LIFO stack.
Elementary data types supported for Dest:
  • DWORD, REAL, TIME, DATE, LWORD, ULINT, LINT, LREAL, BOOL, SINT, USINT, BYTE, INT, UINT, WORD, DINT, UDINT.
  • String is not supported.
  • Only supports variables and one-dimensional arrays such as Array[1] or Array[Index].
DestOffset
Input
UINT
Destination element offset.
Element offset if destination is array data type, otherwise offset should be set to 0.
For array data type, to unload to the first element, the offset should be set as 0.
LIFO
Input
ANY_ELEMENTARY
The starting address of the stack. LIFO must be configured the same for the LFL and LFU instructions.
Element data types supported:
  • DWORD, REAL, TIME, DWORD, REAL, TIME, DATE, LWORD, ULINT, LINT, LREAL, BOOL, SINT, USINT, BYTE, INT, UINT, WORD, DINT, UDINT.
  • Only one dimension is supported.
  • String is not supported.
LIFOCon
Input
FF_LF_CON
LIFO configuration and control. The same configuration must be configured for LFL and LFU instructions. Use the FF_LF_CON data type to configure Position and Length.
Full
Output
BOOL
Indicates when the LIFO stack is full.
  • TRUE: When Length is equal to Position.
  • FALSE: When Position is greater than or equal to zero and less than Length.
Error
Output
BOOL
Indicate the existence of an error condition.
  • TRUE: Operation encountered an error.
  • FALSE: Operation completed successfully or the instruction is not executing.
ErrorID
Output
USINT
A unique numeric that identifies the error. The errors are defined in the LFU error codes.
Done
Output
BOOL
Indicate when operation is completed.
  • TRUE: Operation completed successfully.
  • FALSE: Operation encountered an error condition or the LFU instruction is not executing.
LFL and LFU error codes
Error code
Error description
0
No error.
1
LFL Src data type is not supported.
2
LFU Dest data type is not supported.
3
LIFO data type is not supported.
4
Src and Dest data type mismatch with the LIFO data type.
Corrective action:
LFL Src parameter and LFU Dest parameter data type should match with the LIFO array data type.
5
LIFO: Array dimension is not supported.
Corrective action:
LIFO only supports one-dimensional arrays.
6
LIFOCon control Length exceeds LIFO array size.
Corrective action:
LIFOCon control Length cannot exceed the LIFO array size.
7
LIFOCon Length exceeds the max length.
8
LIFOCon Length is zero.
9
LIFOCon Position exceeds the LIFOCon Length.
10
LFL control Length and Position are equal.
11
LFU control Position is zero.
12
LFL or LFU array dimension is not supported.
Corrective action:
LFL and LFU only support one-dimensional arrays.
13
LFL or LFU DestOffset exceeds Dest array size.

LFU examples

LFU function block diagram example
LFU function block diagram example
LFU ladder diagram example
LFU ladder diagram example
LFU structured text example
LFU structured text example
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal