LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Exiting Real-Time Application

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(3,192 Views)
Solution
Accepted by topic author greenstuff

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

Message 2 of 3
(3,173 Views)

Thanks for your help Luis

0 Kudos
Message 3 of 3
(3,150 Views)