LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading excel data that has two column one date and time and other columns data and plotting out

Currently came into this difficulty, would appreciate any help greatly


First i have attached a excel data file attached, the first column is date and the second is time, the other columns are data. What i want is to show this data as it is in excel into a table in my labview vi, i would also like to plot the data in a multi plot graph with the x axis as the time and date with respect to that recorded in the excel file ?



Thanks
Benjamin
0 Kudos
Message 1 of 11
(4,235 Views)


@martian wrote:
Currently came into this difficulty, would appreciate any help greatly


First i have attached a excel data file attached, the first column is date and the second is time, the other columns are data. What i want is to show this data as it is in excel into a table in my labview vi, i would also like to plot the data in a multi plot graph with the x axis as the time and date with respect to that recorded in the excel file ?



Thanks
Benjamin




Salutations,
Inside the File I/O button area there is a function called the "Read From Spreadsheet File.vi", utilizing it should solve any problems. Note: as far as I know, reading an xls file is rather tricky, so save it as a csv or tab deliminated file etc... Just make sure on the "Read From Spreadsheet File.vi" you select the correct deliminator. Also, you might want to change the default accuracy etc..

Best of wishes,
ElSmitho
0 Kudos
Message 2 of 11
(4,219 Views)
I agree with ElSmitho, but I have 2 remarks to make.

First, the read from spreadsheet VI only reads number. Since you have date and time, you will have to read strings. You can find instructions for modifying both the read and write VIs on their block diagrams. Open them by double clicking them. Then, make sure you saved the modified files to a different location.

Second, after you've done this, you will need to modify the strings into LV time. You can concatenate the strings and then use the method seen in the attached VI. Keep in mind that it isn't finished and that it may have some bugs. It's supposed to use the same codes used in LV's string conversions, but it's not finished.

Then, to plot it, look at the example called XY Graphs in the example finder (help menu). It shows how to create graphs with multiple plots. It's a bit tricky, so be sure to follow it to see exactly how it's done. You can change the graph's X scale into time by right clicking it, selecting Format & Precision and selecting Absolute Time.

To learn more, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here is one you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide.

___________________
Try to take over the world!
Message 3 of 11
(4,214 Views)
You can convert the date and time string to seconds in a rather straight forward maner. First parse the strings into numbers using the scan from string function, then feed a date time cluster. The rest of the work is mainly a play with array functions.
See the attached vi that presents a solution to your problem.

CC

Message Edited by chilly charly on 04-19-2005 05:22 AM

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 4 of 11
(4,196 Views)
Thanks for all the help, manage to read the data and plot the graphs, another thing i need to know is how can i plot multiple plots on the same graph.. and what about having multiple y axis for voltage, current and power factor plots resepctively ..
0 Kudos
Message 5 of 11
(4,178 Views)
You can use the Merge Signals function to bring in multiple plots to a chart. Then, if you want to use separate Y-axes with one X-axis, you can use a stacked plot by right-clicking the chart and selecting "Stack plots". I'm attaching a small example vi that shows what it looks like.

TylerS
0 Kudos
Message 6 of 11
(4,156 Views)
I'm a new user, and have searched, but am unable to find an answer. Martian said he was able to do it, but didn't say how.

I'm able to read an Excel file (saved as tab separated .txt) that has a single column of data, transpose it and feed it into an array. How do you go about reading multiple colums? What do you feed it into, and how do you get the different columns of data into different arrays?

Thanks,
Blair
0 Kudos
Message 7 of 11
(4,147 Views)
Thanks alot , um but can you do me a favour, i cannot open your file because i am using labview 7 only, can i have one in labview 7. Really really appreciated
0 Kudos
Message 8 of 11
(4,136 Views)
This may not work because of some of the express functions I am using, but I did save it for version 7.0 and here it is!
0 Kudos
Message 9 of 11
(3,854 Views)
Hi, i'm a new member and a new user of labWindows CVI, and i have a little problem with ploting data...

Well, i need to plot a speed graph, with X axis in format Date (hour:Minute:Second)

My graph is like this:

[URL=http://www.imageshack.us]Free Image Hosting[/URL]

and i want it to be like this:

[URL=http://www.imageshack.us]Free Image Hosting[/URL]

I have an array which contains Hour,minute,second for every value of speed


Please, can you give me an idea to doing that?

Thanks,

Amine
0 Kudos
Message 10 of 11
(4,036 Views)