Jump to content

Leftover process from built application


gustav

Recommended Posts

I am having trouble with a built application under labview 7.1 . The problem is that under some circumstance the application doesnt exit properly. Basically, after the application exits there is still a process running until I go into the task manager process list and kill it. This happens if I call the 'Exit labview' VI at the end of the application, or if I close the front panel with an invoke node. If I do not call any of these, when the appliation ends the front panel will still be open but the application not running. If I then close the frontpanel no process is left.

I am trying to track down what causes this, main suspicons at the moment are that it is related to either DAQmx or to an externall dll.

Does anyone have some knowledge about what could be causing this behaviour? It would be of great help.

thanks,

gustav

Link to comment

It seems now the problem is related to using a timed loop triggered by a counter output event, see the attached image. As to why this causes the problem I am experiencing I have no idea. It doesnt seem to matter wether the timed loop is triggered by the actual event or not (the loop can also be stopped by a notification). The task used to create the timing source is cleared before the application exits. Anyone has any clue what is going on?

Link to comment

QUOTE(gustav @ Dec 5 2007, 04:32 AM)

Basically, after the application exits there is still a process running until I go into the task manager process list and kill it.

What is the name of the process that is still running? The Quit Labview function should kill all LabVIEW processes, but it won't affect external processes that were launched from LabVIEW. Those need to be handled manually in your program.

Link to comment
QUOTE(TobyD @ Dec 5 2007, 05:20 PM)
What is the name of the process that is still running? The Quit Labview function should kill all LabVIEW processes, but it won't affect external processes that were launched from LabVIEW. Those need to be handled manually in your program.
Ah, I forgot to mention this, the process that is left behind is the same process that runs the application. It has the same name as the application. So quit labview in this case does not seem to kill all labview processes as it should.Probably I should also add that the process left behind does not seem to use any CPU time at all after the application has exited.
Link to comment

QUOTE(gustav @ Dec 5 2007, 12:43 PM)

Ah, I forgot to mention this, the process that is left behind is the same process that runs the application. It has the same name as the application. So quit labview in this case does not seem to kill all labview processes as it should.Probably I should also add that the process left behind does not seem to use any CPU time at all after the application has exited.

The timed loop apparently calls into external DLLs. Somehow and somewhere that external code does not properly get informed about the shutdown so the process hangs on the exit callback of that external DLL, most probably. I haven't used the timed loop very much but I think this is one thing that has happened to me too in the past, including in the development environment.

Asynchronous external code is tricky in LabVIEW, even for the creators of LabVIEW ;) :-)

Rolf Kalbermatter

Link to comment
QUOTE(rolfk @ Dec 7 2007, 02:03 PM)
The timed loop apparently calls into external DLLs. Somehow and somewhere that external code does not properly get informed about the shutdown so the process hangs on the exit callback of that external DLL, most probably. I haven't used the timed loop very much but I think this is one thing that has happened to me too in the past, including in the development environment.
Thanks, yeah, that seems to be the case. After fiddling around a bit my guess is that the timed loop requires some kind of clean up code to be ran when the VI gets unloaded, but this is not done properly if calling the 'Quit Labview' function (or if calling FP close) . It seems I found a workaround by having the main VI use an invoke node for calling a dynamically loaded VI that calls the 'Quit labview' , with 'Wait until done' set to false. I guess this causes the main VI to unload properly and clean up the timed loop before the dynamically loaded VI calls 'Quit labview' . This is of course just guessing, so if anyone has any comments on this it would be interesting to hear it :) .I should add that it was also necessary to add a delay in the dynamically loaded VI before calling Quit labview.
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.