ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping Producer/Consumer loop with queue

I am using a parallel loops with a queue to gather and display data. I want to be able to stop both loops from each loop with a button.  What is the best way to do this. I tried to use the queue error to stop the other loop but it only works from one of the loops.  Any ideas?  Thanks
0 Kudos
Message 1 of 6
(6,561 Views)

Make a local variable from the Exit button and use the local in the other loop.  See this post

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 6
(6,544 Views)

The listed discussions and examples are great and simple.  If you are doing critical aquisition, try this revised queued consumer/producer.  It prevents lockup if one of the loops fails unexpectedly.

 

-Mike

Message 3 of 6
(6,532 Views)
Message Edited by Lucither on 04-30-2010 10:11 PM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 4 of 6
(6,524 Views)

Hi Secr,

 

Here is a solution if you dont want to use Local Variables.

 

Rgs,

 

Lucither

Message Edited by Lucither on 04-30-2010 10:36 PM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 5 of 6
(6,513 Views)
Running Global.vi on my site allows you to synchronize the shutdown any loops of your process, even if they are in other subVIs. I have used it for years in both the simple two-loop situations you face and much more complicated architectures. It has the advantage of being very straightforward and easy to understand.
SULLutions.com
...when a single discipline is not enough
0 Kudos
Message 6 of 6
(6,479 Views)