Chapter 16 Selection Functions; Selecting The Maximum/Minimum Value - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Motion module instructions, standard functions/ function blocks
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

16
SELECTION FUNCTIONS
16.1

Selecting the Maximum/Minimum Value

MAX, MIN
• MAX: This function outputs the maximum input value.
• MIN: This function outputs the minimum input value.
*1
Structured text
d:=MAX(s1,s2);
d:=MIN(s1,s2);
*1 The input variable s can be changed within the range from 2 to 28.
Setting data
■Description, type, data type
Argument
s1 (IN1) to s28 (IN28)
d
Processing details
■Operation processing
• MAX
This function outputs the maximum value of the BOOL, INT, DINT, WORD, DWORD, REAL, LREAL, STRING, or TIME data
type values input to (s1) to (s28), in the same data type as (s), from (d).
Ex.
Data type: INT
(s1)
...
(s28)
1234
INT
_IN1
_IN2
5678
INT
• MIN
This function outputs the minimum value of the BOOL, INT, DINT, WORD, DWORD, REAL, LREAL, STRING, or TIME data
type values input to (s1) to (s28), in the same data type as (s), from (d).
Ex.
Data type: INT
(s1)
...
(s28)
1234
INT
_IN1
_IN2
5678
INT
• Input a BOOL, INT, DINT, WORD, DWORD, REAL, LREAL, STRING, or TIME data type value to (s1) to (s28).
• Conditions for comparing the STRING data type values are as follows:
Match:
Bigger string:
Smaller string:
16 SELECTION FUNCTIONS
188
16.1 Selecting the Maximum/Minimum Value
Description
Input
Output
(d)
MAX
5678
MAX
INT
(d)
MIN
1234
MIN
INT
• All characters matched
• The one having a character with a bigger code (when strings consist of different characters)
• The one having a longer length (when strings are of different lengths)
• The one having a character with a smaller code (when strings consist of different characters)
• The one having a shorter length (when strings are of different lengths)
Type
Data type
Input variable
ANY_ELEMENTARY
Output variable
ANY_ELEMENTARY

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents