
Models 707B and 708B Switching Matrix Reference Manual
Section 7: Command reference
707B-901-01 Rev. A / August 2010
7-231
Usage
results = tspnet.execute(connectionID, commandString)
results = tspnet.execute(connectionID, commandString, formatString)
value1 = tspnet.execute(connectionID, commandString, formatString)
value1, value2 = tspnet.execute(connectionID, commandString, formatString)
value1, ..., valuen = tspnet.execute(connectionID, commandString, formatString)
results
The results of the command execution
connectionID
The connection ID returned from
tspnet.connect()
commandString
The command to send to the remote device
formatString
Format string for the output
value1
The first value decoded from the response message
value2
The second value decoded from the response message
valuen
The nth value decoded from the response message; there is one return value per
format specifier in the format string
Details
This command sends
commandString
to the remote device connection represented by
connectionID
. The
configured termination sequence is added to
commandString
when it is sent to the device
(
tspnet.termination()
). When
formatString
is specified, the command waits for a return string from the
device. The Model 707B or 708B decodes the output string according to the format specified in
formatString
and returns this output string as arguments from the function.
When this command is sent to a TSP-enabled device, the Model 707B or 708B blocks operation until the device
responds or until a timeout error is generated. The TSP prompt from the remote device is read and thrown away.
The Model 707B or 708B places any remotely generated errors into its error queue. When the optional
formatString
is not specified, this command is equivalent to
tspnet.write()
, except that a termination is
automatically added to the end of the line.
Example 1
tspnet.execute(myID, "runScript()")
Command remote device to run script named
runScript
Example 2
tspnet.termination(myID, tspnet.TERM_CRLF)
tspnet.execute(myID, "*idn?")
print("tspnet.execute returns:",
tspnet.read(myID))
Print the
*idn?
string from the remote device.
Also see
(on page 7-232)