![background image](http://html1.mh-extra.com/html/keithley/sourcemeter-2600-series/sourcemeter-2600-series_reference-manual_4098633056.webp)
2-4
TSP Programming Fundamentals
Series 2600 System SourceMeters Reference Manual
2600S-901-01 Rev. A / May 2006
Return to
The active script can be run at any time by sending the command
script.run()
.
The active script can be run many times without needing to re-send it. Each time
the
script.run()
command is given, the active script will be executed.
Sending a new script using the
loadscript
and
endscript
messages will
instruct the TSP-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 “
” topic describes how to use
named scripts to store many scripts in the instrument at one time.
Named scripts
The
loadscript
message can also be used to create named scripts. When 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
loadscript
message by appending it to
the name and separating it from the
loadscript
keyword with a space character.
The message
loadscript
MyScript
will instruct the TSP-enabled instrument to
begin gathering command messages that will be used to create a script named
MyScript
. After sending the command messages, the
endscript
message is still
used to indicate the end of the script. Upon receipt of the
endscript
message,
the instrument will compile the script. If there are no errors, the script will be made
available as the global variable
MyScript
because that is the name we used in
the
loadscript
MyScript
message. After a named script has been successfully
sent to the instrument, it can be run at any time by sending the
MyScript()
mes-
sage. If the name given to the script were different, 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 scripts can be made available simultaneously
within the limits of the memory available to the run-time environment.
Named scripts are stored as global variables in the run-time environment. Like all
other global variables, when the unit is powered off, they are lost. There is non-
volatile storage on the instrument that can be used to store downloaded scripts
across power cycles. See “
” later in this section for more infor-
mation.
Functions
As previously explained, named scripts behave just like TSL functions. Executing a
script is just like executing a function with the same name as the script. Scripts, like
Содержание SourceMeter 2600 Series
Страница 507: ...AppendixA Specifications Appendix A topics Model 2600S Specifications page A 2 2600S 901 01 Rev A May 2006...
Страница 575: ...AppendixF DisplayCharacterCodes Appendix F topics Introduction page F 2...
Страница 592: ......
Страница 593: ......