LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exit application on system shutdown

Hello all

I wrote an application (LV 7.0) using a queued state machine. For the most part elements are enqueued in an event-structure.

As a part of the program I write acquired data into a database (local). This DB is copied to a network-drive when the program is started and regularly finished (using an "Exit"-Button on the front panel). The user often shuts down the system without exiting the program, so the DB is not saved. To avoid this loss of data I use the event "Application Exit?". After enqueueing a "Exit"-element I wait for the "Exit"-Case (which is the same as if the Exit-button was pressed) to be executed. Afterwards SilentShutdown is set True and Discard is set false.

To test this functionality I ran the program an
d shut down the system (WinXP). The program finishes as expected and the DB is copied to the network-drive.

Although the program has finished correctly the system does not shut down and I have to shut it down once more.

Does anyone know how to fix this problem?

Thanks for your help.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 1 of 3
(3,038 Views)
hello thomas

i've seen this behaviour on machines running XP without a LV-installation. does your machine shut down at the first attempt when your app is not running? if not so i would refer to Microsoft.

otherwise:
does LV start any services? check the task manager for running services and applications after your first attempt to shut down the system. maybe you could try to change the shut down timeout settings for applications and services in your registry. i think the default is 60 secs.

greetings
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 3
(3,037 Views)
Hello �

This behavior only affects LabVIEW 7.0 and 7.1 and will be changed in later versions. In the mean time you can watch for the Windows shutdown message with the Application Exit? event, then call the Windows SDK to force a Windows shutdown.

Hope this helps.

S Vences
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(3,037 Views)