LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to read in an ascii file and output it onto a waveform graph...

shan,
i came across your post + file and tested it out.
it reads the file that i give it but nothing happens to the "Data Array" section of you VI.

is that how it's suppose to work?
just trying to find a solution to a problem i'm having
thanks
-r
0 Kudos
Message 11 of 31
(1,763 Views)

Hi,

I'm trying to read in a text file that has the first row for x and the second row for y. The text file is attached to this thread. I'm not suppose to read it by column. I need to read it by row for each element an x and a y. After it reads the text file and plots the data on Lab View, I want to list the numbers on a table that can be shown on the front panel once it is implemented.

0 Kudos
Message 12 of 31
(1,402 Views)
What exactly have you tried and where are you having problems? The Read From Spreadsheet function will work just fine on your file. You would then use an Index Array function to get the rows, bundle the arrays and plot with an XY Graph.
0 Kudos
Message 13 of 31
(1,377 Views)
I have tried something that will work. I have also obtained two plots. One that is linear and the other a cubic graph. I will atch the VI that i have created. It is called a text to file VI. Please let me know if you can fix the poblem. I want to only plot the cubic graph for the x and y values and whenever I run the file that has been read it gives me two plots. Once I have finished reading the file and plotting only one graph, I want to list the numbers in a table on the front panel.
 
Thanks
Fidaali
0 Kudos
Message 14 of 31
(1,371 Views)

Here's a modification that will display the data in a table. I also simplified the Index Array.

I don't know what you mean by 'cubic graph' and whenever I run the VI, I only get a single plot. If you are getting two different plots, is this with the same data file that you posted earlier? Attach an image of the graph with two plots.

0 Kudos
Message 15 of 31
(1,367 Views)

I'm actually getting two plots on my graph. Using the same data file that I have posted earlier, I'm getting two plots on one xy coordinate. I'm sorry I wasn't specific before. The x axis goes from one through five. The y axis computes the cube of the x axis. So, if x is three then the cube of three is 27. I will go ahead and attach the two plots to this message. The attachment is in Corel Paint Shop Photo Pro Photo X2. I'm also attaching the one that you modified earlier. Thanks once again.

Can you briefly explain me how the file is being read. In what direction is it reading the file from the text?

 

Download All
0 Kudos
Message 16 of 31
(1,356 Views)
I think that when I downloaded the text file and then looked at it, I did something to the original. After re-downloading, I see the same thing. It looks like after each row, there is an extra tab at the end of the line. Because of this, you get a an extra xy pair of data at 0,0. It's not an extra plot, it's a single plot with the last data point connecting to 0,0. After doing the Read From Spreadsheet, do a Delete From Array and remove column 5. You can see the extra column yourself if you open the Read From Spreadsheet and run it by itself.


Message Edited by Dennis Knutson on 06-08-2008 06:27 PM
0 Kudos
Message 17 of 31
(1,353 Views)
I didn't understand the last two sentences. Can you clarify the last two sentences and also can you briefly explain how the data is being read from the data file. Is it one row and then the other row or is it reading it from the first column and then the second and etc.
0 Kudos
Message 18 of 31
(1,338 Views)

Okay, in your data file and on each row, there is a tab after the last value and then a line terminator. Read From Spreadsheet in it's default setup, uses a tab character as a delimiter. It reads the row, sees that last tab and assumes there is data there. It creates an element in the output and even though there is no actual data, you have to have something in the array and it defaults to 0. Just open the Read From Spreadsheet and run it. You will see that in column 5 of the output array, a 0 in each row.

The Read From Spreadsheet reads row by row.

0 Kudos
Message 19 of 31
(1,332 Views)
Do you know where is the point 0,0 is coming from because I don't see that on the data file.
0 Kudos
Message 20 of 31
(1,313 Views)