LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can queue transmit large volumn of data, or better use function global instead

Thanks.
0 Kudos
Message 1 of 13
(4,084 Views)

Hi turbo,

what do you mean with large volume of data? How much is large? this works:

Mike



Message Edited by MikeS81 on 06-03-2008 10:32 AM
Message 2 of 13
(4,082 Views)
It depends on what you're doing with the data. An enqueue-dequeue sequence does work in-place, so that enqueuing a large amount of data at one point in your code and dequeuing it in another does not require allocating more memory, but a functional global may have better memory handling if the data is always kept inside the VI.

___________________
Try to take over the world!
Message 3 of 13
(4,074 Views)
Hi Mike,
 
There are two kinds of data, one is a message list, total about 8000 messages. Each message may have 500 character. Another is some binary data list. Each around 100k. Totally about 200 data.
 
 
0 Kudos
Message 4 of 13
(4,063 Views)

They are used in different vis.

Really want to compare how they allocate the memory.

0 Kudos
Message 5 of 13
(4,060 Views)
Checking it is fairly simple - allocate a 1M DBL array in one VI and then enqueue and dequeue it in another VI. You should see that the memory usage only goes up by 8 MB. That's because there is only one copy of the array.
 
This of course assumes that you don't split the wire going into the enqueue or the wire coming out of the dequeue. If you do that, LabVIEW may create a copy of the data.

___________________
Try to take over the world!
0 Kudos
Message 6 of 13
(4,052 Views)
If each element is bigger than the DBL, will it be affected.
How does it compared to function global with the memory inside.
 
0 Kudos
Message 7 of 13
(4,047 Views)


turbot wrote:
If each element is bigger than the DBL, will it be affected.

Just try it and see. As far as I know, this should work the same with every datatype, but I never saw the code behind, so I can't guarantee that it will work the same under any condition.

How does it compared to function global with the memory inside.

With a functional global, you get one copy of the data for the shift register. Whether you create additional copies or not depends entirely on your code. You can use the Show Buffer Allocations tool (in Tools>>Advanced) to see where buffers are allocated.

___________________
Try to take over the world!
0 Kudos
Message 8 of 13
(4,043 Views)

So far as I know the queue is just a data structure, but the function global is have memory allocated, and so far works good. I am not sure if I am right. Can any one correct me.

0 Kudos
Message 9 of 13
(4,011 Views)

memory is allocated for each of the elements in a queue. Provided there are no branches in the wires (casusing buffer copies) that feed a queue, ther is no need to allocate a new buffer to queue up the data. Rather the pointers to the buffer holding the "to-be-queued" data is what get passed by the queue. On the other side of the queue the pointer a grabbed when de-queing and used as the code indicates.

I use queues when dat all ends up in one place and is proceesed then goes away.

If the data goes to multiple locations and or does not go away, then an AE can work using its internal buffer (i.e. the Shift Register).

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 13
(4,006 Views)