NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

close User Interface Automatically

I want tpo close the Teststand User Interface  in deployment maschine, Programmatically  i.e. eg when I say

 

ContinueTesting = False

 

or any other condition

 

 

0 Kudos
Message 1 of 10
(5,174 Views)

Hey aparab,

 

Your method for doing this will depend on what language your user interface is written in. For example, in LabVIEW there is a VI that exits the LabVIEW VI, but C or C# would have a different method for closing the user interface. You'd need to implement this code in your user interface.

 

I would implement the code as a UIMessage event handler, and send a UIMessage from your test sequence when you want to exit the user interface. This is the preferred method of communicating between a test sequence and user interface, and ensures that the action only occurs in a UI which supports it (for example, if you test your code in the Sequence Editor, you probably wouldn't want that application to close down as your test sequence runs).

 

Hope it helps, and let us know if you have any further questions about it!

0 Kudos
Message 2 of 10
(5,163 Views)

Depending upon how you are doing it here are a few ideas:

 

1- If you are using the command line to execute a sequence (http://digital.ni.com/public.nsf/allkb/146D372C1F807E6D862567E7004881AB?OpenDocument)  Then use the /quit flag.  Once the execution completes it will automatically close.

 

2- Using a button on the GUI you can handle the event of the button and trigger a quit event which will close the GUI.

 

3- If you want to trigger the UI to close based on an event (for instance the continue testing flag).  In your PreUUT callback when they click the button to stop testing you can post a UI Message.  Then in the UI handle the UI message to fire the Quit Event for the UI.  WARNING: I do not recommend doing it this way.  Because you still have an execution and close the UI when there is an execution will result in a dialog. You should trigger off of the Execution complete UI Message and check to make sure there are no more executions.  That way you won't have any executions open when you close the UI.  For more on UI messages: http://www.ni.com/white-paper/4532/en/

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 10
(5,162 Views)

You beat me to it Daniel.  🙂

 

I wasn't typing fast enough.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 10
(5,161 Views)

In all fairness, you provided multiple approaches and more links 🙂 I agree with the statements about alternate ways to accomplish this and the caveats of closing the interface with an execution still running.

0 Kudos
Message 5 of 10
(5,159 Views)

Thankyou All  for the fast suggestions,

 

I have  problems with DLL & Clusters which I have mentioned in other threads  NI is not able to provide me a soln since   3 days,  hope

 

the Teststand  experts Can  .....

0 Kudos
Message 6 of 10
(5,154 Views)

can we close the application     from command line the  way I start it from    command line

 

Start Works

 

Close doesnt

tried:

TASKKILL /IM C:\Users\admin-paks\Desktop\UI\TestExec.exe

0 Kudos
Message 7 of 10
(5,130 Views)

Read my post.  It's the first suggestion.  Use the /quit flag when you run it from the command line.

 

If you type testexec.exe /help on the command line you will see all of the options you have.

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 8 of 10
(5,124 Views)

For the question about the DLL and clusters, see the original post here, I posted a response.

0 Kudos
Message 9 of 10
(5,121 Views)

thanks Jigg,

 

the /quit flag works

 

I tried it before also but dont know why  might have made some other mistake

0 Kudos
Message 10 of 10
(5,120 Views)