LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer/consumer stop problem

Solved!
Go to solution

Hi everyone,

 

I need to control a positionner with a motion controller, and record the time of travel of the positionner between two points. I use a producer/consumer pattern, but the stop button doesn't end the program, the second loop is still running. I thought hitting the stop button would create an error and end the while loop.

Do you know where is the problem ?

 

Thank you for your help

0 Kudos
Message 1 of 5
(4,112 Views)
Solution
Accepted by simchoots

Your VI works as expected. Get rid of the mis-used sequence frames.

The last frame is creating the issue as the queue is destroyed only if both loops have finished. As the consumer loop requires the queue to be destroyed to finish, this will never ever happen.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 5
(4,089 Views)

I would have to agree with Norbert here.

 

What is with all the flat sequences?

 

Just remove them they are NOT needed, you already have execution flow control with the Error Cluster.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(4,085 Views)

Thanks for the answers.

Actually the flat sequences before and after the while loops are a convention where I am currently working. It makes the program more "readable". I always thought it was a bad idea, I have now the proof I was right !

Message 4 of 5
(4,057 Views)

I can understand where it is coming from in terms of having all of the inputs and outputs nicely designated, but having something required that can mess with the dataflow of the program is rather badly thought through. If the only reason that they are desired is to make everything more readable you might be just as well off putting a couple of the decoration boxes in their place, at least they don't mess with the flow.

0 Kudos
Message 5 of 5
(4,018 Views)