User manual
Section 13: Instrument Control Library (ICL) Series 3700 System Switch/Multimeter Reference Manual
13-302 3700S-901-01 Rev. C / July 2008
tspnet.execute()
Function
Executes a command string on the remote device.
Usage
[variable =] tspnet.execute(<connection id>, <command
string>, [<format string>])
connection id: Integer value used as a handle for other tspnet commands
command string: Command to send to instrument.
format string: Definition of format string for the input field using zeros (0), the decimal
point (.), the polarity sign (+), and 'E' for exponent.
Remarks
This command sends the command string to the connection device. A termination is
added to the command string when it is sent to the device (see
tspnet.termination() (on page 10-11)). Optionally, when a format string is
specified, the command waits for a string from the device. The Series 3700 decodes
the output string according to the format specified in the format string and returns this
output string as arguments from the function (see tspnet.read() (on page 10-8)
for format specifiers).
When this command is sent to a TSP-enabled device, the Series 3700 suspends
operation until a timeout error is generated or until the device responds, even if no
format string is specified. The TSP prompt from the remote device is read and thrown
away. The Series 3700 places any remotely-generated errors into its error queue.
When the optional format string is not specified, this command is equivalent to
tspnet.write() (on page 10-7), except that a termination is automatically added
to the end of the line.
Errors:
Invalid Specified Connection
Write Failed, Timeout
Write Failed
Read Failed, Timeout
Read Failed, Aborted
Read Failed
Remote Error, <remote error generated by command>
Example
Command remote device to run script named 'runmyscript()':
tspnet.execute(mydevice, 'runmyscript()')
Command remote device to execute a *idn?:
tspnet.termination(mydevice, tspnet.TERM_CRLF)
tspnet.execute(mydevice, ‘*idn?’)
print("instrument write/read returns:: " ,
tspnet.read(id_instr))