Switch TestStand Version Programmatically Based on Sequence File

Updated Oct 19, 2018

Reported In

Software

  • TestStand

Issue Details

I have multiple TestStand Development Environment versions in my development computer. I have Sequence Files created in different versions and while I know how to use the TestStand Version Selector to change the active version of the TestStand Engine, I would like this to happen automatically based on the version used to create the sequence file I am opening.

Solution

This functionality is not available in the Sequence Editor or in the TestStand shipping UI examples. If you open an older sequence file with a newer version of TestStand you will not get any warning because TestStand is backwards compatible, but if you open a sequence file with an older TestStand version, you will get the error shown in Managing Multiple Versions of TestStand With TestStand Version Selector.

To automatically switch the active TestStand Engine version based on a sequence file you will need to implement a custom user interface that follows the steps below:
  1. Open a reference to the TestStand Engine.
  2. Use the IsCurrentSequenceFileVersion method to determine if the sequence file was saved in the active TestStand Engine version. If the output of step 2 is 0, it means the current active version is the correct one for the file.

If the output of the IsCurrentSequenceFileVersion method is 0.
  1. Use the GetSequenceFileEx method to load the sequence file.

If the output of the IsCurrentSequenceFileVersion method is different than 0.
  1. Use the GetFileFormatVersion method to get the version of TestStand that was used to create (or last save) the sequence file.
  2. Close the reference to the sequence file and TestStand Engine.
  3. Use a System Exec VI to run the command to change the active version of the TestStand Engine as explained in TestStand Version Selector.
  4. Repeat steps 1 and 3 to open the sequence file in the correct version of the TestStand Engine.

Additional Information

Refer to the TestStand Simple UI for information about opening and appropriately shutting down the engine. Modifying the TestStand Simple UI or Full Feature UI is an option to avoid needing to program a custom UI from scratch.

Attached is a sequence that will illustrate how to setup the IsCurrentSequenceFileVersion and GetFileFormatVersion method calls in TestStand as a referece; you will need to adapt this idea to the ADE you use to develop your custom UI. Update the SequenceFilePath variable to any sequence file you would like to verify and observe the output of the methods in the message popups. You will need TestStand 2014 or later to open it.

WAS THIS ARTICLE HELPFUL?

Not Helpful