Signal Hound Drivers

Classes:

SignalHoundUSBSA124B(name[, dll_path])

QCoDeS driver for the SignalHound USB SA124B

class qcodes.instrument_drivers.signal_hound.SignalHoundUSBSA124B(name: str, dll_path: str | None = None, **kwargs: Unpack[InstrumentBaseKWArgs])[source]

Bases: Instrument

QCoDeS driver for the SignalHound USB SA124B

The driver needs Signal Hounds software Spike installed to function. In addition, you may need to install Microsoft Visual Studio C++ Redistributable for the driver to function within QCoDeS. At the time of writing the current version of Spike (3.2.3) uses Microsoft Visual Studio C++ Redistributable 2012

Parameters:
  • name – Name of the instrument.

  • dll_path – Path to sa_api.dll Defaults to the default dll within Spike installation

  • **kwargs – kwargs are forwarded to base class.

Attributes:

dll_path

frequency

Center frequency for sweep.

span

Width of frequency span.

npts

Number of points in frequency sweep.

avg

Number of averages to perform.

ref_lvl

Setting reference level will automatically select gain and attenuation optimal for measuring at and below this level

external_reference

Use an external 10 MHz reference source.

device_type

Parameter device_type

device_mode

The driver currently only supports sweeping mode.

acquisition_mode

The driver only supports averaging mode.

rbw

Resolution Bandwidth (RBW) is the bandwidth of spectral energy represented in each frequency bin

vbw

The video bandwidth (VBW) is applied after the signal has been converted to frequency domain as power, voltage, or log units.

reject_image

Apply software filter to remove undersampling mirroring

sleep_time

Time to sleep before and after getting data from the instrument

trace

Parameter trace

power

The maximum power in a window of 250 kHz around the specified frequency with Resolution bandwidth set to 1 kHz.

scale

Parameter scale

frequency_axis

Parameter frequency_axis

freq_sweep

Parameter freq_sweep

Methods:

sync_parameters()

Sync parameters sets the configuration of the instrument using the parameters specified in the Qcodes instrument.

configure()

Syncs parameters to the Instrument and updates the setpoint of the trace.

openDevice()

Opens connection to the instrument

close()

Close connection to the instrument.

abort()

Abort any running acquisition.

preset()

Like close but performs a hardware reset before closing the connection.

QuerySweep()

Queries the sweep for information on the parameters that defines the x axis of the sweep

check_for_error(err, source[, extrainfo])

get_idn()

Parse a standard VISA *IDN? response into an ID dict.

dll_path = 'C:\\Program Files\\Signal Hound\\Spike\\sa_api.dll'
frequency: SweepTraceParameter = self.add_parameter( "frequency", label="Frequency", unit="Hz", initial_value=5e9, vals=vals.Numbers(), parameter_class=SweepTraceParameter, docstring="Center frequency for sweep. " "This is the set center, the actual " "center may be subject to round off " "compared to this value", )

Center frequency for sweep.

This is the set center, the actual center may be subject to round off compared to this value

span: SweepTraceParameter = self.add_parameter( "span", label="Span", unit="Hz", initial_value=0.25e6, vals=vals.Numbers(), parameter_class=SweepTraceParameter, docstring="Width of frequency span. " "This is the set span, the actual " "span may be subject to round off " "compared to this value", )

Width of frequency span.

This is the set span, the actual span may be subject to round off compared to this value

npts: Parameter = self.add_parameter( "npts", label="Number of Points", get_cmd=self._get_npts, set_cmd=False, docstring="Number of points in frequency sweep.", )

Number of points in frequency sweep.

avg: Parameter = self.add_parameter( "avg", label="Averages", initial_value=1, get_cmd=None, set_cmd=None, vals=vals.Ints(), docstring="Number of averages to perform. " "Averages are performed in software by " "acquiring multiple sweeps", )

Number of averages to perform.

Averages are performed in software by acquiring multiple sweeps

ref_lvl: TraceParameter = self.add_parameter( "ref_lvl", label="Reference power", unit="dBm", initial_value=0, vals=vals.Numbers(max_value=20), parameter_class=TraceParameter, docstring="Setting reference level will " "automatically select gain and attenuation " "optimal for measuring at and below " "this level", )

Setting reference level will automatically select gain and attenuation optimal for measuring at and below this level

external_reference: ExternalRefParameter = self.add_parameter( "external_reference", initial_value=False, vals=vals.Bool(), parameter_class=ExternalRefParameter, docstring="Use an external 10 MHz reference source. " "Note that Signal Hound does not support " "disabling external ref. To disable close " "the connection and restart.", )

Use an external 10 MHz reference source.

Note that Signal Hound does not support disabling external ref. To disable close the connection and restart.

device_type: Parameter = self.add_parameter( "device_type", set_cmd=False, get_cmd=self._get_device_type )

Parameter device_type

device_mode: Parameter = self.add_parameter( "device_mode", get_cmd=lambda: "sweeping", set_cmd=False, docstring="The driver currently only " "supports sweeping mode. " "It is therefor not possible " "to set this parameter to anything else", )

The driver currently only supports sweeping mode.

It is therefor not possible to set this parameter to anything else

acquisition_mode: Parameter = self.add_parameter( "acquisition_mode", get_cmd=lambda: "average", set_cmd=False, docstring="The driver only supports averaging " "mode it is therefor not possible to set " "this parameter to anything else", )

The driver only supports averaging mode.

