LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create an array of 2D array

I have problem with creating an array on the front panel!!!
I'd like to create 1D array of a 2D array inside the 2D array is a cluster of 3 U32, red, green and blue value..
I create the 2D array with a cluster of 3 U32 OK.
However when I create a 1D array and grab the 2D array place it inside the 1D array. This does not work.
I am missing something.
0 Kudos
Message 1 of 13
(5,486 Views)
Its subtle.

LV does nto let you make arrays of arrays.

Once you have the cluster in the 1-d array.
Right-click on the array and select add dimension.
Repeat as many times as you like.

I have work with 6-d arrays in LV. It works.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 13
(5,486 Views)
You cannot create an array of arrays. You need to simply add another dimension to create a 3D array. It simply isn't possible to create a 1D array of 2D arrays.

This is an extremely complex data structure. I would suggest reevaluating it for another form. Be sure that this is the appropriate data type for your application. Managing this data type will be difficult.

If you could provide some details as to the need for this data type, we may be able to offer a better selection.

I hope this helps.
0 Kudos
Message 3 of 13
(5,486 Views)
"Ben" wrote in message
news:5065000000050000007A900000-1027480788000@exchange.ni.com...
> Its subtle.
>
> LV does nto let you make arrays of arrays.
>
> Once you have the cluster in the 1-d array.
> Right-click on the array and select add dimension.
> Repeat as many times as you like.
>
> I have work with 6-d arrays in LV. It works.
>
> Ben

What on earth did you need a 6d array for?
0 Kudos
Message 4 of 13
(5,483 Views)
Put the 2d array in a cluster and put that in the 1d array. Try not to get
too complicated with large amounts of data though since complicated
structures cause you to be a memory hog.

"trout00" wrote in message
news:506500000008000000A2540000-1027480788000@exchange.ni.com...
> I have problem with creating an array on the front panel!!!
> I'd like to create 1D array of a 2D array inside the 2D array is a
> cluster of 3 U32, red, green and blue value..
> I create the 2D array with a cluster of 3 U32 OK.
> However when I create a 1D array and grab the 2D array place it inside
> the 1D array. This does not work.
> I am missing something.
Message 5 of 13
(5,483 Views)
This is a proprietary app so I can not reveal all the details.

An app we developed measured characteristics of an anisotropic (i.e. different properties in different directions) material. Three characteristics where measured over the entire volume.

Three dimensions where required for the measurements at each point in space.

Three dimensions for each the "Measurement Space"s.



Ben

P.S. I did not write it, I just supported it.
I seem to remember hearing of someone doing 7-d, but I cannot rember the details
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 13
(5,483 Views)
Adam Russell has the right answer here in my opinion.

There is a big difference between a 3-D array and an array of clusters of 2-D arrays.

A common mistake when first startin with Labview and data analysis / processing is to think that a 3-D array is a good way to group sets of 2-D data. The problem is that when you ungroup, you will find LOTS of zeros because a 3-D array has to be rectangular. I've attached some diagrams to illustrate what Adam and I are talking about.

--Steve
Download All
0 Kudos
Message 7 of 13
(5,197 Views)
I concur w/Laviewguru.

This structure is not only complex but also very expensive in terms of
memory and CPU usage. It is going to require that every 2D element
has an 1D array as large as the largest array you will need for any
one particular array 2D array element. For example:

If you have a 2 D array that is 200 x 300 and most elements only need
10 items in the 1D array but 1 needs 50, then you will have 200 x 300
x 50 elements or 3000000 elements instead of 600040 elements. It is
not a very efficient way to do this.

Perhaps you could have one separate array of 1D elements and your
structure could use two I32 elements in each 2D array element as
pointers into the separate 1D array structure, i.e. a start and end
location or a start+# of elemen
ts. Of course then you have to manage
insertions and deletions but it would leave you with a lot less memory
usage.

You might want to look into sparse array algorithms. Alternatively,
you may want to find a way to implement this using a database where
all the data ends up stored on the disk and only a few records at a
time are in use by your program.

Doug De Clue
LabVIEW developer
ddeclue@bellsouth.net

Labviewguru wrote in message news:<5065000000050000007B900000-1027480788000@exchange.ni.com>...
> You cannot create an array of arrays. You need to simply add another
> dimension to create a 3D array. It simply isn't possible to create a
> 1D array of 2D arrays.
>
> This is an extremely complex data structure. I would suggest
> reevaluating it for another form. Be sure that this is the
> appropriate data type for your application. Managing this data type
> will be difficult.
>
> If you could provide some details as to the need for this data type,
> we may be able
to offer a better selection.
>
> I hope this helps.
0 Kudos
Message 8 of 13
(5,483 Views)
If the spatial vectors are the same for each measurement, the measurement space only needs to be one dimension. For example, I measure A on an X, Y grid. I can represent this as a table. I can also measure B and C at each point. Than means that I have 3 tables: A, B, and C. My data structure is an array of tables (3D array). If I add more measurements, they become tables, not additional dimensions.

As a side note, I have worked over the past two years writing a flexible software architecture that will acquire any number of measurements in any dimensional space. In this situation, you cannot use strictly typed (dimensioned) arrays as your data structure. You must use a 1D array and then peek and poke into it using the same typ
e of formula that the LabVIEW primitives use to access the data in memory. I have had users acquiring 20 measurements in 5D space. The software also includes tools for visualizing cutting planes or cross sections of the data.

If you are ever interested in sharing ideas email me at jim@jimkring.com.

-Jim
0 Kudos
Message 9 of 13
(5,483 Views)
Hi All,

I believe if you take two 1D arrays of different sizes and make a 2D array you will have the same Problem. The 2d Array will be of the size with rows and column sizes which can accomodate bothe arrays. The empty elements will be zeroes.

By definition a 2D array is Rectangle and 3d Array a Cube. Does Any Body Know what a 4d Array looks like?

The Problem is in any Structured Language you would have to define an Array size before hand(not withstanding Variant sizes - they must be defined when being used).

To tackle your Problem the best thing to do is initalize a 3D array of known size with "NaN" (Not a Number). Then you wont have all these zeroes, And you would know which are valid elements and which are not.

Regards,

Mache
Good Luck!

Mache
0 Kudos
Message 10 of 13
(5,197 Views)