
2606B System SourceMeter® Instrument Reference Manual
Section 6: Instrument programming
2606B-901-01 Rev. B / May 2018
6-7
Run scripts
This section describes how to run the anonymous and named scripts.
On the virtual 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 virtual front-panel
EXIT (LOCAL)
key while the script is running, the
script is stopped.
Run the anonymous script
The anonymous script can be run many times without reloading it. It remains in the run-time
environment until a new anonymous script is created or until the instrument is turned off.
To run the anonymous script, use any one of these commands:
•
run()
•
script.run()
•
script.anonymous()
•
script.anonymous.run()
Run a named script
You can run any named script that is in the run-time environment using one of the following
commands:
•
scriptVar
()
•
scriptVar
.run()
Where
scriptVar
is the user-defined name of the script.
To run a named script from TSB Embedded, select the script from the User Scripts list and click
Run
.
When a script is named, it can be accessed using the global variable
scriptVar
.
Example: Run a named script
test3()
If the script
test3
is loaded into the
run-time environment, the instrument
executes
test3
.