Tektronix Keithley 2651A Reference Manual page 553

High power system sourcemeter instrument
Table of Contents

Advertisement

Section 7: TSP command reference
scriptVar.name
This attribute contains the name of a script in the runtime environment.
Type
TSP-Link accessible
Attribute (RW)
No
Usage
scriptVar.name = "scriptName"
scriptName = scriptVar.name
scriptVar
scriptName
Details
When setting the script name, this attribute renames the script that the variable scriptVar
references.
This attribute must be either a valid Lua identifier or the empty string. Changing the name of a script
changes the index that is used to access the script in the script.user.scripts table. Setting the
attribute to an empty string removes the script from the table completely, and the script becomes an
unnamed script.
As long as there are variables referencing an unnamed script, the script can be accessed through
those variables. When all variables that reference an unnamed script are removed, the script is
removed from the runtime environment.
If the new name is the same as a name that is already used for another script, the name of the other
script is set to an empty string, and that script becomes unnamed.
Changing the name of a script does not change the name of any variables that reference that script.
The variables still reference the script, but the names of the script and variables may not match.
Example
test7 = script.new("display.clear() display.settext('Hello from my test')", "")
test7()
print(test7.name)
test7.name = "test7"
print(test7.name)
test7.save()
This example calls the script.new() function to create a script with no name, runs the script, names the
script test7, and then saves the script in nonvolatile memory.
Also see
Rename a script
script.new()
(on page 7-202)
scriptVar.save()
7-208
Model 2651A High Power System SourceMeter® Instrument Reference Manual
Affected by
Not applicable
Name of the variable that references the script
A string that represents the name of the script
(on page 6-48)
(on page 7-210)
Where saved
Default value
Not applicable
Not applicable
2651A-901-01 Rev. C October 2021

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Keithley 2651A and is the answer not in the manual?

Table of Contents