EasyManua.ls Logo

Omron NJ501-1500

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
Loading...
2-313
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Selection Instructions
2
AryMax and AryMin
These instructions search Size elements in array to search In[] starting from In[0]. The value that is
found is assigned to Out, the element number where it was found is assigned to InOutPos, and the
number of times the value was found is assigned to Num. If Num is greater than 1, the value in InOut-
Pos is the number of the lowest element that contains the value that was found.
z AryMax
The AryMax instruction finds the largest value.
z AryMin
The AryMin instruction finds the smallest value.
The following example shows the AryMax instruction when Size is UINT#6.
The input parameter that is passed to In[] is abc[2], so the search starts from abc[2].
If you use a different data type for In[] and Out, make sure the valid range of Out includes the valid
range of In[].
If In[] contains real numbers, the desired results may not be achieved due to error.
Always used a one-dimensional array for In[].
If the value of Size is 0, the values of Out and Num are 0. The value of InOutPos does not change.
An error occurs in the following cases. ENO will be FALSE, and Out will not change.
The value of Size is outside of the valid range.
Size exceeds the array area of In[].
In[] is not a one-dimensional array.
Function
Precautions for Correct Use
ghi:=AryMax(abc[2], UINT#6, def, jkl);
LD ST
abc[2]
def def
ghi
jkl
UINT#6
AryMax
EN ENO
In
Size Num
InOutPos
Largest value = 9999
Not searched.
Not searched.
The lowest element number that contains the largest value 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
9999
2345
9999
4321
4567
1234
9999
9999
INT#9999
Out=ghi
InOutPos=def
Num=jkl
UINT#2
UINT#3

Table of Contents

Related product manuals