10-30-2008 03:50 AM
Hi,
I have a device controled by a Excell (VBA) interface. Truogh this interface I control the motors and Diadem (for the report) and the data are save in a database. When I use the load button from the excell, the VBA application call the script from Diadem Load_DATA_BOF.VBS, (after I complete the new data for the report), and make the report. Now to make it work, I copy the name of the filename that I want to load in a TextBox, and all the data are store in a txt file( protocol_for_load.txt) and Diadem takes from there the data for the report.
What I want to do is to fill automatic the field of the filename in the protocol_for_load.txt, when I select the file in Diadem.
Can this be done?
Thank you for your time
Solved! Go to Solution.
10-30-2008 08:49 AM
Hi Marse,
Please describe more clearly the type of interaction that will take place in DIAdem. You mention that a channel will be selected. Will this happen in a DIAdem file dialog? Will this happen in the NAVIGATOR tree view? Will this happen in the Data Portal? All are possible, but what do you want exactly? Do you perhaps mean something completely different?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-31-2008 08:49 AM
Hi Brad,
I find out how to copy the name of a selected file ( with filedlgfile) and now I want to open the text file ( with the name the same like the file loaded) so I can read the data from inside, but the command textfileopen from the script can't support a variable in the description, I thing.
Fno = textfileopen ( filenametxt, tfread)
Please look in to my script to understand better.
I need to open the txt file with the name the same like the file loaded, to take the data and fill the report. This I need to do in Diadem Script, because I will call the script trough a VBA interface.
Sorry for not being more clearly first time, but I am a beginner in working with VBS.
10-31-2008 09:22 AM
Hi again,
I solve my self the problem.
filenameprotocol=filedlgfile
filenametxt = "D:\BOF-MIU\Scripts\Protocol files\"& filenameprotocol& ".txt"
Fno = textfileopen(filenametxt, tfread)
I forgot to pute some symbols : " and \ .
I told you I am new with VBS and I have some problems with the base stuff: how to include a variable, a function, and I forgot some time to put all the signs to the script.
Thank you for your time.