LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems creating a 2D array in a loop.

Hi!I already read the questions asked regarding creating a 2D array in a loop and tried the suggestions but still mine doesn't work. When i index the row to a particular number it writes all the subarrays to it but when i connect the row index to the iteration number it gives me empty array. I need to get each subaray in each row. Kindly help cos i have tried all...insert array, replace array...nothing seems to work for me....any ideas i'll be greatly glad! i ahve attached the vi. And one more question....how do i scan and write the X axis too to the excel sheet.
0 Kudos
Message 1 of 5
(3,077 Views)
I can't read your file because I have not upgraded from LabVIEW 6.1. However, you should be able to solve your problem by simply initializing a shift register with an empty 2D array and using the build array function to add the 1D array to the 2D array on each iteration of the loop.

I can't answer the second portion of your question without more information or being able to see the vi myself.

Hope this helps.

John
0 Kudos
Message 2 of 5
(3,077 Views)
Hey John,

Thanks ton!!! it worked with the shift register. The second part...well i am using the Cont Acq to spreadsheet file vi from the examples.....i find that the X axis on the chart doesn't get stored in the excel. I need to send that too in excel. Is there a way to do that. Hope this gives u a better picture of my problem.....thanks!
0 Kudos
Message 3 of 5
(3,077 Views)
I'm not familiar with that vi. I always obtain all of my data, format it into the appropriate columns, and then write it to the spreadsheet file using either the "Write to Spreadsheet file" or the "Write characters to file" function. The "Write to Spreadsheet file" function is easier to use but doesn't allow you to included header information, etc.

John
0 Kudos
Message 4 of 5
(3,076 Views)
You can modify the VI in a couple of ways. Your scan rate is the x axis and it is written to the first line of the file. You can skip this and create an array of times and append it to the array of Y values. You could also change the output of AI Read to be of Waveform data type and use Export Waveforms to Spreadsheet File.
0 Kudos
Message 5 of 5
(3,076 Views)