LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building a 3D array 1 element at a time

Highlighted

I am having some trouble with the array functions and ctrl+h and the detailed help don't seem to be doing me much good.

 

I am using the "initialize array" funtion to make an array with 3 columns, and I am trying to use the "insert into array" fuction to put all the numbers in it, but I don't think that this function has the capability to do what I want it to do. 

 

My program gives me a single data point at a time, and not a whole line, so I wanted to be able to take my measurement, give it an index of 0,0, and then put it into the correct spot in the array, then get the next point, give it an index of 0,1, insert it, etc etc etc until all my data is in the array.

 

The insert into array help says there is a line for "inserting an element or subarray at the point specified by INDEX" (paraphrased) but it won't let me wire a scalar to the input.  Is there another function I should use to do this or do I have to use a build array function to make a 1 row, 3 column array and insert each of those into my main array?

0 Kudos
Message 1 of 3
(1,037 Views)
Highlighted

The function you want to use is Replace Array Subset, not Insert Into Array.

0 Kudos
Message 2 of 3
(1,031 Views)
Highlighted

Hi Lars,

 

do you really need a 3D array ( array[x][y][z] ) or do you need a 2D array with 3 columns ?

 

if you create the array (which means you reserve the space for it) with the initialize array function, you actually insert the single elements with the "replace array subset" function (it's also in the array palette). then you can to specify all three indices and you will be able to "replace" the element already in the array.

 

Regards, Ben

_________________________
CLA
Message 3 of 3
(1,030 Views)