2-489
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Stack and Table Instructions
2
RecRangeSearch
The following example is for when Size is UINT#5, MN is INT#1000, MX is INT#2000, Condition is
_EQ_BOTH and Mode is _LINEAR.
For an ascending binary search, the array elements in the input parameter that is passed to In[] must be
in ascending order before this instruction is executed. Then a binary search is performed by executing
this instruction.
ghi:=RecRangeSearch(abc[0], UINT#5, abc[0].m, INT#1000,
INT#2000, _EQ_BOTH, _LINEAR, def, jkl);
LD ST
abc[0]
def
def
ghi
jkl
UINT#5
abc[0].m
INT#1000
INT#2000
_EQ_BOTH
_LINEAR
RecRangeSearch
EN ENO
In
Size Num
Member
MN
MX
Condition
Mode
InOutPos
MX
Member = abc[0].m
Out = ghi
InOutPos[0] = def
Num = jkl
MN
Member m
Matches
0000
3456
0000
Size=UINT#5
Mode=_LINEAR
Condition=_EQ_BOTH
INT#2000
0000
2345
0000
0000
1234
0000
0000
3456
0000
0000
1234
0000
In[0]=abc[0]
In[1]=abc[1]
In[2]=abc[2]
In[3]=abc[3]
In[4]=abc[4]
TRUE
UINT#2
UINT#2
INT#1000