804
20 SELECTION FUNCTIONS
20.2 Selecting Maximum/Minimum Value
20.2 Selecting Maximum/Minimum Value
MAX(_E), MIN(_E)
• MAX(_E): These functions output the maximum value of an input value.
• MIN(_E): These functions output the minimum value of an input value.
â– Descriptions, types, and data types
â– Operation processing
• MAX(_E)
Data type is INT
• MIN(_E)
Data type is INT
• A data value of the BOOL, INT, DINT, WORD, DWORD, REAL, STRING, or TIME type can be input to (s1) to (s28).
• The number of pins for (s) can be changed in the range of 2 to 28.
Ladder diagram Structured text
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
d:=MAX(s1,s2);
d:=MIN(s1,s2);
[With EN/ENO]
d:=MAX_E(EN,ENO,s1,s2);
d:=MIN_E(EN,ENO,s1,s2);
Argument Description Type Data type
EN Execution condition (TRUE: Execution, FALSE: Stop) Input variable BOOL
s1 to s28 Input Input variable ANY_SIMPLE
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d Output Output variable ANY_SIMPLE
These functions output the maximum value of the BOOL, INT, DINT, WORD, DWORD, DWORD, REAL, STRING, or TIME type data input to (s1) to (s28) in
the same data type as (s) from (d).
These functions output the minimum value of the BOOL, INT, DINT, WORD, DWORD, DWORD, REAL, STRING, or TIME type data input to (s1) to (s28) in
the same data type as (s) from (d).
MAX
_IN1
_IN2
OUT
1234
5678
INT
INT
5678
INT
(s1) to (s28)
(d)
A
IN
IN
12
4
7
IN
7
IN
s1
to
s28
d
MIN
_IN1
_IN2
OUT
1234
5678
INT
INT
5678
INT
(s1) to (s28)
(d)
I
IN
IN
12
4
7
IN
IN
7
IN
s1
to
s28
d