How to Get Step Properties From a Sequence File in LabVIEW

Updated Oct 28, 2022

Environment

Software

  • TestStand

I am looking a way to get step properties from a sequence file without opening the TestStand. Is there any TestStand API that we can use to achieve this with an application written in LabVIEW?

  1. Launch NI TestStand and create a new sequence.
  • Add a Statement step
  • Rename the step to Test
  • Use the expression Random(1,100) in the Expression field
  • Save the sequence as Test.seq in C:\Test\
10.png
  1. Launch LabVIEW and create a new VI. Now, you should use the TestStand API Reference Help to implement this functionality.
  2. Create an instance of the TestStand UI Application Manager.
  • Create the TestStand Engine object using the ApplicationMgr.GetEngine method
11.png
  1. Call Engine.GetSequenceFileEx method to load the sequence file located in C:\Test\Test.seq.
12.png
  1. Access the MainSequence using the SequenceFile.GetSequence method and passing 0 to index.
13.png
  1. Call Sequence.AsPropertyObject method to access properties and methods defined in the PropertyObject class.
14.png
  1. Call PropertyObject.GetValString method.
  • Use a lookup string Main["Test"].TS.PostExpr to retrieve the Post-Expression of Test step 
  • Pass 0 to options to specify the default behavior
15.png
  1. Release the sequence file using Engine.ReleaseSequenceFileEx method and close all references.
16.png
  1. At this point, the VI will look like this.
17.png

This VI would return "Random(0,100)" in GetValString string indicator once you run the VI.