From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert into array

Solved!
Go to solution

I need to add one dimensional arary to the end of three dimensional array. I don't know how many I have to use, so replace element wouldn't work. Plan is to pick one page and add one raw at the end of this page.

 

Looks like I can add 2D array to 3D array and 1D array to 2D aray but for 1D array to 3D I got error. See atachement. Any idea?

 

Thanks.

0 Kudos
Message 1 of 6
(3,491 Views)

Exactly where is the "end of a three dimensional array"?

 

You can't add just a single row.

 

2-D arrays must be rectangular.

3-D arrays must be rectangular prisms.

 

Every page must have the same number of rows and columns.

 

What you you want the data to be in the other rows?  Yous must add a 2-D array to it.

 

Also if you want to put something at the beginning or end of an array, then Build Array is the correct function to use.  Insert Array is more complicated and is only meant if you actually want to "INSERT" something between other elements of the array.  99.9% of the time, Build array is the correct function.

Message 2 of 6
(3,474 Views)

Looks like there is no way to use 3D arrays for this. My rows are all the same sizes, but each page has different number of rows. My idea is to use page dimension as "bucket" in which you put incoming rows of data. Each new row goes at the end on chosen page.

 

Build array will not work becasue I have to put row on the predeterment page and build array cannot do it.

 

I might have to go with write to file and create different files instead od third dimension in array. So each file will contain "bucket". Not as elegant as 3D array.

 

Thanks,

0 Kudos
Message 3 of 6
(3,419 Views)

You could use an Array of Clusters that just have a 2D array in it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(3,409 Views)
Solution
Accepted by topic author zoran

Use a 1D array of clusters of 2D arrays.

See attachment

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 6
(3,359 Views)

Thanks. This is what I was looking for.

0 Kudos
Message 6 of 6
(3,345 Views)