11-24-2010 06:07 AM
Is it possible to exit a Real Time application from within the software (the exit() function reboots the system according to the documentation) without the system rebooting?
Thanks
Martin
Solved! Go to Solution.
11-24-2010 11:28 AM - edited 11-24-2010 11:29 AM
The only safe way to terminate a CVI RT application is to return from the RTMain function. If you're nested very deeply under RTMain when you want to terminate the application, and it is not practical to unwind the stack all the way to the top, then one option you have is to use the setjmp/longjmp functions to skip back up to RTMain.
If you do skip a bunch of code by long-jumping, you still have to be very careful in making sure that you free/close any handles or other memory resources that your application might have acquired, before exiting. Unlike Windows, the RT operating system is single-process, and the process will continue running after your application exits, so whatever you do in one invocation will persist.
Luis
11-25-2010 02:33 AM
Thanks for your help Luis