03-30-2015 01:44 PM
Hi veryone
I have used Vision Express to solve Patern Machine problem.
I want to put Assistant and Aquistion in 2 parallel loop. So I have used Producer/Consumer to transfer data
After Running VI, I have pressed Stop button and I met this error
I think Obtain Queue has a problem. I changed Image Control to Contant and wire it to Element data type. I think this way is correct.
So when error occur, it address to IMAQ Coppy in Assistant. So I think I have used Queue Comunication not correctly.
How can I fix it
thank
you can see more detail in follow video: https://www.youtube.com/watch?v=i6FOQ2jypXc&feature=youtu.be
Solved! Go to Solution.
03-30-2015 02:18 PM
Remove "Overlay Pattern Matching Results.vi" temporarily, see if you still get the error message.
It doesn't belong to the producer loop anyway.
03-30-2015 03:24 PM
You are disposing of the Image Queue twice, once when the Producer exits, and a second time when the Consumer exits. Try deleting the Release Queue function after the lower loop exits (and delete the Queue wire after the Dequeue Element). Note that you don't need (and probably don't want) the Get Queue Status in the Consumer -- instead, put the Dequeue Element there, wire a Timeout value (say 10 milliseconds) and wire the Timeout to the Case Statement (if it times out, just "do nothing"). Note that when the Producer releases the Queue, the Dequeue Element will error out, stopping the Consumer.
Bob Schor
03-30-2015 08:59 PM
Hi
I have use your way. But I met this error when I pressed STOP button
How can I fix it?
03-30-2015 09:05 PM
I have tried your way, But No Change
Do you have the other ideal?
03-31-2015 04:20 PM
03-31-2015 06:03 PM
Try this:
You should put the image process in the consumer loop, and release it properly.
04-01-2015 01:48 PM
I don't understand the "solution". How does the Consumer loop exit? The Stop is wired to the Error Line, which means that the Consumer Loop will stop when there is an error. What is the error? Well, the code you developed following my suggestion did the right thing -- when you stopped the Producer loop, you (correctly) released the Queue, which then (correctly) caused Error 1 on the Consumer Loop (since there was no Queue), which (correctly) stopped the Consumer loop. The only "problem" with this code is that an Error 1 is reported from the Consumer loop. Since you are expecting this error, you can use the Exception input on the General Error Handler to "Ignore Error on Match" and wire 1 into the Exception code.
The post you accepted as the "solution" should never exit. When you press the Stop button, the Producer loop will exit, but will wait at the Merge Error function for the Consumer to stop. The Consumer is waiting for an Error (Queue released), which hasn't yet come, so will just hang. If, by some miracle, it did exit because of some other error, the errors would be merged, the Release Queue function would release the Queue, then the General Error Handler should (still) report an error.
Did you actually test this "solution"? Did it really work? Did it exit without reporting any error?
BS
04-03-2015 10:11 AM
HI xaxa9ztb,
I believe that Bob is correct. The queue is not being destroyed by the the Queue Release function, and so the Consumer loop never errors out. You can pass a queue reference around the Producer loop so that the queue will be destroyed and release the Consumer. If you go to File -> New ... then you can use the premade application templates.