tspnet

The tspnet commands module.

These commands are used in the following models: MP5103

THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED.

Please report an issue if one is found.

Attributes and Functions
- tspnet.clear()
- tspnet.connect()
- tspnet.disconnect()
- tspnet.execute()
- tspnet.idn()
- tspnet.read()
- tspnet.readavailable()
- tspnet.reset()
- tspnet.termination()
- tspnet.timeout
- tspnet.tsp.abort()
- tspnet.tsp.abortonconnect
- tspnet.tsp.rbtablecopy()
- tspnet.tsp.runscript()
- tspnet.write()

Tspnet

Bases: BaseTSPCmd

The tspnet command tree.

Properties and methods
  • .clear(): The tspnet.clear() function.
  • .connect(): The tspnet.connect() function.
  • .disconnect(): The tspnet.disconnect() function.
  • .execute(): The tspnet.execute() function.
  • .idn(): The tspnet.idn() function.
  • .read(): The tspnet.read() function.
  • .readavailable(): The tspnet.readavailable() function.
  • .reset(): The tspnet.reset() function.
  • .termination(): The tspnet.termination() function.
  • .timeout: The tspnet.timeout attribute.
  • .tsp: The tspnet.tsp command tree.
  • .write(): The tspnet.write() function.

timeout property writable

timeout: str

Access the tspnet.timeout attribute.

Description
  • This attribute sets the timeout value for the tspnet.connect(), tspnet.execute(), and tspnet.read() commands.
Usage
  • Accessing this property will send the print(tspnet.timeout) query.
  • Setting this property to a value will send the tspnet.timeout = value command.
TSP Syntax
- tspnet.timeout = value
- print(tspnet.timeout)
Raises:

tsp property

tsp: TspnetTsp

Return the tspnet.tsp command tree.

Sub-properties and sub-methods
  • .abort(): The tspnet.tsp.abort() function.
  • .abortonconnect: The tspnet.tsp.abortonconnect attribute.
  • .rbtablecopy(): The tspnet.tsp.rbtablecopy() function.
  • .runscript(): The tspnet.tsp.runscript() function.

clear

clear(connection_id: str) -> None

Run the tspnet.clear() function.

Description
  • This function clears any pending output data from the instrument.
TSP Syntax
- tspnet.clear()
Parameters:
  • connection_id (str) –

    The connection ID returned from tspnet.connect().

Raises:

connect

connect(ip_address: str, port_number: int | None = None, init_string: str | None = None) -> str

Run the tspnet.connect() function.

Description
  • This function establishes a network connection with another LAN instrument or device through the LAN interface.
TSP Syntax
- tspnet.connect()
Parameters:
  • ip_address (str) –

    A string that contains the IP address to which to connect; accepts IP address or host name when trying to connect.

  • port_number (optional, default: None ) –

    Port number (default 5025).

  • init_string (optional, default: None ) –

    Initialization string to send to ipAddress.

Returns:
  • str

    The result of the function call.

Raises:

disconnect

disconnect(connection_id: str) -> None

Run the tspnet.disconnect() function.

Description
  • This function disconnects a specified TSP-Net session.
TSP Syntax
- tspnet.disconnect()
Parameters:
  • connection_id (str) –

    The connection ID returned from tspnet.connect().

Raises:

execute

execute(connection_id: str, command_string: str, format_string: str | None = None) -> str

Run the tspnet.execute() function.

Description
  • This function sends a command string to the remote device.
TSP Syntax
- tspnet.execute()
Parameters:
  • connection_id (str) –

    The connection ID returned from tspnet.connect().

  • command_string (str) –

    The command to send to the remote device.

  • format_string (optional, default: None ) –

    Format string for the output.

Returns:
  • str

    The result of the function call.

Raises:

idn

idn(connection_id: str) -> str

Run the tspnet.idn() function.

Description
  • This function retrieves the response of the remote device to *IDN?.
TSP Syntax
- tspnet.idn()
Parameters:
  • connection_id (str) –

    The connection ID returned from tspnet.connect().

Returns:
  • str

    The result of the function call.

Raises:

