qmi.instruments.siglent.ssa3000x

Instrument driver for the Siglent SSA3000X spectrum analyzer.

Classes

SSA3000X(context, name, transport_descr)

Instrument driver for the Siglent SSA3000X spectrum analyzer.

class qmi.instruments.siglent.ssa3000x.SSA3000X(context: QMI_Context, name: str, transport_descr: str)

Instrument driver for the Siglent SSA3000X spectrum analyzer.

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 device identification string.

Returns:

Device identification string.

get_freq_span() float

Get the frequency span.

Returns:

Frequency span in Hz.

set_freq_span(span_freq: float) None

Sets the frequency span.

Note

Setting the span to 0 Hz puts the analyzer into zero span.

Parameters:

span_freq – Frequency span in Hz [0 or 100 to 3.2e9].

get_freq_center() float

Get the center frequency.

Returns:

Center frequency in Hz.

set_freq_center(center_freq: float) None

Sets the center frequency of the spectrum analyzer.

Parameters:

center_freq – Center frequency in Hz. If zero span, center frequency can be 0 ~ 3.2 GHz, else 50 Hz ~ 3.199999950 GHz.

get_freq_start() float

Get the start frequency.

Returns:

Start frequency in Hz.

get_freq_stop() float

Get the stop frequency.

Returns:

Stop frequency in Hz.

get_trace_format() str

Get the format of the trace data.

Returns:

single precision floating point values “ASCii”: ASCii string representation of values

Return type:

“REAL”

get_trace(channel: int) List[float]

Retrieve trace data from specified channel.

Parameters:

retreived. (Channel for which trace should be)

Returns:

The trace data as a list of floats.

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

Retrieve spectrum data from the specified channel.

Parameters:

retreived. (Channel for which spectrum should be)

Returns:

Tuple containing the frequency and amplitude 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.