LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

queuing question

Currently I have a producer/consumer setup.  I have data going into the queuing VI and then dumping it out from the dequeuing VI for calculations.  The problem I am running into is that at first, the clocks in each loop are matched, but after awhile, the consumer clock slow.  Soon the Producer loop will run, then the consumer, and so on independently.  I tried setting up timeouts so that the producer loop will timeout and stop sending data to the consumer loop until the consumer loop is done, but it seems that this timeout is not working out that way I though it would.  Am I setting the timeout right?  Also, what does the setting the queue size mean?  Does the number represent number of data points, number of bytes, etc...?
 
Thanks,
Travis
0 Kudos
Message 1 of 3
(2,673 Views)
Can you attach your VI?
0 Kudos
Message 2 of 3
(2,661 Views)
Travis,

If I understand you correctly then I think the appropriate LabVIEW Help page will help us out here.

The queue size is the maximum number of elements that can be placed in the queue.  In your case it sounds like this will be the number of data points.  By default there is no limit (except for physical memory limitations) to the number of elements you can put in your queue.

The timeout value of the Enqueue Element VI specifies the number of ms the VI should wait for space to open up in the queue before throwing a timeout error in the event that the queue is full.

It sounds like you are trying to synchronize the two loops.  If this is the case why not just adopt a simpler one loop approach?  The benefit of the producer/consumer architecture is that acquired data or user interface events can be queued and processed when the processor has time rather than relying on the processing happening in real-time.

I hope this helps.

Regards,

Simon H
Applications Engineer
National Instruments
http://www.ni.com/support/
0 Kudos
Message 3 of 3
(2,636 Views)