Nh K
Nh K

Reputation: 13

Writing Waveform data into CSV file in LabVIEW

I have a LabVIEW program which contains voltage, current and power data into the same waveform. I am planning to extract each of them one by one and putting into array. Currently, I have extracted only the voltage waveform and converted the data into a CSV file.

However, the problem is that the time stamp (dt) and the y value are in the same cell of the CSV file which requires to post process in excel to get tab delimited format. I would like to get the end result without post processing.

Can anyone help me to correct the code with delimiter?

LabVIEW Program for single parameter writing into CSV file

CSV file

Moreover, If I want to add two more data (Current and power), how can I append them into another two columns in the CSV file and synchronize with the relative time (dt)?

Upvotes: 1

Views: 405

Answers (1)

Yair
Yair

Reputation: 2276

The VI you're using uses a tab as the delimiter by default. Excel expects a CSV file to be comma-delimited, as suggested by its name. Use a comma as the delimiter.

If you want to add more columns to the file, you need to make your Build Array primitive bigger.

Your code has some other issues too (such as a race condition between writing to the terminal and reading the local variable and overwriting the value in the terminal with each iteration of the outer for loop. If you have multiple waveforms and you want to write them to the same file, you might want to wire the 2D array out of the loop and set the tunnel to concatenate).

Upvotes: 1

Related Questions