100BBasic instructions
7.5 Math
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
191
7.5.7
Minimum and Maximum instructions
Table 7- 53 MIN and MAX instructions
LAD / FBD
SCL
Description
out:= MIN(
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.
out:= MAX(
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 7- 54 Data types for the parameters
Parameter
Data type
1
Description
IN1, IN2
[...IN32]
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Constant
Math operation inputs (up to 32 inputs)
OUT
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal
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 7- 55 ENO status
ENO
Description
1
No error
0
For Real data type only:
One or more inputs is not a real number (NaN).
The resulting OUT is +/- INF (infinity).