2 Instruction Descriptions
2-314
NJ-series Instructions Reference Manual (W502)
ArySearch
The ArySearch instruction searches for the specified value in a one-dimensional array.
* If you omit an input parameter, the default value is not applied. A building error will occur.
Instruction Name FB/FUN Graphic expression ST expression
ArySearch Array Search FUN Out:=ArySearch(In, Size,
Key, InOutPos, Num);
Variables
Name Meaning I/O Description Valid range Unit Default
In[] (array) Array to
search
Input
Array to search Depends on data type.
---
*
Size Number of
elements to
search
Number of elements in In[]
to search
1 to 65535 1
Key Search key Value to search for Depends on data type. ---
InOutPos Found
element
number
In-out Array element number
where value was found
Depends on data type. --- ---
Out Search
result
Output
Search result
Depends on data type.
--- ---
Num Number
found
Number found
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In[] (array) OKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOK
Arrays of enumerations can also be specified.
Size OK
Key Must be same data type as the elements of In[].
InOutPos OK
Out OK
Num OK
(@)ArySearch
EN ENO
In Out
Size Num
Key
InOutPos