LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving to .csv file

Hi,

 

I need a help with saving my waveform to .csv file.

The problem is that I can save my waveform in easy way to .csv file but then I see all my data (time and amplitude) in only one line in excel:

Matipa_1-1594654926099.png

I must to see them in one/two columns, I can do this only with amplitude... How to do this for time too?

Matipa_0-1594654839816.png

Below You can see my program in which I try to do it but unsuccessful...

image.png

Is there a simple way to do this, please help.

 

Thank You for your help,

Mateusz.

0 Kudos
Message 1 of 14
(2,282 Views)

There is a Save Waveform To Text File.vi or something similarly named hiding in the Waveform palette (I don't have access to LabVIEW at the moment to verify the exact name and location).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 14
(2,261 Views)

Yes there is block called 'Export to Spreadsheet File' but then I see this:

1.png

I can't create time and amplitude labels above the data + the entire date is visible (I want to see only X and Y value of the waveform for example: 0,10;-0,184)

 

0 Kudos
Message 3 of 14
(2,247 Views)

Save your code in 2017 and share it, and you will get more help.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 4 of 14
(2,233 Views)

@Matipa wrote:

(I want to see only X and Y value of the waveform for example: 0,10;-0,184)


So based on how you are writing your values here, you are in a part of the world where the comma is used as a decimal separator.  So don't use a csv since you, by definitions, will have a duplicate definition of the comma.  So I recommend you use a tab as the separator and save your data as a txt file.  Excel will still interpret those just fine.

 

And where is the X value coming from?  Is that supposed to be your timestamp?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 14
(2,230 Views)

My idea was to: insert into array t0 and then in the next places c=t0+dt, c+dt, c+2dt et cetera (this should be values of X)

0 Kudos
Message 6 of 14
(2,219 Views)

Ever heard of the phrase, "Don't reinvent the wheel"? There is a VI called Get Waveform Time Array.vi that will get you the array of timestamps from the waveform. 

 

Do you have the Report Generation Toolkit? That might be something to try, to save you a step. I agree with crossrulz though, CSV file wouldn't work too well if comma is your delimiter.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 7 of 14
(2,206 Views)

Here's what I recommend.  Use a FOR loop to format each line of your file.  In this case, I have the date/time stamp, a tab, and then the data point.  Then you can use Build Array to add your header to the front and then Write Text File to write the data.  You could add optimization to the VI by computing the timestamps inside of the FOR loop instead of using the Get Timestamp Array VI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 14
(2,201 Views)

Okay, I made this like You said. Can You tell me is there any possibility to save .csv file without all date format? I mean without this (and past there for example 0) or it is necessary to read from this file?:

 

Matipa_0-1594668388518.png

 

+ How to do the inverse process then? how to make waveform from this saved .csv string file and show it on the same graph?

 

0 Kudos
Message 9 of 14
(2,187 Views)

Without timestamp data, how are you supposed to know the time intervals between data points?  Either you should have a timestamp for every entry or you should describe the time interval in the file somewhere, or no one will know what the graph is supposed to represent.

 

I go with a timestamp for every row.  It would be a lot easier to graph.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 14
(2,170 Views)