Command to terminate screen application?
Hi,
What is the command to terminate the screen, from within the screen code (in case, say, a fatal error occurs and you want to force it to close down)?
So far I've tried, unsuccessfully:
Dispose(); //Doesn't do the job
System.Windows.Forms.Application.Exit(); //Closes the whole flexpendant!
Parent.Controls.Remove(this); //doesn't do the job
DestroyWindow(); //Can't get Windows API to work (unknown)
Thanks.
Technical Support Engineer
Robotics Product & Systems Service
Manufacturing Automation, Automation Technologies (ATMA)
ABB Australia
Email: michael.siminski @ au.abb.com
Comments
-
You should use a
Try...Catch block
around "risky" code to catch the error you are getting so that you can respond in some sort of controlled way.
If you catch the error and don't allow it to be escalated to the level of an unhandled exception (which must close the application), then you probably wouldn't need to force it to be closed.
Russell Drown0 -
Thanks for the reply.
In certain circumstances it may still be desirable to force the screen to close.
If, for example, the screen relies on the robot system being set up a certain way for a key functionality, but this is found not to be the case, then the screen may not be of much use and it might be desirable to close it down. If, during start-up, the screen detects that the system is not set up correctly, it might be desirable to display a message to the user explaining what's wrong and that the screen cannot function properly. After that, it might be desirable to close the screen down to prevent a dis-functional screen being left open and so as not to confuse the user.
Is there a command that will close the screen, if so desired?
Thanks.
Michael Siminski
Technical Support Engineer
Robotics Product & Systems Service
Manufacturing Automation, Automation Technologies (ATMA)
ABB Australia
Email: michael.siminski @ au.abb.com0 -
I don't think this is possible, because I believe the TAF has to call the de-activate and un-install methods on applications to close them.
Your best best would be to check for your requirements early during initialization and disable all functionality or display an error dialog at the first sign of trouble.
Russell Drown0 -
Could this be requested as a feature in a future version?
Thanks.
Michael Siminski
Technical Support Engineer
Robotics Product & Systems Service
Manufacturing Automation, Automation Technologies (ATMA)
ABB Australia
Email: michael.siminski @ au.abb.com0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings