12-22-2008 03:04 PM
I am using Test Stand 4.0 and LabWindows 8.5. I would like to truncate the measurement data before evaluating pass/fail for the test results. The measurement data to truncate would be for the numeric limit step and multi-numeric limit step. The truncation would only take place if the measurement limits were custom. The data would be truncated only for real numbers, and to the number of fractional digits specified by the formatting. I could do this in each of the measurement functions in LabWindows, but that would require changing all of my functions. Is there a way to do this in Test Stand or another suggestion that is global to all processing?
Thanks, Pete
12-22-2008 04:06 PM - edited 12-22-2008 04:11 PM
For a single numeric limit step, you could change the data source expression from
Step.Result.Numeric
to:
Val(Str(Step.Result.Numeric))
This effectively says "get the actual value of my number's formatted value". Note that Str() lets you pass an explicit format if you want.
For the multinumeric limit step, you could truncate all measurements at once with a data source expression like:
Evaluate("{" + Str(Step.NumericArray, "", 1, True, ", ") + "}")
This would truncate all measurements to the single format set for the Step.NumericArray property. However, the multinumeric step lets you set a format for each limit. This is harder. To honor separate formats for each limit without a loop in a preceding step, you'd probably need to make a custom step type based on the provided multinumeric code. Of course, if you choose the Specify Data Source for Each Limit option, then you could get fancy with expressions and use the Val(Str()) trick with the format of each limit. The formats are stored at Step.Result.Measurement["Measurement Name <or index with no quotes>"].Data.NumericFormat