Program instructions
7.16 Table
S7-200 SMART
370
System Manual, V2.3, 07/2017, A5E03822230-AF
7.16.2
First-in-first-out and last-in-first-out
Table 7- 20 FIFO and LIFO instructions
LAD / FBD
STL
Description
FIFO TBL, DATA
The first-in-first-out instruction moves the oldest (or first) entry in a table to an output
memory address, by removing the first entry in the assigned table (TBL) and moving
the value to the location assigned by DATA. All other entries of the table are shifted
up one location. The entry count in the table is decremented for each FIFO execu-
tion.
LIFO TBL, DATA
The last-in-first-out instruction moves the newest (or last) entry in the table to an
output memory address, by removing the last entry in the table (TBL) and moving
the value to the location assigned by DATA. The entry count in the table is decre-
mented for each LIFO execution.
Non-fatal errors with ENO = 0
SM bits affected
•
0006H Indirect address
•
0091H Operand out of range
•
SM1.5: Attempt to remove entry
from empty table
•
SM1.5: Attempt to remove entry from empty table
Input / output
Data type
Operand
TBL
WORD
IW, QW, VW, MW, SMW, SW, T, C, LW, *VD, *LD, *AC
DATA
INT
IW, QW, VW, MW, SMW, SW, T, C, LW, AC, AQW, *VD, *LD, *AC
Note
All table read and table write instructions must be activated by edge trigger instructions.
To create a table, you must first make an entry for the maximum number of table entries
before any entries can be put in the table.