02-21-2006 08:40 AM
02-22-2006 01:17 AM
Hi,
Yes, there are examples in TestStand/examples/callbacks that will help you.
Regards
Ray Farmer
02-22-2006 02:13 AM
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
02-22-2006 07:45 AM - edited 02-22-2006 07:45 AM
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
02-22-2006 07:54 AM
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
02-22-2006 08:00 AM
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
02-22-2006 08:09 AM
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
02-22-2006 08:10 AM
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
02-22-2006 08:23 AM
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
02-22-2006 08:59 AM
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)