12-16 Return to Section Topics 2600AS-901-01 Rev. B / September 2008
Section 12: TSP Fundamentals and Script Management Series 2600A System SourceMeter® Instruments Reference Manual
NOTE If using the Test Script Builder to modify a user script stored in
nonvolatile memory, the script listing should be retrieved from in the
Project Navigator (see
Retrieving scripts from the Series 2600A in
Section 13).
Script management
Script management includes commands for the following operations:
• Downloading and saving scripts to nonvolatile memory.
• Retrieving scripts from the run-time environment so they can be modified.
• Deleting user scripts from nonvolatile memory.
• Restoring scripts in the run-time environment from nonvolatile memory.
Retrieving the source code of a user script.
There are two ways to retrieve the source code for the user script:
• You can retrieve the listing of the script, that is, the source code line by line over the
command interface.
• You can retrieve the entire user script source code as a single string.
The listing for a user script is the source code sent line by line over the command interface. The
listed script can then be modified and saved as a user script under the same name or a new name.
The myscript.list command retrieves a script listing. The script chunk is returned, along with
the shell keywords (loadscript or loadandrunscript, and endscript):
myscript.list()
Where: myscript is the user-defined name of the script.
Example:
Retrieve the listing for a saved script named “test7”:
test7.list()
To retrieve the entire user script source code as a single string use the myscript.source
attribute where myscript is the user-defined name of the script. The loadscript or
loadandrunscript and endscript keywords are not included.
Example:
Retrieve source for a script named “test1”:
print(test1.source)
Deleting a script
From the run-time environment: Replacing, changing or deleting a script from the run-time
environment does not remove the script from nonvolatile memory. To delete a script from the run-
time environment, set it name to an empty string ("") and remove all references to the script. To
remove all references to the script, reassign the variable(s) that reference the script or set the
variable(s) to the nil value.
Example:
-- Delete a user script name "test7" from the run-time environment
test7.name = ""