qcodes_contrib_drivers.drivers.StanfordResearchSystems package

Submodules

qcodes_contrib_drivers.drivers.StanfordResearchSystems.CS580 module

QCoDeS-Driver for Stanford Research Systems CS580 current source: https://www.thinksrs.com/products/cs580.html

Authors:

Julien Barrier, <julien@julienbarrier.eu>

class qcodes_contrib_drivers.drivers.StanfordResearchSystems.CS580.CS580(*args: Any, **kwargs: Any)[source]

Bases: VisaInstrument

Class to represent an SRS CS580 current source

status: beta-version

Parameters:
  • name (str) – name for the instrument

  • address (str) – Visa resource name to connect

  • terminator (str) – Visa terminator

get_idn() Dict[str, str | None][source]

Return the Instrument Identifier Message

get_overload() str[source]

Reads the current avlue of the signal overload status.

reset() None[source]

Reset the CS580 to its default configuration

qcodes_contrib_drivers.drivers.StanfordResearchSystems.DG645 module

class qcodes_contrib_drivers.drivers.StanfordResearchSystems.DG645.DG645(*args: Any, **kwargs: Any)[source]

Bases: VisaInstrument

Qcodes driver for SRS DG645 digital delay generator.

local() None[source]

Go to local.

remote() None[source]

Go to remote.

reset() None[source]

Reset instrument.

save_settings(location: int) None[source]

Save instrument settings to given location.

Parameters:

location – Location to which to save the settings (in [1..9]).

self_calibrate() None[source]

Run auto-calibration routine.

self_test() None[source]

Run self-test routine.

trigger() None[source]

Initiates a single trigger if instrument is in single shot mode.

wait() None[source]

Wait for all prior commands to execute before continuing.

CHANNEL_MAPPING = {'A': 2, 'B': 3, 'C': 4, 'D': 5, 'E': 6, 'F': 7, 'G': 8, 'H': 9, 'T0': 0, 'T1': 1}
DISPLAY_MAPPING = {'advanced_trig_enable': 4, 'burst_T0_config': 14, 'burst_count': 9, 'burst_delay': 8, 'burst_mode': 7, 'burst_period': 10, 'channel_delay': 11, 'channel_output_levels': 12, 'channel_output_polarity': 13, 'prescale_config': 6, 'trig_holdoff': 5, 'trig_line': 3, 'trig_rate': 0, 'trig_single_shot': 2, 'trig_thresh': 1}
OUTPUT_MAPPING = {'AB': 1, 'CD': 2, 'EF': 3, 'GH': 4, 'T0': 0}
POLARITY_MAPPING = {'+': 1, '-': 0}
PRESCALE_MAPPING = {'AB': 1, 'CD': 2, 'EF': 3, 'GH': 4, 'trig': 0}
TRIGGER_MAPPING = {'ext_falling': 2, 'ext_rising': 1, 'internal': 0, 'line': 6, 'single': 5, 'single_ext_falling': 4, 'single_ext_rising': 3}

qcodes_contrib_drivers.drivers.StanfordResearchSystems.SIM928 module

class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SIM928.SIM928(*args: Any, **kwargs: Any)[source]

Bases: VisaInstrument

A driver for Stanford Research Systems SIM 928 DC source modules installed in a SIM900 mainframe.

Parameters:
  • name (str) – An identifier for this instrument, particularly for attaching it to a Station.

  • address (str) – The visa resource name to use to connect.

  • slot_names (Dict[int]) – An dictionary that optionally maps slot numbers to user-defined module names. Default {}.

  • timeout (int, float) – Seconds to allow for responses. Default 5.

  • metadata (Optional[Dict]) – Additional static metadata to add to this instrument’s JSON snapshot.

ask_module(i, cmd)[source]

Write a command string to a module and return a response.

Parameters:
  • i (int, str) – Slot number or module name (as in slot_names) of the module to ask from.

  • cmd (str) – The VISA query string.

Returns:

The response string from the module.

static byte_to_bits(x)[source]

Convert an integer to a list of bits

Parameters:

x (int) – The number to convert.

Returns:

A list of the lowest 8 bits of x where True represents 1 and False 0.

Return type:

list[bool]

check_module_errors(i, raiseexc=True)[source]

Check if any errors have occurred on module i and clear the status registers.

Parameters:
  • i (int, str) – Slot number or module name (as in slot_names) of the module to check the error of.

  • raiseexc (bool) – If true, raises an exception if any errors have occurred. Default True.

Returns:

A list of strings with the error messages that have occurred.

Return type:

list[str]

find_modules()[source]

Query the SIM900 mainframe for which slots have a SIM928 module present.

Returns:

A list of slot numbers where a SIM928 module is present (starting

from 1)

get_module_idn(i)[source]

Get the vendor, model, serial number and firmware version of a module.

Parameters:

i (int, str) – Slot number or module name (as in slot_names) of the module whose id is returned.

Returns:

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

get_module_status(i)[source]

Gets and clears the status bytes corresponding to the registers ESR, CESR and OVSR of module i.

Parameters:

i (int, str) – Slot number or module name (as in slot_names) of the module to get the status of.

Returns:

The bytes corresponding to standard event, communication error and overload statuses of module i

Return type:

int, int, int

get_voltage(i)[source]

Get the output voltage of a module.

Parameters:

i (int, str) – Slot number or module name (as in slot_names) of the module to get the voltage of.

