qmi.instruments.rigol.dg4102

Instrument driver for the Rigol DG4102 Function/Arbitrary Waveform Generator. The instrument class is adapted from the very similar class Rohde und Schwarz SGS100A. Written by Matthew Weaver and Yanik Herrmann (m.j.weaver@tudelft.nl).

Classes

Rigol_Dg4102(context, name, transport[, ...])

Instrument driver for the Rigol DG4102 Function/Arbitrary Waveform Generator.

class qmi.instruments.rigol.dg4102.Rigol_Dg4102(context: QMI_Context, name: str, transport: str, init_source: int = 1)

Instrument driver for the Rigol DG4102 Function/Arbitrary Waveform Generator.

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_idn() QMI_InstrumentIdentification

Read instrument type and version.

Returns:

QMI_InstrumentIdentification instance.

set_source(new_source: int) None

Choose which source channel to control.

Parameters:

new_source – The new source channel number.

get_source() int

Return the source channel which is currently controlled

Returns:

The current source channel number.

get_output_state() bool

Return True if output is enabled, False if output is disabled.

Returns:

The output state.

Return type:

output_state

set_output_state(enable: bool) None

Enable or disable output

Parameters:

enable – The new output state. True for “ON”, False for “OFF”.

get_waveform() str

Return the current waveform.

Returns:

The current waveform text.

set_waveform(waveform: str) None

Set the waveform of a channel.

Parameters:

waveform – The new waveform type. Allowed waveforms are: SINusoid|SQUare|RAMP|PULSe|NOISe|USER|HARMonic|CUSTom|DC

get_frequency() float

Return the current frequency of a channel in Hz.

Returns:

The frequency of a channel.

set_frequency(frequency: float) None

Set the frequency of a channel in Hz.

Parameters:

frequency – The new channel frequency.

get_amplitude() float

Return the current amplitude of a channel in V.

Returns:

The channel amplitude.

set_amplitude(amplitude: float) None

Set the amplitude of a channel in V.

Parameters:

amplitude – The new channel amplitude.

get_offset() float

Return the current offset of a channel in V.

Returns:

The channel offset voltage.

set_offset(offset: float) None

Set the offset of a channel in V.

Parameters:

offset – The new channel offset voltage.

get_phase() float

Return the current phase of a channel in deg.

Returns:

The channel phase.

set_phase(phase: float) None

Set the phase of a channel in deg.

Parameters:

phase – The new channel phase.

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.