Queries; Scripts; Named Scripts - Keithley 2601 Reference Manual

System sourcemeter 2600 series (smu)
Hide thumbs Also See for 2601:
Table of Contents

Advertisement

Section 2: TSP Programming
When the unit is turned off, the entire run-time environment will be lost. Note that SMU non-volatile
reading buffers are not lost.

Queries

TSP-enabled instruments do not have inherent query commands. Like any other scripting
environment the print command and other related print commands are used to generate
output. The print command will create one response message.
An example of generating an output message is the following chunk (two commands) that takes a
measurement and returns its value:
x = smua.measure.v() print(x)
Note that the measurement value is stored in the global variable x between the two commands.

Scripts

When taking advantage of the TSP to perform more complicated sequences of commands,
especially sequences utilizing advanced scripting features such as looping and branching, sending
the entire sequence in one message is very cumbersome. Two special messages can be used to
collect a sequence of command messages together into one chunk.
The
loadscript
subsequent messages rather than executing them immediately. After sending the sequence of
command messages, the
compile the test sequence and make it available to run in a subsequent message. This chunk is
called the "active script."
The active script can be run at any time by sending the command
can be run many times without needing to re-send it. Each time the
given, the active script will be executed.
Sending a new script using the
enabled instrument to replace the active script with the new script. While creating and using scripts
this way is a very powerful feature of TSP-enabled instruments, only being able to access one
script at a time in this way would be very limited. The
named scripts to store many scripts in the instrument at one time.

Named scripts

The
loadscript
message is used to create a named script, the active script is not replaced with the named script.
Instead, a global variable in the run-time environment is created to store the script. Because the
script is stored in a global variable, the name of the script must be a legal TSL variable name.
The name of the script is specified in the
separating it from the
MyScript
will be used to create a script named
endscript
message, the instrument will compile the script. If there are no errors, the script will be made
available as the global variable
MyScript
run at any time by sending the
that name would be used instead.
If a new script is sent with the same name, it will replace the old one. Sending new scripts with
different names will not remove any previously sent scripts. By using named scripts, any number of
2-4
message will instruct the TSP-enabled instrument to begin collecting all
endscript
loadscript
message can also be used to create named scripts. When the
loadscript
will instruct the TSP-enabled instrument to begin gathering command messages that
message is still used to indicate the end of the script. Upon receipt of the
MyScript
message. After a named script has been successfully sent to the instrument, it can be
MyScript()
Return to
Series 2600 System SourceMeter® Instruments Reference Manual
message is used to instruct the TSP-enabled instrument to
and
endscript
"Named
message by appending it to the name and
loadscript
keyword with a space character. The message
. After sending the command messages, the
MyScript
because that is the name we used in the
message. If the name given to the script were different,
Section Topics
. The active script
script.run()
command is
script.run()
messages will instruct the TSP-
scripts" topic describes how to use
loadscript
loadscript
loadscript
2600S-901-01 Rev. C / January 2008
endscript

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

26362602261126122635

Table of Contents