12-6 Return to Section Topics 2600AS-901-01 Rev. B / September 2008
Section 12: TSP Fundamentals and Script Management Series 2600A System SourceMeter® Instruments Reference Manual
programming statements. Figure 12-1 shows an example of how to create (and load) a script
named “test.” When this script is run, the message “This is a test” will be displayed on the Series
2600A and sent to the PC.
As shown, a script is made up of a chunk of programming code that is framed by shell commands.
The first shell command in
Figure 12-1 tells the instrument to start loading the script named “test.”
The last shell command marks the end of the script.
The chunk in Figure 12-1 consists of three lines of code. When the chunk is executed, the test
messages will be sent and displayed. The following command executes the chunk: test()
Figure 12-1
Script example
A script is loaded into the Series 2600A where it can be run. Running a script at the SourceMeter
is faster than running a test program from the PC. The piecemeal transmission process from PC to
SourceMeter instrument is eliminated by the use of a script.
Program statements control script execution and provide facilities such as variables, functions,
branching, and loop control. Because scripts are programs, they are written using a programming
language. This language is called the Test Script Language or TSL. TSL is an implementation of
the Lua scripting language.
There are two types of scripts: Factory scripts and user scripts. A factory script was created by
Keithley Instruments at the factory and stored in nonvolatile memory of the Series System 2600A
SourceMeter. Factory scripts cannot be removed from nonvolatile memory. A user script can be
created using your own program or the Test Script Builder integrated development environment
(IDE), which is a supplied software tool (see
Using Test Script Builder in Section 13). User scripts
are loaded into the Series 2600A run-time environment where they can be run and/or saved to
nonvolatile memory.
Run-time environment
The run-time environment is a collection of global variables (including scripts) the user has
created. After scripts are placed into the run-time environment, they are then ready to be run and/
or managed. Scripts are placed in the run-time environment as follows:
• Scripts saved in Nonvolatile memory of the Series 2600A are automatically recalled into the
run-time environment when the instrument is turned on
• Scripts loaded by the user since the unit was last turned on are stored in the runtime
environment
Nonvolatile memory
After a new or modified user script is loaded into the Series 2600A, it resides in the run-time
environment and will be lost when the unit is turned off. To save a script after power-down, the
script must be saved in the nonvolatile memory. When the Series 2600A is turned back on, all
saved scripts will be loaded into the
Run-time environment.
Do not confuse the run-time environment with the nonvolatile memory of the Series 2600A.
Making changes to a script in the run-time environment does not affect the stored version of that
loadscript test
display.clear()
display.settext(This is a test)
print(This is a test)
endscript
Chunk
Shell Command
Name of Script
Shell Command