Section 6: Instrument programming
Create a script using the script.new command
Use script.new to copy an existing script from the local node to a remote node. This can enable
parallel script execution.
You can create a script with the script.new() function using the command:
scriptVar = script.new(code, name)
Where:
•
scriptVar is the name of the variable that is created when the script is loaded into the runtime
environment.
•
code is the content of the script
•
name is the name that is added to the script.user.scripts table
For example, to set up a two-second beep, you could send the command:
beepTwoSec = script.new("beeper.enable = 1 beeper.beep(2, 2400)", "beepTwoSec")
To run the new script, you can send the command:
beepTwoSec()
When you add beepTwoSec, the global variable and script.user.script table entries are made
to the runtime environment as shown in the following figure.
Global variables
name
beepTwoSec
script.user.scripts table
beepTwoSec
6-38
Figure 81: Runtime environment after creating a script
value
pointer to script named
beepTwoSec
pointer to script named
beepTwoSec
Models 707B and 708B Switching Matrix Reference Manual
Scripts in the runtime environment
script name
beepTwoSec
beeper.enable = 1
source
beeper.beep(2, 2400)
Autorun
No
707B-901-01 Rev. A / August 2010