The arithmetic block ION loses pressure to make a sum with large numbers, for example:
The right answer would be
R3 := 177777777
is there any way to perform calculations with numbers in full form on the ION platform for no loss precision caused by the use of float32?
The standard Float32 format is limited to seven decimal digits of precision (24 binary bits).
The ION Arithmetic module uses Float32 for calculations and outputs.
The only technique I'm aware of is to split the value and use multiple float32 outputs to represent your answer with extended precision.
For example, the number 123456789 cannot be represented exactly in Float32 format (the closest number is approximately 123456794.7). But if the numbers 123E6, and 456789 can be kept separate, they can each be provided as separate Float32 outputs and combined later is a system capable of Float64 math to preserve the extended precision.
In your case, where S1 needs to be scaled by one million and S2 does not:
Formula3: FLOOR(S1+S2/1E6) to provide the 'millions' portion of the result in R3.
Formula4: (S1-FLOOR(S1))*1E6+MOD(S2,1E6) to provide the 'ones' portion of the result in R4.
Thank you Dan for your reply
My problem is to need to perform calculations with a number of up to nine digits, which can be separated into two numbers 123E6 and 456789. But would like to have this number in a Data Recoder Module as a single number.
The number S1=123 and S2=456789 can be represented correctly by the formula S1 + S2 * 1000/1000
But the number S1=999 and S2=999111
is there any way to join the numbers without losing precision?
The formula S1*1000 + S2/1000 may appear to work with this example, but it is just a coincidence.
You will notice that the result does not change when you subtract from the lowest digit.
123456.786, 123456.787, and 123456.788 are also represented as 123456.789 with Float32.
No, there is no way to represent more than 7 digits of precision on the output of an ION Arithmetic module becuase it uses Float32.
The data recorders on-board the devices record in float32 format. As far as I know the only float64 calculations done on-board the device (in the ION modules anyway) are inside the integrator module but the INT module outputs are still float32. All the other ION modules always use float32 or int32 as the base numeric format for calculation purposes.
Another option is to combine the values in the VIP in the PME software. As far as I know the majority (or all) of the VIP calculations are done using float64 values. Once this is done then the value could be inserted into the database for historical measurements.
Remember that the device is only accurate to 4 or 5 digits at most (on the order of 0.1%) so the float32 format is more than capable of this since it handles 7 digits. It is only when you combine large and small numbers together that the issue arises. In this case the possible error in the large number can be of similar magnitude to the most significant digits of the small number so effectively this calculation would be producing high suspect values.
Discuss challenges in energy and automation with 30,000+ experts and peers.
Find answers in 10,000+ support articles to help solve your product and business challenges.
Find peer based solutions to your questions. Provide answers for fellow community members!