NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to junmp to the CleanUp in a different Sequence?

Hi,

 

I have a sequence file containing MainSequence, Measurement and OnFail SubSequences.

 

The MainSequence prepares the power supplies and instruments.

 

The Measurement-SubSequence performs the measurement. The teststep in it has an PostAction: On Fail call SubSequence 'OnFail'.

 

The OnFail SubSequence asks the operator weather he would like to repeat the Measurement or to abort the execution of the test.

 

If the operator clicks 'repeat' there is a CallSequence teststep, that calls the Measurement-SubSequence.

 

If the operator cicks 'abort' i would like to go to the CleanUp of the MainSequence. But i have no idea how?!?

 

The CallSequence Teststep only selects an Sequence, but no teststep in a sequence. Sure, i could set a Flag-Variable and use this flag to jump in the MainSequence to the CleanUp, but i think this ist a bad work-around.

 

Is there an Easy Way to do a safe abort/termination of the execution with a big fail in the testreport?

 

 

0 Kudos
Message 1 of 13
(4,523 Views)

You can terminate the execution.

 

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 might not terminate immediately. If a call to a step module is active, the execution waits for the step module to return.

 

This is the help for Execution.Terminate. Please note that the CleanUp stepgroups are executed for the whole callstack except the process model which proceeds "properly" (which for instance creates the report).

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 13
(4,517 Views)
i alredy tried to use the post action 'terminate' on fail, but then there is noch global-fail. the resultpage hast a green 'ok-marker', but no fail...
0 Kudos
Message 3 of 13
(4,513 Views)

Where have you set the termination?

 

It is best if you could post your sequence file in order to show us your approach.

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 13
(4,511 Views)

i attached the file.

0 Kudos
Message 5 of 13
(4,509 Views)

You are never terminating the execution. Your statemante "Terminate Execution" in the "On Fail" sequence always results in "Done" and therefore will never 'trigger' the post action On Fail.

Your statement has to include something like the following as Expression:

RunState.Execution.Terminate()

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 13
(4,505 Views)

but the measurement fails a few steps earlier... because of this the hole sequence must fail?!?

or not?

Message Edited by bw1faeh0 on 11-03-2009 03:39 PM
0 Kudos
Message 7 of 13
(4,503 Views)

The On Fail post action is only executed for the step which fails. Since the statement never fails, the On Fail is never executed.....

Please don't mess up between the sequence status and the step status! 

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 13
(4,499 Views)

OK, i'll try RunState.Execution.Terminate() tomorrow.

 

Thanks a lot!

0 Kudos
Message 9 of 13
(4,496 Views)

Hi,

 

i tried the RunState.Execution.Terminate() Method in an Expression-Step in Case of a Failing Step. But the inidcator at the end of the test says 'Pass'. There is a conflict between the failing step and the result. See the screenshot.

What can i do?

 

terminate.JPG

 

 

0 Kudos
Message 10 of 13
(4,461 Views)