2-485
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Stack and Table Instructions
2
RecSearch
Using the same example as before, the order of the array elements and the processing results will be
as shown below for an ascending binary search.
For a descending binary search, the array elements in the input parameter that is passed to In[] must be
in descending order before this instruction is executed. Then a binary search is performed by executing
this instruction.
Using the same example as before, the order of the array elements and the processing results will be
as shown below for a descending binary search.
• In[] can be a member of a higher-level structure.
Example: In[0]=str0.str1[0]
• In[] can be an array with two or more dimensions. If In[] is a two-dimensional array, the element num-
ber in the first dimension of the element that matches the search conditions is assigned to InOut-
Pos[0] and the element number in the second dimension is assigned to InOutPos[1].
Additional Information
Key
Member = abc[0].m
Out = ghi
InOutPos[0] = def
Num = jkl
Matches
Member m
0000
1234
0000
INT#1234
0000
1234
0000
0000
2345
0000
0000
3456
0000
0000
3456
0000
TRUE
UINT#0
UINT#2
Size=UINT#5
In[0]=abc[0]
In[1]=abc[1]
In[2]=abc[2]
In[3]=abc[3]
In[4]=abc[4]
Mode=_BIN_ASC
Key
Out = ghi
InOutPos[0] = def
Num = jkl
Member m
Matches
0000
3456
0000
INT#1234
0000
3456
0000
0000
2345
0000
0000
1234
0000
0000
1234
0000
Member=abc[0].m
TRUE
UINT#2
UINT#3
Size=UINT#5
In[0]=abc[0]
In[1]=abc[1]
In[2]=abc[2]
In[3]=abc[3]
In[4]=abc[4]
Mode=_BIN_DESC