Searching The Maximum Value Of 16-Bit Data - Mitsubishi MELSEC iQ-F FX5 series Programming Manual

Melsec iq-f fx5 series
Hide thumbs Also See for MELSEC iQ-F FX5 series:
Table of Contents

Advertisement

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).
Ladder diagram
(s)
(d)
(n)
*1 The MAX(_U) instructions are not supported by the ST language. Use MAX of the standard function.
Page 804 MAX(_E), MIN(_E)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
MAX(P)
Head device number where the maximum value is searched
MAX(P)_U
(d)
MAX(P)
Head device number for storing the maximum value
MAX(P)_U
(n)
Number of data to be searched
■Applicable devices
Operand
Bit
X, Y, M, L,
U\G T, ST,
SM, F, B, SB
(s)
(d)
(n)
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.
(s)
1234 (BIN)
5678 (BIN)
(s)+1
5678 (BIN)
(s)+2
(n)
(s)+(n-2)
-5214 (BIN)
(s)+(n-1)
5555 (BIN)
Operation error
Error code
Description
(SD0/SD8067)
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.
Structured text
ENO:=MAXP(EN,s,n,d);
Word
T, ST, C, D,
U\G
C, LC
W, SD, SW, R
Maximum value
(d)
5678 (BIN)
2
Position
(d)+1
2
Number of data
(d)+2
*1
ENO:=MAXP_U(EN,s,n,d);
Range
Data type
16-bit signed binary
16-bit unsigned binary
16-bit signed binary
16-bit unsigned binary
0 to 65535
16-bit unsigned binary
Double word Indirect
specification
Z
LC
LZ
7 APPLICATION INSTRUCTION
7.17 Data operation instruction
Data type (label)
ANY16
ANY16
ANY16
Constant
Others
K, H
E
$
555
7

Advertisement

Table of Contents
loading

Table of Contents