qmi.instruments.siglent.sds1202xe

Instrument driver for the Siglent SDS1202X-E oscilloscope.

Classes

CommHeader(value)

SDS1202XE(context, name, scpi_transport)

Instrument driver for the Siglent SDS1202X-E oscilloscope.

TriggerCondition(trig_type, source, ...)

A NamedTuple to hold parameters returned from 'trse?' query.

class qmi.instruments.siglent.sds1202xe.CommHeader(value)
class qmi.instruments.siglent.sds1202xe.TriggerCondition(trig_type: str, source: str, hold_type: str, hold_value: str, hold_value2: str)

A NamedTuple to hold parameters returned from ‘trse?’ query.

Parameters:
  • trig_type – Trigger Type.

  • source – Trigger Source.

  • hold_type – Trigger Hold type.

  • hold_value – Trigger Hold value with unit.

  • hold_value2 – Second trigger Hold value with unit.

trig_type: str

Alias for field number 0

source: str

Alias for field number 1

hold_type: str

Alias for field number 2

hold_value: str

Alias for field number 3

hold_value2: str

Alias for field number 4

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

class qmi.instruments.siglent.sds1202xe.SDS1202XE(context: QMI_Context, name: str, scpi_transport: str)

Instrument driver for the Siglent SDS1202X-E oscilloscope.

open() None

Connect to the instrument hardware.

When this method returns, the instrument must be ready for interaction via calls to instrument-specific methods.

Subclasses can extend this method to implement instrument-specific initialization. If they do, they should call super().open() as a last statement.

close() None

Close the connection to the instrument hardware and release associated resources.

When this method returns, the instrument must not be used again unless it is first re-opened by calling the open() method.

Subclasses can extend this method if they have specific resources to close. If they do, they should call super().close() as a last statement.

get_id() str

Query oscilloscope identification string.

Returns:

Module identification string.

set_comm_header(fmt: CommHeader)

Set communication header format.

Parameters:

header – Header format for communication replies.

get_voltage_per_division(channel: int) float

Query voltage per division for specified channel.

Parameters:

channel – Specified channel

Returns:

Voltage per division.

set_voltage_per_division(channel: int, v_div: float) None

Set voltage per division for specified channel.

Parameters:
  • channel – Specified channel

  • v_div – Voltage per division, in Volts

get_voltage_offset(channel: int) float

Query voltage offset for specified channel.

Parameters:

channel – Specified channel

Returns:

Voltage offset.

set_voltage_offset(channel: int, offset: float) None

Set voltage offset for specified channel.

Parameters:
  • channel – Specified channel

  • offset – Voltage offset, in Volts

get_time_per_division() float

Query time per division for oscilloscope.

Returns:

Time per division in seconds.

set_time_per_division(t_div: int, unit: str = 's') None

Set the horizontal scale (time) per division for oscilloscope. The input values must make one of the pre- defined allowed values ranging from 1ns to 100s: [1NS, 2NS, 5NS, 10NS, 20NS, 50NS, 100NS, 200NS, 500NS, 1US, 2US, 5US, 10US, 20US, 50US, 100US, 200US, 500US, 1MS, 2MS, 5MS, 10MS, 20MS, 50MS, 100MS, 200MS, 500MS, 1S, 2S, 5S, 10S, 20S, 50S, 100S].

Parameters:
  • t_div – Time per division value, can be [1, 2, 5, 10, 20, 50, 100, 200, 500].

  • unit – Time per division unit, can be [ns, us, ms, s].

get_sample_rate() float

Query sample rate for oscilloscope.

Returns:

Sample rate.

get_trigger_coupling(channel: int) str

Query trigger coupling type of a given channel.

Parameters:

channel – The channel number.

Returns:

The trigger coupling type.

set_trigger_coupling(channel: int, coupling: str)

Set the trigger coupling type of a given channel.

Parameters:
  • channel – The channel number.

  • coupling – The coupling type [AC, DC, HFREJ, LFREJ].

get_trigger_level(channel: int) float

Query the trigger level of a given channel.

Parameters:

channel – The channel number.

Returns:

The trigger level.

