07-08-2007 01:56 AM
07-08-2007 03:48 AM
In cases your Vi doesnt require saving, you can use a shared variable to control a state machine with "quit Labview" icon in. you will find it in the application control menu.
of course that demands using labview on your server and sending this variable before other system commands. on top of that that will require to add a running vi in your remote computer, which have just a loop and an event structure (with timeout of some 100ms), for handling the labview shutdown. this should not be too difficult tough.
07-08-2007 04:25 AM - edited 07-08-2007 04:25 AM
Hi Peter,
Here's another possibility: (though it seems rather drastic) this VI uses .NET to kill a named process - in this case LabVIEW - if the "Application Instance Close?" event is detected. It seems "Application Instance Close?" " is fired at the same time as the "Quit/Cancel" dialog.
It would be launched in parallel to everything else and takes an occurrance input - if your app terminates normally, set the occurrance to kill this VI.
Caveat#1: It requires .NET
Caveat#2: It's written in LV 8.2 because LV 7.1. .NET constructors weren't working for me today!
Caveat#3: You'll need to change the process name from "LabVIEW" to that of your .EXE - if the app is compiled.
Caveat#4: This is a terrible way to stop a program! - - are you sure the remote-program can't be made smart enough to detect the error-condition and shut-down "gracefully"?
Cheers!
Message Edited by tbd on 07-08-2007 04:33 AM
07-08-2007 04:50 AM - edited 07-08-2007 04:50 AM
Message Edited by tbd on 07-08-2007 04:54 AM
07-08-2007 05:01 AM
In principle, I would say that this kind of behavior is anomalous and should be examined - finding out why the VIs are not stopping and resolving that issue.
As for tbd's suggestion, 7.1 specifically had some issues with .NET constructors. There was a patch which resolved the issue.
If you want to avoid .NET, Windows also has a simple kill command for killing processes.
07-08-2007 07:19 AM
07-08-2007 08:53 PM
I would agree with tst too! (see Caveat #4 in my post)
tst, thank you for the heads-up re: patching 7.1 .NET.
Cheers!
07-09-2007 04:46 PM
Yep, tst is right, definitely the easiest way around.
05-23-2015 06:03 AM
I wrote a VI that calls the WinAPI to force quit LabView for this Idea Exchange post, but it doesn't let me add attachements, so I am attaching it to this ancient thread.
Running this VI will terminate the running LabView process with no dialog boxes, losing all of your work, etc.
09-18-2015 04:21 PM
Thanks, Rob_Calhoun! I'm really interested in your VI, but I have LV 2013. Would you be able to attach a compatibilty version?