From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically assigning scripts to Function keys

I currently have several custom scripts tied to the function keys in DIAdem 9.1.   I did this by manually mapping the scripts to the function keys using the scripts function bar and right clicking on the desired function key icon to set the default script.  I would like to be able to do this programatically. My intent is to create an automated way of setting up diadem to run my scripts.  I am working on a batch file that when run copies the required scripts to a default location and modifies the "ScriptDefault.vbs" file that Diadem uses on startup.  This works for adding my custom menu to diadem but now I need to add some legacy code that relies on pressing <shift><F_>  to start a script.  Can I write a script that on Diadem start my scripts are assigned to the function keys?
 
Thanks,
 
AJL
0 Kudos
Message 1 of 4
(3,387 Views)
Hello AJL,

Please have a look at the Script funktion
Call AutoIconSet(IconSetDevice, IconSetNo, IconSetAutoName)
I guess this is exactly what you are looking for. You will find all neccessary details in the DIAdem help.
Best regards
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 4
(3,377 Views)

Will the AutoIconSet still allow me to use the Function keys?  I thought that the AutoIconSet reassigns the icon to a new script.  Does this disable the funcition keys from working with the icon?  Also, what would the IconSetNo be for the icons in the attached pic, specifically the icon that has the F2 on it.

 

Thanks,

 

AJL

 

 

 

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

Hi AJL,

Ingo is absolutely right (I had never heard of this command before), I was able to use AutoIconSet() to programmatically set the F2 shortcut script icon, such that it can be invoked either with the mouse or with <Shift-F2>, using the following parameters:

Call AutoIconSet("AutoIcon", 2, "C:\Hello.VBS")

Brad Turpin
DIAdem Product Support Engineer
National Instruments

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