Siemens Simatic S7-200 System Manual page 264

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Instruction Set
Table Find
L
TBL_FIND
A
D
EN
SRC
PATRN
INDX
CMD
S
FND=
SRC, PATRN,
T
INDX
L
FND<> SRC, PATRN,
INDX
FND<
SRC, PATRN,
INDX
FND>
SRC, PATRN,
INDX
212
214
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 TABLE operand of a corresponding ATT, LIFO, or
FIFO instruction, as shown in Figure 10-29.
Table format for ATT, LIFO, and FIFO
VW200
VW202
VW204
VW206
VW208
VW210
VW212
VW214
Figure 10-29
10-76
The Table Find instruction searches the table (SRC), starting
with the table entry specified by INDX, for the data value
(PATRN) that matches the search criteria of =, <>, <, or >.
In LAD, the command parameter (CMD) is given a numeric
value of 1 to 4 that corresponds to =, <>, <, and >, respectively.
Operands:
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
215
216
a match is not found, the INDX has a value equal to the entry
count.
The data entries (area to be searched) are numbered from 0 to
a maximum value of 99. A table may have up to 100 entries,
excluding both the parameters specifying the allowed number of
entries and the actual number of entries.
0006
TL (max. no. of entries)
0006
EC (entry count)
xxxx
d0 (data 0)
xxxx
d1 (data 1)
xxxx
d2 (data 2)
xxxx
d3 (data 3)
xxxx
d4 (data 4)
xxxx
d5 (data 5)
Difference in Table Format between Find Instructions and ATT, LIFO, and FIFO
SRC:
VW, T, C, IW, QW, MW, SMW, *VD,
*AC, SW
PATRN:
VW, T, C, IW, QW, MW, SMW, AC,
AIW, Constant, *VD, *AC, SW
INDX:
VW, T, C, IW, QW, MW, SMW, AC,
*VD, *AC, SW
CMD:
1 ( = ) 2 (< >) 3 ( < ) 4 ( > )
Table format for TBL_FIND
VW202
0006
VW204
xxxx
VW206
xxxx
VW208
xxxx
VW210
xxxx
VW212
xxxx
VW214
xxxx
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02
EC (entry count)
d0 (data 0)
d1 (data 1)
d2 (data 2)
d3 (data 3)
d4 (data 4)
d5 (data 5)

Advertisement

Table of Contents
loading

Table of Contents