02-25-2009 07:49 PM
Hello:
i lately just started a project which require mi to use labview.
but as a newbie.. i'm totally clueless ...
so will really appreciate any help given.
My project require mi to plot graphs.using data from notepad...
but the vi attached below can only read numbers .. but it can like differentiate the time and ADC column ..
meaning the graphs shud plot the value of Time on x axis and the value of ADC on Y axis.
but my vi can only read all the number and plot on the Y axis...
really appreciate any help given ..
below attact the .txt file n the vi
02-25-2009 08:29 PM
I don't have your subVI, so I don't know what it is doing.
You have an XY graph.
What you will need to do is read in the data a string at a time and use the Scan From String Function with the correct format code to turn it into a Time stamp and a Double numeric. Build those outputs into two separate arrays looping through the entire file.
When the file is done combine the two arrays into a cluster to feed to the XY graph.
02-25-2009 08:51 PM
Hi,
sorry i dun really understand ..
cos i was just given a LV8.2 student handbook this monday..
and was instructed by my teacher , that it had to be completed by 2weeks time ..
so i was really lost and dun nod how to do it ..
is there anyother way out ?
like a simpler design?
but really thanks for the help ..
02-25-2009 09:10 PM
Please post the extract numbers subVI that is missing. That way we can see what it is doing.
Also, please use complete words. dun cos nod aren't English words.
02-25-2009 09:14 PM
A much simpler method would be to use the Read From Spreadsheet function to get your file all at once. This will return a 2D array that you would use the Index Array function to get each column. The time column is converted with the To Time Stamp. Bundle as mentioned earlier and wire to an XY Graph.
I'd post an example but any code would be an entire solution and I don't think that would help you learn LabVIEW (and isn't that the purpose of this assignment?).
There are some free tutorials here.
02-25-2009 09:44 PM
hello,
thanks for the help given ..
but i cant find the example u post ..
sorry .. but where i can find the example ?sorry sorry ..
02-25-2009 09:51 PM
02-25-2009 10:10 PM
hello,
sorry about it.
i try to do a new vi..
but when i run the .txt .. nothing is being displayed ..
02-25-2009 10:36 PM - edited 02-25-2009 10:36 PM
Well. Your new data file now has a header row that your first data file did not have. Your data is delimited by multiple spaces, and the default delimiter for th Read Spreadsheet File function is a tab.
You are reading the first row of your data, twice. You need to read the first column, and the second column.
You want the Time data to go to the top of the cluster. The raw data to the bottom of the cluster.
Clean up your raw text file. And make changes to your VI like this.
02-25-2009 11:25 PM
You can use XY graph instead of the Waveform graph you've used.
Read the file and sepatate the points in two columns as elements of twoo arrays. Bundle that into a cluster, and pass to the XY Graph.
See the attached image for referenace.
Thanks.