It is therefor not possible to set this parameter to anything else

rbw: TraceParameter = self.add_parameter( "rbw", label="Resolution Bandwidth", unit="Hz", initial_value=1e3, vals=vals.Numbers(0.1, 250e3), parameter_class=TraceParameter, docstring="Resolution Bandwidth (RBW) is " "the bandwidth of " "spectral energy represented in each " "frequency bin", )

Resolution Bandwidth (RBW) is the bandwidth of spectral energy represented in each frequency bin

vbw: TraceParameter = self.add_parameter( "vbw", label="Video Bandwidth", unit="Hz", initial_value=1e3, vals=vals.Numbers(), parameter_class=TraceParameter, docstring="The video bandwidth (VBW) is applied " "after the signal has been converted to " "frequency domain as power, voltage, " "or log units. It is implemented as a " "simple rectangular window, averaging the " "amplitude readings for each frequency " "bin over several overlapping FFTs. " "For best performance use RBW as the VBW.", )

The video bandwidth (VBW) is applied after the signal has been converted to frequency domain as power, voltage, or log units. It is implemented as a simple rectangular window, averaging the amplitude readings for each frequency bin over several overlapping FFTs. For best performance use RBW as the VBW.

reject_image: TraceParameter = self.add_parameter( "reject_image", label="Reject image", unit="", initial_value=True, parameter_class=TraceParameter, get_cmd=None, docstring="Apply software filter to remove undersampling mirroring", vals=vals.Bool(), )

Apply software filter to remove undersampling mirroring

sleep_time: Parameter = self.add_parameter( "sleep_time", label="Sleep time", unit="s", initial_value=0.1, get_cmd=None, set_cmd=None, docstring="Time to sleep before and after " "getting data from the instrument", vals=vals.Numbers(0), )

Time to sleep before and after getting data from the instrument

trace: FrequencySweep = self.add_parameter( name="trace", sweep_len=1, start_freq=1, stepsize=1, parameter_class=FrequencySweep, )

Parameter trace

power: Parameter = self.add_parameter( "power", label="Power", unit="dBm", get_cmd=self._get_power_at_freq, set_cmd=False, docstring="The maximum power in a window of 250 kHz " "around the specified frequency with " "Resolution bandwidth set to 1 kHz." "The integration window is specified by " "the VideoBandWidth (set by vbw)", )

The maximum power in a window of 250 kHz around the specified frequency with Resolution bandwidth set to 1 kHz.

The integration window is specified by the VideoBandWidth (set by vbw)

scale: ScaleParameter = self.add_parameter( "scale", initial_value="log-scale", vals=vals.Enum( "log-scale", "lin-scale", "log-full-scale", "lin-full-scale" ), parameter_class=ScaleParameter, )

Parameter scale

frequency_axis: Parameter = self.add_parameter( "frequency_axis", label="Frequency", unit="Hz", get_cmd=self._get_freq_axis, set_cmd=False, vals=vals.Arrays(shape=(self.npts,)), snapshot_value=False, )

Parameter frequency_axis

freq_sweep: ParameterWithSetpoints = self.add_parameter( "freq_sweep", label="Power", unit="depends on mode", get_cmd=self._get_sweep_data, set_cmd=False, parameter_class=ParameterWithSetpoints, vals=vals.Arrays(shape=(self.npts,)), setpoints=(self.frequency_axis,), snapshot_value=False, )

Parameter freq_sweep

sync_parameters() None[source]

Sync parameters sets the configuration of the instrument using the parameters specified in the Qcodes instrument.

Sync parameters consists of five parts
  1. Center span configuration (freqs and span)

  2. Acquisition configuration

    lin-scale/log-scale avg/max power

  3. Configuring the external 10MHz reference

  4. Configuration of the mode that is being used

  5. Acquisition mode. At the moment only sweeping is implemented

This does not currently implement Configuration of the tracking generator used in VNA mode

configure() None[source]

Syncs parameters to the Instrument and updates the setpoint of the trace.

openDevice() None[source]

Opens connection to the instrument

close() None[source]

Close connection to the instrument.

abort() None[source]

Abort any running acquisition.

preset() None[source]

Like close but performs a hardware reset before closing the connection.

QuerySweep() tuple[int, float, float][source]

Queries the sweep for information on the parameters that defines the x axis of the sweep

Returns:

number of points in sweep, start frequency and step size

static check_for_error(err: int, source: str, extrainfo: str | None = None) None[source]
get_idn() dict[str, str | None][source]

Parse a standard VISA *IDN? response into an ID dict.

Even though this is the VISA standard, it applies to various other types as well, such as IPInstruments, so it is included here in the Instrument base class.

Override this if your instrument does not support *IDN? or returns a nonstandard IDN string. This string is supposed to be a comma-separated list of vendor, model, serial, and firmware, but semicolon and colon are also common separators so we accept them here as well.

Returns:

A dict containing vendor, model, serial, and firmware.

parameters: dict[str, ParameterBase] = {}

All the parameters supported by this instrument. Usually populated via add_parameter().

functions: dict[str, Function] = {}

All the functions supported by this instrument. Usually populated via add_function().

submodules: dict[str, InstrumentModule | ChannelTuple] = {}

All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via add_submodule().

instrument_modules: dict[str, InstrumentModule] = {}

All the InstrumentModule of this instrument Usually populated via add_submodule().

log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)
metadata: dict[str, Any] = {}