2-499
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Stack and Table Instructions
2
RecMax and RecMin
RecMax and RecMin
* If you omit the input parameter, the default value is not applied. A building error will occur.
RecMax: Searches the specified member in the structures of an array of structures for the
maximum value.
RecMin: Searches the specified member in the structures of an array of structures for the
minimum value.
Instruction Name FB/FUN Graphic expression ST expression
RecMax Maximum Record
Search
FUN Out:=RecMax(In, Size,
Member, InOutPos, Num);
RecMin Minimum Record
Search
FUN Out:=RecMin(In, Size,
Member, InOutPos, Num);
Variables
Name Meaning I/O Description Valid range Unit Default
In[] (array) Array to
search
Input
Array of structures to search
---
---
*
Size Number of
elements to
search
Number of array elements to
search
Depends on data type.
1
Member Member to
search
Member of In[] structure to
search
*
InOutPos[]
(array)
Found ele-
ment
number
In-out Found element number 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) Specify an array of structures.
Size OK
Member OK OK OK OK OK OK OK OK OK OK
Specify the same data type as the search member of In[].
(@)RecMax
EN ENO
In Out
Size Num
Member
InOutPos
(@)RecMin
EN ENO
In Out
Size Num
Member
InOutPos