Common attributes for Motion instructions
672 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018
Convert DINT to SINT or INT
To convert a DINT value to a SINT or INT value, the controller truncates the
upper portion of the DINT and stores the lower bits that fit in the data type. If the
value is too large the conversion generates an overflow.
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