LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output oscilloscope data to a CSV file

I'm working with the VI from a Hantek DSO-2150 USB oscilloscope. LabVIEW shows the data in a graph but I'd like to output the results to a CSV file. I think the "Write to measurement file" control would be of use but I'm not sure how to use it. Would someone please help a newbie?

 

Thanks!

0 Kudos
Message 1 of 8
(7,475 Views)

I did not see File I/O happen anywhere. Have you given it a shot at all? For your case, I would recommend using the Write to Spreadsheet File node.

 

Also, have a look at Fundamentals -> File Input and Output in the Example Finder (Help -> Find Examples) to look at some examples.

 

And, I would recommend that you change your architecture. Using Flat Sequence Structures is not the right way to program an application in LabVIEW. I would recommend you have a look at the State Machine Design Pattern (File -> New..) and consider that architecture so it can help you avoid issues in the future as your application grows larger.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 8
(7,465 Views)
Thank you for the advice! I've modifed it as attached below with a write to measurement file. It seems to be working! Could you suggest any improvements?
0 Kudos
Message 3 of 8
(7,461 Views)
That looks good, only consider using the state machine architecture like I mentioned above.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 4 of 8
(7,459 Views)

Thanks Adnan, the state machine sounds like an excellent idea. I am working with an oscilloscope and their software is somewhat lacking. One problem now is it takes 30,000 samples, writes it to file, and then takes 30,000 again. Could this be a limitation of the scope? I'd like to have "seamless data logging".

 

Thanks again for all of your help!

0 Kudos
Message 5 of 8
(7,457 Views)
Not sure; you'd have to look at the documentation.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 6 of 8
(7,454 Views)
Ok thanks, once again I really appreciate your help!
0 Kudos
Message 7 of 8
(7,452 Views)

And just to answer your original question:
The 'write to spreadsheet file' has an input for 'delimeter'.

By default, the delimiter is 'tab' but you can wire a ',' and it will use a comma as a delimeter.

Then if you save the file as *.csv excel should be able to open it no problem.

Cory K
0 Kudos
Message 8 of 8
(7,445 Views)