02-22-2013 07:00 PM
By all accounts my built application seems to have exited normally, however it still shows in the Task Manager and I have to kill the process in order to run it again.
I have a top level app controller actor that launches two other actors: 1) Application UI and 2) H/W controller.
When the user hits the Exit button in the UI, the event handler sends a normal stop message to the top level actor. In Stop Core of the top level actor, this causes a normal stop message to both the UI and the H/W controller actors. In the UI actor, when the parent Actor Core terminates, the code then uses a value(signaling) event to exit the user event structure. The H/W controller is simply a placeholder and so only contains a call to the parent Actor Core method. The top level actor then calls the LabVIEW Exit VI. All three actors are reaching the end of the code as evidenced by message dialogs placed at the end of the data flow.
This works fine in development mode (except I don't call the LabVIEW Exit).
What am I missing here?
02-22-2013 07:13 PM
Do your LVLIB's get locked when run in the development environment, but not unlocked like they should when the program finishes?
02-22-2013 07:36 PM
You might want to put in a little wait of half a second or so before calling the exit LabVIEW VI. It gives the actors enough time to shutdown.
02-22-2013 07:43 PM
Yes to seeing the lock/unlock on the lvlibs when running in development as expected.
Adding a delay before the Quit LabVIEW VI does not work.
02-22-2013 07:46 PM
I assume you are reffering to the Quit LabVIEW function?
This function is pretty powerfull from what I've experienced. Nothing escapes from it as far as I know. If you ever have doubt about exiting LabVIEW, this function does the trick 100% of the time. I would investigate to make sure you are actually hitting the quit function in your code and not sitting somewhere else.
02-22-2013 08:24 PM
I'm definitely hitting the Quit function...I've got a message dialog immediately in front of it that pops up.
Then I took out calling the nested actors and just send a Normal Stop to the top level actor, get the message dialog that it's quitting, answer OK...and the app is STILL stuck in the Task Manager.
02-23-2013 02:17 PM
Problem was two things:
If either of the above conditions was true (hiding the window or calling Quit LabVIEW), the app remains in memory.
03-07-2013 12:02 AM
Is there any followup to why the Quit LabVIEW function sometimes fails to blast an actor framework exe out of memory? For an exe, I don't really feel like thinking about what front panels are open when I just force a quit (although I am not against the idea if that's the only solution for now)
Even though BillMe is okay where he's at, I'd like to continue this for my own selfish sake.
I'm very interested in the answer for a couple reasons:
I'm also wondering if this is related to why all of my LVLIB's and classes do not unlock when I stop my program in LV IDE. If I want to modify a class definition or add/remove/rename after that, I have to close my project.
I had not actually posted on either of my issues because I thought it was something peculiar that I'd done to my project, especially because I was a total rookie when I started this so may have done something weird. I should mention that all actors appear to shut down just fine, judging by their front panels. Back when I had a message queue backup problem, an actor still processing would wait to shut down while processing, and you could watch it finally finish and see the run arrow go back to idle, so I don't think that's the problem. Also, I can run this any number of times in the IDE without issue.
03-07-2013 02:38 PM
Ben_Phillips wrote:
Is there any followup to why the Quit LabVIEW function sometimes fails to blast an actor framework exe out of memory?
Yes.
A) The bug is that the Quit LV function does not work when called from a VI launched through Asynchronous Call By Reference. That means if it is called from any Actor Core.vi or its subVIs.
B) This bug should be fixed in the current beta of LV 2013. To test it, visit http://ni.com/beta to sign up for the beta program and (if approved) download the software.
03-07-2013 02:42 PM
Well that's good to know for my LV2011 AF application. I had planned to create a launcher VI that closes itself after launching the top-level UI actor so the app doesn't show two tiles in the Windows Taskbar. Is there a way to accomplish this and still be able to make the EXE exit when the app stops running?