01-22-2008 04:15 AM
01-22-2008 06:47 AM
Hi,
Within the ProcessModelPostStep, 'RunState.Caller.RunState.Caller.Step.TS.LoopType' will tell you whether the caller step is looping.
If its the Step that is looping then RunState.Caller.Step.TS.LoopType will indicating its loop type.
This is a string property and will contain "NoLooping" as the default.
Hope this helps
Regards
Ray Farmer
01-22-2008 07:23 AM
No unfortunately not. I mean the looping witch is set in the step property not the from the context menü (TestStand 4.0)
The Information I need is in SequenceContext (RunState).LoopIndex and SequenceContext.LoopNumIterations. The problem is that my evant handler has an other SequenceContext because it is in an other Sequence "ProcessModelPostStep" and not "MainSequence" or somthing like that. I can't use the following pseudocode because the variables loopidx and loopnumit are always 0
int
frameID = 0,loopidx=0,loopnumit=0;NationalInstruments.TestStand.Interop.API.SequenceContext ctx = niExcecution.ForegroundThread.GetSequenceContext(0, out frameID);
loopidx=ctx.LoopIndex;
loopnumit=ctx.LoopNumIterations;
01-22-2008 08:48 AM
Hi,
You dont what to be using the Foreground Thread because thats the thread your OI is running in, You need the back ground thread pointed too by an index value.
The obtaining the SequenceContext of that thread you need to get down to the Step reference to identify whether its looping before obtain the loopindex etc.
Regards
Ray Farmer