NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Run Cleanup on failure programatically

Hi guys,
Under TestStand 2.0.1f1, go to Configure->Station Options, and look at the On Run-Time error menu ring. It contains 4 items as follows :
Show Dialog (0)
Run Cleanup (1)
Ignore (2)
Abort (3)

(I'll explain the numbers here in a minute)

If you then look at the Engine property RTEOption, you have the following
RTEOption_Abort - (Value: 3)
RTEOption_Continue - (Value: 1)
RTEOption_Ignore - (Value: 2)
RTEOption_Retry - (Value: 4)
RTEOption_ShowDialog - (Value: 0)

If I create an action step that uses the above RTEOption, run it, and then look at the Station Options again, I see the marked (the number next to the item done earlier) in the Menu Ring.
The problem is, the two don't match up, i.e. if I set a 1, whic
h is continue, I see Run Cleanup, and depending on the previous setting, I can get the dialog to show, or contiinue straight on.

So what are the additional things that need setting along with RTEOption that give you a true RunCleanup?

I know the best architecture is to use the callbacks for either SequenceFilePostStepRunTimeError or ProcessModelPostStepRunTimeError, but then you need a way of forcing the enxt step to enter the cleanup step group, and if the Station Option hasn't been set correctly, it'd be nice to force it.

Thanks

S.

(This came about whilst answering a question at http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000F35B0000&UCATEGORY_0=_8_&UCATEGORY_S=0
and I was trying to force the Run Cleanup option.)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 1 of 5
(4,333 Views)
Hello Sacha,

Station options have to do with future behavior, so when you change the RTE option using Engine.RTEOption it takes effect next time you execute a sequence. If you want to modify the RTE option for the current executing sequence, you should modify it from the Current Execution instead. See Execution.RTEOptionForThisExecution

Regards,

Roberto P.
National Instruments
Applications Engineer
www.ni.com/support
Message 2 of 5
(4,332 Views)
Thanks,
that sort of works, but it still doesn't explain the mis-type in the enum texts.
To get the cleanup run as I want it, I have to set the RTEOptionForThisExecution to RTEOption_Continue. There simply isn't a RTEOption_cleanup.

Also, shouldn't I be able to modify the station options on the fly - it's the next step that should pick up the changes, as they're to the engine itself - for example, set an execution going, and play around with the tracing speed.
Finally, I've verified your answer, by after the first run, useing the engine object to modify the RTEOption, on a subsequent runs , I see the behaviour I want. Strange then. So you couldn't modify the engine permanently unless it's outside a sequence execution, that's not going to rely on it.
OK, s
trange, but OK.

Can you clear up which enum's are supposed to do what then, as RTEOption_Continue, actually runs cleanup.

Thanks

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 3 of 5
(4,332 Views)
Hello Sacha,

I agree that this RTE Option may be confusing when you call it using Engine and Execution. NI R&D engineers are already aware of it.

For your second question:

RTEOption_Abort - (Value: 3, stop execution no clean up)
RTEOption_Continue - (Value: 1, stop execution with clean up)
RTEOption_Ignore - (Value: 2, don't stop and ignore error)
RTEOption_Retry - (Value: 4, stop execution with clean up)
RTEOption_ShowDialog - (Value: 0, display dialog)

Regarding the naming convention (RTE_Continue should be something like RTE_RunCLeanUp) and the RTE_Retry option that in fact is the same as continue, I will notify NI R&D Engineers.

Regards,

Roberto P.
Message 4 of 5
(4,332 Views)
Thanks for your help Roberto.

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 5 of 5
(4,332 Views)