NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Step Index for a specific test step name

How do I look up the StepIndex value (array index value for RunState.Sequence.Main["TestStepName"]) for a specific test step in a sequence? I am planning to use the number so I can dynamically change the test step execution order using the NextStepIndex parameter.

Thanks,
Scott Trosper
0 Kudos
Message 1 of 3
(3,636 Views)
Hi Scott,

In the example attached, The Setup Step Group obtains an array of Steps from the Main.

All the example does at present is to step the next step to execute in the Main, But I hope it helps to answer your query.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 3
(3,636 Views)
Hi Scott,

The StepIndex value can be obtained by the following sequence of ActiveX calls:

- SequenceFile.GetSequenceByName("MainSequence")
- Sequence.GetStepByName("TestStepName")
- Step.GetStepIndex

An example of usage of this technique is shown in the attached sequence file "Example.seq". The function parameters are declared as variables in the "Locals".

Hope this helps,
Silvius
Silvius Iancu
0 Kudos
Message 3 of 3
(3,636 Views)