04-12-2018 11:51 AM
Hi
I have attached a basic producer consumer loop with the different events as enum values. But an error is happening in enque and only the first event is happening, remaining events are not being queued. Do please kindly help me in solving the problem. Thanking You.
Govind
Solved! Go to Solution.
04-12-2018 11:57 AM - edited 04-12-2018 12:00 PM
@govindsankar wrote:
Hi
I have attached a basic producer consumer loop with the different events as enum values. But an error is happening in enque and only the first event is happening, remaining events are not being queued. Do please kindly help me in solving the problem. Thanking You.
Govind
Data flow! Basic mistake. When you start your VI, after the first Enqueue element, you just Release your Queue. Put the Release Queue on the error wire, and only release the Queue, when you stopped the Producer loop!
edit: it is just silly to use two loops set to run forever. NEVER use the "Abort" button to stop your app. Did you check the official Producer/consumer template, it shows a simple way how to do it properly...
The rest of your VI neither makes too much sense. What is your goal? You always Enqueu the same element in the Producer, in the single Event case you have...
04-12-2018 12:03 PM
Your Release Queue is actually in parallel with your other loops. What I recommend is you let the consumer maintain the queue. In your Done state, release the queue.
As an aside, this is looking more like a Queued Message Handler than a Producer/Consumer.