Hi Sean,
Sorry that I was unclear in my explanation, I will try again with more detail (see attached VI for reference for the following pointers) as I step through the process:
- I used this control to access which constant value of Y that I wanted to chose for this run of the VI (or it could be dynamically selected if you include a while loop). It has a length of one so that the array subset that is outputted will limit the Y dimension to only values refered to by the constant and therefore allow us to create a XZ 2D array. If you fed the entire original array into the for loops it would not be able to rebuild the correct array (see point 5 for more information).
- This is the "Array Subset" VI which as already touched on in point one allows you to set one dimension constant so that we get a ?x1x? array which can be built correctly.
- This auto-index terminal allows us to access a value of Z on each iteration of the loop, isolating the different XY arrays
- This auto-index terminal allows us to access a value of Y on each iteration of the loop (in this case since there is only one the foor loop will only run once), leaving a 1D array of X values
- This is the key to the process because we don't index (built) the Y values back into the array, hence we are able to create a 2D array. Using the for loop and this technique we are able to transform a ?x1x? array into a ?x? array.
- In this final step we index into the Z values for each 1D X array creating the final XZ 2D array
As far as your second question, how to accomplish this for an XY array. The process would be the same except in points 1&2 this would refer to a constant Z index and Z length of 1 and the index at 6 would be a terminal (you can enable/disable indexing by right clicking the for loop terminal) whereas the terminal at 5 would become an index. This would index into the Y array and not the Z array creating a XY 2D array.
I hope this helps to clear up any confusion that you may have had. Feel free to post again if you have any further questions related to this post or the issue. Thanks and have a good evening!
Cheers,
Jonah
Applications Engineer
National Instruments
Jonah Paul
Marketing Manager, NI Software