
Models 707B and 708B Switching Matrix Reference Manual
Section 6: Instrument programming
707B-901-01 Rev. A / August 2010
6-5
Create a script by sending commands over the remote interface
You can send commands over the remote interface instead of using TSB Embedded. To create a
script over the remote interface, you can use the
loadscript
,
loadandrunscript
, and
endscript
commands.
The
loadscript
and
loadandrunscript
commands start the collection of messages that make
up the script. When the instrument receives either of these commands, it starts collecting all
subsequent messages. Without these commands, the instrument would run them immediately as
individual commands.
The
endscript
command tells the instrument to compile the messages. It compiles the messages
into one group of commands. This group of commands is loaded into the runtime environment.
The following figure shows an example of how to load and create a script named “test.” The first
command tells the instrument to start collecting the messages for the script named “test.” The last
command marks the end of the script. When this script is run, the message “This is a test” will be
displayed on the instrument and sent to the computer.
Figure 79: 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 create 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
.