NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Evaluating NaN Comparison Type in TestStand Numeric Limit Step

I'm using a 4070 DMM to return Resistance Measurements to a TestStand numeric Limit step. How can I use a comparison type when the LabView vi returns NaN (Not a Number). I want the step to pass as long as the Resistance Measurement is > GT some value.
0 Kudos
Message 1 of 4
(4,623 Views)
NAN comparison in expressions and limit tests works as follows

(NAN > x) == false
(NAN == x) == false
(NAN < x) == false
(NAN == NAN) == true

To summarize, a NAN is neither greater or less than another number and is only equal to another NAN.

If you want NAN to fail and measurement > some_limit to pass, then just use the > (GT) operator.

If you want NAN to also pass, then you need to check for it separately. You can do this dozens of ways. Here are a few:

a) Use a pass/fail step with an expression like: Locals.x > 10 || Locals.x == NAN

b) Use two limit steps, one to check for NAN and one to check the limit. Use preconditions to specify the NAN check only runs for the NAN value and the limit check only runs for non-NAN values. This will ensure
the measurement makes it to the report.

c) If NAN is your instruments way of returning "resistance too high to measure", then you could transform the NAN into an INF in the data source expression and then use a GT limit. Example data source expression:
Step.Result.Numeric == NAN ? INF : Step.Result.Numeric
0 Kudos
Message 2 of 4
(4,623 Views)
I have the same situation. Here is my solution:

I use a Numeric Limit test with the following settings
Comparison Type: LEGE (<= >=)
Measurement Must Be: <= NaN Or >= {insert value here}

This works just like "Locals.x > 10 || Locals.x == NAN", since the NaN treats the '<=' as a '='(less than OR equal to).
0 Kudos
Message 3 of 4
(4,623 Views)

This is really counter intuitive to do this way because NAN publishes in the datasheet under the low limit column?? But it works.

0 Kudos
Message 4 of 4
(2,449 Views)