PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in reading from niDmm: NaN

This error occurs often. It passed already but then fail again with NaN.
Do you also have example to capture the error and save to text file? Thanks
0 Kudos
Message 1 of 7
(4,803 Views)
Phuc,
Usually the DMM will return NaN when the measurement is out of range. If you increase the range of the measurement do you still get the error?

_
Mike
0 Kudos
Message 2 of 7
(4,802 Views)
Michael,
Thanks for the response. I will switch to auto-range.
Do you have any method to trap this error? when I get NaN error, I would like to set it to -99.99.

Best Regard,

PN
0 Kudos
Message 3 of 7
(4,802 Views)
Depending upon your software environment ther should be a function called "Is a number?" or "Not a Number?" In LabVIEW this can be found in the comparison menu. The return of the function will be a boolean and can use this to replace the number with -99 if needed.

Good Luck,
Mike
0 Kudos
Message 4 of 7
(4,802 Views)
The 'Not a Number' worked well.
After I set niDMM to autorange, I still got some NaN reading. Thanks to your recommendation, I set it to -99.9 now.
Best regards,
Phuc
0 Kudos
Message 5 of 7
(4,802 Views)
How to notify "NaN" in VB .NET after niDmm got this value?
0 Kudos
Message 6 of 7
(4,730 Views)
Hey everyone,
niDMM has a great function that you could call: (from help file)

[niDMM_IsOverRange
Usage:
ViStatus = niDMM_IsOverRange(ViSession Instrument_Handle, ViReal64 Measurement_Value, ViBoolean* Is_Over_Range)

"Takes a measurement value and determines if the value is a valid measurement or a value indicating that an overrange condition occurred."]

You could call this after a read and check for the over range condition. Immediately following you could check the value of the ViBoolean that is set and return your value accordingly. i.e.
//sample
ViStatus = niDMM_Read(...................., Reading)
ViStatus = niDMM_IsOverRange(........, Reading , Is_Over_Range)
if(Is_Over_Range)
Reading = -99.99;
//rest of code

Just a thought

Sincerely,
Gavin Goodrich
Applications Engineer
National Instruments
0 Kudos
Message 7 of 7
(4,718 Views)