Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

Function
The ArySearch instruction searches Size elements of one-dimensional array to search In[] for elements
with the same value as search key Key. The search starts from In[0].
The values of search result Out, found element number InOutPos, and number found Num are as fol-
lows:
Element with
same value as
Key
Exists.
Does not exist.
The relationship between values with data types that are not integers or real numbers are determined
as given in the following table.
Data type
TIME
DATE, TOD, or DT
The following example is for when Size is UINT#6 and Key is INT#5555.
The input parameter that is passed to In[] is abc[2], so the search starts from abc[2].
LD
abc[2]
UINT#6
INT#5555
def
The lowest element number that
contains same value as Key is 3.
In[0]=abc[2]
In[1]=abc[3]
In[2]=abc[4]
Size=UINT#6
In[3]=abc[5]
In[4]=abc[6]
In[5]=abc[7]
Additional Information
When you compare TIME, DT, or TOD data, adjust the data so that the precision of the values is the
same. Use the following instructions to adjust the precision of the values: TruncTime (page 2-651),
TruncDt (page 2-655), and TruncTod (page 2-659).

NY-series Instructions Reference Manual (W560)

Out
InOutPos
TRUE
Lowest element number that con-
tains the same value as Key
FALSE
Does not change.
The numerically larger value is considered to be larger.
Later dates or times of day are considered to be larger.
ArySearch
EN
ENO
In
ghi
Size
Num
jkl
Key
InOutPos
def
Not searched.
Key=INT#5555
5555
2345
5555
5555
4567
1234
9876
5555
Not searched.
Number of elements with
same value as Key
0
Relationship
ST
ghi:=ArySearch(abc[2], UINT#6, INT#5555, def, jkl);
TRUE
Out=ghi
InOutPos=def
UINT#3
UINT#2
Num=jkl
2 Instruction Descriptions
Num
2
2-351

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents