Specifications

SIMATIC Instructions
9-109
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Last-In-First-Out
The Last-In-First-Out instruction removes the last entry
in the table (TBL), and outputs the value to a location
specified by DATA. The entry count in the table is
decremented for each instruction execution.
Error conditions that set ENO = 0: SM1.5 (empty table),
SM4.3 (run-time), 0006 (indirect address), 0091 (operand
out of range)
This instruction affects the following Special Memory bits:
SM1.5 is set to 1 if you try to remove an entry from an
empty table.
Inputs/Outputs Operands Data Types
TABLE VW, IW, QW, MW, SW, SMW, LW, T, C,*VD, *AC, *LD WORD
DATA VW, IW, QW, MW, SW, SMW, LW, AQW, T, C, AC, *VD, *AC, *LD WORD
Last-In-First-Out Example
LAD
STL
LD I4.0
LIFO VW200, VW300
I4.0
LIFO
EN
DATA VW300VW200 TBL
Application
1234
VW300
After execution of LIFO
Before execution of LIFO
0006
0003
5431
8942
1234
xxxx
xxxx
xxxx
VW200
VW202
VW204
VW206
VW208
VW210
VW212
VW214
TL (max. no. of entries)
EC (entry count)
d0 (data 0)
d1 (data 1)
0006
0002
xxxx
5431
8942
xxxx
xxxx
xxxx
VW200
VW202
VW204
VW206
VW208
VW210
VW212
VW214
d2 (data 2)
TL (max. no. of entries)
EC (entry count)
d0 (data 0)
d1 (data 1)
FBD
ENO
LIFO
EN
DATA
VW300
TBL
ENO
VW200
I4.0
Figure 9-36 Example of Last-In-First-Out Instruction
L
A
D
S
T
L
OUT
LIFO
EN
TBL DATA
LIFO TABLE, DATA
F
B
D
ENO
222 224
333
221