ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Easy way to terminate one sequence file and continue with other ones?

If I have a sequence file that is executing some Actions which call methods in a C# DLL, and one of those methods determines that the sequence file should terminate/abort (but the entire test should not terminate/abort), how do I accomplish that?
 
Both the Engine.TerminateAll() and Execution.Terminate() methods will terminate the entire test and not just the sequence file.  I would like to just terminate a sequence file and then have the execution continue with the step after the one that called the sequence file.  I can do this by having the method set the result and then having an "If" step check the result and skip the remaining steps in the sequence file if appropriate.  But I was wondering if there is an easier way...  can I do that just by calling one method from within the DLL?
 
 
0 Kudos
Message 1 of 4
(3,397 Views)

Hi,

You can not use the Terminate methods as it will just shut the executions.

What you can do is modify some properties so that the next step that's executed is the end of the cleanup, ie

RunState.PreviousStepIndex = GetNumElements( RunState.Sequence.Cleanup)-1,

RunState.StepIndex =-1,

RunState.NextStepIndex = -1,

RunState.StepGroup= "Cleanup"

Hope this helps

Regards

Ray Farmer

 

 

Regards
Ray Farmer
0 Kudos
Message 2 of 4
(3,390 Views)

Hi,

Attached is a small example. the Label in the Cleanup is jumped over, if its not it will generate some text in the result file.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 3 of 4
(3,383 Views)
Thank you Ray, will try this out later.

0 Kudos
Message 4 of 4
(3,344 Views)