LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enqueue flatten string vs cluster

I have seen someone flatten a cluster into string and enqueue the string instead of enqueuing the cluster directly.  Is that a reason why he would do that?  It was code for LabVIEW 7.0.  Maybe a limitation in previous version of LabVIEW?  What is the pros and cons of doing that?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 4
(2,633 Views)

Unless you need to pass the data to something other than a LabVIEW application there is no real benefit to flattening the cluster to a string.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 4
(2,629 Views)

The advantages are that you can pass many datatypes through the same queue (although I would probably use variants myself if I really wanted to do this), and that you can easily add a tcp layer to communicate between application instances.

 

The disadvantages are that restoring the data is a bit ugly and that you are making data copies.  LV stores data in memory using the flattened data structure, but the actual storage may not be contiguous.  Explicitly flattening the data means that it must be copied to a contiguous space in memory.

Message 3 of 4
(2,620 Views)

I think that early versions of the queue had limits on the data types it would accept.  That had probably changed by version 7, but this could have been a habit from earlier.

 

If a cluster is the appropriate data type for what you are doing, pass the cluster to the queue.

 

Lynn

Message 4 of 4
(2,598 Views)