ieee488_2_commands

Module containing inner classes to use for APIs for IEEE 488.2 commands.

IEEE4882Commands

IEEE4882Commands(pi_control: PIControl)

An inner class containing an API for all the IEEE 488.2 SCPI commands.

cls

cls() -> None

Send the *CLS (Clear Status) command.

This command (no query form) clears the following:

  • Event Queue
  • Standard Event Status Register
  • Status Byte Register (except the MAV bit)

If the *CLS command immediately follows an end-of-message terminator, the Output Queue and MAV bit (Status Byte Register bit 4) are also cleared. MAV indicates that information is in the output queue. The device clear (DCL) control message will clear the output queue and thus MAV. *CLS does not clear the output queue or MAV.

*CLS can suppress a Service Request that is to be generated by an *OPC.

ese

ese(value: int | None = None) -> str

Send or query the *ESE (Event Status Enable) command.

This command sets and queries the bits in the Event Status Enable Register (ESER). The ESER prevents events from being reported to the Status Byte Register (STB).

The power-on default for the ESER is 0 if *PSC is 1. If *PSC is 0, the ESER maintains the previous power cycle value through the current power cycle.

Parameters:
  • value (int | None, default: None ) –

    An integer specifying the binary bits of the ESER, from 0 to 255.

Returns:
  • str

    The output of the query.

Raises:
  • ValueError

    Indicates that the input value is not within the accepted range.

esr

esr() -> str

Query the *ESR? (Standard Event Status Register) command.

This query-only command returns the contents of the Standard Event Status Register (SESR). *ESR? also clears the SESR (since reading the SESR clears it).

Returns:
  • str

    The output of the query.

idn

idn() -> str

Query the *IDN? (Identification) command.

This query-only command returns the instrument identification code.

Returns:
  • str

    The output of the query.

lrn

lrn() -> str

Query the *LRN? (Learn) command.

This query-only command returns the commands that list the instrument settings.

Returns:
  • str

    The output of the query.

opc

opc(write: bool = False) -> str

Send or query the *OPC (Operation Complete) command.

The *OPC command generates an operation complete event which propagates through the Standard Event Status Register (SESR) when all pending commands that block OPC are complete.

The *OPC? query returns “1” after all blocking OPC operations are complete. The *OPC? query response is not available to read until all pending operations finish, so an appropriate timeout value should be used.

Parameters:
  • write (bool, default: False ) –

    A boolean indicating if the *OPC should be set rather than queried.

Returns:
  • str

    The output of the query, otherwise an empty string.

opt

opt() -> str

Query the *OPT? (Options) command.

This query-only command returns a comma separated list of installed options as an arbitrary ASCII string (no quotes) of the form:

<optionCode>:<optionDescription>,<optionCode>:<optionDescription>...

Returns:
  • str

    The output of the query.

psc

psc(value: bool | None = None) -> str

Send or query the *PSC (Power-on Status Clear) command.

This command sets and queries the power-on status flag that controls the automatic power-on handling of the SRER, and ESER registers. When *PSC is true, the SRER and ESER registers are set to 0 at power-on. When *PSC is false, the current values in the SRER and ESER registers are preserved in nonvolatile memory when power is shut off and are restored at power-on.

Parameters:
  • value (bool | None, default: None ) –

    A boolean indicating the status to set the power-on status flag to.

Returns:
  • str

    The output of the query.

rst

rst() -> None

Send the *RST (Reset) command.

This command (no query form) does the following:

  • Recalls the default instrument setup.

The *RST command does not change the following:

  • The Power-on Status Clear Flag (*PSC command).
  • The Event Status Enable Register (*ESE command).
  • The Service Request Enable Register (*SRE command).

*RST only resets the programmable interface settings, it does not change any user interface settings.

sre

sre(value: int | None = None) -> str

Send or query the *SRE (Service Request Enable) command.

The *SRE (Service Request Enable) command sets and queries the bits in the Service Request Enable Register.

Parameters:
  • value (int | None, default: None ) –

    An integer specifying the binary bits of the SRER, from 0 to 255.

Returns:
  • str

    The output of the query.

Raises:
  • ValueError

    Indicates that the input value is not within the accepted range.

stb

stb() -> str

Query the *STB? (Status Byte) command.

