LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1 Enqueue

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(3,220 Views)
Solution
Accepted by topic author govindsankar

@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...

 

error_1_enque_element_BD.png

 

 

Message 2 of 3
(3,215 Views)
Solution
Accepted by topic author govindsankar

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 3
(3,208 Views)