Model 2651A High Power System SourceMeter® Instrument Reference Manual
Section 6: Instrument programming
2651A-901-01 Rev. A / March 2011
6-61
TSP-Net capabilities
For both Test Script Processor (TSP
®
) and non-TSP devices, the TSP-Net library permits the Model
2651A to control a remote device through the LAN port. Using TSP-Net library methods, you can
transfer string data to and from a remote device, transfer and format data into Lua variables, and
clear input buffers. The TSP-Net library is only accessible using commands from a remote command
interface and is not available from the front panel.
You can use TSP-Net commands to communicate with any Ethernet-enabled device. However,
specific TSP-Net commands exist for TSP-enabled devices to allow for support of features unique to
the TSP scripting engine. These features include script downloads, reading buffer access, wait
completion, and handling of TSP scripting engine prompts.
Using TSP-Net commands with TSP-enabled instruments, a Model 2651A can download a script to
another TSP-enabled device and have both devices run scripts independently. The Model 2651A can
read the data from the remote device and either manipulate the data or send the data to a different
remote device on the LAN. You can simultaneously connect to a maximum of 32 devices using
standard TCP/IP networking techniques through the LAN port of the Model 2651A.
Using TSP-Net with any Ethernet-enabled device
NOTE
(on page 5-1) for more details about the commands presented in this
section.
To communicate to a remote Ethernet-enabled device from the Model 2651A:
1. Connect to the remote device through the LAN port;
•
The Model 2651A has Auto-MDIX, so you can use either a LAN crossover cable or a LAN straight-
through cable to connect directly from the Model 2651A to an Ethernet-enabled device, or to a hub.
2. Establish a new connection to a remote device at a specific IP address using the
tspnet.connect()
function. For non-TSP
®
enabled devices, you must also provide the port
number, or the Model 2651A assumes the remote device to be TSP-capable and enables TSP
prompts and error handling.
If the Model 2651A is not able to make a connection to the remote device, it generates a timeout
error. Use
tspnet.timeout
to set the timeout value. The default timeout value is 20 seconds.
NOTE
Set
tspnet.tsp.abortonconnect
to
1
to abort any script currently running on a remote
TSP-enabled device.
3. Use
tspnet.write()
or
tspnet.execute()
to send strings to a remote device. Using
tspnet.write()
sends strings to the device exactly as indicated, and you must supply any
needed termination characters or other lines. Use
tspnet.termination()
to specify the
termination character. If you use
tspnet.execute()
instead, the Model 2651A appends
termination characters to all strings sent to the command.