03-24-2015 05:16 PM
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?
03-25-2015 11:18 PM
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
03-26-2015 08:02 AM
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.
03-26-2015 04:26 PM
Do the same in PostStep callback, filter numeric tests, and update result