LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read a text file and display a xy graph

Solved!
Go to solution

Hi!

I am using LabVIEW 8.5, and I am trying to read columns from a file and plot with xy graph. I can do it with two channels, but I am having problems when the numbers of channels connected increase (maybe six or ten).

My text file looks like this:

[Where first column x = time, the rest of the columns are channels = y]

8.828        22.604        23.076            [The number of channels connected can change]

9.828        22.604        22.604

10.828      21.658        22.131

11.828      22.131        22.131

12.828      22.131        22.131

13.828      22.604        22.604

14.828      21.658        22.604

15.828      22.131        22.131

16.828      21.658        23.076

17.828      22.604        22.131

18.828      22.131        22.604

 

I attached a picture of what I already try… Now I am trying a combination of those. If anyone has some advice or suggestion, please let me know.

 

Sincerely,

Julieta.

0 Kudos
Message 1 of 9
(7,107 Views)
Solution
Accepted by topic author Julieta

Try the code below.

 

Message Edited by Dennis Knutson on 02-16-2010 02:18 PM
Message 2 of 9
(7,092 Views)

Thanks for the advice!... I just modified what I had a little bit and it is working, maybe is not the optimums solution…

 

I would like to make the time invisible in the graph… It that possible? I attached a picture of my graph, because my English is not good.  There are two lines near to 22 (two channels connected at that moment), and a line near to 0 which is time (the strong pink one).  I would like to make invisible the strong prink one only.  I try to make invisible, but I fail… I changed colors looking for another solution and I fail again, because it is taking the colors that I choose for the channels.  I can not disable because I need it to make the x axes works with the time that I already saved.  If someone has an advice or suggestion I really appreciate it…

 

Sincerely,

Julieta.

0 Kudos
Message 3 of 9
(6,998 Views)

Hi

 

Would you be able to post this VI?

I have something simliar to graph, the txt file has commas separating the x-y data

 

The txt file is of the format

 

+1.8803E+03, 2.8803E+3

+3.8803E+03, 3.8803E+3 

+4.8803E+03, 4.8803E+3

 

(I've included the first 3 data points there is 100 data points to graph)

 

I can manipulate the vi to accomodate what I'm doing

 

Thanks

     

0 Kudos
Message 4 of 9
(6,555 Views)

The VI is posted. It's a snippet.

0 Kudos
Message 5 of 9
(6,544 Views)

Didn't no that.Cheers for the reply.

0 Kudos
Message 6 of 9
(6,539 Views)

Hi

 

Excuse my grammar in last reply.That should be, I didn't know that about the snippets.Thank you again for the reply.

 

 

I do have an issue plotting my data and correcting the vi posted to suit my data

 

The data I have is stored in the format x,y,z as per line of the txt file, I need to plot column x against column y while ignoring z in the text file.

 

+1.8803E+03,+6.8327E+01,+1.4779E+02,0
+5.0000E+03,+7.5986E+01,+1.1293E+02,0
+4.0000E+03,+7.5986E+01,+1.1293E+02,0
+1.0000E+02,+5.8782E+01,-1.7695E+02,0

 

Any advice is appreciated.

 

Thank you

 

 

Download All
0 Kudos
Message 7 of 9
(6,528 Views)

In the Index Array function, wire the 0 into the Columns index, rather than the rows index.  (Likewise for the 1, but the 1 actually doesn't need to be wired at all since it is assumed to be the next column in sequence if you leave the input unwired.)

 

0 Kudos
Message 8 of 9
(6,520 Views)

Thank you for pointing out the error.

 

It works perfectly now.

0 Kudos
Message 9 of 9
(6,509 Views)