The *STB? (Read Status Byte) query returns the contents of the Status Byte Register (SBR) using the Master Summary Status (MSS) bit.

Returns:
  • str

    The output of the query.

tst

tst() -> str

Send the *TST? (Self-Test) command.

Tests (self-test) the interface and returns the result.

Returns:
  • str

    The output of the query.

wai

wai() -> None

Send the *WAI (Wait) command.

The *WAI (Wait) command (no query form) prevents the instrument from executing further commands or queries until all pending commands that generate an OPC message are complete.

LegacyTSPIEEE4882Commands

LegacyTSPIEEE4882Commands(pi_control: PIControl)

Bases: TSPIEEE4882Commands

flowchart LR tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.LegacyTSPIEEE4882Commands[LegacyTSPIEEE4882Commands] tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands[TSPIEEE4882Commands] tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.IEEE4882Commands[IEEE4882Commands] tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands --> tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.LegacyTSPIEEE4882Commands tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.IEEE4882Commands --> tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands click tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.LegacyTSPIEEE4882Commands href "" "tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.LegacyTSPIEEE4882Commands" click tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands href "" "tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands" click tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.IEEE4882Commands href "" "tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.IEEE4882Commands"

An inner class containing an API for all the IEEE 488.2 commands for legacy TSP models.

cls

cls() -> None

Send Clear Status commands (eventlog.clear(), status.clear()).

This command (no query form) clears the following:

  • Event Queue
  • Standard Event Status Register
  • Status Byte Register

ese

ese(value: int | None = None) -> str

Send or query the Event Status Enable (status.standard.enable) command.

This command sets and queries the bits in the Event Status Enable Register (ESER). The ESER prevents events from being reported to the Status Byte Register (STB).

Parameters:
  • value (int | None, default: None ) –

    An integer specifying the binary bits of the ESER, from 0 to 255.

Returns:
  • str

    The output of the query.

Raises:
  • ValueError

    Indicates that the input value is not within the accepted range.

esr

esr() -> str

Query the Standard Event Status Register (print(status.standard.event)) command.

This query-only command returns the contents of the Standard Event Status Register (SESR). print(status.standard.event) also clears the SESR (since reading the SESR clears it).

Returns:
  • str

    The output of the query.

idn

idn() -> str

Query the *IDN? (Identification) command.

This query-only command returns the instrument identification code.

Returns:
  • str

    The output of the query.

lrn

lrn() -> str

Query the *LRN? (Learn) command.

This query-only command returns the commands that list the instrument settings.

Returns:
  • str

    The output of the query.

opc

opc(write: bool = False) -> str

Send or query the Operation Complete command.

The OPC command generates an operation complete event which propagates through the Standard Event Status Register (SESR) when all pending commands that block OPC are complete.

Parameters:
  • write (bool, default: False ) –

    A boolean indicating if the command should be set rather than queried.

Returns:
  • str

    The output of the query, otherwise an empty string.

opt

opt() -> str

Query the *OPT? (Options) command.

This query-only command returns a comma separated list of installed options as an arbitrary ASCII string (no quotes) of the form:

<optionCode>:<optionDescription>,<optionCode>:<optionDescription>...

Returns:
  • str

    The output of the query.

psc

psc(value: bool | None = None) -> str

Send or query the *PSC (Power-on Status Clear) command.

This command sets and queries the power-on status flag that controls the automatic power-on handling of the SRER, and ESER registers. When *PSC is true, the SRER and ESER registers are set to 0 at power-on. When *PSC is false, the current values in the SRER and ESER registers are preserved in nonvolatile memory when power is shut off and are restored at power-on.

Parameters:
  • value (bool | None, default: None ) –

    A boolean indicating the status to set the power-on status flag to.

Returns:
  • str

    The output of the query.

rst

rst() -> None

Send the Reset (reset()) command.

sre

sre(value: int | None = None) -> str

Send or query the Service Request Enable (status.request_enable) command.

The status.request_enable (Service Request Enable) command sets and queries the bits in the Service Request Enable Register.

Parameters:
  • value (int | None, default: None ) –

    An integer specifying the binary bits of the SRER, from 0 to 255.

Returns:
  • str

    The output of the query.

Raises:
  • ValueError

    Indicates that the input value is not within the accepted range.