set_trigger_level(channel: int, trig_level: float) None

Set trigger level for a given channel. The trigger level is checked for internal triggers, with the range of -4.5*DIV to 4.5*DIV. There is also a limit of -3*DIV to +3*DIV for external trigger levels. If the value is not within the range, the controller sets it to the nearest edge value. Note that the trigger range might not be centered to 0V, but at the current offset value.

Parameters:
  • channel – The channel number.

  • trig_level – Trigger level voltage (Volts).

get_trigger_mode()

Query the oscilloscope trigger mode.

Returns:

The trigger mode.

set_trigger_mode(mode: str)

Set the oscilloscope trigger mode.

Parameters:

mode – The oscilloscope trigger mode [AUTO, NORM, SINGLE, STOP].

get_trigger_select() TriggerCondition

Get the selected trigger condition for waveform acquisition.

Returns:

NamedTuple holding the received parameters parsed from the response string: trig_type, source, hold_type, hold_value[, hold_value2].

Return type:

trigger_parameters

get_trigger_slope(channel: int) str

Get the trigger slope setting of a specific channel.

Parameters:

channel – The channel number.

Returns:

The trigger slope of selected channel

set_trigger_slope(channel: int, slope: str) None

Set the trigger slope for a specific channel.

Parameters:
  • channel – The channel number.

  • slope – The slope type, must be one of following values: NEG, POS, WINDOW

Returns:

The trigger slope of selected channel

arm_trigger()

Start a new signal acquisition.

stop_acquisition()

Stop acquisition.

get_trigger_state() int

Query the internal state change register. Not that this query returns only values of 0th bit or 13th bit.

Returns:

No signal acquired, register is cleared. 1: A new signal has been acquired. 8192: Trigger is ready, no acquisition. 8193: Trigger is ready, acquisition stopped.

Return type:

Value in range of 16 bits. 0

screen_dump() bytes

Query oscilloscope for screen dump.

Returns:

Raw bytes of a bitmap of the oscilloscope display.

get_waveform(channel: int | str) bytes

Saves and acquires the raw bytes of a waveform trace for a specified source from the oscilloscope waveform memory. This can come from analog or digital channels or from FFT waveform (“MATH”).

Parameters:

channel – Specific channel number for channels C1-C4 OR trace source from list {MATH,D0,D1,D2,…,D15}

Returns:

Raw bytes of the waveform.

trace_dump(channel: int) Tuple[ndarray, ndarray]

Query oscilloscope for trace dump of specified channel. See page 331 from Programming guide [PG01-E02C]

Parameters:

channel – Channel which trace should be dumped.

Returns:

Tuple containing the time and voltage data of the trace of the specified channel.

force_unlock() None

Forcefully unlock the remote object.

This unlocks the object, regardless of who owns the lock. This allows you to unlock an object if the locking proxy has been destroyed without unlocking.

Use this with care.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

classmethod get_category() str | None

Return the optional name of the category this object belongs to.

A category name is a free-form string that has no special significance. Its purpose is to distinguish between groups of RPC objects that fulfill similar roles.

get_name() str

Return the name of this object.

Returns:

name attribute.

get_signals() list[SignalDescription]

Return a list of signals that can be published by this object.

Returns:

List consisting of qmi_signals attributes.

is_locked() bool

Query if the remote object is locked.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

is_open() bool

Return True if the instrument is open (ready for interaction).

lock(timeout: float = 0.0, lock_token: str | None = None) bool

Lock the remote object. If timeout is given, try every 0.1s within the given timeout value. The remote object can be locked with an optional custom lock token by giving a string into lock_token keyword argument.

If successful, this proxy is the only proxy that can invoke RPC methods on the remote object; other proxies will receive an “object is locked” response. The return value indicates if the lock was granted; a denied lock means the object was already locked by another proxy.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

release_rpc_object() None

Give a warning if the instrument is removed while still open.

unlock(lock_token: str | None = None) bool

Unlock the remote object.

Without optional parameters, this is only allowed by the proxy that initially locked the object. By giving the lock token as an input parameter, the specific object locked by this token can be unlocked. The return value indicates if the unlocking was successful.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.