Why Does Flush Queue Return a Cluster Array When My Queue Type is an Array?
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: N/A
I am using a queue in LabVIEW. I set its type to be an array of single precision numbers. When I call the Flush Queue VI, it returns an array of clusters. The cluster contains one element that is an array of single precision numbers. Why doesn't this return as a 2-Dimensional array?
Flush Queue cannot return a 2-D array since each element in the queue could be an array of a different length. For instance, suppose the queue held two arrays, [1,2,3] and [4,5]. If these were combined into a 2-D array, the matrix would be [[1,2,3] , [4,5,0]]. Notice that the second row was forced to add an element of 0 since 2-D arrays must have an equal number of elements in each row and in each column. By using an array of clusters, each array can have different number of elements. To access the elements, first index the cluster array, and then use the Unbundle VI to access the individual arrays.
KnowledgeBase DIRECT-3S8RDE: What is a Queue?
Developer Zone Example: Queue to Pass Data
Report Date: 04/21/2004
Last Updated: 05/07/2008
Document ID: 38KGDEV3