LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to input data from Excel in a Labview table?

Hello!

I am looking for a solution to input data from excel to a table in Labview OR how can I use copy and paste to insert data in a Labview table. Can it be done?

For example - I'm trying to input some data (let's say I have 3 variables a, b, and c) and do some calculations; the output are other values, let's say x, y, z. I would like to have the input from a table and the output should result in a table also. I can further send the output table to excel and I believe Labview has a good example about this. However, Labview does not have any example on how to INPUT a table from excel. Or, let'say you do some calculations in excel and you have a table of 100 lines and 3 columns (a, b, c). It would be annoyng and time consuming to input value by value in an Labview array or table all the cells. Apparently copy and paste does not work for Labview arrays and tables. Or, am I wrong; what would be a good solution to enter more data at one time?

Any examples would be greatly appreciated.

Thank you.
0 Kudos
Message 1 of 18
(6,671 Views)
Hello,

A solution I think is easy is to save the excell sheet as a text file (csv of tab separating values) and then use the function Read From Spreadsheet File in LabVIEW to read the data.

Hop this helps,
Paulo
Message 2 of 18
(6,670 Views)
Thank you Paulo. This sounds like a decent solution.

I am still looking for a solution to copy and paste data from excel or other similar software (for example Minitab) to a table (or whatever) in Labview.
0 Kudos
Message 3 of 18
(6,666 Views)
You can use ActiveX methods to get data directly from Excel into LV, but it won't be as simple as reading from the tab delimited text file. Search the example finder (Help>>Find Examples) for Excel and you will find examples for talking to Excel.

___________________
Try to take over the world!
Message 4 of 18
(6,660 Views)
Thank you.

I find extremely annoying the fact that you cannot really copy and paste data (numbers) in a table or array.
I know nothing about ActiveX but I will look into it.

Does anybody knows what can I use to acess database files and extract data that I can further use in calculations? Any examples?
0 Kudos
Message 5 of 18
(6,655 Views)
RPJ,

I found this someplace and it works for me.

Mike
Message 6 of 18
(6,640 Views)
Mike,

Thank you. The example is excellent.
However, for some files works for other doesn't work (nothing is displayed). Nevertheless it could be useful for what I am trying to do.

Thanks again.
Radu
0 Kudos
Message 7 of 18
(6,634 Views)
Radu,

In the "For loop", be sure the SheetName matches the name of the sheet you want to read from the Excel file.

In the "input cluster" is where you set the StartRow, StartColumn, EndRow, and EndColumn of the sheet you want to read. (Cell A1 = 0,0).

Mike
0 Kudos
Message 8 of 18
(6,628 Views)
Mike,

I followed your advice. The same thing happens.
It appears this is happening only for the excel files that have more than 1 worksheets. Apparently the vi can read only one spreadsheet in a file. What is even more intriguing is that even if I close the application and excel, if I restart the application and or excel and try to reopen the file a message tells me that the file is already ove and if I want to overwrite...
It would be neat to make the read-excel-file vi identify the other spreadsheets also and ask you which one you want to read. I believe this would imply adding in the input cluster one more case for spreadsheet but I'm not shure what the other connections will look like. Any way, before doing anything else I'll have to restart my computer to close those background running excel files 🙂
0 Kudos
Message 9 of 18
(6,629 Views)
Here is a small utility that can be used to copy and paste between a table and Excel.
I have been obliged to slice the llb into small chuncks for internet technical issues. Sorry...


CC

Message Edited by chilly charly on 04-02-2005 03:21 PM

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Download All
Message 10 of 18
(6,616 Views)