User manual
Section 13: Instrument Control Library (ICL) Series 3700 System Switch/Multimeter Reference Manual
13-304 3700S-901-01 Rev. C / July 2008
tspnet.read()
Remarks
This command reads available data from the device (as indicated by the format string)
and returns the number of arguments (as indicated by the format string).
The format string can contain the following identifiers:
%[width]s
Read data until the specific length
%[max width]t
Read data until the specific length or delimitated by
punctuation
%[max width]n
Read data until a newline and/or carriage return
%d
Read a number (delimitated by punctuation)
If no format is specified, the command returns a string containing the data until a new
line is reached. If no data is available, the Series 3700 will hold off operation until the
requested data is available or until a timeout error is generated. Use
tspnet.timeout to specify the timeout period.
A maximum of 10 specifiers are allowed in a format string.
When reading from a TSP-enabled remote device, the Series 3700 removes TSP
prompts and places any errors received from the remote device into its own error
queue. The Series 3700 prefaces errors from the remote device with "Remote Error,"
and followed by with the error number and error description.
Errors:
Invalid Specified Connection
Read Failed, Timeout
Read Failed, Aborted
Read Failed
Remote Error, <remote error generated by command>
Example
Send “*idn?” to remote device:
tspnet.write(id_instr,"*idn?\r\n")
Read and print response from remote device:
print("instrument write/read returns:: " ,
tspnet.read(id_instr))
tspnet.readavailable()
Function
Device read output available.
Usage
[<num bytes> =] tspnet.readavailable(<connection id>)
connection id: Integer value used as a handle for other tspnet commands
Remarks
This command checks to see if any output data is available from the device. No data is
read. It is intended to allow TSP
TM
scripts to continue to run without waiting on a
remote command to finish.
Errors:
Invalid Specified Connection
Read Failed