NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access current step index of MainSequence of an executing sequence file from the process model

Hi there.  I would like to be able to access from the process model the index of the current step in MainSequence of the the currently executing sequence file.  My goal is to form the process model determin the number of steps in MainSequence from the process model at the beginning of execution (I think I have a handle on this) and then in a PreStep callback in the process model be able to determin that I am on step, for example, 6 of 15 in MainSequence.  I have thousands of steps total in all the sub sequences with lots of looping so I do not really want to consider those, just the steps in MainSequence.

 

I am just not sure what the API call chain is to pick that up. 

 

Thanks!

 

Greg

Gregory Osenbach
0 Kudos
Message 1 of 4
(3,768 Views)

Hi Gosenbach,

 

In this case, RunState.NumStepsExecuted may do what you want. Though it is not necessary giving you an index of the step in which it is executing, you can derive that if the value is 3, then 3 steps have been executed and Teststand is currently executing the fourth step. This will also start over for every category. It will count the number of steps in Setup, then start over for Main. Unfortunately, there does not seem to be a MainSequence.StepIndex or MainSequence.NumStepsExecuted call. I hope that this helps!


Regards,

Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,718 Views)

Hi Greg

 

If this would be my task, i would first determine the all of the steps that WILL be used in MainSequence

by calling: RunState.SequenceFile.GetSequenceByName("MainSequence").GetNumSteps(StepGroup_Main)

and store it in a FileGlobal of your Model.

Note: This is only vaild for Steps inside the Main! Steps insde Setup and Clean up where not focused!!

 

During runtime consume SequenceFilePreStep Callback.

Determine the current index by using: Parameters.Step.StepIndex

And to filter only for MainSequnence use for PreCondition: StrComp(Parameters.Step.Sequence.Name,"MainSequence")== 0

and  Parameters.Step.StepGroup == StepGroup_Main

 

Now you can do: I am 6 of 15 in MainSequence.

 

Hope this helps

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 3 of 4
(3,714 Views)

Thank you Jeergen and Jackie.  I'll give that a shot and report back how it went.  Thanks!

 

Greg

Gregory Osenbach
0 Kudos
Message 4 of 4
(3,703 Views)