LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot graph from a text file

Hi,

I am trying to plot a graph from a text file, which has three columns of data in number(Can I add the timestamp as the x-axes in the first column so I have four columns in total?).

What's the easiest way to do this and what is the maximum number of points I can plot on a waveform graph?

Thanks.


hellolv

0 Kudos
Message 1 of 4
(5,342 Views)
You could read your text file and use the 'spreadsheet string to array' function to convert you string data to a numeric array and plot it on the graph
 
In examples shipped with LabVIEW, Find examples>> Fundamentals>> File input and output folder, you will find 2 vi's 'write to text file.vi' and 'read from text file.vi', which demonstrates what you are asking for
 
Regards,
Dev
0 Kudos
Message 2 of 4
(5,319 Views)

Hello I am trying to generate a plot from a string array that has been saved as a text file. I tried to use the read from text file tool then string to array but it didn't work, then I used the scan from string function but I don't know how to format the string to get as output the values I need that are the first and third column. I am new to labview and I was wondering if somebody can lend me a hand. Attached text file. 

0 Kudos
Message 3 of 4
(4,965 Views)

You would have been better off starting a new thread for your question rather than tacking onto a 3+-year old thread.

 

I am assuming you're trying to convert the first column to a timestamp? There's a variety of ways to read the file. One simple way to do it is to use the Read From Spreadsheet File to read it in the whole thing and then just chop off the "header" lines. You can then parse out the lines as needed. See attached example (LV 8.2). In this example I convert the first column into a timestamp. You can view the online help for the Scan From String to see the codes that are used to scan the text into a timestamp. The XY Graph is configured to display the X axis as absolute time.

0 Kudos
Message 4 of 4
(4,953 Views)