NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a step index number from TestStand

I am trying to get the step index from TestStand.

 

Specifically, I am trying to use a post step callback to calculate a progress value that I can pass to the TS user interface at run time.  What I want is the step index of the step that the post step callback is working on. NI showed me how to get the current index using property nodes and sequence context in a simple vi. So I put that in the post step callback and assumed it would get the step index of the calling step. It doesn't. All it gets is the step index of that vi in the post step sequence, which is utterly useless. I can go through and add the property nodes to every single vi I have, but this is ludicrous.

 

So how do I get a step index and pass that number to the post step callback?  Two of us have been tag teaming NI for a week to figure out a way to update a progress bar. We are several suggested methods into this and none of them work. Has anybody ever pulled this off?

 

Thanks

0 Kudos
Message 1 of 4
(5,319 Views)

Are you sure you want to update your progress value after every step?  I assume you want to use the PostStep callback, which would run after every step.  Just a warning, this could add significant overhead to the execution of your sequence.  If I were to do it, I would periodically (say every 4 or 5 steps) add a Statement step which calls the PostUIMessageEx method.  

If you truly want to do it after every step, you could do this through the Runstate.  Put this statement in your callback.

 

RunState.Caller.RunState.StepIndex

 

This works assuming you have one big Mainsequence.  You would have to do a bit more work if you are using subsequences.  

Rod T.
0 Kudos
Message 2 of 4
(5,317 Views)

Hi Rimfire,

 

A reference to the current step is stored in the postStepCallback sequence as a parameter (parameters.Step), so you can access this information using "Parameters.Step.StepIndex".

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 3 of 4
(5,278 Views)

We're doing something similar but we use (Parameters.Step.StepType.Name == "NI_MultipleNumericLimitTest") as a Precondition to see if we want to use the stepindex to update progress since all of our tests are of type NI_MultipleNumericLimitTest. You may need to do something similar to filter when you want to update the progress bar.

CTA, CLA, MTFBWY
0 Kudos
Message 4 of 4
(5,257 Views)