stanza.drivers.qswitch

Module Contents

Classes

NameDescription
QSwitchChannelQSwitch channel for setting and getting the state of the lines and relays.
QSwitchNone

Data

logger

API

1stanza.drivers.qswitch.logger

Value: getLogger(...)

1class stanza.drivers.qswitch.QSwitchChannel(name: str, channel_id: int, config: stanza.base.channels.ChannelConfig, driver: stanza.pyvisa.PyVisaDriver)

Bases: stanza.base.channels.InstrumentChannel

QSwitch channel for setting and getting the state of the lines and relays.

1_query_all_relays(command: str) -> list[int]

Query all 10 relays on this channel and return their states as a list of integers.

1_set_relay(
2 command: str, relay: int | str
3) -> None

Execute a relay command for a single relay (int) or multiple relays (comma-separated string).

1_get_connect() -> list[int]

Get the connection state of all relays on this channel.

1_set_connect(relay: int | str) -> None

Connect the specified relay or relays on this channel.

1_get_disconnect() -> list[int]

Get the disconnection state of all relays on this channel.

1_set_disconnect(relay: int | str) -> None

Disconnect the specified relay or relays on this channel.

1_setup_parameters() -> None

Initialize and add connect_relay and disconnect_relay parameters to this channel.

1class stanza.drivers.qswitch.QSwitch(instrument_config: stanza.models.ControlInstrumentConfig, channel_configs: dict[str, stanza.base.channels.ChannelConfig], is_simulation: bool = False, sim_file: str | None = None)

Bases: stanza.base.instruments.BaseControlInstrument

1_initialize_channels(channel_configs: dict[str, stanza.base.channels.ChannelConfig]) -> None

Create and add QSwitchChannel instances for all configured breakout channels.

1_channels_suffix(
2 channel_names: list[str], tap: int | str
3) -> str

Format channel names and tap number into a SCPI command suffix for multi-channel operations.

1get_grounded(channel_name: str | list[str]) -> bool | list[bool]

Check if breakout box channel(s) are grounded.

1set_grounded(channel_name: str | list[str]) -> None

Set breakout box channel(s) to grounded.

1get_ungrounded(channel_name: str | list[str]) -> bool | list[bool]

Check if breakout box channel(s) are ungrounded.

1set_ungrounded(channel_name: str | list[str]) -> None

Set breakout box channel(s) to ungrounded.

1get_connected(
2 channel_name: str | list[str], line_number: int
3) -> bool | list[bool]

Get if breakout box channel(s) are connected to the line number.

1set_connected(
2 channel_name: str | list[str], line_number: int
3) -> None

Set breakout box channel(s) to connected to the line number.

1get_disconnected(
2 channel_name: str | list[str], line_number: int
3) -> bool | list[bool]

Get if breakout box channel(s) are disconnected from the line number.

1set_disconnected(
2 channel_name: str | list[str], line_number: int
3) -> None

Set breakout box channel(s) to disconnected from the line number.

1close() -> None

Close the QSwitch driver.