
7 APPLICATION INSTRUCTION
7.17 Data operation instruction
555
7
Searching the maximum value of 16-bit data
MAX(P)(_U)
These instructions search the maximum value from the (n) point(s) of 16-bit binary data in the device starting from the one
specified by (s), and store the maximum value in the device specified by (d).
*1
The MAX(_U) instructions are not supported by the ST language. Use MAX of the standard function.
Setting data
■
Descriptions, ranges, and data types
■
Applicable devices
Processing details
• These instructions search the maximum value from the (n) point(s) of 16-bit binary data in the device starting from the one
specified by (s), and store the maximum value in the device specified by (d). These instructions start searching from the
device specified by (s), and store the location from (s) of the first maximum value in (d)+1 and the number of maximum
values in (d)+2.
Operation error
Ladder diagram
Structured text
ENO:=MAXP(EN,s,n,d);
ENO:=MAXP_U(EN,s,n,d);
Operand
Description
Range
Data type
Data type (label)
(s)
MAX(P)
Head device number where the maximum value is searched
16-bit signed binary
ANY16
MAX(P)_U
16-bit unsigned binary
(d)
MAX(P)
Head device number for storing the maximum value
16-bit signed binary
ANY16
MAX(P)_U
16-bit unsigned binary
(n)
Number of data to be searched
0 to 65535
16-bit unsigned binary
ANY16
Operand
Bit
Word
Double word
Indirect
specification
Constant
Others
X, Y, M, L,
SM, F, B, SB
U
\G
T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U
\G
Z
LC
LZ
K, H
E
$
(s)
(d)
(n)
Error code
(SD0/SD8067)
Description
2820
The (n) point(s) of data in the device starting from the one specified by (s) exceed the corresponding device range.
The device specified by (d) exceeds the corresponding device range.
(s)
(d)
(n)
1234 (BIN)
5678 (BIN)
5678 (BIN)
-5214 (BIN)
5555 (BIN)
(n)
(s)
(s)+1
(s)+(n-2)
(s)+(n-1)
(s)+2
5678 (BIN)
2
2
(d)
(d)+1
(d)+2
Maximum value
Position
Number of data
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......