Model 2651A High Power System SourceMeter® Instrument Reference Manual
Section 6: Instrument programming
2651A-901-01 Rev. A / March 2011
6-45
NOTE
You can also use the
script.new()
and the
scriptVar.
source
attribute commands to create a
script with a new name. For example, if you had an existing script named
test1
, you could create a
new script named
test2
by sending the command:
test2 = script.new(test1.source, "test2")
See
(on page 7-155).
Delete user scripts from the instrument
In most cases, you can delete the script using
script.delete()
as described in
(on page 6-11) and then turning the instrument off and then back on again. However, if you
cannot turn the instrument off, you can use the following steps to completely remove a script from the
instrument.
When you completely remove a script, you delete all references to the script from the runtime
environment, the
script.user.scripts
table, and nonvolatile memory.
To completely remove a script:
1.
Remove the script from the runtime environment.
Set any global variables that refer to the
script to
nil
or assign the variables a different value. For example, to remove the script
"beepTwoSec" from the runtime environment, send the following code:
beepTwoSec = nil
2.
Remove the script from the script.user.scripts table.
Set the name attribute to an empty string
(""). This makes the script nameless, but does not make the script become the anonymous script.
For example, to remove the script named "beepTwoSec", send the following code:
script.user.scripts.beepTwoSec.name = ""
3.
Remove the script from nonvolatile memory.
To delete the script from nonvolatile memory,
send the command:
script.delete("
name
")
where
name
is the name that the script was saved as. For example, to delete
beepTwoSec
, you
would send:
script.delete("beepTwoSec")
You can also use TSB Embedded to delete a script from nonvolatile memory. In the TSB Embedded
page, select the script from the User Scripts list and click
Delete
.