Example Code

Log NI Software to TestStand Report

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

  • LabVIEW
  • Teststand

Code and Documents

Attachment

Overview

This example shows how you can include a list of installed NI software in the report header, which can be useful for validating test reports or troubleshooting issues.

 

Description

This example uses the system configuration API in a LabVIEW code module to obtain a list of installed NI software.  The code module returns an array of strings containing the software list.  The code module is called in the PreUUT callback in order to add the data to the report header.  Data can be easily added to the report header using this procedure:

 

  1. Add a new property to the Parameters.UUT.AdditionalData container.  This is an unstructured container and can contain any type of data.  Use the TestStand API to create a property or clone an existing property.  In this example, the software list is stored in a local variable, and cloned into the AdditionalData container as a property named "Software":

    Parameters.UUT.AdditionalData.SetPropertyObject("Software", 1, Locals.Software.clone("",0)),
    
  2. Set the "IncludeInReport" flag for the new property to indicate to the report generator that it should be included.  You can use the SetFlags method to achieve this:

    Parameters.UUT.AdditionalData.SetFlags("", 0, PropFlags_IncludeInReport)

 

Hardware and Software Requirements

TestStand 2014 or Compatible

LabVIEW 2014 or Compatible (to view the LabVIEW code module source code) 

 

Steps to Implement or Execute Code

  1. Extract the attached archive, and open the sequence file.
  2. Ensure that report generation is enabled.
  3. Select Execute » Single Pass to run the sequence.
  4. Observe that the report header contains a software list.

 

Additional Information or References

 

 

Kurt P
Automated Test Software R&D

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