Value difference between OPC Kepware and readBlocking

Hi,

Why there is a difference in value tag between OPC Kepware and the value read by the function readBlocking? Also, the value in the Designer is exactly like in the OPC.

And also:

Why round 5 gives us 27,8 and changing it to 6, immediately gives us 27,799999?

standard python behavior: Built-in Functions — Python 3.12.3 documentation

>>> round(27.799999, 5)
27.8
>>> round(27.799999, 6)
27.799999
>>>
2 Likes

For 32-bit floating point, 27.8 IS the same number as 27.799999.

Nothing to do with Ignition at all.

The least common denominator of any number ending in .8 is five. Which yields a repeating binary fraction.

{ If you convert to double, and show even more decimal places, it will look even weirder. Simply artifacts of binary fractions. }

2 Likes

To illustrate Phil's point:


(IEEE-754 Floating Point Converter)

4 Likes