NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I sanitize my numeric results using a Process Model Plug-In?

I have a TestStand sequence that sometimes sends special floating point numbers to our database-- numbers like -Inf, Inf, and NaN. NaN is OK but -Inf and Inf are not, so I'm trying to write a Process Model Plug-In through TestStand's Configure >> Result Processing... dialog box. I actually got that working but I don't know the syntax of switching on the step types and modifying their results' data....

 

Specifically, I want to look only at steps of type "Numeric Limit Test" and "Multiple Numeric Limit Test", then if their results are -Inf or Inf, change those to NaN.

 

Is there some example code I could look at that does this or something else that will help me do this?

0 Kudos
Message 1 of 4
(4,169 Views)

In the post-expression of the Step you want to sanatize, you can use the following expression:

 

Step.Result.Numeric= ( Step.Result.Numeric == INF? NAN:Step.Result.Numeric)

 

The psuedo-code equivalent of this is:

 

If (Step.Result.Number == INF)    *(INF covers both positive and negative infinity)

       Step.Result.Number = NAN

Else

       Step.Result.Number = Step.Result.Number

 

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

That works perfectly for any given step, but is there a way I can make that work automatically on ALL steps of type "Numeric Limit Test" and "Multiple Numeric Limit Test"?

 

I'm afraid I might miss a step, and I don't want to have duplicate code everywhere.

0 Kudos
Message 3 of 4
(4,135 Views)

Do the same in PostStep callback, filter numeric tests, and update result 

0 Kudos
Message 4 of 4
(4,125 Views)