NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

modify steps in calling sequence from sub-sequence

Solved!
Go to solution

Is there a way to view and modify the steps in the main sequence by way of a sub sequence?

 

What I'm currently doing is that I use a for-each loop to step through RunState.Sequence.Main and for each step in Main, I am looking to see if the step is a sequence file (RunState.Sequence.Main[i].isSequence).  If it is calling a sequence, I'm filling out an array with the name of the step which is used to make a list from which the user can select which tests (sub-sequences) will be run.

 

After the user selects the tests, I then step through my created array and assign Normal or Skip to each step based on the user input.

 

This works great when working in the upper sequence.  My problem is that I need to perform this same action on several sequence files and would like to make this a sub-sequence so that I don't have to copy and paste it in several locations (and have to worry about changing it multiple times if it becomes necessary).  I've tried looking through all the RunState.Caller methods/properties and can't seem to find anything that will allow me to step through the Main[i] array of steps in the calling sequence.

 

 

On a side note, is there a variable type that can be used to store the step information for the current element (i.e. Locals.CurrentElement = RunState.Sequence.Main[0])? Not important, nor needed, but I was trying to figure that out for a little bit before I realized it is not really necessary in this case.

0 Kudos
Message 1 of 3
(507 Views)
Solution
Accepted by topic author UnkleQuacker

Hi,

 

If i understand correctly you want to modify the main sequence from a sub sequence during runtime.

 

RaviShrigiri_0-1694021962819.png

 

In the above picture i am reading a step of a mainsequence from the sub sequence.

You need to use Runstate.Caller.Runstate.Sequence.Main.... to access step variables of the calling sequence.

 

Regarding your second question each type of step has different variables in it.So maybe not possible.

0 Kudos
Message 2 of 3
(461 Views)

Aha!! that second RunState...Not sure why I didn't think of that.  I appreciate it!

0 Kudos
Message 3 of 3
(455 Views)