Obtain TestStand Sequence File Version Programmatically

Updated Dec 14, 2017

Issue Details

I would like to obtain the sequence file version of the sequence that I am currently executing. Is there a way to obtain this information at execution time?

Solution

To access the sequence file version manually, navigate to Edit»Sequence File Properties. You can view and modify the version number of your sequence file from here. For more information on the Sequence File Properties Dialog Box, see TestStand 2016 Help: Sequence File Properties Dialog Box


To access this property dynamically, you can use the TestStand API. TestStand provides you with a reference to the sequence file that is being executed through the current SequenceContext. The property that contains this reference is RunState.SequenceFile, which is a reference to an ActiveX SequenceFile object. The RunState.SequenceFile.Data.Version property is a string that corresponds to the version of your sequence file. 


In TestStand 3.0 and later, you can also use the RunState.SequenceFile property and make ActiveX calls to obtain the sequence file version. First, you will have to change your sequence file reference to a PropertyObjectFile reference. You can use the AsPropertyObjectFile method of the SequenceFile class to do this. Once you have a PropertyObjectFile reference, you can call the Version method. This method returns the version of your sequence file as a string. For more information about the API function calls, refer to the TestStand API Reference Help in the TestStand Help. 

In TestStand 2.0.1, the PropertyObjectFile's Version method is not available in the TestStand API. However, RunState.SequenceFile.Data.Version is a hidden property that you can use to retrieve sequence file version. Because it is a hidden property, you will not be able to see it in the Expression Browser or the SequenceContext until you have enabled the Show Hidden Properties option in TestStand. This can be done by selecting Configure»Station Options, clicking the Preferences tab, and enabling the Show Hidden Properties option. This hidden property is available in TestStand 2.0.1, TestStand 3.0, and all later versions. See the attached sequence for an example of using this API function. 

 

Additional Information

You may also want to programmatically modify the version of the sequence file from within the sequence file itself. See the Community Example Programmatically Modify Sequence File Version using TestStand API for an example of how to do so.

WAS THIS ARTICLE HELPFUL?

Not Helpful