Allen-Bradley LOGIX 5000 Reference Manual page 546

Controllers advanced process control and drives and equipment phase and sequence instructions
Hide thumbs Also See for LOGIX 5000:
Table of Contents

Advertisement

Chapter 11
Common Attributes for Advanced Process Control and Drives Instructions
546
The REAL data type also stores
display differs based on the display format.
Data type conversions
When data types are mixed for operands within an instruction, some instructions
automatically convert data to an optimal data type for that instruction. In some
cases, the controller converts data to fit a new data type; in some cases the
controller just fits the data as best it can.
Conversion
larger integer to smaller integer
SINT or INT to REAL
DINT to REAL
LREAL to LREAL
LREAL TO REAL
LREAL/REAL to unsigned integer
Signed Integer/Unsigned Integer to
LREAL/REAL
Signed integer to unsigned integer
Unsigned integer to signed integer
REAL to integer
Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
infinity and
NAN, but the software
Result
The controller truncates the upper portion of the larger integer and
generates an overflow.
For example:
Decimal
DINT
65,665
INT
129
SINT
-127
No data precision is lost
Data precision could be lost. Both data types store data in 32 bits, but the
REAL type uses some of its 32 bits to store the exponent value. If precision is
lost, the controller takes it from the least-significant portion of the DINT.
No data precision is lost.
Data precision could be lost.
Data precision could be lost. If the source value is too big to fit into
destination the controller stores what it can and may produce an overflow.
If the integer value has more significant bits than can be stored in the
destination, the lower bits will be truncated.
If the source value is too big to fit into destination the controller stores what
it can and may produce an overflow.
If the source value is too big to fit into destination the controller stores what
it can and may produce an overflow.
The controller rounds the fractional part and truncates the upper portion of
the non-fractional part. If data is lost, the controller sets the overflow status
flag.
Rounding is to the nearest whole number:
less than 0.5, round down; equal to 0.5, round to nearest even integer;
greater than 0.5, round up
For example:
REAL (source)
DINT (result)
Binary
0000_0000_0000_0001_0000_0
000_1000_0001
0000_0000_1000_0001
1000_0001

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents