This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Accessing Sequence Called by Sequence Call Step in TestStand via LabVIEW

Updated Aug 14, 2024

Environment

Software

  • TestStand
  • LabVIEW

How can I use LabVIEW to programmatically access the sequences called by the Sequence Call step in TestStand?

  1. Launch NI TestStand and create a new sequence.
    • Add 2 Sequence Call steps.
    • Rename the first step as A1 and the 2nd step as B1.
    • Create 2 new subsequences by going to the Sequences tab at the right side of the TestStand window, right-clicking in the tab, and selecting New Sequence.
    • Rename the 2 new subsequences to A2 and B2.
    • Go to the Main Sequence by clicking the MainSequence in the Sequences tab
    • In the Step Settings A1, tick the Use Current File and select A2 in the drop-down menu of Sequence
    • Repeat the same for B1 but select B2 for the sequence.
    • Save the sequence as Test.seq in C:\Test\
test seq.png
  1. Launch LabVIEW and create a new VI.
  2. Place TestStand UI Application Manager on the front panel. (Controls>>TestStand>>Application Manager)
TS UI.png
  1. In the block diagram, place an invoke node to create the TestStand Engine object by using the IApplicationMgr.GetEngine method
rtaImage (2).jfif
  1. Call Engine.GetSequenceFileEx method and wire a string constant with the sequence file path, C:\Test\Test.seq to load the sequence file.
Engine.GetSequenceFileEx.png
  1. Access the MainSequence by using the SequenceFile.GetSequence method and passing 0 to index.
SequenceFile.GetSequence.png
  1. Use Call Sequence.GetStep method, pass value 0 to index and select StepGroup_Main for the stepGroupParam to access the Sequence Call step A1.
Sequence.GetStep.png
  1. Call Step.Module method to access the module related to the step.
Step.Module.png
  1. Call Module.AsPropertyObject method to access properties and methods defined in the PropertyObject class.
Module.AsPropertyObject.png
  1. Call PropertyObject.GetValString method.
    • Use a lookup string SeqName to retrieve the name of the sequence called in the step 
    • Pass 0 to options to specify the default behavior
PropertyObject.GetValString.png
  1. Call SequenceFile.GetSequenceIndex method and pass the retrieved sequence name to get the sequence name index number.
  2. To access the called sequence, A2, use SequenceFile.GetSequence method and pass the index number obtained.
SequenceFile.GetSequenceIndex.png
 
  1. You will then be able to use the sequence reference to get properties of the A2 sequence. As an example, call SequenceFile.GetNumSteps method and you will get number of steps in the sequence name to get the sequence name index number.
  2. Release the sequence file using Engine.ReleaseSequenceFileEx method and close all references.
Engine.ReleaseSequenceFileEx.png
  1. At this point, the block diagram will look something as below:
TestStand LV.png

Once you run the above code, it would return "A2" in Sequence Name indicator if you pass value 0 and "B2" in the same indicator if you pass value 1 to index for Sequence.GetStep invoke node. GetNumSteps indicator will show the number of steps in the sequence that you are pointing to.