LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

exit doesn't quit instead stops

In my application, i need to exit labview upon completion of execution of code. It used to work earlier. Now that my application code has grown in size, the exit doesn't quit the application instead it stops the application. You can see the VI icon on the screen if you try to quit my exe. Looks like some kind of bug with labview. i have seen the same in the past but when i deleted the exit icon and then inserted a new one, the problem disappeared. But this time around, the problem persists. Can anyone suggest some solution? even the FP.close doesnt work.

Thanks,
Anand
Message 1 of 10
(3,954 Views)
I there a chance that there is a different VI still open and running in memory? I have seen this before. LabVIEW will not quit if there is a VI in memory and it is running. Are you calling anything dynamically that might not be closing? Are you using an event structure in your code?
Message 2 of 10
(3,954 Views)
The code uses event structure and there is no dynamic vi that is running while the exit command is called. But this code was working earlier. Now the exit command behaves like a stop command. I dont know why. Is there a workaround
Message 3 of 10
(3,954 Views)
Are you sure that Quit is executed and that it's the function that stops the VI? Have you used Highlight Execution to verify this?
Do you have anything wired to the input of Quit LabVIEW? If you do, make sure that input is really True when Quit executes.
Do you know the specific change you made when Quit stopped working?
Message 4 of 10
(3,954 Views)
Yes. I am using Exit.. This is inside a T/F case and will b executed only if it is run as exe. Interestingly if you have dialog box b4 exit, then the exit works correctly!! but if u remove the dialog, then it behaves like stop
Message 5 of 10
(3,954 Views)
Can you post a snapshot of your code showing the dialog box and Quit?
Message 6 of 10
(3,954 Views)
I have 2 images for you. Intially i had a exit in case 3. it started misbehaving. so i put an exit in case 2. it did not work as well. then i put an dialog box before exit (in case 3) it works. the image that i posted, has 2 exits in case 3. but in my actual program i always used one of the two.

Anand
Download All
Message 7 of 10
(3,954 Views)
You've got a sequence structure and not cases nor any event structure that I can see and it's probably the sequence stucture thats giving you problems. A sequence structure always executes all frames. Putting an Exit in Frame 2 may confuse the LabVIEW compiler because LabVIEW will want to run frame 3 after frame 2 completes. I've never seen this before but then again I never use sequence structures like you've got them. I suspect that if put the Exit back into the last frame, everything will be fine. Or, you can eliminate the sequence structure entirely and use a state machine, in which case you'll have much greater control over the execution and you can stop whenever you want.
Message 8 of 10
(3,954 Views)
This VI was originally designed to have only the while loop in seq 2 but slowly it became so big!. I moved the exit out of the sequence but still it didnt make any difference. Earlier the same piece of code used to work. But as the code in the main vi got bigger and bigger, this section seems to misbehave. Got any suggestions. I saw someone had already posted exactly the same issue earlier. But there were no solutions posted.


http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000003C870000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=exit+stop&USEARCHCONTEXT_QUESTION_S=0

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000477
70000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=exit+stop&USEARCHCONTEXT_QUESTION_S=0
Message 9 of 10
(3,954 Views)
What's in the Exe?=False case? Have you tried eliminating the inner case and wiring "Exe?" directly to the Exit input? Or, if you need the Exe?=False case, still wiring "Exe?" or a True constant to Exit?
What are you doing in frame 3 of the inner sequence? Why have a sequence frame after you always exit an exe?
From the other two threads you referenced, it looks like there's some history with Exit not working as expected. So you may need to just try something different to see if it works. Maybe, similar to what Dennis suggested, add a final frame to the outer sequence and put "Exe?" wired to Exit (with nothing else) there. Or put Exit completely outside all sequences and wired to "Exe?" from inside the outer s
equence.
Message 10 of 10
(3,954 Views)