Series 2600B System SourceMeter® instrument Reference Manual Section 8: Instrument programming
2600BS-901-01 Rev. F/August 2021 8-9
Autoexec script
The autoexec script runs automatically when the instrument is turned on. It runs after all the scripts
have loaded and any scripts defined as autorun have run.
To create a script that executes automatically, create and load a new script and name it autoexec.
See Create and load a script (on page 8-3).
You must save the autoexec script to nonvolatile memory if you want to use it after instrument
power has been turned off and then turned on again. See Save a user script to nonvolatile memory
(on page 8-10) for more detail.
Example: Creating an autoexec script with the loadscript command
loadscript autoexec
display.clear()
display.settext("Hello from autoexec")
endscript
autoexec.save()
Creates the script autoexec.
Saves the autoexec script to nonvolatile memory. The next time the instrument is turned on, Hello from
autoexec is displayed.
Example: Creating an autoexec script using TSB Embedded
display.clear()
display.settext("Hello from autoexec")
In the TSP Script box, enter autoexec.
Enter the code in the entry box.
Click Save Script.
Creates a new script that clears the display when the instrument is turned on and displays Hello from
autoexec.
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 autorun attribute of the script to no and then save the script.