Specifications

SIMATIC Instructions
9-106
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Table Find
The Table Find instruction searches the table (SRC),
starting with the table entry specified by INDX, for the
data value (PTN) that matches the search criteria defined
by CMD. The command parameter (CMD) is given a
numeric value of 1 to 4 that corresponds to =, <>, <, and
>, respectively.
If a match is found, the INDX points to the matching
entry in the table. To find the next matching entry, the
INDX must be incremented before invoking the Table
Find instruction again. If a match is not found, the INDX
has a value equal to the entry count.
A table may have up to 100 data entries. The data
entries (area to be searched) are numbered from 0 to a
maximum value of 99.
Error conditions that set ENO = 0: SM4.3 (run-time),
0006 (indirect address), 0091 (operand out of range)
Inputs/Outputs Operands Data Types
SRC VW, IW, QW, MW, SMW, LW, T, C, *VD, *AC, *LD WORD
PTN VW, IW, QW, MW, SW, SMW, AIW, LW, T, C, AC, Constant, *VD,
*AC, *LD
INT
INDX VW, IW, QW, MW, SW, SMW, LW, T, C, AC, *VD, *AC, *LD WORD
CMD Constant BYTE
Note
When you use the Find instructions with tables generated with ATT, LIFO, and
FIFO instructions, the entry count and the data entries correspond directly. The
maximum-number-of-entries word required for ATT, LIFO, and FIFO is not
required by the Find instructions. Consequently, the SRC operand of a Find
instruction is one word address (two bytes) higher than the TBL operand of a
corresponding ATT, LIFO, or FIFO instruction, as shown in Figure 9-33.
0006
0006
xxxx
xxxx
xxxx
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)
d2 (data 2)
Table format for ATT, LIFO, and FIFO
d5 (data 5)
d3 (data 3)
d4 (data 4)
0006
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
VW202
VW204
VW206
VW208
VW210
VW212
VW214
EC (entry count)
d0 (data 0)
d1 (data 1)
d2 (data 2)
d5 (data 5)
d3 (data 3)
d4 (data 4)
Table format for TBL_FIND
Figure 9-33 Difference in Table Format between Find Instructions and ATT, LIFO, FIFO
L
A
D
S
T
L
FND= SRC, PATRN
INDX
FND<> SRC, PATRN,
INDX
FND< SRC, PATRN,
INDX
FND> SRC, PATRN,
INDX
TBL_FIND
EN
SRC
PTN
INDX
CMD
F
B
D
ENO
222 224
333
221