Example Code

Reloading Module Prototypes For All Steps In a TestStand Sequence File

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

This example sequence uses the TestStand API to programmatically reload module prototypes on all steps within a given sequence file.  It utilizes the ForEach sequence file, which provides an easy way to perform common iteration tasks, such as performing an operation on each step or each sequence in one or more sequence files.
 

Description

 

This example uses the DisplayFileDialog() Method to prompt the user to select one or more files.  The example then passes the list of selected files to the ForEachStepInPathList sequence in the ForEach.seq tool which ships with TestStand (this tool is located in <TestStand>\Components\Tools\ForEach.seq).  The Locals.sequenceCallback variable defines a sequence in the current sequence file that is called by the foreach tool on each step in each sequence file being processed.  The callback sequence includes a Parameters.data parameter which contains a reference to the active step.  The example uses this reference to call the Module.LoadPrototype() method to reload the module prototype.

 

Hardware and Software Requirements

Reload All Step Prototypes In Sequence Files - TS2012

TestStand 2012 SP1 or compatible

Reload All Step Prototypes In Sequence Files - TS3_1

TestStand 3.1 or compatible

 

Steps to Implement or Execute Code

  1. Run the ReloadAllPrototypes sequence using the Execute » Run MainSequence option.
  2. When Prompted, select one or more sequence files to process.
  3. View the resulting report showing that all steps were updated"

Additional Information or References

For more information on using the ForEach.seq tool, refer to the following example:

Creating a Sequence File Iteration Tool - Replacing Absolute Module Paths with Relative Paths 

Al B.
Staff Software Engineer - TestStand
CTA/CLD

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

Contributors