
Section 7: TSP command reference
2606B System SourceMeter® Instrument Reference Manual
7-374
2606B-901-01 Rev. B / May 2018
When the 2606B reads from a TSP-enabled remote instrument, the 2606B removes Test Script
Processor (TSP
®
) prompts and places any errors it receives from the remote instrument into its own
error queue. The 2606B prefaces errors from the remote device with "
Remote Error
," followed by
the error number and error description.
Example
tspnet.write(deviceID, "*idn?\r\n")
print("write/read returns:", tspnet.read(deviceID))
Send the
"*idn?\r\n"
message to the instrument connected as
deviceID
.
Display the response that is read from
deviceID
(based on the
*idn?
message).
Also see
(on page 7-369)
(on page 7-374)
(on page 7-376)
(on page 7-380)
tspnet.readavailable()
This function checks to see if data is available from the remote device.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
bytesAvailable
= tspnet.readavailable(
connectionID
)
bytesAvailable
The number of bytes available to be read from the connection
connectionID
The connection ID returned from
tspnet.connect()
Details
This command checks to see if any output data is available from the device. No data is read from the
instrument. This allows TSP scripts to continue to run without waiting on a remote command to finish.
Example
ID = tspnet.connect("192.0.2.1")
tspnet.write(ID, "*idn?\r\n")
repeat bytes = tspnet.readavailable(ID) until bytes > 0
print(tspnet.read(ID))
tspnet.disconnect(ID)
Send commands that will create data.
Wait for data to be available.
Also see
(on page 7-369)
(on page 7-373)