LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Polling

crossrulz, I will look over that example.  I have a question about queues.  I know you first have to obtain a queue then pass in data by enqueuing and then you can dequeue that data from other loops.  Lets say I have a producer-consumer model.  I have a producer that obtains a queue on the outside of a while loop and enqueues data from a random number generator.  Let's say I have two consumer loops (Loop1 and Loop2) that both are waiting for the queue in the producer loop to be enqueued with data.  Let's also say Loop1 is running faster that Loop2.

 

Loop1 and Loop2 are waiting for data to be enqueued and both have "Dequeue Element" to dequeue the data when available.  Are these dequeue elements separately handled by each Loop (meaning if I enqueue data from Loop1 will that first data point be lost in Loop2 since the queue has already been dequeued once already)?  Or does each dequeue element have access to every piece of data obtained by the queue regardless if a Loop already dequeued an element from the queue?

 

Thanks so much!

 

 

0 Kudos
Message 11 of 13
(590 Views)

Once an element is dequeued, it is gone.  So if you have multiple loops trying to dequeue from an queue, you will have no clue which loop will process which queued item.  99.9% of the time, you should only have 1 place where you dequeue.  Queues are meant for a N to 1 communications.  So you really need a different queue for each loop you are trying to control.


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 12 of 13
(585 Views)

Have you considered notifiers

 

Here you have a Master Slave architecture link, but before using it, maybe you should read in this help also before choosing.

 

Regards

0 Kudos
Message 13 of 13
(566 Views)