Stanford Research Systems Drivers¶
Classes:
|
QCoDeS driver for the Stanford Research Systems SG384 RF Signal Generator. |
|
QCoDeS driver for the Stanford Research Systems SR560 Voltage-preamplifier. |
|
QCoDeS driver for the Stanford Research Systems SR830 Lock-in Amplifier. |
|
QCoDeS driver for the Stanford Research Systems SR860 Lock-in Amplifier. |
|
QCoDeS driver for the Stanford Research Systems SR865 Lock-in Amplifier. |
|
QCoDeS driver for the Stanford Research Systems SR865A Lock-in Amplifier. |
|
Base class for Stanford SR86x Lock-in Amplifier drivers. |
|
Buffer module for the SR86x drivers. |
- class qcodes.instrument_drivers.stanford_research.SG384(name: str, address: str, reset: bool = False, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
VisaInstrument
QCoDeS driver for the Stanford Research Systems SG384 RF Signal Generator.
Status: beta version Includes the essential commands from the manual
Attributes:
default_terminator
The default terminator to use if the terminator is not specified when creating the instrument.
frequency
Parameter frequency
phase
Parameter phase
amplitude_LF
Parameter amplitude_LF
amplitude_RF
Parameter amplitude_RF
amplitude_HF
Parameter amplitude_HF
amplitude_clock
Parameter amplitude_clock
noise_mode
Parameter noise_mode
enable_RF
Parameter enable_RF
enable_LF
Parameter enable_LF
enable_HF
Parameter enable_HF
enable_clock
Parameter enable_clock
offset_clock
Parameter offset_clock
offset_rearDC
Parameter offset_rearDC
offset_bnc
Parameter offset_bnc
modulation_coupling
Parameter modulation_coupling
FM_deviation
Parameter FM_deviation
modulation_function
Parameter modulation_function
enable_modulation
Parameter enable_modulation
modulation_rate
Parameter modulation_rate
modulation_type
Parameter modulation_type
- default_terminator: str | None = '\n'¶
The default terminator to use if the terminator is not specified when creating the instrument. None means use the default terminator from PyVisa.
- frequency: Parameter = self.add_parameter( name="frequency", label="Frequency", unit="Hz", get_cmd="FREQ?", set_cmd="FREQ {:.3f}", get_parser=float, vals=vals.Numbers(min_value=9.5e5, max_value=4.05e9), )¶
Parameter frequency
- phase: Parameter = self.add_parameter( name="phase", label="Carrier phase", unit="deg", get_cmd="PHAS?", set_cmd="PHAS {:.1f}", get_parser=float, vals=vals.Numbers(min_value=-360, max_value=360), )¶
Parameter phase
- amplitude_LF: Parameter = self.add_parameter( name="amplitude_LF", label="Power of BNC output", unit="dBm", get_cmd="AMPL?", set_cmd="AMPL {:.2f}", get_parser=float, vals=vals.Numbers(min_value=-47, max_value=13), )¶
Parameter amplitude_LF
- amplitude_RF: Parameter = self.add_parameter( name="amplitude_RF", label="Power of type-N RF output", unit="dBm", get_cmd="AMPR?", set_cmd="AMPR {:.2f}", get_parser=float, vals=vals.Numbers(min_value=-110, max_value=16.5), )¶
Parameter amplitude_RF
- amplitude_HF: Parameter = self.add_parameter( name="amplitude_HF", label="Power of RF doubler output", unit="dBm", get_cmd="AMPH?", set_cmd="AMPH {:.2f}", get_parser=float, vals=vals.Numbers(min_value=-10, max_value=13), )¶
Parameter amplitude_HF
- amplitude_clock: Parameter = self.add_parameter( name="amplitude_clock", label="Rear clock output", unit="Vpp", get_cmd="AMPC?", set_cmd="AMPC {:.2f}", get_parser=float, vals=vals.Numbers(min_value=0.4, max_value=1.00), )¶
Parameter amplitude_clock
- noise_mode: Parameter = self.add_parameter( name="noise_mode", label="RF PLL loop filter mode", get_cmd="NOIS?", set_cmd="NOIS {}", val_mapping={"Mode 1": 0, "Mode 2": 1}, )¶
Parameter noise_mode
- enable_RF: Parameter = self.add_parameter( name="enable_RF", label="Type-N RF output", get_cmd="ENBR?", set_cmd="ENBR {}", val_mapping={"OFF": 0, "ON": 1}, )¶
Parameter enable_RF
- enable_LF: Parameter = self.add_parameter( name="enable_LF", label="BNC output", get_cmd="ENBL?", set_cmd="ENBL {}", val_mapping={"OFF": 0, "ON": 1}, )¶
Parameter enable_LF
- enable_HF: Parameter = self.add_parameter( name="enable_HF", label="RF doubler output", get_cmd="ENBH?", set_cmd="ENBH {}", val_mapping={"OFF": 0, "ON": 1}, )¶
Parameter enable_HF
- enable_clock: Parameter = self.add_parameter( name="enable_clock", label="Rear clock output", get_cmd="ENBC?", set_cmd="ENBC {}", val_mapping={"OFF": 0, "ON": 1}, )¶
Parameter enable_clock
- visa_handle: pyvisa.resources.MessageBasedResource = visa_handle¶
The VISA resource used by this instrument.
- 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 viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- offset_clock: Parameter = self.add_parameter( name="offset_clock", label="Rear clock offset voltage", unit="V", get_cmd="OFSC?", set_cmd="OFSC {}", get_parser=float, vals=vals.Numbers(min_value=-2, max_value=2), )¶
Parameter offset_clock
- offset_rearDC: Parameter = self.add_parameter( name="offset_rearDC", label="Rear DC offset voltage", unit="V", get_cmd="OFSD?", set_cmd="OFSD {}", get_parser=float, vals=vals.Numbers(min_value=-10, max_value=10), )¶
Parameter offset_rearDC
- offset_bnc: Parameter = self.add_parameter( name="offset_bnc", label="Low frequency BNC output", unit="V", get_cmd="OFSL?", set_cmd="OFSL {}", get_parser=float, vals=vals.Numbers(min_value=-1.5, max_value=1.5), )¶
Parameter offset_bnc
- modulation_coupling: Parameter = self.add_parameter( name="modulation_coupling", label="External modulation input coupling", get_cmd="COUP?", set_cmd="COUP {}", val_mapping={"AC": 0, "DC": 1}, )¶
Parameter modulation_coupling
- FM_deviation: Parameter = self.add_parameter( name="FM_deviation", label="Frequency modulation deviation", unit="Hz", get_cmd="FDEV?", set_cmd="FDEV {:.1f}", get_parser=float, vals=vals.Numbers(min_value=0.1, max_value=32e6), )¶
Parameter FM_deviation
- modulation_function: Parameter = self.add_parameter( name="modulation_function", label="Modulation function for AM/FM/PhiM", get_cmd="MFNC?", set_cmd="MFNC {}", val_mapping={ "Sine": 0, "Ramp": 1, "Triangle": 2, "Square": 3, "Noise": 4, "External": 5, }, )¶
Parameter modulation_function
- enable_modulation: Parameter = self.add_parameter( name="enable_modulation", get_cmd="MODL?", set_cmd="MODL {}", val_mapping={"OFF": 0, "ON": 1}, )¶
Parameter enable_modulation
- class qcodes.instrument_drivers.stanford_research.SR560(name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
Instrument
QCoDeS driver for the Stanford Research Systems SR560 Voltage-preamplifier.
This is a virtual driver only and will not talk to your instrument.
Note
The
cutoff_lo
andcutoff_hi
parameters will interact with each other on the instrument (hi cannot be <= lo) but this is not managed here, you must ensure yourself that both are correct whenever you change one of them.gain
has a vernier setting, which does not yield a well-defined output. We restrict this driver to only the predefined gain values.
Attributes:
cutoff_lo
Parameter cutoff_lo
cutoff_hi
Parameter cutoff_hi
invert
Parameter invert
gain
Parameter gain
Methods:
get_idn
()Parse a standard VISA
*IDN?
response into an ID dict.- cutoff_lo: Parameter = self.add_parameter( "cutoff_lo", get_cmd=None, set_cmd=None, initial_value="DC", label="High pass", unit="Hz", vals=Enum(*cutoffs), )¶
Parameter cutoff_lo
- cutoff_hi: Parameter = self.add_parameter( "cutoff_hi", get_cmd=None, set_cmd=None, initial_value=1e6, label="Low pass", unit="Hz", vals=Enum(*cutoffs), )¶
Parameter cutoff_hi
- invert: Parameter = self.add_parameter( "invert", get_cmd=None, set_cmd=None, initial_value=True, label="Inverted output", vals=Bool(), )¶
Parameter invert
- 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 viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- gain: Parameter = self.add_parameter( "gain", get_cmd=None, set_cmd=None, initial_value=10, label="Gain", unit=None, vals=Enum(*gains), )¶
Parameter gain
- 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.
- class qcodes.instrument_drivers.stanford_research.SR830(name: str, address: str, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
VisaInstrument
QCoDeS driver for the Stanford Research Systems SR830 Lock-in Amplifier.
Attributes:
phase
Parameter phase
reference_source
Parameter reference_source
frequency
Parameter frequency
ext_trigger
Parameter ext_trigger
harmonic
Parameter harmonic
amplitude
Parameter amplitude
input_config
Parameter input_config
input_shield
Parameter input_shield
input_coupling
Parameter input_coupling
notch_filter
Parameter notch_filter
sensitivity
Parameter sensitivity
reserve
Parameter reserve
time_constant
Parameter time_constant
filter_slope
Parameter filter_slope
sync_filter
Parameter sync_filter
X_offset
Parameter X_offset
Y_offset
Parameter Y_offset
R_offset
Parameter R_offset
output_interface
Parameter output_interface
X
Parameter X
Y
Parameter Y
R
Parameter R
P
Parameter P
complex_voltage
Complex voltage parameter calculated from X, Y phase using Z = X +j*Y
buffer_SR
Parameter buffer_SR
buffer_acq_mode
Parameter buffer_acq_mode
buffer_trig_mode
Parameter buffer_trig_mode
buffer_npts
Parameter buffer_npts
sweep_setpoints
Parameter sweep_setpoints
SNAP_PARAMETERS
Methods:
snap
(*parameters)Get between 2 and 6 parameters at a single instant.
increment_sensitivity
()Increment the sensitivity setting of the lock-in.
decrement_sensitivity
()Decrement the sensitivity setting of the lock-in.
autorange
([max_changes])Automatically changes the sensitivity of the instrument according to the R value and defined max_changes.
set_sweep_parameters
(sweep_param, start, stop)- phase: Parameter = self.add_parameter( "phase", label="Phase", get_cmd="PHAS?", get_parser=float, set_cmd="PHAS {:.2f}", unit="deg", vals=Numbers(min_value=-360, max_value=729.99), )¶
Parameter phase
- reference_source: Parameter = self.add_parameter( "reference_source", label="Reference source", get_cmd="FMOD?", set_cmd="FMOD {}", val_mapping={ "external": 0, "internal": 1, }, vals=Enum("external", "internal"), )¶
Parameter reference_source
- frequency: Parameter = self.add_parameter( "frequency", label="Frequency", get_cmd="FREQ?", get_parser=float, set_cmd="FREQ {:.4f}", unit="Hz", vals=Numbers(min_value=1e-3, max_value=102e3), )¶
Parameter frequency
- ext_trigger: Parameter = self.add_parameter( "ext_trigger", label="External trigger", get_cmd="RSLP?", set_cmd="RSLP {}", val_mapping={ "sine": 0, "TTL rising": 1, "TTL falling": 2, }, )¶
Parameter ext_trigger
- harmonic: Parameter = self.add_parameter( "harmonic", label="Harmonic", get_cmd="HARM?", get_parser=int, set_cmd="HARM {:d}", vals=Ints(min_value=1, max_value=19999), )¶
Parameter harmonic
- amplitude: Parameter = self.add_parameter( "amplitude", label="Amplitude", get_cmd="SLVL?", get_parser=float, set_cmd="SLVL {:.3f}", unit="V", vals=Numbers(min_value=0.004, max_value=5.000), )¶
Parameter amplitude
- input_config: Parameter = self.add_parameter( "input_config", label="Input configuration", get_cmd="ISRC?", get_parser=self._get_input_config, set_cmd="ISRC {}", set_parser=self._set_input_config, vals=Enum(*self._INPUT_CONFIG_TO_N.keys()), )¶
Parameter input_config
- input_shield: Parameter = self.add_parameter( "input_shield", label="Input shield", get_cmd="IGND?", set_cmd="IGND {}", val_mapping={ "float": 0, "ground": 1, }, )¶
Parameter input_shield
- input_coupling: Parameter = self.add_parameter( "input_coupling", label="Input coupling", get_cmd="ICPL?", set_cmd="ICPL {}", val_mapping={ "AC": 0, "DC": 1, }, )¶
Parameter input_coupling
- notch_filter: Parameter = self.add_parameter( "notch_filter", label="Notch filter", get_cmd="ILIN?", set_cmd="ILIN {}", val_mapping={ "off": 0, "line in": 1, "2x line in": 2, "both": 3, }, )¶
Parameter notch_filter
- sensitivity: Parameter = self.add_parameter( name="sensitivity", label="Sensitivity", get_cmd="SENS?", set_cmd="SENS {:d}", get_parser=self._get_sensitivity, set_parser=self._set_sensitivity, )¶
Parameter sensitivity
- reserve: Parameter = self.add_parameter( "reserve", label="Reserve", get_cmd="RMOD?", set_cmd="RMOD {}", val_mapping={ "high": 0, "normal": 1, "low noise": 2, }, )¶
Parameter reserve
- time_constant: Parameter = self.add_parameter( "time_constant", label="Time constant", get_cmd="OFLT?", set_cmd="OFLT {}", unit="s", val_mapping={ 10e-6: 0, 30e-6: 1, 100e-6: 2, 300e-6: 3, 1e-3: 4, 3e-3: 5, 10e-3: 6, 30e-3: 7, 100e-3: 8, 300e-3: 9, 1: 10, 3: 11, 10: 12, 30: 13, 100: 14, 300: 15, 1e3: 16, 3e3: 17, 10e3: 18, 30e3: 19, }, )¶
Parameter time_constant
- filter_slope: Parameter = self.add_parameter( "filter_slope", label="Filter slope", get_cmd="OFSL?", set_cmd="OFSL {}", unit="dB/oct", val_mapping={ 6: 0, 12: 1, 18: 2, 24: 3, }, )¶
Parameter filter_slope
- sync_filter: Parameter = self.add_parameter( "sync_filter", label="Sync filter", get_cmd="SYNC?", set_cmd="SYNC {}", val_mapping={ "off": 0, "on": 1, }, )¶
Parameter sync_filter
- X_offset: Parameter = self.add_parameter( "X_offset", get_cmd="OEXP? 1", get_parser=parse_offset_get )¶
Parameter X_offset
- Y_offset: Parameter = self.add_parameter( "Y_offset", get_cmd="OEXP? 2", get_parser=parse_offset_get )¶
Parameter Y_offset
- R_offset: Parameter = self.add_parameter( "R_offset", get_cmd="OEXP? 3", get_parser=parse_offset_get )¶
Parameter R_offset
- output_interface: Parameter = self.add_parameter( "output_interface", label="Output interface", get_cmd="OUTX?", set_cmd="OUTX {}", val_mapping={ "RS232": "0\n", "GPIB": "1\n", }, )¶
Parameter output_interface
- X: Parameter = self.add_parameter( "X", get_cmd="OUTP? 1", get_parser=float, unit="V" )¶
Parameter X
- Y: Parameter = self.add_parameter( "Y", get_cmd="OUTP? 2", get_parser=float, unit="V" )¶
Parameter Y
- R: Parameter = self.add_parameter( "R", get_cmd="OUTP? 3", get_parser=float, unit="V" )¶
Parameter R
- P: Parameter = self.add_parameter( "P", get_cmd="OUTP? 4", get_parser=float, unit="deg" )¶
Parameter P
- complex_voltage: Parameter = self.add_parameter( "complex_voltage", label="Voltage", get_cmd=self._get_complex_voltage, unit="V", docstring="Complex voltage parameter " "calculated from X, Y phase using " "Z = X +j*Y", vals=ComplexNumbers(), )¶
Complex voltage parameter calculated from X, Y phase using Z = X +j*Y
- buffer_SR: Parameter = self.add_parameter( "buffer_SR", label="Buffer sample rate", get_cmd="SRAT ?", set_cmd=self._set_buffer_SR, unit="Hz", val_mapping={ 62.5e-3: 0, 0.125: 1, 0.250: 2, 0.5: 3, 1: 4, 2: 5, 4: 6, 8: 7, 16: 8, 32: 9, 64: 10, 128: 11, 256: 12, 512: 13, "Trigger": 14, }, get_parser=int, )¶
Parameter buffer_SR
- buffer_acq_mode: Parameter = self.add_parameter( "buffer_acq_mode", label="Buffer acquistion mode", get_cmd="SEND ?", set_cmd="SEND {}", val_mapping={"single shot": 0, "loop": 1}, get_parser=int, )¶
Parameter buffer_acq_mode
- buffer_trig_mode: Parameter = self.add_parameter( "buffer_trig_mode", label="Buffer trigger start mode", get_cmd="TSTR ?", set_cmd="TSTR {}", val_mapping={"ON": 1, "OFF": 0}, get_parser=int, )¶
Parameter buffer_trig_mode
- buffer_npts: Parameter = self.add_parameter( "buffer_npts", label="Buffer number of stored points", get_cmd="SPTS ?", get_parser=int, )¶
Parameter buffer_npts
- visa_handle: pyvisa.resources.MessageBasedResource = visa_handle¶
The VISA resource used by this instrument.
- 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 viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- sweep_setpoints: GeneratedSetPoints = self.add_parameter( "sweep_setpoints", parameter_class=GeneratedSetPoints, vals=Arrays(shape=(self.buffer_npts.get,)), )¶
Parameter sweep_setpoints
- SNAP_PARAMETERS: ClassVar[dict[str, str]] = {'aux1': '5', 'aux2': '6', 'aux3': '7', 'aux4': '8', 'ch1': '10', 'ch2': '11', 'freq': '9', 'p': '4', 'phase': '4', 'r': '3', 'x': '1', 'y': '2', 'θ': '4'}¶
- snap(*parameters: str) tuple[float, ...] [source]¶
Get between 2 and 6 parameters at a single instant. This provides a coherent snapshot of measured signals. Pick up to 6 from: X, Y, R, θ, the aux inputs 1-4, frequency, or what is currently displayed on channels 1 and 2.
Reading X and Y (or R and θ) gives a coherent snapshot of the signal. Snap is important when the time constant is very short, a time constant less than 100 ms.
- Parameters:
*parameters – From 2 to 6 strings of names of parameters for which the values are requested. including: ‘x’, ‘y’, ‘r’, ‘p’, ‘phase’ or ‘θ’, ‘aux1’, ‘aux2’, ‘aux3’, ‘aux4’, ‘freq’, ‘ch1’, and ‘ch2’.
- Returns:
A tuple of floating point values in the same order as requested.
Examples
>>> lockin.snap('x','y') -> tuple(x,y)
>>> lockin.snap('aux1','aux2','freq','phase') >>> -> tuple(aux1,aux2,freq,phase)
Note
Volts for x, y, r, and aux 1-4 Degrees for θ Hertz for freq Unknown for ch1 and ch2. It will depend on what was set.
If X,Y,R and θ are all read, then the values of X,Y are recorded approximately 10 µs apart from R,θ. Thus, the values of X and Y may not yield the exact values of R and θ from a single snap.
The values of the Aux Inputs may have an uncertainty of up to 32 µs.
The frequency is computed only every other period or 40 ms, whichever is longer.
- increment_sensitivity() bool [source]¶
Increment the sensitivity setting of the lock-in. This is equivalent to pushing the sensitivity up button on the front panel. This has no effect if the sensitivity is already at the maximum.
- Returns:
Whether or not the sensitivity was actually changed.
- decrement_sensitivity() bool [source]¶
Decrement the sensitivity setting of the lock-in. This is equivalent to pushing the sensitivity down button on the front panel. This has no effect if the sensitivity is already at the minimum.
- Returns:
Whether or not the sensitivity was actually changed.
- autorange(max_changes: int = 1) None [source]¶
Automatically changes the sensitivity of the instrument according to the R value and defined max_changes.
- Parameters:
max_changes – Maximum number of steps allowing the function to automatically change the sensitivity (default is 1). The actual number of steps needed to change to the optimal sensitivity may be more or less than this maximum.
- class qcodes.instrument_drivers.stanford_research.SR860(name: str, address: str, reset: bool = False, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
SR86x
QCoDeS driver for the Stanford Research Systems SR860 Lock-in Amplifier.
The SR860 instrument is almost equal to the SR865, except for the max frequency
- class qcodes.instrument_drivers.stanford_research.SR865(name: str, address: str, reset: bool = False, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
SR86x
QCoDeS driver for the Stanford Research Systems SR865 Lock-in Amplifier.
The SR865 instrument is almost equal to the SR860, except for the max frequency
- class qcodes.instrument_drivers.stanford_research.SR865A(name: str, address: str, reset: bool = False, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
SR86x
QCoDeS driver for the Stanford Research Systems SR865A Lock-in Amplifier.
The SR865A instrument is almost equal to the SR865, except for the max frequency
- class qcodes.instrument_drivers.stanford_research.SR86x(name: str, address: str, max_frequency: float, reset: bool = False, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
VisaInstrument
Base class for Stanford SR86x Lock-in Amplifier drivers. This class should not be instantiated directly instead one of the model specific sub classes should be used.
Attributes:
PARAMETER_NAMES
default_terminator
The default terminator to use if the terminator is not specified when creating the instrument.
frequency
Parameter frequency
sine_outdc
Parameter sine_outdc
amplitude
Parameter amplitude
harmonic
Parameter harmonic
phase
Parameter phase
sensitivity
Parameter sensitivity
filter_slope
Parameter filter_slope
sync_filter
Parameter sync_filter
noise_bandwidth
Parameter noise_bandwidth
signal_strength
Parameter signal_strength
signal_input
Parameter signal_input
input_range
Parameter input_range
input_config
Parameter input_config
input_shield
Parameter input_shield
input_gain
Parameter input_gain
adv_filter
Parameter adv_filter
input_coupling
Parameter input_coupling
time_constant
Parameter time_constant
external_reference_trigger
The triggering mode for synchronization of the internal reference signal with the externally provided one
reference_source
The source of the reference signal
external_reference_trigger_input_resistance
Input resistance of the input for the external reference signal
X
Parameter X
Y
Parameter Y
R
Parameter R
P
Parameter P
complex_voltage
Parameter complex_voltage
X_offset
Parameter X_offset
Y_offset
Parameter Y_offset
R_offset
Parameter R_offset
X_expand
Parameter X_expand
Y_expand
Parameter Y_expand
R_expand
Parameter R_expand
Methods:
get_values
(*parameter_names)Get values of 2 or 3 parameters that are measured by the lock-in amplifier.
get_data_channels_values
()Queries the current values of the data channels
get_data_channels_parameters
([query_instrument])Convenience method to query a list of parameters which the data channels are currently assigned to.
get_data_channels_dict
([requery_names])Returns a dictionary where the keys are parameter names currently assigned to the data channels, and values are the values of those parameters.
- PARAMETER_NAMES: ClassVar[dict[str, str]] = {'P': '3', 'R': '2', 'X': '0', 'Xnoise': '8', 'Y': '1', 'Ynoise': '9', 'amplitude': '13', 'aux_in1': '4', 'aux_in2': '5', 'aux_in3': '6', 'aux_in4': '7', 'aux_out1': '10', 'aux_out2': '11', 'frequency': '15', 'frequency_ext': '16', 'phase': '12', 'sine_outdc': '14'}¶
- default_terminator: str | None = '\n'¶
The default terminator to use if the terminator is not specified when creating the instrument. None means use the default terminator from PyVisa.
- frequency: Parameter = self.add_parameter( name="frequency", label="Frequency", unit="Hz", get_cmd="FREQ?", set_cmd="FREQ {}", get_parser=float, vals=Numbers(min_value=1e-3, max_value=self._max_frequency), )¶
Parameter frequency
- sine_outdc: Parameter = self.add_parameter( name="sine_outdc", label="Sine out dc level", unit="V", get_cmd="SOFF?", set_cmd="SOFF {}", get_parser=float, vals=Numbers(min_value=-5, max_value=5), )¶
Parameter sine_outdc
- amplitude: Parameter = self.add_parameter( name="amplitude", label="Amplitude", unit="V", get_cmd="SLVL?", set_cmd="SLVL {}", get_parser=float, vals=Numbers(min_value=0, max_value=2), )¶
Parameter amplitude
- harmonic: Parameter = self.add_parameter( name="harmonic", label="Harmonic", get_cmd="HARM?", get_parser=int, set_cmd="HARM {:d}", vals=Ints(min_value=1, max_value=99), )¶
Parameter harmonic
- phase: Parameter = self.add_parameter( name="phase", label="Phase", unit="deg", get_cmd="PHAS?", set_cmd="PHAS {}", get_parser=float, vals=Numbers(min_value=-3.6e5, max_value=3.6e5), )¶
Parameter phase
- sensitivity: Parameter = self.add_parameter( name="sensitivity", label="Sensitivity", get_cmd="SCAL?", set_cmd="SCAL {:d}", get_parser=self._get_sensitivity, set_parser=self._set_sensitivity, )¶
Parameter sensitivity
- filter_slope: Parameter = self.add_parameter( name="filter_slope", label="Filter slope", unit="dB/oct", get_cmd="OFSL?", set_cmd="OFSL {}", val_mapping={6: 0, 12: 1, 18: 2, 24: 3}, )¶
Parameter filter_slope
- sync_filter: Parameter = self.add_parameter( name="sync_filter", label="Sync filter", get_cmd="SYNC?", set_cmd="SYNC {}", val_mapping={"OFF": 0, "ON": 1}, )¶
Parameter sync_filter
- noise_bandwidth: Parameter = self.add_parameter( name="noise_bandwidth", label="Noise bandwidth", unit="Hz", get_cmd="ENBW?", get_parser=float, )¶
Parameter noise_bandwidth
- signal_strength: Parameter = self.add_parameter( name="signal_strength", label="Signal strength indicator", get_cmd="ILVL?", get_parser=int, )¶
Parameter signal_strength
- signal_input: Parameter = self.add_parameter( name="signal_input", label="Signal input", get_cmd="IVMD?", get_parser=self._get_input_config, set_cmd="IVMD {}", set_parser=self._set_input_config, vals=Enum(*self._INPUT_SIGNAL_TO_N.keys()), )¶
Parameter signal_input
- input_range: Parameter = self.add_parameter( name="input_range", label="Input range", unit="V", get_cmd="IRNG?", set_cmd="IRNG {}", val_mapping={1: 0, 300e-3: 1, 100e-3: 2, 30e-3: 3, 10e-3: 4}, )¶
Parameter input_range
- input_config: Parameter = self.add_parameter( name="input_config", label="Input configuration", get_cmd="ISRC?", set_cmd="ISRC {}", val_mapping={"a": 0, "a-b": 1}, )¶
Parameter input_config
- input_shield: Parameter = self.add_parameter( name="input_shield", label="Input shield", get_cmd="IGND?", set_cmd="IGND {}", val_mapping={"float": 0, "ground": 1}, )¶
Parameter input_shield
- input_gain: Parameter = self.add_parameter( name="input_gain", label="Input gain", unit="ohm", get_cmd="ICUR?", set_cmd="ICUR {}", val_mapping={1e6: 0, 100e6: 1}, )¶
Parameter input_gain
- adv_filter: Parameter = self.add_parameter( name="adv_filter", label="Advanced filter", get_cmd="ADVFILT?", set_cmd="ADVFILT {}", val_mapping={"OFF": 0, "ON": 1}, )¶
Parameter adv_filter
- input_coupling: Parameter = self.add_parameter( name="input_coupling", label="Input coupling", get_cmd="ICPL?", set_cmd="ICPL {}", val_mapping={"ac": 0, "dc": 1}, )¶
Parameter input_coupling
- visa_handle: pyvisa.resources.MessageBasedResource = visa_handle¶
The VISA resource used by this instrument.
- 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 viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- time_constant: Parameter = self.add_parameter( name="time_constant", label="Time constant", unit="s", get_cmd="OFLT?", set_cmd="OFLT {}", val_mapping={ 1e-6: 0, 3e-6: 1, 10e-6: 2, 30e-6: 3, 100e-6: 4, 300e-6: 5, 1e-3: 6, 3e-3: 7, 10e-3: 8, 30e-3: 9, 100e-3: 10, 300e-3: 11, 1: 12, 3: 13, 10: 14, 30: 15, 100: 16, 300: 17, 1e3: 18, 3e3: 19, 10e3: 20, 30e3: 21, }, )¶
Parameter time_constant
- external_reference_trigger: Parameter = self.add_parameter( name="external_reference_trigger", label="External reference trigger mode", get_cmd="RTRG?", set_cmd="RTRG {}", val_mapping={ "SIN": 0, "POS": 1, "POSTTL": 1, "NEG": 2, "NEGTTL": 2, }, docstring="The triggering mode for synchronization of the " "internal reference signal with the externally provided " "one", )¶
The triggering mode for synchronization of the internal reference signal with the externally provided one
- reference_source: Parameter = self.add_parameter( name="reference_source", label="Reference source", get_cmd="RSRC?", set_cmd="RSRC {}", val_mapping={"INT": 0, "EXT": 1, "DUAL": 2, "CHOP": 3}, docstring="The source of the reference signal", )¶
The source of the reference signal
- external_reference_trigger_input_resistance: Parameter = ( self.add_parameter( name="external_reference_trigger_input_resistance", label="External reference trigger input resistance", get_cmd="REFZ?", set_cmd="REFZ {}", val_mapping={ "50": 0, "50OHMS": 0, 0: 0, "1M": 1, "1MEG": 1, 1: 1, }, docstring="Input resistance of the input for the external " "reference signal", ) )¶
Input resistance of the input for the external reference signal
- X: Parameter = self.add_parameter( "X", label="In-phase Magnitude", get_cmd="OUTP? 0", get_parser=float, unit="V", )¶
Parameter X
- Y: Parameter = self.add_parameter( "Y", label="Out-phase Magnitude", get_cmd="OUTP? 1", get_parser=float, unit="V", )¶
Parameter Y
- R: Parameter = self.add_parameter( "R", label="Magnitude", get_cmd="OUTP? 2", get_parser=float, unit="V" )¶
Parameter R
- P: Parameter = self.add_parameter( "P", label="Phase", get_cmd="OUTP? 3", get_parser=float, unit="deg" )¶
Parameter P
- complex_voltage: Parameter = self.add_parameter( "complex_voltage", label="Voltage", get_cmd=self._get_complex_voltage, unit="V", vals=ComplexNumbers(), )¶
Parameter complex_voltage
- X_offset: Parameter = self.add_parameter( "X_offset", label="X offset ", unit="%", get_cmd="COFP? 0", set_cmd="COFP 0, {}", get_parser=float, vals=Numbers(min_value=-999.99, max_value=999.99), )¶
Parameter X_offset
- Y_offset: Parameter = self.add_parameter( "Y_offset", label="Y offset", unit="%", get_cmd="COFP? 1", set_cmd="COFP 1, {}", get_parser=float, vals=Numbers(min_value=-999.99, max_value=999.99), )¶
Parameter Y_offset
- R_offset: Parameter = self.add_parameter( "R_offset", label="R offset", unit="%", get_cmd="COFP? 2", set_cmd="COFP 2, {}", get_parser=float, vals=Numbers(min_value=-999.99, max_value=999.99), )¶
Parameter R_offset
- X_expand: Parameter = self.add_parameter( "X_expand", label="X expand multiplier", get_cmd="CEXP? 0", set_cmd="CEXP 0, {}", val_mapping={"OFF": "0", "X10": "1", "X100": "2"}, )¶
Parameter X_expand
- Y_expand: Parameter = self.add_parameter( "Y_expand", label="Y expand multiplier", get_cmd="CEXP? 1", set_cmd="CEXP 1, {}", val_mapping={"OFF": 0, "X10": 1, "X100": 2}, )¶
Parameter Y_expand
- R_expand: Parameter = self.add_parameter( "R_expand", label="R expand multiplier", get_cmd="CEXP? 2", set_cmd="CEXP 2, {}", val_mapping={"OFF": 0, "X10": 1, "X100": 2}, )¶
Parameter R_expand
- get_values(*parameter_names: str) tuple[float, ...] [source]¶
Get values of 2 or 3 parameters that are measured by the lock-in amplifier. These values are guaranteed to come from the same measurement cycle as opposed to getting values of parameters one by one (for example, by calling sr.X(), and then sr.Y().
- Parameters:
*parameter_names – 2 or 3 names of parameters for which the values are requested; valid names can be found in PARAMETER_NAMES attribute of the driver class
- Returns:
a tuple of 2 or 3 floating point values
- get_data_channels_values() tuple[float, ...] [source]¶
Queries the current values of the data channels
- Returns:
tuple of 4 values of the data channels
- get_data_channels_parameters(query_instrument: bool = True) tuple[str, ...] [source]¶
Convenience method to query a list of parameters which the data channels are currently assigned to.
- Parameters:
query_instrument – If set to False, the internally cashed names of the parameters will be returned; if True, then the names will be queried through the instrument
- Returns:
a tuple of 4 strings of parameter names
- get_data_channels_dict(requery_names: bool = False) dict[str, float] [source]¶
Returns a dictionary where the keys are parameter names currently assigned to the data channels, and values are the values of those parameters.
- Parameters:
requery_names – if False, the currently assigned parameter names will not be queries from the instrument in order to save time on communication, in this case the cached assigned parameter names will be used for the keys of the dicitonary; if True, the assigned parameter names will be queried from the instrument
- Returns:
a dictionary where keys are names of parameters assigned to the data channels, and values are the values of those parameters
- class qcodes.instrument_drivers.stanford_research.SR86xBuffer(parent: SR86x, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentChannel
Buffer module for the SR86x drivers.
This driver has been verified to work with the SR860 and SR865. For reference, please consult the SR860 manual: http://thinksrs.com/downloads/PDFs/Manuals/SR860m.pdf
Attributes:
Parameter capture_length_in_kb
Parameter capture_config
Parameter capture_rate_max
Parameter capture_rate
Parameter capture_status
Number of bytes captured so far in the buffer.
Number of kilobytes captured so far in the buffer, rounded-up to 2 kilobyte chunks.
Methods:
snapshot_base
([update, params_to_skip_update])State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).Sets the capture rate to maximum.
start_capture
(acquisition_mode, trigger_mode)Start an acquisition.
Stop a capture
set_capture_length_to_fit_samples
(sample_count)Set the capture length of the buffer to fit the given number of samples.
wait_until_samples_captured
(sample_count)Wait until the given number of samples is captured.
get_capture_data
(sample_count)Read the given number of samples of the capture data from the buffer.
Capture one sample per each trigger, and return when the specified number of triggers has been received.
capture_samples_after_trigger
(sample_count, ...)Capture a number of samples after a trigger has been received.
capture_samples
(sample_count)Capture a number of samples at a capture rate, starting immediately.
- capture_length_in_kb: Parameter = self.add_parameter( "capture_length_in_kb", label="get/set capture length", get_cmd="CAPTURELEN?", set_cmd="CAPTURELEN {}", set_parser=self._set_capture_len_parser, get_parser=int, unit="kB", )¶
Parameter capture_length_in_kb
- capture_config: Parameter = ( self.add_parameter( # Configure which parameters we want to capture "capture_config", label="capture configuration", get_cmd="CAPTURECFG?", set_cmd="CAPTURECFG {}", val_mapping={"X": "0", "X,Y": "1", "R,T": "2", "X,Y,R,T": "3"}, ) )¶
Parameter capture_config
- capture_rate_max: Parameter = self.add_parameter( "capture_rate_max", label="capture rate maximum", get_cmd="CAPTURERATEMAX?", get_parser=float, )¶
Parameter capture_rate_max
- capture_rate: Parameter = self.add_parameter( "capture_rate", label="capture rate raw", get_cmd="CAPTURERATE?", set_cmd="CAPTURERATE {}", get_parser=float, set_parser=self._set_capture_rate_parser, )¶
Parameter capture_rate
- capture_status: Parameter = ( self.add_parameter( # Are we capturing at the moment? "capture_status", label="capture status", get_cmd="CAPTURESTAT?" ) )¶
Parameter capture_status
- count_capture_bytes: Parameter = self.add_parameter( "count_capture_bytes", label="captured bytes", get_cmd="CAPTUREBYTES?", unit="B", get_parser=int, docstring="Number of bytes captured so far in the buffer. Can be " "used to track live progress.", )¶
Number of bytes captured so far in the buffer. Can be used to track live progress.
- count_capture_kilobytes: Parameter = self.add_parameter( "count_capture_kilobytes", label="captured kilobytes", get_cmd="CAPTUREPROG?", unit="kB", docstring="Number of kilobytes captured so far in the buffer, " "rounded-up to 2 kilobyte chunks. Capture must be " "stopped before requesting the value of this " "parameter. If the acquisition wrapped during operating " "in Continuous mode, then the returned value is " "simply equal to the current capture length.", )¶
Number of kilobytes captured so far in the buffer, rounded-up to 2 kilobyte chunks. Capture must be stopped before requesting the value of this parameter. If the acquisition wrapped during operating in Continuous mode, then the returned value is simply equal to the current capture length.
- snapshot_base(update: bool | None = False, params_to_skip_update: Sequence[str] | None = None) dict[Any, Any] [source]¶
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters:
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns:
base snapshot
- Return type:
- set_capture_rate_to_maximum() None [source]¶
Sets the capture rate to maximum. The maximum capture rate is retrieved from the device, and depends on the current value of the time constant.
- start_capture(acquisition_mode: str, trigger_mode: str) None [source]¶
Start an acquisition. Please see page 137 of the manual for a detailed explanation.
- Parameters:
acquisition_mode – “ONE” | “CONT”
trigger_mode – “IMM” | “TRIG” | “SAMP”
- set_capture_length_to_fit_samples(sample_count: int) None [source]¶
Set the capture length of the buffer to fit the given number of samples.
- Parameters:
sample_count – Number of samples that the buffer has to fit
- wait_until_samples_captured(sample_count: int) None [source]¶
Wait until the given number of samples is captured. This function is blocking and has to be used with caution because it does not have a timeout.
- Parameters:
sample_count – Number of samples that needs to be captured
- get_capture_data(sample_count: int) dict[str, ndarray] [source]¶
Read the given number of samples of the capture data from the buffer.
- Parameters:
sample_count – number of samples to read from the buffer
- Returns:
The keys in the dictionary correspond to the captured variables. For instance, if before the capture, the capture config was set as ‘capture_config(“X,Y”)’, then the keys will be “X” and “Y”. The values in the dictionary are numpy arrays of numbers.
- capture_one_sample_per_trigger(trigger_count: int, start_triggers_pulsetrain: Callable[..., Any]) dict[str, np.ndarray] [source]¶
Capture one sample per each trigger, and return when the specified number of triggers has been received.
- Parameters:
trigger_count – Number of triggers to capture samples for
start_triggers_pulsetrain – By calling this non-blocking function, the train of trigger pulses should start
- Returns:
The keys in the dictionary correspond to the captured variables. For instance, if before the capture, the capture config was set as ‘capture_config(“X,Y”)’, then the keys will be “X” and “Y”. The values in the dictionary are numpy arrays of numbers.
- capture_samples_after_trigger(sample_count: int, send_trigger: Callable[..., Any]) dict[str, np.ndarray] [source]¶
Capture a number of samples after a trigger has been received. Please refer to page 135 of the manual for details.
- Parameters:
sample_count – Number of samples to capture
send_trigger – By calling this non-blocking function, one trigger should be sent that will initiate the capture
- Returns:
The keys in the dictionary correspond to the captured variables. For instance, if before the capture, the capture config was set as ‘capture_config(“X,Y”)’, then the keys will be “X” and “Y”. The values in the dictionary are numpy arrays of numbers.
- capture_samples(sample_count: int) dict[str, ndarray] [source]¶
Capture a number of samples at a capture rate, starting immediately. Unlike the “continuous” capture mode, here the buffer does not get overwritten with the new data once the buffer is full.
The function blocks until the required number of samples is acquired, and returns them.
- Parameters:
sample_count – Number of samples to capture
- Returns:
The keys in the dictionary correspond to the captured variables. For instance, if before the capture, the capture config was set as ‘capture_config(“X,Y”)’, then the keys will be “X” and “Y”. The values in the dictionary are numpy arrays of numbers.
- 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 viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