Allen-Bradley LOGIX 5000 Reference Manual page 549

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

Advertisement

Common Attributes for Advanced Process Control and Drives Instructions
Controllers
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580,
Compact GuardLogix 5380, and GuardLogix 5580 controllers
CompactLogix 5370, ControlLogix 5570, Compact GuardLogix
5370, and GuardLogix 5570 controllers
Denormalized numbers and -0.0 are treated as 0.0
If a computation results in a NAN value, the sign bit could be positive or negative.
In this situation, the software displays 1#.NAN with no sign.
Not all decimal values can be exactly represented in this standard format, which
results in a loss of precision. For example, if you subtract 10 from 10.1, you expect
the result to be 0.1. In a Logix controller, the result could very well be 0.10000038.
In this example, the difference between 0.1 and 0.10000038 is .000038%, or
practically zero. For most operations, this small inaccuracy is insignificant. To put
things in perspective, if you were sending a floating point value to an analog
output module, there would be no difference in the output voltage for a value
being sent to the module that differs by .000038%.
Guidelines for Floating-point Math Operations
Follow these guidelines:
When performing certain floating-point math operations, there may be a loss of
precision due to rounding error. Floating-point processors have their own internal
precision that can impact resultant values.
Do not use floating point math for money values or for totalizer functions. Use
INT or DINT values, scale the values up, and keep track of the decimal place (or
use one INT or DINT value for dollars, and a second INT or DINT value for
cents).
Do not compare floating-point numbers. Instead, check for values within a range.
The LIM instruction is provided specifically for this purpose.
Totalizer Examples
The precision of the REAL data type affects totalization applications such that
errors occur when adding very small numbers to very large numbers.
For example, add 1 to a number over a period of time. At some point the add will
no longer affect the result because the running sum is much greater than 1, and
there are not enough bits to store the entire result. The add stores as many upper
bits as possible and discards the remaining lower bits.
To work around this, do math on small numbers until the results get large. Then,
transfer them to another location for additional large-number math. For example:
Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
Data Type
REAL, LREAL
REAL
Chapter 11
549

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents