
Series 3700A System Switch/Multimeter Reference Manual
Section 11: TSP command reference
3700AS-901-01 Rev. D/June 2018
11-345
Example 1
myTest8 = script.new(
"display.clear() display.settext('Hello from myTest8')", "myTest8")
myTest8()
Creates a new script referenced by the variable
myTest8
with the name "
myTest8"
.
Runs the script. The instrument displays "
Hello from myTest8
".
Example 2
autoexec = script.new(
"display.clear() display.settext('Hello from autoexec')", 'autoexec')
Creates a new autoexec script that clears the display when the instrument is turned on and displays "
Hello
from autoexec
".
Also see
Create a script using the script.new() command
(on page 10-45)
Global variables and the script.user.scripts table
(on page 11-351)
(on page 11-345)
script.newautorun()
This function creates a script and enables autorun.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
scriptVar
= script.newautorun("
code
")
scriptVar
= script.newautorun("
code
", "
name
")
scriptVar
The name of the variable that will reference the script
code
A string that contains the body of the script
name
The name of the script
Details
The
name
parameter is the name that is added to the
script.user.scripts
table. If
name
is not
given, an empty string is used, and the script is unnamed. If the name already exists in
script.user.scripts
, the existing script's
name
attribute is set to an empty string before it is
replaced by the new script.
Note that
name
is the value that is used for the instrument front panel display. If this value is not
defined, the script is not available from the front panel.
You must save the new script into nonvolatile memory to keep it when the instrument is turned off.
The script is run automatically immediately after it is created.
This command is the same as the
script.new()
function except that the script is automatically run.