NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Incomplete Execution

I am using TestStand UI to call my sequence and when I exit using the exit menu (see image 1) it will give me this dialog box from TestStand (see image 2).

 

Now I understand that for TestStand to fully exit, I will need to terminate all the sequence before it can logout and then exit.

What I'm trying to do is either trigger a IEngine.Shutdown or a TerminateAll when someone exits automatically without having the dialog box from TestStand popup.

 

I've tried handling it from CVI using API calls and from TestStand using Callbacks or GetStates().

 

From the CVI side, as soon as I exit, it triggers the OnQueryShutdown(); and after bouncing around through UIMessage(), it will then go to OnExitApplication() after all sequence/executions/threads are terminated.

 

Any help would be appreciated.

Download All
0 Kudos
Message 1 of 8
(5,146 Views)

Hi @b1ack1otus,

 

I might try using the Exit LabVIEW.vi to close out of the LabVIEW UI when running the TestStand executable. Also, from the CVI side, maybe using a custom UI message might work or a breakpoint. I hope this helps!

0 Kudos
Message 2 of 8
(5,101 Views)

ExitLabVIEW.vi will not work for this.

 

If you're using the ApplicationManager control, you should call ApplicationMgr.Shutdown and wait on the ApplicationMgrExitApplication event. If not, you have to take a few passes at Engine.ShutDown

 

This help doc explains the correct way to shut down the engine:

TestStand Help: Shutting Down the Engine

 

Let me know if you have questions,

Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 3 of 8
(5,092 Views)

Actually, Looking back at your question - it looks like you're already calling Shutdown.

 

Do you just want to automatically terminate instead of show that dialog?

 

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 4 of 8
(5,084 Views)

Hey WireWeaver,

 

Sorry for the late reply, but yes. I basically want to just suppress the dialog box and always select yes.

0 Kudos
Message 5 of 8
(5,062 Views)

"Currently there is no exported method or property in the TestStand API that closes the sequence editor programmatically. Instead of using the sequence editor to execute sequences, you can create your own operator interface and implement a programmatic shutdown of it."

 

Programmatically Closing the Sequence Editor

http://digital.ni.com/public.nsf/allkb/2892FED93FC0D4EA86256C2F008360D4

0 Kudos
Message 6 of 8
(5,047 Views)

I don't think that link is strictly correct. You could probably do something like:

 

Runstate.Engine.GetInternalOption(InternalOption_ApplicationMgr).GetCommand(CommandKind_Exit, 0).Execute(false).  

 

A caveat being that you need to be in a non-execution thread because trying to exit while an execution is running triggers a prompt.

0 Kudos
Message 7 of 8
(5,045 Views)

I will try to call that function outside of the non-execution thread.

 

I suppose there's no definitive way to automatically select the "YES" option on the prompt.

0 Kudos
Message 8 of 8
(5,001 Views)