LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting waveform to CSV automatically

Hi,

I want to export waveform containing multiple channels from OSC (SS attached) to a CSV file. One option is to use invoke node export data to excel but then we have to  save file manually to specific location. I want to export automatically into CSV file by given path, I have tried one method which is making a for loop and unbundle by name and then export waveform to spreadsheet (as seen in SS) but it is not working as data is too much and sometimes code stuck on this VI.

What can be other possibilities to make it happen automatically and conveniently.  Please note it is not a 1D or 2D waveform, It is a 1D array of cluster of 3 elements.

 

Faizan_habib_1-1761667561585.png

Thanks

 

0 Kudos
Message 1 of 6
(341 Views)

You don't need to save the X increment nor the initial x everytime from the cluster. You can just extract the 2D of data and save using a write to spreadhseet, using comma as separator and ensuring that append to file is set to true. 

LVNinja_0-1761671765426.png

If you are having performance issues, then you can create the file and open the file outside the loop and then write data inside the  loop and close it afterwards. 

LVNinja_1-1761671960767.png

 

 

 

 

Message 2 of 6
(314 Views)

A cluster of three special elements (t0, dt, 1D or 2D array) is a "legacy waveform" (before the waveform datatype was introduced) that e.g. waveform graphs understand directly.

 

First you need to decide how to export to a csv file. Most often, you would create a time array (based on t0, dt, N) and place that in the first column, with the data in the second column, but there are many other possible ways.

 

So first decide how you want it saved and let's go from there. 😄

Message 3 of 6
(297 Views)

Thanks for replying. So, if you export a "legacy Waveform" manually you get the headers in First row "Time Channel 1, "Amplitude Channel 1", "Time Channel 2", "Amplitude Channel 2" like that. So, I  would like to export in a same way. The method I used did in the same way but it works once in a 10th time and sometime data is too big that I cannot open CSV file. 


0 Kudos
Message 4 of 6
(267 Views)

@Faizan_habib wrote:

Thanks for replying. So, if you export a "legacy Waveform" manually you get the headers in First row "Time Channel 1, "Amplitude Channel 1", "Time Channel 2", "Amplitude Channel 2" like that. So, I  would like to export in a same way. The method I used did in the same way but it works once in a 10th time and sometime data is too big that I cannot open CSV file. 


If you export it manually, you can arrange the information any way you want.

Unfortunately, you did not show what you did, so we cannot comment.

 

The capability to open a CSV file rests with the application you use. If you use LabVIEW to read it back in, the size does not matter. If you use certain other applications, they might have limits (e.g. Excel is limited to about a million rows),

 

For large datasets, CSV is a poor choice.

Message 5 of 6
(253 Views)

Hi,

Sorry for late reply, I  got busy with some higher priority work. So, I am still struggling to export "Legacy Waveform"  automatically to the desire path. My data is not too big just 13k to 25k rows normally. If you can provide me any example to export "Legacy waveform" would really help me. You can also see in the picture how i am trying to export it in my first message. 

Thanks 

0 Kudos
Message 6 of 6
(49 Views)