08-18-2008 02:47 PM
I have a LabVIEW task compiled to EXE which is downloaded to a remote processor; the front panel remains open locally.
I want to kill that task and re-download it. This works the way I want if I use the local mouse to click the RED-X kill box on the upper right corner of the local front panel for the remote task... The panel disappears AND the remote task stops executing.
The problem is that when I use the WIN32-API to try and kill the local front panel for the remote task I never get the remote task killed. Some WIN32-API calls such as sending EndTask via USER32.DLL to the local panel's window ID cause the local panel to close but the remote task keeps running and is not aborted. Sending a WM_Close to the local panel's window ID involves the operator because it produces a LabVIEW dialog asking me whether I "want to close all RT tasks or not"
What message do I send to the window, or what system call do I envoke to get the same result as that simple local mouse click on the RED-X kill box on the upper right corner of the local front panel for the remote task?
Thanks, Jerry
09-08-2008 06:23 AM
Hello.
Normally a Real-Time task does not require a front panel so closing the Front Panel that you have opened remotely does not necessarily cause the VI to stop running, it merely disconnects the front panel connection to the VI.
In order to achieve the same resul, you can use an Invoke Node to close another VI.
To do this you will need to follow the steps outlined below.
Hope this helps!
09-08-2008 06:38 AM
Thank you for the reply...
Your idea is potentially useful to me, I might be able to use that method to download a 'killer' task to the remote processor which would open a reference to the headless process and abort the headless process, then automatically exit leaving no task running so I can download the main task again.
I am still wondering though; what is the communication that causes the remote processor task to completely exit remote processor memory when I mouse-click the "RED-X" kill box window decoration on the local front panel?
Jerry
09-09-2008 11:44 PM
If you stay connected to a target in LabVIEW 8.x, then closing the local copy of the VI will cause it to stop running on the target. With earlier versions, yes you do get a prompt Exit LabVIEW without closing RT Engine VIs.
From the MSDN website, it seems that WM_CLOSE can prompt the user, and if they agree, WM_DESTROY will be called to Destroy the Window.
Hopefully this can lead you to your answer.