stb

stb() -> str

Query the Status Byte (print(status.condition)) command.

Returns:
  • str

    The output of the query.

tst

tst() -> str

Send the (print([[0]])) (Self-Test) command.

Tests (self-test) the interface and returns the result.

Returns:
  • str

    The output of the query.

wai

wai() -> None

Send the waitcomplete() command.

TSPIEEE4882Commands

TSPIEEE4882Commands(pi_control: PIControl)

Bases: IEEE4882Commands

flowchart LR tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands[TSPIEEE4882Commands] tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.IEEE4882Commands[IEEE4882Commands] tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.IEEE4882Commands --> tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands click tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands href "" "tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.TSPIEEE4882Commands" click tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.IEEE4882Commands href "" "tm_devices.driver_mixins.shared_implementations.ieee488_2_commands.IEEE4882Commands"

An inner class containing an API for all the IEEE488.2 TSP commands.

cls

cls() -> None

Send Clear Status commands (errorqueue.clear(), status.clear()).

This command (no query form) clears the following:

  • Event Queue
  • Standard Event Status Register
  • Status Byte Register

ese

ese(value: int | None = None) -> str

Send or query the Event Status Enable (status.standard.enable) command.

This command sets and queries the bits in the Event Status Enable Register (ESER). The ESER prevents events from being reported to the Status Byte Register (STB).

Parameters:
  • value (int | None, default: None ) –

    An integer specifying the binary bits of the ESER, from 0 to 255.

Returns:
  • str

    The output of the query.

Raises:
  • ValueError

    Indicates that the input value is not within the accepted range.

esr

esr() -> str

Query the Standard Event Status Register (print(status.standard.event)) command.

This query-only command returns the contents of the Standard Event Status Register (SESR). print(status.standard.event) also clears the SESR (since reading the SESR clears it).

Returns:
  • str

    The output of the query.

idn

idn() -> str

Query the *IDN? (Identification) command.

This query-only command returns the instrument identification code.

Returns:
  • str

    The output of the query.

lrn

lrn() -> str

Query the *LRN? (Learn) command.

This query-only command returns the commands that list the instrument settings.

Returns:
  • str

    The output of the query.

opc

opc(write: bool = False) -> str

Send or query the Operation Complete command.

The OPC command generates an operation complete event which propagates through the Standard Event Status Register (SESR) when all pending commands that block OPC are complete.

Parameters:
  • write (bool, default: False ) –

    A boolean indicating if the command should be set rather than queried.

Returns:
  • str

    The output of the query, otherwise an empty string.

opt

opt() -> str

Query the *OPT? (Options) command.

This query-only command returns a comma separated list of installed options as an arbitrary ASCII string (no quotes) of the form:

<optionCode>:<optionDescription>,<optionCode>:<optionDescription>...

Returns:
  • str

    The output of the query.

psc

psc(value: bool | None = None) -> str

Send or query the *PSC (Power-on Status Clear) command.

This command sets and queries the power-on status flag that controls the automatic power-on handling of the SRER, and ESER registers. When *PSC is true, the SRER and ESER registers are set to 0 at power-on. When *PSC is false, the current values in the SRER and ESER registers are preserved in nonvolatile memory when power is shut off and are restored at power-on.

Parameters:
  • value (bool | None, default: None ) –

    A boolean indicating the status to set the power-on status flag to.

Returns:
  • str

    The output of the query.

rst

rst() -> None

Send the Reset (reset()) command.

sre

sre(value: int | None = None) -> str

Send or query the Service Request Enable (status.request_enable) command.

The status.request_enable (Service Request Enable) command sets and queries the bits in the Service Request Enable Register.

Parameters:
  • value (int | None, default: None ) –

    An integer specifying the binary bits of the SRER, from 0 to 255.

Returns:
  • str

    The output of the query.

Raises:
  • ValueError

    Indicates that the input value is not within the accepted range.

stb

stb() -> str

Query the Status Byte (print(status.condition)) command.

Returns:
  • str

    The output of the query.

tst

tst() -> str

Send the (print([[0]])) (Self-Test) command.

Tests (self-test) the interface and returns the result.

Returns:
  • str

    The output of the query.

wai

wai() -> None

Send the waitcomplete() command.