NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

StepIndex property of SequenceContext

Hi,

I'm writing a User Interface in VB based around the simple example which ships with TestStand and am including a display window to show all the steps in the current step group and to highlight the execution progress.

I am receiving the Trace_UI message and am extracting the Thread from it. I am then extracting the SequenceContext from the Thread and then the StepIndex property from the Context.
The code is as follows:

Set Context = UImsg.Thread.GetSequenceContext(0, frameId)
StepIndex = Context.StepIndex

The problem is that the StepIndex property is always returned as -1.
(The PreviousStepIndex property appears to be correct.)
I am wondering if this is because for a Trace Event, there is assumed to be no currently exec
uting step?

Can anyone suggest why this happens or maybe another way to obtain the current step index?

Thanks
Dan
0 Kudos
Message 1 of 2
(3,085 Views)
Dan,

At the time get the current step index there is no step executing. The trace message is set from the engine after it complete executing a step. The current step index at that time will always be -1. The udpating of the GUI is meant to occur after each step is executed.

In your trace message code if you check the previous step index and next step index you will find that they are N and N+1, respectively, where N is the step index of the step that has just been executed.
Message 2 of 2
(3,085 Views)