186
4
4 Instructions4.5.3 Table Operation
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
S2 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
n X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
A dened data stack is searched to nd the units with the same data as the compared data as well as the
maximum and minimum values.
S1 is the head address of the searched data stack.
S2 is the data to be searched for.
D is the head address of search result storage.
n is the length of the searched data area. In 16-bit operation, the value range is 1 to 256; in 32-bit
operation, the value range is 1 to 128.
In 32-bit operation, S1, S2, and D point to 32-bit variables, and n is calculated based on 32-bit variable
width.
◆
Application
X20
〔SER D10 D0 D80 K10 〕
S1 S2 D n
(D 10 )=K100
(D 11 )=K
(D 12 )=K100
(D 13 )= K 98
(D 14 )=K
123
(D 15 )= K 66
(D 16 )=K100
(D 17 )= K 100
(D 18 )=K210
(D 19 )= K 88
˄'˅
˙.
Element
Number
Parameter
Condition
0
1
2
3
4
5
6
7
8
9
D 10
D 11
D 12
D 13
D 14
D 15
D 16
D 17
D 18
D 19
Maximum
Equal
Minimum
S1 S2
111
n
D80
D81
D82
D83
D84
D
Parameter
4
Equal
Equal
Equal
0
7
5
8
Definition
Number of equal parameters
ID of the first equal parameter
ID of the last equal parameter
ID of the minimum parameter
ID of the maximum parameter
Search result
Searched Data
Compared data
Usage:
Comparison is performed only when X20 = ON in the instruction ow. Signed numbers are compared
algebraically, for example, –8 < +2.
When there are multiple minimum or maximum values, the element with the greatest number is displayed.
The search result is stored in ve consecutive units from head address D. If no equal data exists, the
values in D80 to D82 in the preceding example are all 0s.