EasyManuals Logo

Omron NJ501-1500 User Manual

Omron NJ501-1500
990 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #363 background imageLoading...
Page #363 background image
2-315
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Selection Instructions
2
ArySearch
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:
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].
• Always use a one-dimensional array for In[].
• Make sure that Key has the same data type as the elements of In[].
• If the value of Size is 0, the values of Out and Num are 0. The value of InOutPos does not change.
• When Key is an enumeration, always use a variable for the input parameter to pass to Key. A building
error will occur if a constant is passed.
• An error occurs in the following cases. ENO will be FALSE, and Out, Num, and InOutPos will not
change.
• Size exceeds the array area of In[].
• In[] or Key is STRING data and it does not end in a NULL character.
• In[] is not a one-dimensional array.
Function
Element with
same value as
Key
Out InOutPos Num
Exists. TRUE Lowest element number that con-
tains the same value as Key
Number of elements with
same value as Key
Does not exist. FALSE Does not change. 0
Precautions for Correct Use
ghi:=ArySearch(abc[2], UINT#6, INT#5555, def, jkl);
LD ST
abc[2]
def def
ghi
jkl
UINT#6
INT#5555
ArySearch
EN ENO
In
Size Num
Key
InOutPos
Not searched.
Not searched.
The lowest element number that
contains same value as Key is 3.
In[0]=abc[2]
In[1]=abc[3]
In[2]=abc[4]
In[3]=abc[5]
In[4]=abc[6]
In[5]=abc[7]
Size=UINT#6
5555
2345
5555
5555
4567
1234
9876
5555
TRUE
Key=INT#5555
Out=ghi
InOutPos=def
Num=jkl
UINT#3
UINT#2

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NJ501-1500 and is the answer not in the manual?

Omron NJ501-1500 Specifications

General IconGeneral
BrandOmron
ModelNJ501-1500
CategoryController
LanguageEnglish

Related product manuals