09-26-2013 01:56 AM
Hello All,
I am very new to customise Process Model.
I would like to modify the "Sequential process model", so that if any of the step in "Setup" section of client sequence has error/fail, execution must skip the "Main" section & directly go to "Cleanup" section of my "Client Sequence File".
I would like to make this behaviour common to all my Client Sequence file running, thats why I would like to modify process Model.
Regards,
Deepak Singh
09-26-2013 08:53 AM
The default behavior of TestStand is already to go to cleanup on error (though even in the case where the error is in mainsteps). If you want to also go to cleanup on failure, open the station options dialog box and check the checkbox for the setting "Immediately goto cleanup on sequence failure". This applies to all steps though, not just the ones in setup. If you just want it to apply to particular steps in setup, then you can set the post actions for such steps to either terminate or goto cleanup.
Hope this helps,
-Doug
09-26-2013 11:53 PM
Thanks Dug,
I only want to go to cleanup (automatically) if any Error/Fail occurs in "Setup" section.
"Immediately goto cleanup on sequence failure" => This option is applied to all Section (Main, Setup, Cleanup).
I have more than 100 CST's already created, also more than 300 "Client Sequence file" already running/created.
So, it will not be good idea to change the "Post Action" behaviour of all steps added in "Setup" section inside 300 Sequence files.
Thats why I thought about, doing this with the help of process model. Also model customisation will make this behaviour common to station, irrespective of "Steps in Setup" or "Sequence File".
Looking for few more experts comments.
Regards,
Deepak Singh
09-27-2013 03:55 AM
Deepak,
I think it may not be possible from Process Model.
Process model calls main sequence.
Once main sequence is executed then control goes back to process model.
There is no control of the main sequence at the intermediate level ( like between setup or main or cleanup) from process model.
It can be done using engine callbacks by using sequencefilepoststep - failure or runtimeerror but again that means you need to change all your sequences.
I am attaching a small test sequence which you can add at the end of setup part of your test sequence.It detects if any of the steps in setup has failed or errored out and accordingly jumps to cleanup.
The change that i have suggested below needs to be done across all your test sequence .Please try it if you dont find any other simpler solution.
Ravi S
National Instruments
09-27-2013 07:19 AM
Thanks Ravi,
I appreciate you solution. If I could'nt find any good solution, I will defnitely follow this.
Few more comments needed...
Regards,
Deepak Singh
09-27-2013 10:15 AM
You can add a StationPostStepFailure callback that will apply to everything on the station in the file:
<TestStandPublic>\Components\Callbacks\Station\StationCallbacks.seq
That sequence will then get called whenever any step on the station fails and you can then determine what you want to happen and make it do so from that sequence.
-Doug
10-01-2013 10:58 AM - edited 10-01-2013 11:05 AM
Other alternative solution with a SequenceFilePostStep callback :
To get the group of the step executed : Parameters.Step.StepGroup
Legend :
To get the status of the current step : Parameters.Step.Result.Status
Once you get the status and the step group, you can execute in the callback a Terminate Execution active X step (in case of step group = 0 and status = "Failed" or "Error"). It will do the same as Go to cleanup but with a final result status = "Terminated".
Another solution to avoid copy n times this sequence in each sequence file manually => copy dynamically this sequence during the process model execution (before the MainSequence execution) to the sequence file you want to execute. Another advantage is that if you modify the sequence file post step sequence later, it will be modified for all.
Hope this helps
Pierre