DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I copy the name of a file, that I selected by a click?

Solved!
Go to solution

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

0 Kudos
Message 1 of 4
(3,852 Views)

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

0 Kudos
Message 2 of 4
(3,847 Views)

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.

0 Kudos
Message 3 of 4
(3,829 Views)
Solution
Accepted by topic author Marse

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.

0 Kudos
Message 4 of 4
(3,828 Views)