01-30-2013 11:31 AM
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?
01-30-2013 11:39 AM
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.
01-30-2013 12:00 PM
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.
01-30-2013 01:28 PM
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