Example Code

Setting Report Options for a Specific TestStand Sequence File

Code and Documents

Attachment

Overview

When creating a test sequence in TestStand, you may want to ensure that certain report options are set for the sequence, regardless of the current station settings.  To accomplish this, you can use the ReportOptions callback in a sequence file to change specific options.

 

Description

To set the report options for a particular sequence, complete the following steps:

 

  1. Create the ReportOptions Callback
    1. Right-click the Sequences pane, and select Sequence File Callbacks...
    2. Double click the ReportOptions callback, then click OK
  2. Determine the property values to set.  To find the correct property values for the report option properties:
    1. Configure the report using the report options dialog to match the desired configuration.
    2. Insert a breakpoint into the ReportOptions callback sequence
    3. Execute using Execute » Single Pass.  Once the breakpoint is hit, use the variables pane to view the value.  You can also copy the entire Parameters.ReportOptions to the clipboard
    4. Resume the sequence.  If you copied the parameter, paste it in the callback sequence locals for reference.
  3. Set the desired properties using a statement step
    1. In the ReportOptions callback, insert a statement step
    2. Using the copied ReportOptions in Locals, create statements to set the desired settings, such as

      Parameters.ReportOptions.Format = "txt",
      Parameters.ReportOptions.IncludeLimits = True
    3. Delete the local you created for reference
  4. Run the sequence using Execute » Single pass, and verify that the report options are updated. 

 

 

Hardware and Software Requirements

TestStand 2014 or compatible

 

Steps to Implement or Execute Code

  1. Open the attached sequence
  2. Run the sequence using Execute » Single Pass 
  3. Observe that the generated report is a text report and includes test limits, regardless of the current settings.

 

Applications Engineer
National Instruments

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

Comments
Sipic
Member
Member
on

I've been struggling with changing report options on the fly (I didn't want to record all results in a specific subsequence.  This example shows quite clearly how to employ the callback on entry to a subsequence but I wish I could find more documentation on the use of specific parameters.

Anyone know how to use the ResultFilterExpression?