LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what is better in arithmetic, SGL / FXP / DBL

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

0 Kudos
Message 1 of 6
(2,140 Views)

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.

 

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 6
(2,136 Views)

exemple with the attached picture.

 

the result with cvi is    Ksin

-299,055055

 

 

there is difference!

 

Regards,

sasa

0 Kudos
Message 3 of 6
(2,124 Views)

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. 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 6
(2,115 Views)

duplicate post, already asked here

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 6
(2,107 Views)

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?


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 6 of 6
(2,103 Views)