Basic instructions
8.5 Math functions
S7-1200 Programmable controller
260 System Manual, V4.2, 09/2016, A5E02486680-AK
Table 8- 54 Data types for parameters
SInt, Int, DInt, USInt, UInt, UDInt
Math operation input and output
Table 8- 55 ENO status
0 The resulting value is outside the valid number range of the selected data type.
Example for SInt: INC (+127) results in +128, which exceeds the data type maximum.
ABS (Form absolute value)
Table 8- 56 ABS (absolute value) instruction
Calculates the absolute value of a signed integer or real number at parameter
IN and stores the result in parameter OUT.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
Table 8- 57 Data types for parameters
SInt, Int, DInt, Real, LReal
SInt, Int, DInt, Real, LReal
1
The IN and OUT parameters must be the same data type.
Table 8- 58 ENO status
1 No error
0 The math operation result value is outside the valid number range of the selected data type.
Example for SInt: ABS (-128) results in +128 which exceeds the data type maximum.