2 Instruction Descriptions
2-312
NJ-series Instructions Reference Manual (W502)
AryMax and AryMin
* If you omit the input parameter, the default value is not applied. A building error will occur.
AryMax: Finds the elements with the largest value in a one-dimensional array.
AryMin: Finds the elements with the smallest value in a one-dimensional array.
Instruction Name FB/FUN Graphic expression ST expression
AryMax Array Maximum FUN Out:=AryMax(In, Size,
InOutPos, Num);
AryMin Array Minimum FUN Out:=AryMin(In, Size, InOut-
Pos, 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
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) OKOKOKOKOKOKOKOKOKOK
Size OK
InOutPos OK
Out OKOKOKOKOKOKOKOKOKOK
Num OK
(@)AryMax
EN ENO
In Out
Size Num
InOutPos
(@)AryMin
EN ENO
In Out
Size Num
InOutPos