LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variable size 2D arrays

Good afternoon everyone.

I need to allocate array of buffers (arrays). Each buffer would be different size. When implementing this in C/C++ it would look like an array of pointers where each pointer would point to a specific array. Each array could be NULL terminated to know exactly where it ends.

How can I implement this in LabVIEW? Two dimentional arrays are an option, but would waste a lot of memory since the second dimmention would have to be the dimmention of the largest buffer.

Please help.

Thank you in advance,
BorisMoto
0 Kudos
Message 1 of 3
(2,742 Views)
Well, you can use an array of clusters, where each cluster holds a 1D array. I think this would take less memory but it would definitly be more complex becuase you're adding the cluster operations. To do this, create a 1D array, drag it into a cluster and drag that cluster into another array. It's possible that this isn't any better. You can measure the performance difference by using VI profiling (Tools>>Advanced) and by using timing (the time the VI stopped minus the time it started).

___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,727 Views)
Another option I can think about is using a 3D array. It looks like when you use this array, each page is dealt with like a seperate 2D array, so if you use only the first column (0) of each page, you can "skip the second dimension" and work only with the first and third.

___________________
Try to take over the world!
0 Kudos
Message 3 of 3
(2,710 Views)