05-05-2011 11:05 AM
I am trying to build an executable, but it does not stop running when I quit. I have to stop it through the task manager. How can I make it actually stop the .exe thread?
I have confirmed that the loop stops running, and have even tried connecting it to the "stop" function.
Thank you!
05-05-2011 12:09 PM
can you post your code so we can see what you are doing? I would suspect that you are not closing all of your references when you close the program. I have seen this happen when I did not close all the reference to excel. I do not believe that I have seen it for a LabVIEW app.
05-05-2011 01:33 PM
I haven' t found any unclosed references . Is there a way to get a list of all open references?
There's a lot here, and it's it's fairly messy (lots of inherited code and attempts), so perhaps I can explain some. Any closing event, including "panel close?" generates a user event that goes to the closing sequence "Quit"
05-05-2011 01:56 PM
OK here goes. This code need to fit on one screen for easy troubleshooting. I am seeing the STOP vi used throughout this software. That is a really bad way to stop LabVIEW. You need to get rid of those. I would use an event structure in both loops and only look for the stop or exit event in the first loop or I would use events.
If you can clean up the code and shrink it down to fit on one screen I will start helping you rework this vi.
05-05-2011 02:00 PM
you never unregister the user events
05-05-2011 02:07 PM
I think I would also suggest you look into a state machine. This would make the code easier because you would not need the events in the event structure.
05-05-2011 02:10 PM
I'll see what I can do with this. Thank you.
05-05-2011 02:11 PM
It is done in the "Quit" case of the user events.
05-05-2011 03:01 PM
Ahh-
@emc08 wrote:
It is done in the "Quit" case of the user events.
But you left the right side tunnel unwired from the the inside (so the event reg terminal OUT contains the valid refnum to the user event you just tried to destroy) Event terminals behave like SRs with invisable wires in every case that is not wired
Here is an example demoing just this behavior.
05-05-2011 03:14 PM
@Jeff Bohrer wrote:
Ahh-
@emc08 wrote:
It is done in the "Quit" case of the user events.
But you left the right side tunnel unwired from the the inside (so the event reg terminal OUT contains the valid refnum to the user event you just tried to destroy) Event terminals behave like SRs with invisable wires in every case that is not wired
Here is an example demoing just this behavior.
I'm sorry, but I can't see th eexample because I am running 2009. I think I understand. I've cleaned up the code a little bit, and added a shift register for the events. Is this what I needed to do? This still does not solve the problem, unfortunately. If I close, the "Quit" sequence properly executes, (including closing of the front panel), but the thread still does not close.