07-29-2013 09:44 AM
I took both the Basic and Advanced DIAdem training courses, and have been scripting for several months. I am interested in knowing how to include specific lines of code based on the computer. I am told this would be similar to .ini files in LabVIEW, although I have never used .ini files myself.
Solved! Go to Solution.
07-30-2013 11:03 AM
Hi Karen,
What do you mean by "include lines of code"? Do you mean what happens when you execute a "ScriptInclude()" or "ScriptCmdAdd()" command in a DIAdem VBScript? Or do you mean that you want to execute several lines at the moment that DIAdem is starting, similar to "ScriptStart()"?
What do you mean by "based on the computer"? Do you mean that you want to set up different command files on various target computers, but you're always running the same (named) file of commands on each target computer? Or do you mean that you want to set up the same file of commands on all target computers, but you want different commands to run from that file based on which computer you're on. In this second case, how do you determine which computer you're on-- MAC address, logged in user name, or what?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
08-05-2013 07:54 AM
Hi Brad,
I’m scripting code to be used by multiple users in various locations of my company. Users at each location open the scripts I have saved at their location. Each location has a different directory path to the script and related DIAdem files it needs to access. I set this path at the beginning of the script.
Dim MyFolders(1)
MyFolders(0)="Z:\"
Each time I update my script, I need to remember to update the path before saving it in the respective directory. I was wondering if there is a way to code something like “read this file for path directory and other settings”, and then I just create that file once at each of these locations. Then each time I save an updated version in each location it is all the same script, because the “path” is set outside of the script. I can see other reasons for needing something similar in the future, such as headings on reports are similar at each location, but different from the other locations. I hope this explains my question.
Thank you,
Karen
08-05-2013 12:02 PM
Hi Brad,
I tried Call ScriptInclude() and called another script where I defined the pathname and that worked. Thank you.
Karen