NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Name of Future Step in TestStand Sequence

Hello All,

 

  Working on a sequence of numeric limit tests, and need to set the limits programatically, based on an imported configuration file.  I use a simple action call to set the limits with a code module (TestStand Set Property Value function), but in order to make the code module reusable, I need to pass in the step name for the test step it applies to, each time I call it.  The problem is that the step that each limit applies to is several steps later in the sequence.  I know that I can get the name of the next step (RunState.NextStep.Name) but need to know if it is possible to get names of later steps as well.  I'm guessing it may have something to do with the "NextStepIndex" function, but can't seem to get the context right.  Please advise.  Thanks in advance.

 

GSinMN

0 Kudos
Message 1 of 4
(4,654 Views)

Hey GSinMN,

 

This can be done with an expression like the following: RunState.Sequence.Main["MyStepName"].  

 

Another thing you might be interested in is the Property Loader, which handles these types of operations for you by allowing you to create a file with limits and later load those limits into your test sequences. You can use the Property Loader as a step, or from the Tools menu in the Sequence Editor. 

0 Kudos
Message 2 of 4
(4,642 Views)

Figured it out myself.

 

Locals."Variable To Set" = RunState.Sequence.GetStep((RunState.Sequence.GetStepIndex(Step.Name, StepGroup_Main))+"Number of steps in Future",StepGroup_Main).Name

 

Where "variable to set" is the name of the variable you are assigning the step name to and "number of steps in future" is an integer that represents the index with respect to the current step (i.e. 2 would mean the second step after the current step).

 

GSinMN

0 Kudos
Message 3 of 4
(4,641 Views)

Thanks for the reply Daniel.  I was writing mine the same time you were.

0 Kudos
Message 4 of 4
(4,640 Views)