Series 3700A System Switch/Multimeter Reference Manual
Section 10: Instrument programming
3700AS-901-01 Rev. D/June 2018
10-5
To load a named script by sending commands:
1. Send the command
loadscript
scriptName
, where
scriptName
is the name of the script.
The name must be a legal Lua variable name.
2. Send the commands that need to be included in the script.
3. Send the command
endscript
.
4. You can now run the script. See
(on page 10-5).
To run the script immediately, use
loadandrunscript
scriptName
instead of
loadscript
.
Create a script using TSB Embedded
If you are using TSB Embedded to create scripts, you do not need to use the commands
loadscript
or
loadandrunscript
and
endscript
.
You can create a script from the instrument web page with TSB Embedded. When you save the script
in TSB Embedded, it is loaded into the run-time environment and saved in the nonvolatile memory of
the instrument.
To create a script using TSB Embedded:
1. In the TSP Script box, enter a name for the script.
2. In the input area, enter the sequence of commands to be included in the script.
3. Click
Save Script
. The name is added to the User Scripts list on the left.
Create a script using the create configuration script feature
The create configuration script feature captures the present settings of the instrument. Once saved,
you can use this script to return to that configuration, or use it as a starting point to create your own
scripts.
Once created, the configuration script is a normal TSP script
— you can use it as you do any other
script.
For detail on creating a configuration script, see
Save the present configuration
(on page 3-33).
Run scripts
This section describes how to run the anonymous and named scripts.
On the front panel, items are available through the USER menu if you explicitly add them to the
menu. The items the menu selections represent can be scripts, function calls, or instrument
commands. Items in the menus are referred to as scripts in this section.
The SCRIPTS menu lists the names of scripts in nonvolatile memory or script that have been added
to the run-time environment. The anonymous script also appears in this menu.
If the instrument is in local control when the script is started, it switches to remote control (
REM
is
displayed) while the script is running. The instrument is returned to local control when the script
completes. If you press the front-panel
EXIT (LOCAL)
key while the script is running, the script is
stopped.