
Section 6: Instrument programming
2606B System SourceMeter® Instrument Reference Manual
6-8
2606B-901-01 Rev. B / May 2018
Run a user script from the instrument front panel
From the virtual front panel, you can load and run a script that was previously added to the USER
menu.
To run the code from the virtual front panel and add it to the USER menu:
1. Select the
LOAD
key.
2. Select
USER
.
3. Select the user chunk from list and press the
ENTER
key. The chunk is loaded into the run-time
environment.
If you are used to using
in Test Script Builder, note that the output of the prints using this
procedure will not function the same as when you are in Test Script Builder. You may find that it
makes more sense to use Test Script Builder to get the output you need.
4. Press the
RUN
key to execute.
To run a script directly without adding it to the USER menu:
1. Select the
LOAD
key.
2. Select
SCRIPTS
and select the
ENTER
key. There may be a short pause before a menu is
displayed that represents the scripts in the instrument.
3. Select the script from the list and select the
ENTER
key. The script is now loaded for front panel
execution.
4. Press the
RUN
key
to execute.
If you are used to using
in Test Script Builder, note that the output of the prints using this
procedure will not function the same as when you are in Test Script Builder. You may find that it
makes more sense to use Test Script Builder to get the output you need.
Scripts that run automatically
You can set up scripts to run automatically when you power on the instrument. To do this, either set
the
autorun
attribute for the script to
yes
(see
(on page 6-8)), or create a script with
the script name
autoexec
(see
(on page 6-9)).
Autorun scripts
Autorun scripts run automatically when the instrument is turned on. You can set any number of scripts
to autorun. The run order for autorun scripts is arbitrary, so make sure the run order is not important.
As shown in the example below, you can set a script to run automatically by setting the
.autorun
attribute of the script to
"yes"
and then saving the script.
Example:
scriptVar
.autorun = "yes"
scriptVar
.save()
Where:
scriptVar
is the user-defined name of the script.
To disable autorun, set the script's
.autorun
attribute to
"no"
and then save the script.