PLC REAL Total Stops Growing? The Increment May Be Too Small
- PLC Play Ground
- 0
- Posted on
A floating-point total can stop responding to small additions while remaining far below its maximum magnitude. Check resolution at the current value, not only overflow limits. Larger totals have wider spacing between representable numbers.
Binary32 numerical example; target representation and rounding must be confirmed.
What is happening?
Finite floating-point precision means some additions round back to the original value. The effect depends on representation, magnitude, increment, and rounding. A wider final display cannot recover increments discarded during arithmetic.
Check these five things
-
Identify the actual storage and intermediate numerical types.
-
Compare accumulated magnitude with the smallest required increment.
-
Simulate long-running boundary conditions rather than only startup.
-
Review wider or fixed-point storage where appropriate.
-
Check every downstream conversion and persistence path.
Worked example
In IEEE binary32 arithmetic using round-to-nearest, 16,777,216 plus 1 rounds back to 16,777,216. A REAL event accumulator can therefore lose single-unit increments at that magnitude. The example assumes binary32 behavior; confirm the actual PLC representation.
Quick diagnostic reference
| Property | Question |
|---|---|
| Maximum magnitude | Overflow risk? |
| Representable spacing | Increment visible? |
| Downstream storage | Precision retained? |
The mistake to avoid
Resetting totals periodically may hide the issue while breaking reporting continuity. Choose an explicit accumulation and rollover strategy that preserves the required quantity.
How to verify the fix
Test the largest intended lifetime total with the smallest increment. Verify reporting, restart, and transfer paths preserve the same accuracy requirement.
Field-work boundary: These are educational diagnostic guides. Use the exact equipment manuals and approved site procedures. Electrical testing and machinery changes belong to qualified, authorized personnel; control hazardous energy and validate affected functions before release.
Technical reference
ABB: REAL and LREAL data types. The examples and diagnostic tables above are original teaching material; they do not replace the product manual.
