Model 2657A High Power System SourceMeter® Instrument Reference Manual
Section 6: Instrument programming
2657A-901-01 Rev. B/December 2012
6-43
If the new name is the same as a name that is already used for a script, the name of the existing
script is removed and that script becomes unnamed. This removes the existing script if there are no
other variables that reference the previous script. If variables do reference the existing script, the
references remain intact.
Changing the name of a script does not change the name of any variables that reference that script.
After changing the name, the script is located in the
script.user.scripts
table under its new
name.
Figure 99: Rename script
For example, to change the name of the script named
test2
to be
autoexec
:
test2.name = "autoexec"
test2.save()
The
autoexec
script runs automatically when the instrument is turned on. It runs after all the scripts
have loaded and any scripts marked as autorun have run.
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-160).
NOTE
Global variables
Scripts in the runtime environment
No
Autorun
beeper.enable = 1
beeper.beep(2, 2400)
script name
source
beep2sec
Name
Value
script.user.scripts table
beepTwoSec
beep2sec
reference to script that is
now named beep2sec
reference to script that is
now named beep2sec
NOTE
Summary of Contents for 2657A
Page 3: ......