NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Append 2D array to 2D array

Solved!
Go to solution

I have a 2D array that I need to append another 2D array onto to add more columns.  I'm performing a test which returns a 2D array of data.  I then change a power supply setting and perform the test again.  I collect the returned data into a 2D array that I'll reuse for each iteration.  I the want a Statement step that will append the 2 D array to the end of a 2D array that starts out empty and will grow as the original 2D array is appended to it.

 
A00   A10   A20     B00   B10   B20     A00   A10   A20   B00   B10   B20
A01   A11   A21     B01   B11   B21     A01   A11   A21   B01   B11   B21
A02   A12   A22  +  B02   B12   B22  =  A02   A12   A22   B02   B12   B22
A03   A13   A23     B03   B13   B23     A03   A13   A23   B03   B13   B23
A04   A14   A24     B04   B14   B24     A04   A14   A24   B04   B14   B24
A05   A15   A25     B05   B15   B25     A05   A15   A25   B05   B15   B25

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 1 of 7
(5,457 Views)

Hello kbbersch,

 

Please check to this example: http://forums.ni.com/t5/NI-TestStand/How-to-append-1D-array-to-2D-array-locals/td-p/1244638

 

 

Carmen C.

 

Message 2 of 7
(5,438 Views)

I found that solution while searching but I'm actually trying to append a 2D to a 2D, not a 1D to a 2D.  I may have to do a loop using that solution but I was hoping to find a way to just do it directly.

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 3 of 7
(5,411 Views)
Solution
Accepted by topic author kbbersch

You could always use something like this example.

 

Hope this helps,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 4 of 7
(5,404 Views)

This is exactly what I was working on.  I'm new enough to TestStand that I was struggling with the syntax of redimensioning the arrays.

 

It's interesting that when you readimension the arrays from 2D to 1D you don't have to move the data around.  As long as there are the same number of elements they get populated with the data automatically.  What happens if there are

more elements in the new 1D array than in the 2D array?  Do I end up with empty elements or do I just lose all the data?

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 5 of 7
(5,400 Views)

You end up with empy elements.  Basically whatever the default value for the datatype of the array is.

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 7
(5,396 Views)

BTW- I think it's a lot easier in the newer versions of TestStand.  I haven't played with the new version though enough yet.

 

I do not like how the functions require "[0]" syntax.  I wish it would just take in an index but I do understand why they do it... for the multi dimensional functionality.

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 7
(5,395 Views)