100BBasic instructions
7.5 Math
S7-1200 Programmable controller
188
System Manual, 11/2011, A5E02486680-05
Table 7- 40 ENO status
ENO
Description
1
No error
0
The Math operation result value would be outside the valid number range of the data type selected. The
least significant part of the result that fits in the destination size is returned.
0
Division by 0 (IN2 = 0): The result is undefined and zero is returned.
0
Real/LReal: If one of the input values is NaN (not a number) then NaN is returned.
0
ADD Real/LReal: If both IN values are INF with different signs, this is an illegal operation and NaN is
returned.
0
SUB Real/LReal: If both IN values are INF with the same sign, this is an illegal operation and NaN is
returned.
0
MUL Real/LReal: If one IN value is zero and the other is INF, this is an illegal operation and NaN is
returned.
0
DIV Real/LReal: If both IN values are zero or INF, this is an illegal operation and NaN is returned.
7.5.3
Modulo instruction
Table 7- 41 MOD instruction
LAD / FBD
SCL
Description
out := in1 MOD in2;
You can use the MOD instruction to return the remainder of an integer
division operation. The value at the IN1 input is divided by the value at
the IN2 input and the remainder is returned at the OUT output.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
Table 7- 42 Data types for parameters
Parameter
Data type
1
Description
IN1 and IN2
SInt, Int, DInt, USInt, UInt, UDInt, Constant
Modulo inputs
OUT
SInt, Int, DInt, USInt, UInt, UDInt
Modulo output
1
The IN1, IN2, and OUTparameters must be the same data type.
Table 7- 43 ENO values
ENO
Description
1
No error
0
Value IN2 = 0, OUT is assigned the value zero