LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read and plot data from excel file

Hi all,

I have a excel file with data. How can I read the data from the excel file, choose the last 2 rows and plot it in a graph?

Please advice.

The excel data file is attached

Thanks


Message Edited by cheyne on 06-12-2008 08:50 AM
0 Kudos
Message 1 of 9
(5,085 Views)

Hi cheyne,

you can use the "read from spreadsheet file" function to read the file. Then index the array with the specified rows or columns and connect it to the graph.

Hope it helps.
Mike

0 Kudos
Message 2 of 9
(5,081 Views)
Your file is not an Excel spreadsheet. It's just a tab-delimited text file. An Excel spreadsheet is a different beast, and would require ActiveX to read. Since it's a text file you can use the VI that Mike mentioned.

For the graphing part, have you taken a look at the many examples that ship with LabVIEW? Help->Find Examples.

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.


Message Edited by smercurio_fc on 06-12-2008 09:13 AM
Message 3 of 9
(5,075 Views)
which function actually is used to create excel file?
0 Kudos
Message 4 of 9
(5,061 Views)
Hi cheyne,
if you want to create "real" excel files you have to use activex functions. There are lots of examples in the forum. You can also go to the excel board.
Mike
0 Kudos
Message 5 of 9
(5,059 Views)
Is your LabVIEW program generating the data, or is the data coming from someplace else? If the LabVIEW program is generating the data do you really need it to be an Excel file? The file you uploaded can be opened by Excel even though it's a tab-delimited text file. If the data is coming from someplace else then you need to look elsewhere.

The Excel thread is here.
Message 6 of 9
(5,056 Views)
My data is created through labview write to spreadsheet function. Is there such a similar function to create excel file? Spreadsheet and excel what is the main different?
0 Kudos
Message 7 of 9
(5,051 Views)
The Write to Spreadsheet File VI creates a tab-delimited text file that is in a spreadsheet-like format. This means you have columns and rows. Columns are separated by tabs. Rows are separated by the end-of-line character(s). That's it. It's not the same as an Excel file. There is no similar function for creating an Excel file. There are the report VIs, but those are different, and you need to buy the toolkit in order to get Excel functionality. If you absolutely have to have an Excel file (and I still don't see why), you have to use ActiveX in order to automate Excel. This also means that you have to have Excel installed on your computer.

There are numerous examples over in the Excel board for using ActiveX with LabVIEW to automate Excel. There's also a few examples that ship with LabVIEW. Open the Example Finder (Help -> Find Examples) and search for "excel". Open the example called "Write Table to XL".


Message Edited by smercurio_fc on 06-12-2008 10:03 AM
0 Kudos
Message 8 of 9
(5,047 Views)
For more information and some sample VI's and tool kits, you can go to the excel board



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 9 of 9
(5,038 Views)