Section 6: Instrument programming
Model 2651A High Power System SourceMeter® Instrument Reference Manual
6-2
2651A-901-01 Rev. A / March 2011
What is a script?
A script is a collection of instrument control commands and programming statements. Scripts that you
create are referred to as
user scripts
.
Your scripts can be interactive. Interactive scripts display messages on the front panel of the
instrument to prompt the operator to enter parameters.
Runtime and nonvolatile memory storage of scripts
Scripts are loaded into the runtime environment of the instrument. From there, they can be stored in
the nonvolatile memory.
The runtime environment is a collection of global variables, which include scripts, that the user has
defined. A global variable can be used to remember a value as long as the instrument is turned on
and the variable has not been assigned a new value. After scripts are loaded into the runtime
environment, you can run and manage them from the front panel of the instrument or from a
computer.
Nonvolatile memory is where information is stored even when the instrument is turned off. To save a
script when the instrument is turned off, you must save it to nonvolatile memory. The scripts that are
in nonvolatile memory are loaded into the runtime environment when the instrument is turned on.
Information in the runtime environment is lost when the instrument is turned off.
Scripts are placed in the runtime environment when:
•
The instrument is turned on. All scripts that are saved to nonvolatile memory are copied to the
runtime environment when the instrument is turned on.
•
They are loaded into the runtime environment.
For detail on the amount of memory available in the runtime environment, see
(on page 6-46).
NOTE
If you make changes to a script in the runtime environment, the changes are lost when the instrument
is turned off. To save the changes, you must save them to nonvolatile memory. See
(on page 6-10).
What can be included in scripts?
Scripts can include combinations of commands and Lua code. Commands tell the instrument to do
one thing and are described in the
(see "Commands" on page 7-8). Lua is a
scripting language that is described in
Fundamentals of programming for TSP
(on page 6-14).
Commands that cannot be used in scripts
Though an instrument accepts the following commands, you cannot use these commands in scripts.