6 - 49 6 - 49
6 IEC FUNCTIONS
6.8.2 Maximum value MAX
MAX_E
The specified data are searched for the maximum value.
Function definition
ANY_SIMPLE MAX( ANY_SIMPLE S1, ANY_SIMPLE S2,…., ANY_SIMPLE Sn );
Argument
Argument Name
IN/OUT
Description
S1 to Sn
IN
Search target data
Return value
Return Value
Description
ANY_SIMPLE Search
result
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
REAL
w_Real4 := MAX(
w_Real1,w_Real2,w_Real3 );
LD SM400
EMOV w_Real1
w_Real4
LDE< w_Real4
w_Real2
EMOV w_Real2
w_Real4
LDE< w_Real4
w_Real3
EMOV w_Real3
w_Real4
LD,EMOV,LDE<
INT
D0 := MAX( D1,D2,D3 );
LD
SM400
MOV D1
D0
LD< D0
D2
MOV D2
D0
LD< D0
D3
MOV D3
D0
LD,MOV,LD<
DINT
w_DWord4 := MAX( -
2147483648,0,2147483647 );
LD SM400
DMOV K2147483647
w_DWord4
LD,DMOV
BOOL
w_Bit4 := MAX(
w_Bit1,w_Bit2,w_Bit3 );
LD w_Bit1
OR w_Bit2
OR w_Bit3
OUT w_Bit4
LD,OR,OUT
STRING
w_Str4 := MAX(
"ABC","DEF","GHI" );
LD SM400
$MOV "ABC"
w_Str4
LD$< w_Str4
"DEF"
$MOV
"DEF" w_Str4
LD$< w_Str4
"GHI"
$MOV "GHI"
w_Str4
LD,$MOV,LD$<
Summary of Contents for MELSEC L series
Page 1: ...Programming Manual Structured Text ...
Page 2: ......
Page 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Page 297: ......