qmi.instruments.tektronix.afg31000

Instrument driver for the Tektronix AFG31000 series arbitrary function generator.

Classes

BurstMode(value)

Burst mode.

Tektronix_AFG31000(context, name, transport)

Instrument driver for the Tektronix AFG31000 series arbitrary function generator.

TriggerEdge(value)

Trigger edge.

Waveform(value)

Waveform shape.

class qmi.instruments.tektronix.afg31000.Waveform(value)

Waveform shape.

class qmi.instruments.tektronix.afg31000.BurstMode(value)

Burst mode.

class qmi.instruments.tektronix.afg31000.TriggerEdge(value)

Trigger edge.

class qmi.instruments.tektronix.afg31000.Tektronix_AFG31000(context: QMI_Context, name: str, transport: str)

Instrument driver for the Tektronix AFG31000 series arbitrary function generator.

This driver has been tested with the AFG31022 but probably works with all AFG31000 series instruments.

This driver communicates with the instrument via USB or via Ethernet.

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.

reset() None

Reset most instrument settings to factory defaults.

This function is equivalent to the “default” button on the front panel.

get_idn() QMI_InstrumentIdentification

Read instrument type and version and return QMI_InstrumentIdentification instance.

get_external_reference_enabled() bool

Return True if the external reference clock input is selected.

set_external_reference_enabled(enable: bool) None

Choose internal or external reference clock source.

Parameters:

enable – True to select the external 10 MHz reference clock input. False to select the internal reference source.

get_output_enabled(channel: int) bool

Return True if the specified output is enabled.

Parameters:

channel – Output channel (1 or 2).

Returns:

True if the specified output is enabled, False if disabled.

set_output_enabled(channel: int, enable: bool) None

Enable or disable the specified output channel.

Parameters:
  • channel – Output channel (1 or 2).

  • enable – True to enable the output, False to disable.

get_waveform(channel: int) Waveform

Return the current waveform for the specified channel.

Parameters:

channel – Output channel (1 or 2).

Returns:

A Waveform constant.

set_waveform(channel: int, waveform: Waveform) None

Set the waveform for the specified channel.

Selecting a waveform that is not compatible with the current modulation type, will cause the modulation type to be set to Continuous.

Parameters

channel: Output channel (1 or 2). waveform: A Waveform constant specifying the new waveform.

Waveforms EMEMORY and EFILE are currently not supported by this driver.

get_sweep_enabled(channel: int) bool

Return True if frequency sweeping is enabled for the specified channel.

Parameters:

channel – Output channel (1 or 2).

Returns:

True if frequency sweeping is enabled, False if disabled.

get_continuous_frequency(channel: int) float

Return the frequency of the output waveform.

This command is not available when frequency sweeping is enabled.

Parameters:

channel – Output channel (1 or 2).

Returns:

Output frequency in Hz.

set_continuous_frequency(channel: int, frequency: float) None

Set the channel to fixed frequency mode with the specified frequency.

This command disables frequency sweeping and enables fixed frequency (continuous) mode.

Parameters:
  • channel – Output channel (1 or 2).

  • frequency – New output frequency in Hz.

get_amplitude(channel: int) Tuple[float, float]

Return the current output amplitude levels.

Parameters:

channel – Output channel (1 or 2).

Returns:

Tuple (low, high) of output levels in Volt.

set_amplitude(channel: int, vlow: float, vhigh: float) None

Set the output amplitude levels for the specified channel.

Parameters:
  • channel – Output channel (1 or 2).

  • vlow – Low output amplitude in Volt.

  • vhigh – High output amplitude in Volt.

get_pulse_duty_cycle(channel: int) float

Return the current pulse duty cycle for the specified channel.

Parameters:

channel – Output channel (1 or 2).

Returns:

Duty cycle as a percentage between 0.0 and 100.0.

set_pulse_duty_cycle(channel: int, duty_cycle: float) None

Set the pulse duty cycle for the specified channel.

This function also configures the instrument to hold the duty cycle fixed when the pulse frequency is changed (thus changing the pulse width).

