LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

QUIT LabVIEW.vi works differently in LC8.2

It sounds like you have a race condition. If the main loop stops somehow before the local varaible is set, the parallel loop would never see the stop condition.

In a complex program I prefer to use two-way communication for the shutdown events. The main loop sends a "Halt" command to the parallel loop (usually via a queue). The other loop closes down (after setting outputs to safe states, closing files...) and then sends a "Stopped" status via another queue back to the main loop. Only after receiving the "Stopped" status message does the main loop shut down. It is a bit more involved but avoids the situation where the main loop has stopped but the secondary loop is still running and cannot be told to stop.

Lynn
0 Kudos
Message 11 of 14
(920 Views)
Well... i'm even more confused than before... I've narrowed it down to a subvi. More background:

1. App has worked since 6.1 in some form or another and with the subvi in question since 7.1.
2. The subvi in question is not actually called, but is simply placed in a case structure when the Quit changes to a Stop.
3. The subvi is a designated as a dynamic vi in the app builder and is a "minibar" for controling certain aspects of the main program. It is not displayed by default, but it has to be controlled outside of my main loop because i only want it to go away if my app exits, not just reloads it's configs. When i tried calling it from the event loop, it halted execution of my event structure and so i coded around it a long time ago. See item 1 above.
4. With this particular subvi, there are not ANY external code calls being made (many other parts of my app call CINs or DLLs).

Thoughts?
0 Kudos
Message 12 of 14
(907 Views)
OK... fixed.

The issue i have is with an event loop that contains an Event for "Application Instance Close" and "Quit Labview" being called. I am not sure why this worked in 8.0.1 and not in 8.2, but i am able to remove this in my application without any adverse effects and i am back to 100% now.

Thanks for all the help!
0 Kudos
Message 13 of 14
(899 Views)
Similar issue here solved, code looks like this...
 
Init routine - while loop containing event structure - Cleanup - Quit-if-Exe
 
1.  Exe will not quit if event structure contains the <Application> Instance Close (not Instance Close?)
2.  Even though event structure is no longer executing LV still will not exit.
 
Solution, remove application instace close event and it shuts down just fine.  Thanks for the thread, it helped me zero in on this same issue in my application.
0 Kudos
Message 14 of 14
(732 Views)