Section 6: Instrument programming
Model 2651A High Power System SourceMeter® Instrument Reference Manual
6-10
2651A-901-01 Rev. A / March 2011
Example: Retrieve the content of a script with scriptVar.list()
scriptVarTest.list()
Request a listing of the source of
scriptVarTest
. The instrument outputs the
following (note that the loadscript and endscript
commands are included).
Output:
loadscript scriptVarTest
listTones = {100, 400, 800}
for index in listTones do
beeper.beep(.5, listTones[index])
end
endscript
Working with scripts in nonvolatile memory
The previous section,
Fundamentals of scripting for TSP
(on page 6-1), described working with
scripts, primarily in the runtime environment.
Scripts can also be stored in nonvolatile memory. Information in nonvolatile memory is stored even
when the instrument is turned off. The scripts that are in nonvolatile memory are loaded into the
runtime environment when the instrument is turned on.
The runtime environment and nonvolatile memory are separate storage areas in the instrument. The
runtime environment is wiped clean when the instrument is turned off. The nonvolatile memory
remains intact when the instrument is turned off. When the instrument is turned on, information in
nonvolatile memory is loaded into the runtime environment.
This section describes how to work with the scripts in nonvolatile memory, including how to:
•
Save a user script to nonvolatile memory
•
•
Restore a script to the runtime environment
•
(on page 6-11)
Save a user script
You can save scripts to nonvolatile memory using commands or TSB Embedded.
Only named scripts can be saved to nonvolatile memory. The anonymous script must be named
before it can be saved to nonvolatile memory.
NOTE
If a script is not saved to nonvolatile memory, the script is lost when the instrument is turned off.