09-25-2014 09:04 AM
Hi,
I'm using CompactRio and doing some arithmetic operation on RT, I had seen in that arithmetic operation result with SGL input is different from FXP or DBL one,
why it happen?
Regards,
SASA
09-25-2014 09:13 AM - edited 09-25-2014 09:17 AM
Different in what way?
They three representation us a different number of bits, so will operate with different precision. In general, the results should be quite similar except for rare cases.
For FXP, the precision is configurable and you can balance how many bits to use for the integer part and the fractional part.
09-25-2014 09:21 AM
exemple with the attached picture.
the result with cvi is Ksin
-299,055055 |
there is difference!
Regards,
sasa
09-25-2014 09:32 AM
Well, you only show a DBL computation and compare it with a computation in a datatype that you don't define. What datatype was used in CVI?
How do you know what is correct?
Do both versions of the algorithm do all computations in exactly the same order?
Do all inputs have exactly the same precision?
We cannot debug code pictures. Please attch the actual VI. Populate all control values with typical default data before saving.
09-25-2014 09:37 AM
duplicate post, already asked here…
09-25-2014 09:37 AM
So the results agree withing 5 decimal digits, which is plenty for typical real-world signals.. Where is the data coming from? How many bits does the DAQ have? What are you going to do with the result of the computation?