12-09-2008 06:00 AM
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
12-09-2008 09:22 AM
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.
12-09-2008 09:28 AM
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
12-09-2008 09:56 AM
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.
12-09-2008 10:07 AM
12-09-2008 10:13 AM
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
12-09-2008 10:14 AM
12-09-2008 10:20 AM
And I do have Report generation toolkit licensed as well..
Thank you for helping me..
Vedran
12-09-2008 10:29 AM
12-09-2008 10:58 AM
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.