LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D array

Solved!
Go to solution

Hi,

 

I have 3D array (4x6x4) with the data. I need to create 1D array with the data at a given row and column for all the pages. I prepared a picture to better explain it. The red arrow goes through the pages 0,1,2,3, and points to the data contained in row 3, and column 0 creating 1D array with 4 elements. I need to “scan” all the rows and columns to create 6x4=24 such 1D arrays. Is there simple solution to this problem? I am running LabVIEW 8.6.

 

Thanks in advance!

 

 

3Darray.PNG

0 Kudos
Message 1 of 8
(2,895 Views)

Try this.

 


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 2 of 8
(2,880 Views)

Thanks .:aCe:.  it is very close to the solution. The only problem is I need to “scan” through all the rows and columns automatically in a loop. 

How can I accomplish this?

0 Kudos
Message 3 of 8
(2,864 Views)
Solution
Accepted by topic author -Chris-

.:aCe:. is on the right track. (but begging to make the Rube Goldberg threadSmiley Wink) the Resize Array primitave solves for the general case and can reuse the array buffer saving some RAM to bootSmiley Surprised

BETTER.png


"Should be" isn't "Is" -Jay
Message 4 of 8
(2,858 Views)

Good one Jeff. I did not read the last lines! Well not properly anyway, thats my excuse!

Whats your excuse of not saving it in version 8.6? Smiley Wink


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 5 of 8
(2,856 Views)

Thanks Jeff, it works!

0 Kudos
Message 6 of 8
(2,844 Views)

@.:aCe:. wrote:

Good one Jeff. I did not read the last lines! Well not properly anyway, thats my excuse!

Whats your excuse of not saving it in version 8.6? Smiley Wink



Since the "code" needed is a primitive and some wires I assumed the OP had it in 8.6Smiley Very Happy


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 8
(2,836 Views)

I think Jeff meant to say "reshape array". It will give you a 2D array that may or may not be exactly what you want, because you specified you want 24 1D arrays. Who knows? 😉

 

To generically get a single vertical column, you would use "index array" (see image middle, top is equivalent code by ace).

 

To scan over all vertical columns, you would place it in a stack of 2 FOR loops and iterate over the xy positions.

 

 

0 Kudos
Message 8 of 8
(2,830 Views)