LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enqueued element does not dequeue

Solved!
Go to solution

I have a QSM with an event and a consumer loop. To stop the event loop in case of an error occurred in the consumer loop, I trigger an error event and write "Error" to the queue. After that I stop the event loop and proceed with the Error state in the consumer loop. 

 

Now the Problem is that whenever I write "Error" to the Queue, the element does not dequeue. 

In the second screenshot I do not stop the event loop, to confirm that the element wont dequeue.

I only have one dequeue Block in my VI. Can someone show me the solution?

 

Thank you very much and regards.

 

TikeMyson_0-1652702192641.png

TikeMyson_1-1652702225017.png

 

0 Kudos
Message 1 of 5
(1,223 Views)
Solution
Accepted by TikeMyson

It's hard to debug pictures, but anyway... I guess that there's an uncleared error traveling on the error wire, so the Dequeue node does nothing. Clear the error after signaling true to Error. Of course in this version of your vi you may directly exit the lower loop on error, since there is no error management at all (I guess there will be some cleanup in the "Error" case sooner or later).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 5
(1,214 Views)
Solution
Accepted by TikeMyson

Your dequeue function is on error, thus will not take any information from your queue.

Using a register to loop an error cluster that is going to a dequeue element is not good as you will lock your consumer loop.

 

One way is to separate the error for the dequeue function and for your loop.

Another way is to do all the stuff related to an error as soon it occurs then cleaning the error cluster.

 

Message 3 of 5
(1,210 Views)

Hoi Paola,

 

Thank you very much. I guess I am blind after all...

0 Kudos
Message 4 of 5
(1,205 Views)

Thank you too Defaphne!

0 Kudos
Message 5 of 5
(1,203 Views)