read

read(connection_id: str, format_string: str | None = None) -> str

Run the tspnet.read() function.

Description
  • This function reads data from a remote device.
TSP Syntax
- tspnet.read()
Parameters:
  • connection_id (str) –

    The connection ID returned from tspnet.connect().

  • format_string (optional, default: None ) –

    Format string for the output, maximum of 10 specifiers.

Returns:
  • str

    The result of the function call.

Raises:

readavailable

readavailable(connection_id: str) -> str

Run the tspnet.readavailable() function.

Description
  • This function checks if output data is available from the remote device.
TSP Syntax
- tspnet.readavailable()
Parameters:
  • connection_id (str) –

    The connection ID returned from tspnet.connect().

Returns:
  • str

    The result of the function call.

Raises:

reset

reset() -> None

Run the tspnet.reset() function.

Description
  • This function disconnects all TSP-Net sessions.
TSP Syntax
- tspnet.reset()
Raises:

termination

termination(connection_id: str, term_sequence: str | None = None) -> str

Run the tspnet.termination() function.

Description
  • This function sets the device line termination sequence.
TSP Syntax
- tspnet.termination()
Parameters:
  • connection_id (str) –

    The connection ID returned from tspnet.connect().

  • term_sequence (optional, default: None ) –

    The termination sequence.

Returns:
  • str

    The result of the function call.

Raises:

write

write(connection_id: str, input_string: str) -> None

Run the tspnet.write() function.

Description
  • This function writes a string to the remote instrument.
TSP Syntax
- tspnet.write()
Parameters:
  • connection_id (str) –

    The connection ID returned from tspnet.connect().

  • input_string (str) –

    The string to be written.

Raises:

TspnetTsp

Bases: BaseTSPCmd

The tspnet.tsp command tree.

Properties and methods
  • .abort(): The tspnet.tsp.abort() function.
  • .abortonconnect: The tspnet.tsp.abortonconnect attribute.
  • .rbtablecopy(): The tspnet.tsp.rbtablecopy() function.
  • .runscript(): The tspnet.tsp.runscript() function.

abortonconnect property writable

abortonconnect: str

Access the tspnet.tsp.abortonconnect attribute.

Description
  • This attribute contains the setting for abort on connect to a TSP-enabled instrument.
Usage
  • Accessing this property will send the print(tspnet.tsp.abortonconnect) query.
  • Setting this property to a value will send the tspnet.tsp.abortonconnect = value command.
TSP Syntax
- tspnet.tsp.abortonconnect = value
- print(tspnet.tsp.abortonconnect)
Raises:

abort

abort(connection_id: str) -> None

Run the tspnet.tsp.abort() function.

Description
  • This function causes the TSP-enabled instrument to stop executing any of the commands that were sent to it.
TSP Syntax
- tspnet.tsp.abort()
Parameters:
  • connection_id (str) –

    Integer value used as a handle for other tspnet commands.

Raises:

rbtablecopy

rbtablecopy(
    connection_id: str, name: str, start_index: int | None = None, end_index: int | None = None
) -> str

Run the tspnet.tsp.rbtablecopy() function.

Description
  • This function copies a reading buffer synchronous table from a remote instrument to a TSP-enabled instrument.
TSP Syntax
- tspnet.tsp.rbtablecopy()
Parameters:
  • connection_id (str) –

    Integer value used as a handle for other tspnet commands.

  • name (str) –

    The full name of the reading buffer name and synchronous table to copy.

  • start_index (optional, default: None ) –

    Integer start value.

  • end_index (optional, default: None ) –

    Integer end value.

Returns:
  • str

    The result of the function call.

Raises:

runscript

runscript(connection_id: str, name: str, script: str) -> None

Run the tspnet.tsp.runscript() function.

Description
  • This function loads and runs a script on a remote TSP-enabled instrument.
TSP Syntax
- tspnet.tsp.runscript()
Parameters:
  • connection_id (str) –

    Integer value used as an identifier for other tspnet commands.

  • name (str) –

    The name that is assigned to the script.

  • script (str) –

    The body of the script as a string.

Raises: