LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

executable does not stop running when closed

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!

0 Kudos
Message 1 of 22
(3,613 Views)

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.

Tim
GHSP
0 Kudos
Message 2 of 22
(3,605 Views)

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"

0 Kudos
Message 3 of 22
(3,594 Views)

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.

Tim
GHSP
0 Kudos
Message 4 of 22
(3,587 Views)

you never unregister the user events


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 22
(3,586 Views)

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.

Tim
GHSP
0 Kudos
Message 6 of 22
(3,581 Views)

I'll see what I can do with this. Thank you.

0 Kudos
Message 7 of 22
(3,576 Views)

It is done in the "Quit" case of the user events.

0 Kudos
Message 8 of 22
(3,574 Views)

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.

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 22
(3,557 Views)

@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.

0 Kudos
Message 10 of 22
(3,550 Views)