NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Teststand GotoCleanup

Hi,

 

I have a callback sequence (postStepsequence) in which i check the status of a boolean (is name is titi) after each step. If titi is false, the callback don't do anything and if it's True i'd like to run the mainsequence cleanUp.

So i have writted RunSate.Caller.GotoCleanUp = titi in my callback.

 

I have a mainsequence who call a subsequence.

If titi (the boolean) becomes true when the execution is running the mainsequence, the execution goes directly in the mainsequence's cleanUp, but if titi becomes true when the execution is running the subsequence, the execution goes in the subsequence's cleanUp.

How can go directly in the mainsequence wherever the execution is running (subsequence, sub-subsequence....)?

 

Thank you

0 Kudos
Message 1 of 6
(3,914 Views)

Why not just call RunState.Execution.Terminate()?

0 Kudos
Message 2 of 6
(3,906 Views)

Terminate does execute all cleanup stepgroups in the callstack up to the MainSequence. This is definetly the recommended way, so nothing wrong with the suggestion/recommendation here from asbo.

 

Nevertheless, you can directly jump into the cleanup stepgroup of your MainSequence. "All" you have to do is to jump up to the caller in the whole callstack until you reach MainSequence. So this jumping depends on the depth of that callstack.

 

hope this helps,
Norbert

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

Thank you for your responses.

 

I have tried asbo way to do, it has worked.

 

"All" you have to do is to jump up to the caller in the whole callstack until you reach MainSequence. So this jumping depends on the depth of that callstack. 

0 Kudos
Message 4 of 6
(3,891 Views)

This is not sufficient. If you do want to skip all other cleanup stepgroups in the callstack, you have to "exit" the level of callstack without running into the cleanup.

Please note that this is not really recommended.

 

You can do this by stating

RunState.StepGroup = "Cleanup", RunState.NextStepIndex = -1

for each level of the callstack you want to jump out without execution of the cleanup (and rest of main/setup).

 

Norbert

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

Thank you for all your reponses.

0 Kudos
Message 6 of 6
(3,839 Views)