05-11-2016 08:19 AM
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
Solved! Go to Solution.
05-11-2016 09:10 AM
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
05-11-2016 09:17 AM
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.
05-11-2016 10:12 AM
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 !
05-11-2016 09:47 PM
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.