LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

make application to read from excel and give result after query form the same excel file

Hello everyone!

 

I am newcomer to LabView 8.6, with previous programming experience.

 

My problem is next:

 

I need to make a query for example one type of machinig, one parameter which need to be adressable (mapped) to specific value and bring report of that value in application. Those values are specified in excell table with various worksheets (each worksheet represent on type of machinig i.e. milling, drilling, etc.), every worksheet is pupulated with values like material in rows (tool steel, specific material) and columns with specific parameter of the machining. To make it short, query from application should be select material, select type of machinig and select parameter of specific previously selected machining and the output should be the speed (m/min) which is specified in the that very column and row.

 

I would highly appreciate any kind of help since i am new to LabView.

 

Thank you for your assistance in advance!

 

Regards,

 

Vedran Galeta

 

 

0 Kudos
Message 1 of 10
(3,628 Views)

There are a couple of way to do this.  One possibility would be to read in your work sheets to spreadsheet strings, then convert them to arrays.  You could then index the arrays by the column you want then search the 1D array then index your 2D array with the result to retreve the data you want.  This would involve having a lot of large arrays in memory though.

 

Another method (this is what I would do) would be to get all that information into a database rather than an Excel workshee and then use LabVIEWs dababase tools and just use SQL queries.  That way you can have the DB do most of the work for you and your code stays fairly simple and is a lot more memory efficient.

 

 

Gregory Osenbach
0 Kudos
Message 2 of 10
(3,609 Views)

Ok, I have an update.

 

I manage to deal with selection through case frame.

 

Now I want to use case selection to each worksheet in excel file i.e. milling = 1, 1 -> go to worksheet milling, second case would be some kind of material i.e. corrax = 14 and finally parameter i.e. depth of cut = 4. So based on the information "1" for sheet, "14" for row in the sheet and "4" column of the sheet i need to import that specific data in report based on the query for the material positioned on those let´s call them coordinates in excel file (xls).

 

So can you please give some guidance in order to accomplish that task?

 

Thank You for any help you can provide me.

 

Regards,

Vedran

0 Kudos
Message 3 of 10
(3,607 Views)

Do you have the report generation toolkit?  I believe that has some built in tools for doing what you are looking at.

 

Otherwise you will have to do it all manually.  This will involve using an automation open to get an reference to Excel then using a string of properity nodes to open the file/worksheet you want and then more properity nodes to read the cell you want as variants which will then need to be converted to numerics, strings, etc.

Gregory Osenbach
0 Kudos
Message 4 of 10
(3,600 Views)
Oh, what version of LabVIEW are you using?  They changed a LOT of thinkg to do with Excel and reports in 8.6
Gregory Osenbach
0 Kudos
Message 5 of 10
(3,599 Views)

Thanks gosenbach for your reply.

 

That was my idea as well (connect it through database), but since the company pulls relation through numerous xls to that top one I am forced to used through xls, at least for now unless I figure out how to connect that workbook to DB that LV can actually work with (i have to check all the options, I don't want to discuss without some background).

 

I´ll check back tomorrow with more information..

 

Thank you for help!

 

Regards,

 

Vedran

0 Kudos
Message 6 of 10
(3,597 Views)
I am using LabView 8.6 version..
0 Kudos
Message 7 of 10
(3,593 Views)

And I do have Report generation toolkit licensed as well..

 

Thank you for helping me..

 

Vedran

 

 

0 Kudos
Message 8 of 10
(3,588 Views)
There is the "Excel Get Worksheet" and the "Excel Get Data" that would do it for you.  However, the new report generation toolkit for 8.6 looks like it was redone to use LVOOP and I am not sure how to get the reference to an existing file with the stuff in the lvclass.  I was expecting to see an "Excel Open File" or "Open Report" somewhere but it does not seem to be there.  If we can get past that point, those two previously mentioned VIs should do exactly what you want them to do.
Gregory Osenbach
0 Kudos
Message 9 of 10
(3,585 Views)

It looks like to get the LVOOP object for your existing XLS file, you need to use "New Report.vi" and wire the path to your existing file into the "template" input.

 

LV Help:

"template (Report Generation Toolkit) specifies a path to a Word document or Excel worksheet that acts as a report template. Enter the path to an existing Word document or Excel worksheet to open and edit an existing report for a template. The VI ignores this input for HTML and standard reports."

 

I think the documentation on this vi could be worded a bit better.

 

 

Gregory Osenbach
0 Kudos
Message 10 of 10
(3,583 Views)