Showing results for 
Search instead for 
Did you mean: 

inputting data into a set 2D array

Go to solution

Hello all,

I am trying to input data that is being measured in real time into a set array size (as I need to then put the data collected into a 3D graph).

The problem is when the data is coming in, it can be read easily and placed in a 1D array. But trying to input this into a 2D array that indexes itself after it reaches the final column in the array is proving rather difficult.


I have attached the file i am using but you wont be able to run it without the equipment i am using.


I have attached some images of the results i am getting and the methods i have used.

Measurement 2 shows me trying to come up with a way to index itself by chnaging the row at which the data is imputed. However when the index row is chnaged during the operation all the data is moved to the below row leaving the first row empty (as shown in Measurement 2 when the index changes)


I have done a variety of methods and looked online but this is as close as i have got.

Thanks for any help,



0 Kudos
Message 1 of 4

You seem to be doing a lot of work just getting the index of the array element you want to write.  Can you not just use nested for loops.  In the example I have replaced your 'measuring from spectrum' with a random number generator to demonstrate the principle.  Attached is a snippet (labVIEW 2015 - sorry dont have LabVIEW 2012 on my PC)

0 Kudos
Message 2 of 4

Thanks Ken_Naylor for your quick response


I can’t do that due to the spectrum analyser is working in sync with another piece of equipment (called the spindor). It’s an automated turntable that is being fed a lot of strings, and then at each string (or rotation of the turntable) a measurement is taken.

If I were to do nested loops around the spectrum analyser then it just repeats taken measurements without sending them to the array as well as no turning of the turntable.

However I gave it a try but it didn’t work (if in fact I did it right?).


0 Kudos
Message 3 of 4
Accepted by topic author zandrous

Prebuild the array outside the loop, and just divide the loop iteration by the number of columns, and use the quotient and remainder to index the array.

Message 4 of 4