LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer Consumer Issues

Hi all,

 

I'm creating my first producer-consumer program, and I've run into a few problems.  I have two producer loops (one is a pressure controller and the other is power reading loop).  I've used queues to pass data into the consumer loop which records the data (at a much slower rate).  The problem is that the producer loop (the pressure controller) contains the stop signal for the program.  So I've had problems shutting down all 3 loops.

 

My questions are......Do I have to shut down the consumer loop first, then the producers?  What is the best way to pass stop signals (local variables, booleans in a queue, etc)?   Also when I try to use the producer loop to stop the other loops I get the attached error.  Anyone have any recommendations for making an efficient stopping procedure?  The wait inside the consumer loop is quite long (5 min), so I'd like the minimize the stopping time, if possible.

 

I've attached two versions that I've been working with.  They use version 8.5.

 

Thanks in advance - Dan

0 Kudos
Message 1 of 3
(2,640 Views)
I like to stop the program in the producer loop, and wire the error output of the dequeue element function to the stop of the consumer loop (when the producer loop stops the dequeue element function will generate an error, the error out will cary this to the stop and the loop will stop).  Hope this helps!
Message 2 of 3
(2,639 Views)
Yeah, that worked pretty well.  Thanks again for the help
0 Kudos
Message 3 of 3
(2,589 Views)