Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

SASA1

Member

09-25-2014 09:04 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

altenbach

Knight of NI

09-25-2014 09:13 AM - edited 09-25-2014 09:17 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

exemple with the attached picture.

the result with cvi is Ksin

-299,055055 |

there is difference!

Regards,

sasa

altenbach

Knight of NI

09-25-2014 09:32 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

GerdW

Knight of NI

09-25-2014 09:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

duplicate post, already asked here…

Best regards,

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

altenbach

Knight of NI

09-25-2014 09:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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?