NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I tell that a default numeric format has been applied to a numeric limit step?

I am working on generating custom HTML code for our test systems in order to reduce the 'footprint' of the standard HTML entries for numeric limits, multiple-numeric limit steps etc....

 

For a Numeric Limit step, I can set the Numeric Format via the 'Limits' tab and select the pulldown arrow to select any format.  Does TestStand actually save this information with the step so I could possibly use this later?   I ask this because my modifications are within the 'ModifyReportEntry' Callback.   When I am modifying the code to generate new HTML within this callback, I have no idea if the developer has selected a Numeric Format for a given step OR simply left it as DEFAULT.

 

To make matters more confusing, here is some more information....

 

When I pause the execution in the callback I notice the following:

 

Case 1:  User has selected a Numeric Format ( this example I will say 3 digits of precision ) %.3f. for a numeric limit step.

 

Parameters.Result.Limits.Low = 10.000

Parameters.Result.Limits.High = 20.000

Parameters.Result.Numeric = 15.657

 

Notice the numeric data is ALREADY formatted! Great, I can simply use this to generate my custom HTML table for the numeric limit step.

 

Case 2 : User has left the numeric format to <Default> for the step.

 

Parameters.Result.Limits.Low = 10

Paramters.Result.Limits.High = 20

Parameters.Result.Numeric = 15.65713515155

 

Numeric data is NOT formatted.  I know that TestStand will apply the Default Numeric Format that is configured in the report options when it writes the report but since I am doing a custom report I am stuck.

 

My question is how can I possibly tell that the data has already been formatted by TestStand in the ModifyReportEntry callback?  Is there some flag that I could check or anything?

 

I do notice that the Parameters.ReportEntry string contains TestStand's default HTML code for the step and this is already properly formatted.. so as a possible workaround I could 'pick out' the data from this string but this is slow and time consuming.

 

Thanks

 

PH

 

 

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

PH,

 

You can find out if the numeric format has changed using the TestStand API. I use the following statement in my step's post-expression to find out the numeric format that TestStand uses for the step.

 

Step.Limits.Low.NumericFormat

 

If the string returned is an empty string, then it is the default format, otherwise, it's the one specified in the string.

 

Hope this helps.

 

 

Raj
National Instruments
Applications Engineer
Message 2 of 2
(3,317 Views)