Parameters:
  • channel – Output channel (1 or 2).

  • duty_cycle – New duty cycle as a percentage between 0.0 and 100.0. The valid range also depends on the pulse frequency and the transition times.

get_pulse_delay(channel: int) float

Return the current pulse delay for the specified channel.

Parameters:

channel – Output channel (1 or 2).

Returns:

Pulse lead delay in seconds.

set_pulse_delay(channel: int, delay: float) None

Set pulse delay for the specified channel.

The minimum allowed pulse delay is 0. The maximum allowed pulse delay depends on the pulse period and duty cycle. The pulse delay must be less than the pulse period. In burst mode, the delayed pulse must end before a non-delayed next pulse would have started.

Parameters:
  • channel – Output channel (1 or 2).

  • delay – New pulse lead delay in seconds.

get_burst_mode(channel: int) BurstMode

Return the current burst mode for the specified channel.

Parameters:

channel – Output channel (1 or 2).

Returns:

BurstMode.TRIGGERED or BurstMode.GATED.

set_burst_mode(channel: int, mode: BurstMode) None

Set the burst mode of the specified channel.

Parameters:
  • channel – Output channel (1 or 2).

  • mode – Burst mode (BurstMode.TRIGGERED or BurstMode.GATED).

get_burst_count(channel: int) int | float

Return the number of cycles in burst mode.

Parameters:

channel – Output channel (1 or 2).

Returns:

Number of cycles per output burst, or math.inf for infinite cycles.

set_burst_count(channel: int, cycles: int | float) None

Set the number of cycles in burst mode.

Parameters:
  • channel – Output channel (1 or 2).

  • cycles – Number of cycles, range 1 to 10**6, or math.inf for infinite cycles.

get_burst_enabled(channel: int) bool

Return True if burst mode is enabled for the specified channel.

Parameters:

channel – Output channel (1 or 2).

Returns:

True if burst mode is enabled for the specified channel, False if disabled.

set_burst_enabled(channel: int, enable: bool) None

Enable or disable burst mode for the specified channel.

Parameters:
  • channel – Output channel (1 or 2).

  • enable – True to enable burst mode, False to disable.

get_external_trigger_enabled() bool

Return True if the external trigger input is enabled.

set_external_trigger_enabled(enable: bool) None

Enable or disable the external trigger input.

Parameters:

enable – True to select the external trigger input. False to select the internal timer as trigger source.

get_trigger_edge() TriggerEdge

Return the current trigger edge.

Returns:

TriggerEdge.RISING or TriggerEdge.FALLING.

set_trigger_edge(edge: TriggerEdge) None

Set the trigger edge.

Parameters:

edge – Either TriggerEdge.RISING or TriggerEdge.FALLING.

get_output_load_impedance(channel: int) float

Return the configured load impedance of the specified output channel.

Parameters:

channel – Output channel (1 or 2).

Returns:

Assumed load impedance in Ohm, or math.inf for open circuit.

set_output_load_impedance(channel: int, impedance: float) None

Configure the load impedance of the specified output channel.

Note: The output impedance of the instrument is fixed at 50 Ohm. This command configures the impedance of the load that is assumed to be connected to the output. This affects the calculation of output amplitudes.

Parameters:
  • channel – Output channel (1 or 2).

  • impedance – Load impedance in Ohm, range 1 to 10000, or math.inf to assume open circuit.

get_output_inverted(channel: int) bool

Return True if the output polarity of the specified channel is inverted.

Parameters:

channel – Output channel (1 or 2).

Returns:

True if polarity is inverted, False if polarity is normal.

set_output_inverted(channel: int, enable: bool) None

Enable or disable inverted output polarity.

Parameters:
  • channel – Output channel (1 or 2).

  • enable – True to select inverted output, False to select normal output polarity.

set_display_brightness(brightness: float) None

Set brightness of the touchscreen display.

Parameters:

brightness – Display brightness in range 0.0 to 1.0. Value 0.0 is the lowest brightness but does not completely disable the display.

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.