NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to truncate measurement data in TS 4?

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

0 Kudos
Message 1 of 2
(3,092 Views)

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

 

 

Message Edited by James Grey on 12-22-2008 04:11 PM
0 Kudos
Message 2 of 2
(3,088 Views)