07-13-2020 10:46 AM
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:
I must to see them in one/two columns, I can do this only with amplitude... How to do this for time too?
Below You can see my program in which I try to do it but unsuccessful...
Is there a simple way to do this, please help.
Thank You for your help,
Mateusz.
07-13-2020 11:29 AM
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).
07-13-2020 11:46 AM
Yes there is block called 'Export to Spreadsheet File' but then I see this:
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)
07-13-2020 12:11 PM
Save your code in 2017 and share it, and you will get more help.
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.
07-13-2020 12:12 PM
@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?
07-13-2020 12:30 PM
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)
07-13-2020 12:54 PM
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.
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.
07-13-2020 01:05 PM - edited 07-13-2020 01:06 PM
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.
07-13-2020 02:28 PM
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?:
+ How to do the inverse process then? how to make waveform from this saved .csv string file and show it on the same graph?
07-13-2020 03:08 PM
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.