LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from spreadsheet and plot multiple XY graph

Solved!
Go to solution

 

I'm trying to read a text file using the "Read from Spreadsheet" function. Next I want to plot the data in it on a single XY Graph.

 

The text file contains 4 coloums and the first coloumn is X axis and rest are for Y axis. I'm not able to get the multiple plots. 

 

However, I could get it to plot when only a single graph is to be plotted(only 2 coloumn in file). I've attached my VI and a picture here.

Screen Shot 2012-04-25 at 10.55.36 AM.png

 

I need help in plotting multiple XY graph from the text file with the 4 coloumns.

 

 

0 Kudos
Message 1 of 14
(11,452 Views)
Solution
Accepted by topic author Bachna

Hi Bachna,

  You need to build an array of clusters to get multiple plots on an xy graph.You have created one cluster for one plot.Again you try to build an array similar clusters to get multiple plots.

 

Regards,

SrikrishnaNF

Regards,
Srikrishna


Message 2 of 14
(11,446 Views)

Thanks a lot SrikrishnaNF! You saved the day for me, it works perfectly now! Here's a picture of the VI.

Screen Shot 2012-04-25 at 11.57.52 AM.png

0 Kudos
Message 3 of 14
(11,441 Views)

I have search the NI forum for 2 days tring to find a good spreadsheet to graph solution.

This is by far the best & simplest.

 

P.S.This should be a Sticky on this forum 

0 Kudos
Message 4 of 14
(10,175 Views)

Here's a more scalable solution, useful if you have one x and many y columns.

 

 

Download All
Message 5 of 14
(10,162 Views)

Thanks altenbach

For your input which would bo very useful for future projects if I need to have so flexablity, for this one I only needed 1X & 2Y.

What really helped me was how simple it was to use when graphing a Labview saved Time Stamp for X w/ just a Read From Spreadsheet File to Transpose 2D Array to Index Array to Bundle to Build Array to graph .

So many others did not work for what I needed.

Again Thanks Everyone

0 Kudos
Message 6 of 14
(10,082 Views)

Also see if you like this old idea. 😄

Message 7 of 14
(10,072 Views)

Hi there, 

 

 

I have somthing similar but somehow the VI only reads the first row. it doesnt read the other rows. Not sure what went wrong there. 

 

been cracking my head for a few days now. anyone can tell me what is wrong here?

I have attached both my text file and VI. 

 

 

Download All
0 Kudos
Message 8 of 14
(9,876 Views)

By default, it expects a tab character as delimiter, but your file does not contain a single one! Thus it read each line as a single value and stops reading once a number is read. You get all numbers if you wire a space as delimiter, but there are some zeroes in-between.

 

Your file is very dirty, with multiple spaces and sometimes commas between values. Where does it come from? Maybe you should first fix the program that generates the data.

 

Else you might want to read it as plain string, remove the unwanted characters, and then use spreadsheet string to array to parse it.

 

DId you know that index array is resizeable?

0 Kudos
Message 9 of 14
(9,871 Views)

Using this VI, my graph plots a line from the last data point, back to zero. I want to remove that line, making it end at the last data poin. Attached is a pic of the graph.

Download All
0 Kudos
Message 10 of 14
(8,885 Views)