03-20-2003 04:56 AM
03-20-2003 02:34 PM
03-20-2003 04:06 PM
01-13-2009 01:05 PM
I have been teaching LabVIEW to myself for a while now, and just came to a new topic that I cant seem to figure out : Queues.
I understand, conceptually, the function of queues, but could someone please give me an example of when this would be neccessary?
It almost seems you could replicate this FIFO behavior with some simple array functions.
I guess I am just not understanding it.
01-13-2009 01:59 PM
Others may have a better explanation and example, but I have found that queues in LabView are very useful when you need to transfer a lot of information quickly and want to make sure you don't overflow or drop elements. They are better at this than using variables because the writer can keep writing whether or not the reader has read the last element.
For instance, recently we were trying to record data on a cRIO device and get the fastest rates possible. We were recieving data from the FPGA FIFO and writing directly to file. When you try to record 32 channels of 32 bits/element at 1 kHz you begin to test the limits of your write to file function. Queues worked better than variables for this because every so many cycles the write function would sort of hiccup and pause, causing the elements in the queue to increase (backup). If we were using regular variables we would have had to wait for the recording to catch up before we could continue reading data. This would mean we would be overflowing the FIFO or missing data points. However, with a queue, elements could back up a little and then the record function would catch up. (As a side note, write to binary file worked faster than TDMS in these benchmark experiments.)
Can anyone explain it better?
01-13-2009 02:13 PM
There are a few good benefits to queues that are quick to memory.
Queues break dataflow, a named queue is the same queue anywhere in an application.
This is great for multi-loop applications (See Producer-Consumer architecture in the help).
I use it most here with a gui loop to handle user events and queue up operations to happen in another loop.
01-13-2009 02:23 PM
01-13-2009 02:31 PM