Models 707B and 708B Switching Matrix Reference Manual
Section 7: Command reference
707B-901-01 Rev. A / August 2010
7-239
tspnet.tsp.runscript()
This function loads and runs a script on a remote instrument.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function Yes
Usage
tspnet.tsp.runscript(connectionID, script)
tspnet.tsp.runscript(connectionID, name, script)
connectionID
Integer value used as an identifier for other
tspnet
commands
name
The name that is assigned to the script
script
The body of the script as a string
Details
This function is appropriate only for TSP-enabled instruments.
This function downloads a script to a remote instrument and runs it. It automatically adds the appropriate
loadscript
and
endscript
commands around the script, captures any errors, and reads back any prompts.
No additional substitutions are done on the text.
The script is automatically loaded, compiled, and run.
Any output from previous commands is discarded.
This command does not wait for the script to complete.
To load only and run at a later time, make sure the script contains only functions. Use
tspnet.execute()
to
execute those functions at a later time.
If no name is specified, the script will be unnamed.
Example
tspnet.tsp.runscript(myconnection, "mytest",
"print([[start]]) for d = 1, 10 do print([[work]]) end print([[end]])")
Load and run a script entitled
mytest
on the TSP-enabled instrument connected with
myconnection
. The
source of
mytest
will be the contents of the string passed for the third parameter.
Also see