09-18-2010 10:06 AM
Hi,
I have a text file filled up with data like this
...
-0.027762___0.020000
-0.031100___0.040000
-0.028828___0.060000
-0.031166___0.080000
...
I would like to line-by-line strip the unnecessary data away after the first number. I would like to display this updated set of data in a graph in a way that the X scale would show the relative time with 20 ms resolution. I thought of a solution similar to the attached picture but it is for charts. I need to display it in graphs as I want to include cursors as well later on.
Does somebody have an idea how to get rid of the unnecessary data efficiently and how to display the updated data in a relative timed X scale?
Thanks,
Krivan
Solved! Go to Solution.
09-18-2010 10:13 AM
A graph has the same offset and multiplier properties. Or you can simply create a waveform datatype with the Build Waveform function (Waveform palette).
09-18-2010 02:02 PM
Hi,
like the attached VI shows I tried to "clean" the data file using the match pattern and then save the modified data into another text file. I tried furthermore to set up a graph to show the modified data with time information [step in every 20 ms].
It somehow doesn't work for me but don't see why. Can you please advise what I'm doing wrong.
Thanks,
Krivan
09-18-2010 02:53 PM
Well, everything is wrong. Don't do a read with every iteration. Use the Read From Spreadsheet function once with the delimeter thats in the file. Wire up the property node correctly. Converting the floating point numbers to integers is very wrong unless you want to plot all zeroes.
The attached VI will display the entire file at once. If that's not what you want, it's a simple modification. Have you taken the basic LabVIEW tutorial?
No clue as to what your idea of 'cleaned' is.
09-18-2010 03:00 PM
Here is the modified version. Only the first line of the raw data file is read and written into the other file, the data isn't opened on the graph. Any ideas?
Thanks.
09-18-2010 03:03 PM
Hi,
I'll have a look to your VI shortly, I haven't seen your post before I posted mine. The 'cleaned' was supposed to be the modified data where the not necessary information has been stripped away.
So if raw data is for example 0.4877459___0.20000 then the 'cleaned' is 0.4877459 because ___0.20000 has been removed from the string.
09-18-2010 03:09 PM
Hi Dennis,
thanks for the advices and your help, that's exactly what required.