NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Goto Cleanup after N fails?

Solved!
Go to solution

Instead of immediate goto cleanup on sequence fail, any suggestions how to customise a process model to implement a goto cleanup after N failures?

 

I think I can check the number of fails in a ProcessModelPostStep and flag on some limit - but but not sure the best way to initiate a 'goto cleanup' in the process model?

 

Thanks.

0 Kudos
Message 1 of 5
(4,026 Views)

CIM1,

 

Add an ActiveX/COM step to terminate in your ProcessModelPostStep that is preconditioned on your failure count.

 

Terminate Method

Syntax

Execution.Terminate

Purpose

Terminates the execution.

Remarks

Cleanup step groups execute as part of the termination process. If the execution is an interactive execution, use the Execution.TerminateInteractiveExecution method instead.

The execution may not terminate immediately. If a call to a step module is active, the execution waits for the step module to return.

 

-Jack

0 Kudos
Message 2 of 5
(4,019 Views)

Thanks for suggestion but I do not want to terminate the execution.

 

I want to goto cleanup - in the same sense that it is possible to set goto cleanup on step fail in Station Options or Sequence Properties.

 

 

 

0 Kudos
Message 3 of 5
(4,012 Views)
Solution
Accepted by topic author CIM1

Well, that's a different story then... I assumed you where talking about terminating and going to cleanup - sorry about that.

 

You could try adding a statement to your ProcessModelPostStep that sets the following:

 

ThisContext.RunState.Caller.RunState.GotoCleanup = True 

 

And is preconditioned to your flag and to prevent it from executing in the Process Model:

 

ThisContext.RunState.Caller.RunState.StepIndex > 0 && ThisContext.RunState.Caller.RunState.StepGroup != "Cleanup" && ThisContext.RunState.Caller.IsProcessModel != True

 

I didn't test it with any use cases, but you might be able to get something like this to work with your test logic.

 

-Jack 

Message Edited by Capt. Jack on 09-22-2009 09:16 AM
Message 4 of 5
(3,985 Views)

Just tried it and it worked great - thanks Cap'n

0 Kudos
Message 5 of 5
(3,972 Views)