Common Attributes for Advanced Process Control and Drives Instructions
544 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
Convert a DINT to an INT and a SINT
This DINT value Converts to this smaller value
16#0001_0081 (65,665) INT: 16#0081 (129)
SINT: 16#81 (-127)
Convert REAL to SINT, INT, or DINT
To convert a REAL value to an integer value, the controller rounds any fractional
part and stores the bits that fit in the result data type. If the value is too large the
conversion generates an overflow.
Numbers round as in the following examples.
Fractions < 0.5 round down to the nearest whole number.
Fractions > 0.5 round up to the nearest whole number.
Fractions = 0.5 round up or down to the nearest even number.
Important:
Conversion of REAL values to DINT values
This REAL value Converts to this DINT value
-2.5
-3.5
-2
-4
-1.6 -2
-1.5 -2
-1.4 -1
1.4 1
1.5 2
1.6 2
2.5
3.5
2
4