11-27-2008 08:28 AM
I have some trouble with the closing of executeable VIs.
For measurement inside a vehicle we installed a pc which boot automatically when IGN is turned on and run a vi for automated datalogging, also using USB devices.
The PC has an input to start/shut-down. This input is activated when IGN is turned off. All active applications are closed by windows, before shutting down the PC.
Sometimes the USB interfaces hang-up, due to missing initialization.
My VI is using the STOP buttom to execute the "Close Interface" SubVI.
My question:
Is this SubVI also executed when the PC is just shut-down without pressing the STOP button explicitly??
How can it be solved?
Thanks for any support.
11-27-2008 10:52 AM
"Is this SubVI also executed when the PC is just shut-down without pressing the STOP button explicitly?? "
If i understand the question correctly, no.
"How can it be solved?"
If you can , you can let Labview finish the program and Labview to stut down windows. All other programs will shut down as they do, now.
11-27-2008 01:04 PM
I agree, the VI will most likely not be executed when the application is killed by an OS.
Have a lookhere at a paper on closing an application.
Ton
12-01-2008 12:24 PM
If I understood correctly, no the sub-VI will not run.
When a computer is shutting down, it systematically kills all running processes.
It also does not allow any new processes to start up (*hence sometimes you will see a pop-up "____ failed to open because (OS) is shutting down")
This means, that the sub-VI will not run. Make the shutting-down code the VERY LAST code that runs to avoid this issue.