LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert data into an array

Solved!
Go to solution

Hi altenbach,

 

Thanks for your all suggestions. I'm a newbie to labview less than (2 weeks). I hope the vi file will be more optimized when i learn the programs capabilites and functions. Since i don't know programs capabilities and thinking labview based(mostly trying to implement code based solution) my programs and algorithms are bad. I aim to make them good(at least "meh")

 

About handling the excel file, i have a few questions if you dont mind.

 

My project is to get oscilloscope graph data and some values of the signal(like amplitude, frequency etc.) I get the data and save on excel, i can get the values and save on excel(thanks to everyone). 

 

Form is like this

Person name: 

Test number:

 

Data   Freq   Duty  Amplitude

data1   5          20            10 

data2   5          19            10

data3   5          19            10

datan   5          21            10

 

The problem is, oscilloscope sends me the data in an array. So each loop i get 100 data value but 1 freq, 1 amplitude 1 duty.

 

What i need is to tell data "write to coloumn A" and the other datas to write to coloumn "B,C,D" 

Data needs another info because it has to write coloumn A and remember last row.

 

What does refnum send to file? can i edit it? can i say, write this part only to specific coloumn and write other datas to other coloumns?

 

Sorry for my English also.

 

Thank you so much! 

0 Kudos
Message 11 of 13
(396 Views)

With regards to a "header" (Person Name, Test number), you should write this into the file after you open it but before the While loop.

 

With regards to 1,1,1,N samples, if your desired output is 

 

A B C D1

A B C D2

A B C D3

...

E F G D101

E F G D102

...

 

then you can use Initialize Array to create arrays of the same value with length 100 (or as needed, you could use array size if the number of "data" points might change) for each of A, B, and C, and then write the 2D array to spreadsheet string and then file.

 

Example_VI.png

Note I used Transpose Array to get the spreadsheet the other way (time going down).


GCentral
0 Kudos
Message 12 of 13
(376 Views)

Wow, thats really complete answer. Thank you so much! 

 

There is a few block that i dont recognize but i will check them and learn what they do. Thanks again. That was a really really good answer and explanation. I will try this asap.

 

Have a nice day!

 

Best Wishes,

Doguhan

0 Kudos
Message 13 of 13
(370 Views)