01-08-2014 11:41 AM
Hi, I am new to this forum and am looking for some advice on a worksheet I'm trying to construct. I have an Excel spreadsheet that is basically a 2D array, and I want to use Dasylab v12 Pro to be able to import a value from this array based on user selections from within the Dasylab worksheet.
Column A lists 200+ diesel engine models. I've shown 9 in my Excel attachment...one model per row (shaded in yellow), and each engine model can be run at several speeds (shaded green in columns B thru F). For an engine in a given row, combined with a chosen operating speed gives you a corresponding horsepower (blue shading).
I have this Excel sheet saved somewhere on my C:/ drive, and what I want to do is when the user starts the Dasylab worksheet he will select from a drop drown menu to choose the engine model (ie A, B, C, etc) and another drop down menu to choose the speed (ie 1470, 1760, etc). I know that I can make a drop down menu with a Coded Switch within Dasylab, however it seems only 16 choices can be made from each switch, so for my 200 engine models I will need 13 switches! I know I can assign a text description like "Engine A" to a numerical value within that coded switch. Somehow I need to take those two selections made within the Dasylab experiment, and read this Excel file (ie my database of all of these 200 diesel engine models) as a 2 dimensional array by row and column to spit out the data value (the blue numbers) back into Dasylab.
The goal is to take the engine model, speed, and the horsepower obtained from the array search and write these to an .asc file that I will create a running log of this data. So, after the test page is run 50 times it will have 50 rows of data containing these 3 parameters. There is some other test data taken from my data acquisition that goes along with this, however that's not part of my 2D array predicament.
I'm taking a guess that I need to do something with global strings & variables, and some how import them and export them with an ODBC in/out module. This is something I've just never worked with before so I am a bit lost. Obviously I can just make the user type in the engine model and speed as a startup parameter at the start of the test and save that to a variable or string, but I want to make it idiot proof so that the two selections (ie row and column) can be chosen from a pre-set list and will yield my data value. Everything else related to Dasylab I am pretty proficient with.
Thanks,
Mike
01-08-2014 12:40 PM
The fastest way would be to create a macro in Excel for the user entry and then save the complete result in a INI file that will be read by DASYLab when it start.
I am assuming you will be using DASYLab to run some kind of data acquisition right?
01-08-2014 01:22 PM
I didn't think of doing it that way. I just tried a simple ASCII file with these same column headings and importing that thru a Dasylab Read Data module, which I think does the same thing I want to do. It workd as I transfered it to a Digial Meter module just to make sure it worked. I'll end up sending this to a Write Data module to the log file I'm making.
Now I just need to write an Excel macro, but I'll look elsewhere for that.
thanks for your help,
Mike
01-08-2014 01:32 PM
This would be the best way.
Also, with version 13 they started using Phyton to create custom modules that can be programmed in DASYLab.
We arte learning this right now and I know that you can use standard message dialogs with that as well.
I would suggest to you to download a demo of V13 and take a look at the Pyton module.
Also, usually DASYLab system intgretors like us, can provide services also on things like this including Excel programming for pre and post analisys