04-03-2010 06:42 PM
Is there a way to force Labview to maintain the original array dimension independently from one another when creating 2D or even possibly 3D arrays? It appears to be autosized every set of inputs to the maximum size. But I want to maintain each set of array size independent from one another. How do I do that?
04-03-2010 06:55 PM
04-03-2010 07:03 PM
04-03-2010 07:50 PM
04-03-2010 11:19 PM
Another commonly used device is to make the first (0th) element of each array represent the array length: so new array A would be
0x06 (6 elements follow)
0x01
0xFF
etc.
then when you're working one of the 1d arrays, you index the 0th element, convert it to I32 and use that as the length in a subarray node to return just the original array.
04-05-2010 08:02 AM
Be aware that such an approach has issues with memory use. If your data sizes are big enough, you should use the cluster approach. For those who do not know what this is, consider the following:
In the bottom image, each array element is composed of a cluster containing a 1D array. This allows each 1D array to be independently sized, but also adds an extra layer to getting data out of the 1D array. This can cause issues with data copies in older versions of LabVIEW, but the In Place Element Structure has largely eliminated these for newer versions.
04-05-2010 05:41 PM
04-06-2010 08:38 AM - edited 04-06-2010 08:38 AM
Sure. Here is a screenshot showing buffer allocations. Note the extra copy of the cluster using the traditional extraction of a single element from the array of clusters of arrays. It is not there if using the In Place Element. Code is is LabVIEW 8.5 (when the In Place Element was introduced).
Note that in LabVIEW 2009, the buffer viewer will show a buffer on the output of the index array in the In Place Element. This buffer is not a full copy, but a static allocation to handle indexing an out-of-bounds element.
04-06-2010
11:18 PM
- last edited on
05-09-2025
04:37 PM
by
Content Cleaner
That made sense to me after the 5th time I read it. Now I know about In Place Element Structure. I was using LV8.0 for too long;-)
Is the In Place Element Structure you recommend we implement all the time (when we can)? Can you give examples? Has anybody done any benchmarking?
04-06-2010 11:44 PM - edited 04-06-2010 11:45 PM