From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Teststand Sequence with Python

Solved!
Go to solution

Hello, 

I am trying to figure out how to write a python script that can pull the Steps and Variable values from a Teststand sequence file. I don't know where to begin. Has anyone done anything like this before that could point me in the right direction? I know that I can use the Python Step commands to call a Python file from Teststand, but I want to do the opposite of this. Call a Teststand file from Python, not to execute the sequence but just to retrieve and read the sequence. 

0 Kudos
Message 1 of 2
(2,714 Views)
Solution
Accepted by topic author kclayt88

TestStand has powerful set of ActiveX interfaces which you can use to traverse entire sequence file. All the interfaces in TestStand, along with its function and properties are mentioned in the TestStand help.

 

In python, you can use pywin32 module to interact with ActiveX APIs. This link contains example of opening a sequence file in python and executing it. For your case, after the sequence file is opened, instead of executing it, you can use other functions and properties to traverse the sequence file and get any property or its value.

 

-Shashidhar

Message 2 of 2
(2,673 Views)