Model 2651A High Power System SourceMeter® Instrument Reference Manual
Section 6: Instrument programming
2651A-901-01 Rev. A / March 2011
6-5
Figure 83: Loadscript and endscript example
loadscript test
display.clear()
display.settext(”This is a test”)
print(”This is a test”)
endscript
Tells instrument to start
collecting messages
Name of the script that will be created
Tells instrument to stop
collecting messages and
create a script named “test”
Body of script
To load a named script by sending commands:
1. Send the command
loadscript
scriptName
, where
scriptName
is the name of the script.
The name must be a legal Lua variable name (see
(on page 6-16)).
2. Send the commands that need to be included in the script.
3. Send the command
endscript
.
4. You can now run the script. See
NOTE
To run the script immediately, use
loadandrunscript
scriptName
instead of
loadscript
.
Create a script using TSB Embedded
NOTE
If you are using TSB Embedded to create scripts, you do not need to use the commands
loadscript
or
loadandrunscript
and
endscript
. For information on using TSB Embedded,
select the Help button on a web page or the Help option from the navigational pane on the left side.
You can create a script from the instrument web page with TSB Embedded. When you save the script
in TSB Embedded, it is loaded into the runtime environment and saved in the nonvolatile memory of
the instrument.
To create a script using TSB Embedded:
1. In the TSP Script box, enter a name for the script.
2. In the input area, enter the sequence of commands to be included in the script. Line numbers are
automatically assigned.
3. Click
Save Script
. The name is added to the User Scripts list on the left.