LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

double array

Hi, I'm trying to create an array of arrays (Data_Switch_Array). I increased the number of Dimensions to 2. When I access an array, I would in other languages state Data_Switch_Array[i] where i is just some number. However, I can't seem to do this.
 
I was thinking about making an array of containers, however, I may need to manipulate the array later.
      for all Data_Switch_Array[i]
              Data_Switch_Array[i][0] = new data; \
Therefore I don't think containers would be appropriate since I need to have the name as general as possible.
 
What can I do?
 
Thanks ahead,
Kat
 
 
0 Kudos
Message 1 of 5
(2,754 Views)
New Update:
 
Use an Array of Containers containing arrays. But that just sounds silly and more annoying than I'm used to.,
0 Kudos
Message 2 of 5
(2,753 Views)
Hi,
 
From what I understand, labview doesnt support arrays of arrays. You are right when you say you can use an array of clusters where each cluster consists of an array. It is not really much more work to maintain than an array of arrays, just access the first array (Data_Switch_Array) and unbundle the cluster to access the second array. It is not the prettiest of solutions, but really all it is is an extra bundle or unbundle function whenever you want to access data, if this seems bulky on your block diagram, write a subvi to do your array indexing.
 
 
Jeff


Using Labview 7 Express
0 Kudos
Message 3 of 5
(2,735 Views)
Thanks for letting me know. That is what I have implemented at the moment.
0 Kudos
Message 4 of 5
(2,730 Views)
If all of your arrays have the same dimensions, you can use a 2-d array.  If they don't you can either use a 2-d array and keep track of the dimension sizing seperately (LV will fill with 0's to make the arrays the same size), or you can use an array of clusters of arrays to have varying sizes of arrays.

To access an elemnt in a 2-D array, you use index array.  It will automatically expand to include two indices.  You can leave one empty to get a whole row or column, or specify both to get a single element.  To set a value, use Replace Array Subset in a similar manner.  The array primitives will automaticcaly adapt based on the dimension of the array you are feeding it.
0 Kudos
Message 5 of 5
(2,728 Views)