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: 

Inserting 2D array to a 3D array

Solved!
Go to solution

HI

I have a 3d string array 2x2x2 and I need to add another page to that array.

This new page is 2x3.

I am using "Insert into array" function and result is a 3D array 3x2x2, but it should be 3x2x3.

I mean, last inserted page was inserted but cut to 2x2

How can I do it ?

Regards

0 Kudos
Message 1 of 3
(709 Views)
Solution
Accepted by topic author EDGAR_PLATRONICS

Hi Edgar,

 


@EDGAR_PLATRONICS wrote:

I have a 3d string array 2x2x2 and I need to add another page to that array.

This new page is 2x3.

I am using "Insert into array" function and result is a 3D array 3x2x2, but it should be 3x2x3.

I mean, last inserted page was inserted but cut to 2x2


Did you read the LabVIEW help for InsertIntoArray? Especially the last paragraph on "Details"? That sentence about "changing only one dimension"?

 


@EDGAR_PLATRONICS wrote:

How can I do it ?


First change the size of the existing "pages" in your 3D array, then insert the new "page" array…

 

But: most often it is recommended to use BuildArray instead of InsertIntoArray - as is also in your case!

Replace InsertIntoArray by BuildArray to append your 3rd "page" and magically the 2D array is appended correctly to your existing 3D array…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(698 Views)

Thank you very much for your help

0 Kudos
Message 3 of 3
(672 Views)