Basic instructions
8.5 Math functions
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
261
MIN (Get minimum) and MAX (Get maximum)
Table 8- 59 MIN (get minimum) and MAX (get maximum) instructions
in1:=_variant_in_,
in2:=_variant_in_
[,...in32]);
The MIN instruction compares the value of two parameters IN1
and IN2 and assigns the minimum (lesser) value to parameter
OUT.
in1:=_variant_in_,
in2:=_variant_in_
[,...in32]);
The MAX instruction compares the value of two parameters IN1
and IN2 and assigns the maximum (greater) value to parameter
OUT.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
Table 8- 60 Data types for the parameters
IN1, IN2
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Time,
Math operation inputs (up to 32 inputs)
OUT SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Time,
Math operation output
1
The IN1, IN2, and OUT parameters must be the same data type.
To add an input, click the "Create"
icon or right-click on an input stub for one of
the existing IN parameters and select the "Insert input" command.
To remove an input, right-click on an input stub for one of the existing IN parameters (when
there are more than the original two inputs) and select the "Delete" command.
Table 8- 61 ENO status
0 For Real data type only:
• At least one input is not a real number (NaN).
• The resulting OUT is +/- INF (infinity).