2 Instruction Descriptions
2-482
NJ-series Instructions Reference Manual (W502)
RecSearch
The RecSearch instruction searches an array of structures for elements that match the search key with
the specified method.
* If you omit the input parameter, the default value is not applied. A building error will occur.
Instruction Name FB/FUN Graphic expression ST expression
RecSearch Record Search FUN Out:=RecSearch(In, Size,
Member, Key, Mode, InOut-
Pos, Num);
Variables
Name Meaning I/O Description Valid range Unit Default
In[] (array) Array to
search
Input
Array of structures to search
---
---
*
Size Number of
elements to
search
Number of array elements to
search
Depends on data type.
1
Member Member to
search
Member of In[] structure to
search
*
Key Search key Search value
Mode Search
method
Search method _LINEAR,
_BIN_ASC,
_BIN_DESC
_LINEA
R
InOutPos[]
(array)
Element
numbers of
matching
elements
In-out Element numbers of
matching elements
Depends on data type.
--- ---
Out Search
result
Output
TRUE: There are elements
that match conditions
FALSE: There are no
elements that match
conditions
Depends on data type.
--- ---
Num Number of
matches
Number of matches
(@)RecSearch
EN ENO
In Out
Size Num
Member
Key
Mode
InOutPos