Returns:

The current voltage of module i as a float.

reset_module(i)[source]

Sends the SIM Reset signal to module i.

Causes a break signal (MARK level) to be asserted for 100 milliseconds to module i. Upon receiving the break signal the modul will flush its internal input buffer, reset its command parser, and default to 9600 baud communications.

Parameters:

i (int, str) – Slot number or module name (as in slot_names) of the module to reset.

set_smooth(voltagedict, equitime=False)[source]

Set the voltages as specified in voltagedict` smoothly, by changing the output on each module at a rate ``volt_#_step/smooth_timestep.

Parameters:
  • voltagedict (Dict[float]) – A dictionary where keys are module slot numbers or names and values are the desired output voltages.

  • equitime (bool) – If True, uses smaller step sizes for some of the modules so that all modules reach the desired value at the same time.

set_voltage(i, voltage)[source]

Set the output voltage of a module.

Parameters:
  • i (int, str) – Slot number or module name (as in slot_names) of the module to set the voltage of.

  • voltage (float) – The value to set the voltage to.

write_module(i, cmd)[source]

Write a command string to a module with NO response expected.

Parameters:
  • i (int, str) – Slot number or module name (as in slot_names) of the module to write to.

  • cmd (str) – The VISA command string.

qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR570 module

class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR570.SR570(*args: Any, **kwargs: Any)[source]

Bases: VisaInstrument

QCoDeS driver for the Stanford Research Systems SR570 Low-Noise Current Preamplifier.

This is a real driver and it will talk to your instrument (as opposed to SR560 from QCoDeS).

It can’t listen to it, so make sure that you either reset or set parameters before reading them.

(Resetting the device will update the parameters’ value with their reset value as per documentation.)

The device can also be accessed via TCP/IP if exposed via something like:

socat /dev/ttyUSB0,echo=0,b9600,cstopb=1,parenb=0,raw tcp-listen:20570,reuseaddr,nodelay
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.

reset() None[source]

qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR844 module

class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR844.ChannelTrace(name: str, channel: int, **kwargs: Any)[source]

Bases: ParameterWithSetpoints

Parameter class for the two channel buffers

__init__(name: str, channel: int, **kwargs: Any) None[source]
Parameters:
  • name – The name of the parameter

  • channel – The relevant channel (1 or 2). The name should match this.

get_buffer_length() int[source]
get_raw() Any[source]

get_raw is called to perform the actual data acquisition from the instrument. This method should either be overwritten to perform the desired operation or alternatively for Parameter a suitable method is automatically generated if get_cmd is supplied to the parameter constructor. The method is automatically wrapped to provide a get method on the parameter instance.

parse_binary(rawdata: bytes) ndarray[Any, dtype[_ScalarType_co]][source]
poll_raw_binary_data(N: int) Any[source]
update_unit() None[source]
class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR844.GeneratedSetPoints(sweep_array: Iterable[float | int] = array([0., 0.11111111, 0.22222222, 0.33333333, 0.44444444, 0.55555556, 0.66666667, 0.77777778, 0.88888889, 1.]), *args: Any, **kwargs: Any)[source]

Bases: Parameter

A parameter that generates a setpoint array from start, stop and num points parameters.

get_raw() Any[source]

get_raw is called to perform the actual data acquisition from the instrument. This method should either be overwritten to perform the desired operation or alternatively for Parameter a suitable method is automatically generated if get_cmd is supplied to the parameter constructor. The method is automatically wrapped to provide a get method on the parameter instance.

set_raw(value: Iterable[float | int]) None[source]

set_raw is called to perform the actual setting of a parameter on the instrument. This method should either be overwritten to perform the desired operation or alternatively for Parameter a suitable method is automatically generated if set_cmd is supplied to the parameter constructor. The method is automatically wrapped to provide a set method on the parameter instance.

update_units_if_constant_sample_rate() None[source]

If the buffer is filled at a constant sample rate, update the unit to “s” and label to “Time”; otherwise do nothing

class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR844.SR844(*args: Any, **kwargs: Any)[source]

Bases: VisaInstrument

This is the qcodes driver for the Stanford Research Systems SR844 Lock-in Amplifier

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.

get_display_value(channel: int, disp: str) int[source]
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.

set_sweep_parameters(sweep_param: Parameter, start: float, stop: float, n_points: int = 10, label: str | None = None) None[source]
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-2, 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’, ‘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.

update_ch_unit(channel: int) None[source]
SNAP_PARAMETERS = {'aux1': '6', 'aux2': '7', 'ch1': '9', 'ch2': '10', 'freq': '8', 'p': '5', 'phase': '5', 'r_dbm': '4', 'r_v': '3', 'x': '1', 'y': '2', 'θ': '5'}
sensitivity_value_map = {1e-07: 0, 3e-07: 1, 1e-06: 2, 3e-06: 3, 1e-05: 4, 3e-05: 5, 0.0001: 6, 0.0003: 7, 0.001: 8, 0.003: 9, 0.01: 10, 0.03: 11, 0.1: 12, 0.3: 13, 1: 14}
value_sensitivity_map = {0: 1e-07, 1: 3e-07, 2: 1e-06, 3: 3e-06, 4: 1e-05, 5: 3e-05, 6: 0.0001, 7: 0.0003, 8: 0.001, 9: 0.003, 10: 0.01, 11: 0.03, 12: 0.1, 13: 0.3, 14: 1}

Module contents