Example Code

Add Module Execution Time Information for Call Executable Step to Report in TestStand

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Teststand

Code and Documents

Attachment

 

Overview

Because the call executable step does not use a module, the executable time is not displayed by default in the test report.  This example shows how to include the EXE execution time information for any Call Executable steps in a report.

 

Description

 

Because the call executable step does not use a code module to call the EXE, TestStand will not include the module execution time information for any Call Executable steps in a report.  However, the results for the step do include a TotalTime property, which you can use to generate a ModuleTime property which will be included by the report generator.

 

In order to access the result data for the step before it is added to the resultList, you can use the SequenceFilePostResultListEntry callback, which provides the result data in a parameter Parameters.Results.  In this callback, you can use the following TestStand API call to generate the ModuleTime property and populate it with the TotalTime value:

 

Step.Result.SetValNumber("TS.ModuleTime", PropOption_InsertIfMissing, Step.Result.TS.TotalTime)

The report generator will automatically include the ModuleTimne in the report, so no further action is needed

 

Hardware and Software Requirements

Module Time for Call EXE - TS2012.seq

 TestStand 2012 or compatible

Module Time for Call EXE - TS2017.seq

TestStand 2017 or compatible

Steps to Implement or Execute Code

  1. Open the attached sequence file
  2. Run the sequence using Execute » Single Pass
  3. When the execution completes, observe that the execution time is present in the test report.

Capture.JPG

 

 

Justin D
Applications Engineer
National Instruments
http://www.ni.com/support/

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