2600S-901-01 Rev. C / January 2008
Return to
2-3
Series 2600 System SourceMeter® Instruments Reference Manual
Section 2: TSP Programming
Introduction
Conventional instrumentation responds to command messages sent to the instrument. Each
command message contains one or more commands. The instrument executes these commands
in order.
To conduct a test, a computer (controller) is programmed to send sequences of commands to an
instrument. The controller orchestrates the actions of the instrumentation. The controller is
typically programmed to request measurement results from the instrumentation and make test
sequence decisions based on those measurements.
Keithley Instruments’ Test Script Processor-based instruments can operate as conventional
instruments by responding to a sequence of command messages sent by a controller. They are
also capable of much more.
Test Script Processor (TSP)
Scripting
To orchestrate a sequence of actions.
Scripting Language
A programming language used for scripting.
The Test Script Processor (TSP) is a scripting engine that runs inside the instrument. It is capable
of running code written in a scripting language called Lua (www.lua.org). We will refer to Lua as
the Test Script Language (TSL). The TSP runs portions of TSL code formally known as chunks.
Most messages sent to the instrument are directly executed by the TSP as TSL chunks. The
simplest messages sent to the instrument would be individual instrument control commands. Even
though these messages are executed as TSL chunks, using them is no different than using a
conventional instrument. The user sends a command message and the instrument executes that
command. When sending individual command messages, it is irrelevant that the TSP is executing
the message as a chunk.
Instrument control commands are implemented as a library within the TSL. The command set for a
TSP-enabled instrument is referred to as the Instrument Control Library (ICL) for that instrument.
Each TSP-enabled instrument will have its own ICL. Although each TSP-enabled instrument runs
the same TSL, different instruments respond to different commands and the ICL for each
instrument may be different.
ICL commands are very similar to the commands sent to a conventional instrument but ICL
commands look like function calls or assignment statements. For example the command to set the
output voltage level to one volt on channel A is
smua.source.levelv = 1
. Similarly, the command
to turn the Channel A output on is
smua.source.output = smua.OUTPUT_ON
. These commands,
when sent individually as separate messages, are each a TSL chunk.
Commands do not need to be sent as separate messages. The two commands from above can be
combined into one message, and thereby one chunk, by concatenating the two commands
together with a space separating them. The resulting chunk would be as follows:
smua.source.levelv = 1 smua.source.output = smua.OUTPUT_ON
Run-time environment
A feature of all scripting environments is the run-time environment. In the TSP, the run-time
environment is simply a collection of global variables. A global variable can be used to remember
a value as long as the unit is powered on and the variable is not assigned a new value. The
command
x = smua.measure.v()
instructs the instrument to measure voltage and store the
result in a global variable named “x.”
A global variable can be removed from the environment by assigning it the
nil
value. For
example, the command
x = nil
will remove the global variable
x
from the run-time environment.