07-23-2014 06:07 AM
I want tpo close the Teststand User Interface in deployment maschine, Programmatically i.e. eg when I say
ContinueTesting = False
or any other condition
07-23-2014 08:51 AM
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!
07-23-2014 08:55 AM
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,
07-23-2014 08:56 AM
You beat me to it Daniel. 🙂
I wasn't typing fast enough.
07-23-2014 09:32 AM
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.
07-23-2014 10:17 AM
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 .....
07-25-2014 05:31 AM
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
07-25-2014 09:16 AM
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,
07-25-2014 09:24 AM
For the question about the DLL and clusters, see the original post here, I posted a response.
07-25-2014 09:27 AM
thanks Jigg,
the /quit flag works
I tried it before also but dont know why might have made some other mistake