Example Code

Including Measurement Information in Execution Viewer

Overview

As with most elements in TestStand, you can customize the Execution Viewer to include expressions and additional information about each step.

 

Description

This example adds a conditional expression to a new colum in the execution state of the execution viewer. This colume is not visable at edit time, but displays measurment information with Numeric Limit Tests and Multiple Numeric Limit Tests. For all other tests it displays a empty string.

 

Result.PNG

 

To do this modification from the Sequence Editor, right click the steps panel » Step List Configurations » Edit Step List Configurations.

Config.png

Here you can edit and customize you edit time display as well as exeution display.

 

I created a new configureation and added a new expression column to it.

Edit.png

 

The expresstion I added grabs the results from the tests and formats it correctly.

 

(RunState.Step.StepType.Name == "NumericLimitTest")? Str(RunState.Step.Result.Numeric,"%$2.2f"):( (RunState.Step.StepType.Name == "NI_MultipleNumericLimitTest")?Str(RunState.Step.NumericArray,"Value: %$2.2f           "):" ")

 

Expression.png

Try out changing was is displayed and see what all you can show your operator at run time or your deveoper at edit time.

 

Requirements

Software

NI TestStand

 

Steps to Implement or Execute Code

  1. Right click the steps panel » Step List Configurations » Edit Step List Configurations
  2. Click New
  3. Click the Columns tab
  4. Click Add
  5. Change Type to Expression
  6. Add Expression (RunState.Step.StepType.Name == "NumericLimitTest")? Str(RunState.Step.Result.Numeric,"%$2.2f"):( (RunState.Step.StepType.Name == "NI_MultipleNumericLimitTest")?Str(RunState.Step.NumericArray,"Value: %$2.2f  "):" ")

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.