NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Test Sequence Flow from inside the ProcessModelPostStepFailure Engine Callback

When a Test Failure is detected within or TestStand System, the user must have the option to Repeat the Sub Sequence containing the failed step, Continue Testing or Cancel Testing.
 
Can I achieve this sort of control of the test sequences from inside the ProcessModelPostStepFailure Engine Callback?
 
Any ideas greatly received.
 
Regards
 
Steve
There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 1 of 20
(4,762 Views)

Hi,

Yes, there are examples in TestStand/examples/callbacks that will help you.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 20
(4,741 Views)

Thank you for your replay Ray,

Unfortunately the examples use a callback inside the sequence file where as I am using a callback inside the process model.  I imagine the idea is the same but I am struggling to work out the correct property string for the sequence file NextStepIndex and StepIndex from inside the process model callback.  The closest I have got to anything useful is shown below.

RunState.Main.RunState.NextStepIndex = RunState.Main.RunState.StepIndex

Any thoughts anyone?

Steve

 

There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 3 of 20
(4,741 Views)

Hi,

I just copied the contents of the SequenceFilePost StepFailure, Main and Locals into a ProcessModelPostStepFailure Main and Locals in \User\Models\TestStandModels\SequentialModel.seq.

Made sure I removed the SequenceFilePost StepFailure sequence from a copy of the example sequencefile and it ran as expected without any further alterations.

You should be using RunState.Caller.RunState.NextStepIndex = RunState.Caller.RunState.StepIndex

 

Regards

Ray Farmer

Message Edited by Ray Farmer on 02-22-2006 01:47 PM

Regards
Ray Farmer
Message 4 of 20
(4,736 Views)

Thanks for your effort Ray,

The only thing I am missing now is how to work out if the failure is from a Test Step or a Sub Sequence, as I only want to repeat Sub Sequences that fail.  I have been looking at RunState.Caller.RunState.SequenceFailed but it's no good.

Is there a Step Property that defines the step type (to differentiate between Test Step and Sub Sequence Step)?

Regards

Steve

There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 5 of 20
(4,729 Views)

Hi,

Just re-read your original question.

To Retry the first step in the Sub-sequence you would set the NextStepIndex = 0.

This will set it back to the first step of the group ie Main | Setup |Cleanup depending where your failed step was.

If you what to set it back to the first step in Setup, then you would have to set, as well, the StepGroup = "Setup"

Hope this helps

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 20
(4,728 Views)

Hi,

You can try using RunState.CallStackDepth, if this is greater than 2, then its a SubSequence to MainSequence and you are in the Callback.

Regards

Ray Farmer

Regards
Ray Farmer
Message 7 of 20
(4,726 Views)

I am controlling the NextStepIndex in the Main Sequence to re-run my Sub Sequences and this is working fine.  It re-runs the entire Sub Sequence rather than the steps inside a sub sequence, which is important for the results file. 

Please check my previous post for my remaining problem

Regards

Steve

There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 8 of 20
(4,724 Views)

Hi Ray

That would work for Sub Sequences of the Main Sequence which fortunately is all I need it to work for,  it doesn't seem like the cleanest solution. 

Is there no way of determining the step type?

Thanks again for your time

Steve

There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 9 of 20
(4,721 Views)

Hi Steve,

  sods law - I started generating the attached example about 2:00 and the thread has progressed on a bit from there.

Here's the example anyway. It shows the step type's name that failed, so that should give you a starting point.

I've also included a crude mechanism for the retry too. Bear in mind that the architecture you're trying to acheive cannot simply jump around the place between groups, just 0 to go to the start of the group, and -1 to go to the end of the group.

To restart an entire sequence, you'll need to get out of that sequence to start with, which I suppose would be the point of only doing the retry section if the calling step was a sequencecall type

The attached example can differentiate the step types easily enough. Just need to be careful about which point you ask to restart from - as you've said earlier - restart the step = restarting the subsequence since you're then back up a level where the calling step resides.

Good luck

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 10 of 20
(4,717 Views)