Section 11: TSP command reference Model 2601B-PULSE System SourceMeter Instrument Reference Manual
11-384 2601B-PULSE-901-01A April 2020
Details
This command reads available data from the remote instrument and returns responses for the
specified number of arguments.
The format string can contain the following specifiers:
Read data until the specified length
Read data until the specified length or until punctuation is found, whichever comes first
Read data until a newline or carriage return
Read a number (delimited by punctuation)
A maximum of 10 format specifiers can be used for a maximum of 10 return values.
If formatString is not provided, the command returns a string that contains the data until a new
line is reached. If no data is available, the 2601B-PULSE pauses operation until the requested data is
available or until a timeout error is generated. Use tspnet.timeout to specify the timeout period.
When the 2601B-PULSE reads from a TSP-enabled remote instrument, the 2601B-PULSE removes
Test Script Processor (TSP
®
) prompts and places any errors it receives from the remote instrument
into its own error queue. The 2601B-PULSE 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
tspnet.connect() (on page 11-380)
tspnet.readavailable() (on page 11-384)
tspnet.timeout (on page 11-386)
tspnet.write() (on page 11-390)
tspnet.readavailable()
This function checks to see if data is available from the remote device.
Usage
bytesAvailable = tspnet.readavailable(connectionID)
The number of bytes available to be read from the connection
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.