LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom probe with “NaN”

Why custom probe is not working if value is “NaN” ?

 

Probe.png

Munna
0 Kudos
Message 1 of 5
(3,200 Views)

Hi Munna,

 

because NaN is always unequal to each other floating point number. Even when compared to NaN

 

Wikipedia explains a lot of NaN floating point issues…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,185 Views)

Thanks for your reply.

 

I think probe is working like secound approach (red area).

Probe2.png

 

 

Why it is not working like first approach? because we already have LabVIEW vi to check NaN but why this function is not included in Probe?

as we know, we are not checking NaN directly with Equal then why probe is using same apporach?

Munna
0 Kudos
Message 3 of 5
(3,176 Views)

Hi Munna,

 

this conditional probe is made for general use: checking for equality of regular floating point numbers.

 

You want to check for a special (irregular) FP number - this is not covered by a simple "equal" operation as is written in the IEEE754 standard for floating point numbers. (Again: Wikipedia is a good source of information on this topic!)

 

You need to check for NaN using a special operation as NaN is handled special in floating point hard-/software!

One more fact: there is not just one special NaN, there are a lot of NaN values… (Read the specs!)

 

You know you can create your own specialized probes?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(3,171 Views)

I would suggest that this is a bug in the probe, most likely because whoever wrote the code for the probe didn't think of that use case. In the LV version I currently have open the probe does have that code and does correctly detect NaN, so I guess someone noticed it at some point.

 

As Gerd said, you can create your own probes and LV has documentation for how to do this. You can also look at the existing probe at <LabVIEW>\vi.lib\_probes, but be aware that if you change it, those changes will only apply on your computer.


___________________
Try to take over the world!
Message 5 of 5
(3,153 Views)