DS345 Function Generator#

class QInstrument.instruments.StanfordResearch.DS345.instrument.QDS345(portName=None, **kwargs)[source]#

Bases: QSerialInstrument

SRS DS345 Function Generator

Properties#

Function Output#

amplitude: float [V]

Peak-to-peak output amplitude. Range: 0 <= amplitude <= 5, amplitude + |offset| <= 5

frequency: float [Hz]

Output frequency. Range by waveform:

  • sine, square: 1 μHz – 30.2 MHz

  • triangle, ramp: 1 μHz – 100 kHz

  • arbitrary: 2.329 mHz – 40 MHz (sampling rate)

  • noise: 10 MHz (fixed)

invert: bool

True: invert output polarity.

mute: bool

True: silence output (saves and restores amplitude).

offset: float [V]

DC offset voltage. Range: -5 <= offset <= 5, amplitude + |offset| <= 5

phase: float [degrees]

Output waveform phase. Range: 0.001 – 7199.999 Note: raises an instrument error if waveform is noise (4) or arbitrary (5), or if a sweep or FM is active.

waveform: int

Output waveform. 0: sine, 1: square, 2: triangle, 3: ramp, 4: noise, 5: arbitrary

Output Modulation#

modulation: bool

True: enable output modulation.

modulation_type: int

0: linear sweep, 1: log sweep, 2: AM, 3: FM, 4: PM, 5: burst

modulation_waveform: int

Modulating waveform. 0: single, 1: ramp, 2: triangle, 3: sine, 4: square, 5: arbitrary, 6: none (burst mode) Note: arbitrary (5) is valid for AM, FM, and PM only, and the waveform must be loaded before enabling modulation.

modulation_rate: float [Hz]

Modulation rate. Range: 0.001 – 10000

burst_count: int

Number of cycles per burst. Range: 1 – 30000 (burst time must not exceed 500 s)

am_depth: int [%]

AM modulation depth. Range: 0 – 100. Negative values enable double-sideband suppressed-carrier (DSBSC) modulation.

fm_span: float [Hz]

Peak frequency deviation for FM. Range: 0 – 2 * frequency

pm_span: float [degrees]

Peak phase deviation for PM. Range: 0 – 7199.999

sweep_center_frequency: float [Hz]

Center frequency for frequency sweep. Range: 0 – waveform maximum

sweep_span: float [Hz]

Span for frequency sweep. Negative values sweep downward. Range: |sweep_span| <= 2 * sweep_center_frequency

sweep_start_frequency: float [Hz]

Start frequency for sweep. Range: 0 – waveform maximum

sweep_stop_frequency: float [Hz]

Stop frequency for sweep. Range: 0 – waveform maximum

trigger_rate: float [Hz]

Internal trigger rate for bursts and sweeps. Range: 0.001 – 10000 (rounded to 2 significant digits)

trigger_source: int

Trigger source for bursts and sweeps. 0: single (see trigger()), 1: internal rate, 2: external positive slope, 3: external negative slope, 4: line

Arbitrary Waveform#

sampling_frequency: float [Hz]

Sampling rate for arbitrary waveform playback. Range: 1 mHz – 40 MHz

comm = {'baudRate': qtpy.QtSerialPort.QSerialPort.BaudRate.Baud9600, 'dataBits': qtpy.QtSerialPort.QSerialPort.DataBits.Data8, 'eol': '\n', 'flowControl': qtpy.QtSerialPort.QSerialPort.FlowControl.NoFlowControl, 'parity': qtpy.QtSerialPort.QSerialPort.Parity.NoParity, 'stopBits': qtpy.QtSerialPort.QSerialPort.StopBits.TwoStop}#
identify()[source]#

Return True if the connected device identifies as a DS345.

Queries the instrument identification string (*IDN?) and checks for the 'DS345' model token in the response.

Return type:

bool

reset()[source]#

Reset the DS345 to its factory default settings.

Return type:

None

trigger()[source]#

Issue a single trigger for a burst or sweep.

Only effective when trigger_source is 0 (single trigger mode). Logs a warning otherwise.

Return type:

None

set_span_from_markers()[source]#

Set the sweep span from the current marker positions (MKSP).

Return type:

None

set_markers_from_span()[source]#

Set the marker positions from the current sweep span (SPMK).

Return type:

None

set_ttl()[source]#

Set output amplitude and offset to TTL levels.

Return type:

None

set_ecl()[source]#

Set output amplitude and offset to ECL levels.

Return type:

None

load_waveform(waveform)[source]#

Load an arbitrary waveform into the DS345.

Parameters:

waveform (ArrayLike) – Up to 16300 samples. Values are clipped and rounded to the range [-2048, 2047] before transmission.

Return type:

None

amplitude_modulation(waveform)[source]#

Load an arbitrary amplitude modulation waveform.

Configures the instrument for arbitrary AM and uploads the waveform. Modulation is enabled on completion.

Parameters:

waveform (ArrayLike) – Up to 10000 samples normalized to [-1, 1], where -1 is full off and +1 is full on.

Return type:

None

class QInstrument.instruments.StanfordResearch.DS345.fake.QFakeDS345(*args, **kwargs)[source]#

Bases: QFakeInstrument, QDS345

Fake DS345 for UI development without hardware.

All standard properties are backed by an in-memory store via QFakeInstrument._register(). Two properties are re-registered after the parent registration runs:

  • amplitude: the real instrument uses a non-standard response format ('1.000VP'), so the fake uses a plain float store entry.

  • mute: the real setter calls transmit(), which is a no-op in the fake. The fake setter updates _store['amplitude'] directly so that the amplitude widget reflects the muted/unmuted state.

identify()[source]#

Return True if the connected device identifies as a DS345.

Queries the instrument identification string (*IDN?) and checks for the 'DS345' model token in the response.

Return type:

bool

class QInstrument.instruments.StanfordResearch.DS345.widget.QDS345Widget(*args: Any, **kwargs: Any)[source]#

Bases: QInstrumentWidget

Stanford Research Systems DS345 Function Generator

UIFILE = 'DS345Widget.ui'#
INSTRUMENT#

alias of QDS345

class QInstrument.instruments.StanfordResearch.DS345.tree.QDS345Tree(*args, device=None, fields=None, **kwargs)[source]#

Bases: QInstrumentTree

Parameter tree for the Stanford Research Systems DS345 Function Generator.

INSTRUMENT#

alias of QDS345