User manual
Series 3700 System Switch/Multimeter Reference Manual  Section 10: TSP-Net 
3700S-901-01 Rev. C / July 2008  10-7 
tspnet.execute() 
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)) 
tspnet.write() 
Function 
Write strings to remote device. 
Usage 
tspnet.write(<connection id>, <input string>) 
connection id: Integer value used as a handle for other tspnet commands 
input string: String type used for writing to the remote instrument 










