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:
VisaInstrumentClass to represent an SRS CS580 current source
status: beta-version
- Parameters:
qcodes_contrib_drivers.drivers.StanfordResearchSystems.DG645 module¶
- class qcodes_contrib_drivers.drivers.StanfordResearchSystems.DG645.DG645(*args: Any, **kwargs: Any)[source]¶
Bases:
VisaInstrumentQcodes driver for SRS DG645 digital delay generator.
- save_settings(location: int) None[source]¶
Save instrument settings to given location.
- Parameters:
location – Location to which to save the settings (in [1..9]).
- 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.SIM900 module¶
- class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SIM900.SIM900(*args: Any, **kwargs: Any)[source]¶
Bases:
VisaInstrumentStanford Research Systems SIM900 mainframe.
Modules communicate through the mainframe using packet-mode commands, without switching the host connection into transparent mode. The driver expects newline-terminated module responses and exclusive use of the port buffers. Module streaming must be stopped before issuing queries.
- Parameters:
name – Instrument name.
address – VISA resource address.
query_delay – Seconds between polls of a module’s input buffer.
**kwargs – Forwarded to
qcodes.instrument.VisaInstrument. For a serial connection, configure the VISA handle’s baud rate to match the mainframe if it differs from the power-on default of 9600 baud.
- ask_port(port: int, cmd: str) str[source]¶
Flush stale input, send a query and read a complete module response.
Uses the mainframe’s
timeout(seconds) while waiting for the module. A timeout raisesTimeoutError, including any partial response.
- flush(port: int | None = None) None[source]¶
Flush input buffers for one port, or all ports if omitted.
- read_port(port: int, nbytes: int | None = None) str[source]¶
Read bytes already available from a module, without stripping terminators.
If omitted,
nbytesis obtained from the input buffer count. An empty buffer returns an empty string. An explicit count must not exceed the available bytes: the mainframe rejects such RAWN queries.
- scan_ports() list[str | None][source]¶
Return ID strings for ports 1 through 8, or None for unresponsive ports.
Each module is given
query_delayseconds to start responding. Input buffers are flushed before scanning; do not scan during streaming.
- class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SIM900.SIM900Module(parent: SIM900, name: str, port: int, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentChannel[SIM900]Base class for a module connected to a SIM900 port.
Register the instance with
parent.add_submodule(name, module)to include its parameters in station snapshots.- Parameters:
parent – SIM900 mainframe.
name – Submodule name.
port – Mainframe port number, from 1 through 8.
**kwargs – Forwarded to
qcodes.instrument.InstrumentChannel.
qcodes_contrib_drivers.drivers.StanfordResearchSystems.SIM928 module¶
- class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SIM928.SIM928(*args: Any, **kwargs: Any)[source]¶
Bases:
VisaInstrumentA 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.
- check_module_errors(i, raiseexc=True)[source]¶
Check if any errors have occurred on module
iand clear the status registers.
- 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_status(i)[source]¶
Gets and clears the status bytes corresponding to the registers ESR, CESR and OVSR of module
i.
- 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.
- 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.
qcodes_contrib_drivers.drivers.StanfordResearchSystems.SIM960 module¶
- class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SIM960.SIM960(parent: SIM900, name: str, port: int, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
SIM900ModuleStanford Research Systems SIM960 analog PID controller in a SIM900 mainframe.
The SIM960 is a double-width module. Use the port to which its connector is attached, not the adjacent slot covered by its panel.
Construction sets numeric response tokens and CRLF response termination but does not change any PID settings or enable the output.
- Parameters:
parent – SIM900 mainframe.
name – Submodule name.
port – Mainframe port to which the module is connected.
**kwargs – Forwarded to
SIM900Module.
- start_ramping(enable: bool) None[source]¶
Continue (True) or pause (False) an active setpoint ramp.
A pending ramp can only be started using the front-panel Ramp Start/Stop button; this command cannot initiate it.
- derivative: Parameter[float, Self] = self.add_parameter( "derivative", label="Derivative gain", unit="s", get_cmd="DERV?", set_cmd="DERV {:.2g}", get_parser=float, vals=Numbers(1e-6, 10), )¶
Derivative gain; does not enable derivative action.
- derivative_enable: Parameter[bool, Self] = self.add_parameter( "derivative_enable", get_cmd="DCTL?", set_cmd="DCTL {}", val_mapping={False: 0, True: 1}, )¶
Enable derivative action.
- display: Parameter[str, Self] = self.add_parameter( "display", get_cmd="DISP?", set_cmd="DISP {}", val_mapping={ "gain": 0, "integral": 1, "derivative": 2, "offset": 3, "ramp_rate": 4, "setpoint": 5, "manual_output": 6, "output_limit_upper": 7, "output_limit_lower": 8, "setpoint_monitor": 9, "measure_monitor": 10, "error_monitor": 11, "output_monitor": 12, }, )¶
Select the front-panel display field.
- error_monitor: Parameter[float, Self] = self.add_parameter( "error_monitor", unit="V", get_cmd="EMON?", set_cmd=False, get_parser=float, )¶
Single measurement of the proportional-amplified error.
- gain: Parameter[float, Self] = self.add_parameter( "gain", label="Proportional gain", unit="V/V", get_cmd="GAIN?", set_cmd="GAIN {:.2g}", get_parser=float, vals=MultiType(Numbers(-1000, -0.1), Numbers(0.1, 1000)), )¶
Signed proportional gain. Setting gain also changes polarity.
- integral: Parameter[float, Self] = self.add_parameter( "integral", label="Integral gain", unit="1/s", get_cmd="INTG?", set_cmd="INTG {:.2g}", get_parser=float, vals=Numbers(0.01, 500000), )¶
Integral gain; does not enable integral action.
- integral_enable: Parameter[bool, Self] = self.add_parameter( "integral_enable", get_cmd="ICTL?", set_cmd="ICTL {}", val_mapping={False: 0, True: 1}, )¶
Enable integral action.
- manual_output: Parameter[float, Self] = self.add_parameter( "manual_output", unit="V", get_cmd="MOUT?", set_cmd="MOUT {:.3f}", get_parser=float, vals=Numbers(-10, 10), )¶
Manual output voltage; does not change output mode.
- measure_monitor: Parameter[float, Self] = self.add_parameter( "measure_monitor", unit="V", get_cmd="MMON?", set_cmd=False, get_parser=float, )¶
Single measurement of the Measure input.
- offset: Parameter[float, Self] = self.add_parameter( "offset", label="Output offset", unit="V", get_cmd="OFST?", set_cmd="OFST {:.3f}", get_parser=float, vals=Numbers(-10, 10), )¶
Output offset, with millivolt resolution.
- offset_enable: Parameter[bool, Self] = self.add_parameter( "offset_enable", get_cmd="OCTL?", set_cmd="OCTL {}", val_mapping={False: 0, True: 1}, )¶
Enable the output offset.
- output_limit_lower: Parameter[float, Self] = self.add_parameter( "output_limit_lower", unit="V", get_cmd="LLIM?", set_cmd=self._set_output_limit_lower, get_parser=float, vals=Numbers(-10, 10), )¶
Lower output limit, with 10 mV resolution, not above the upper limit.
- output_limit_upper: Parameter[float, Self] = self.add_parameter( "output_limit_upper", unit="V", get_cmd="ULIM?", set_cmd=self._set_output_limit_upper, get_parser=float, vals=Numbers(-10, 10), )¶
Upper output limit, with 10 mV resolution, not below the lower limit.
- output_mode: Parameter[str, Self] = self.add_parameter( "output_mode", get_cmd="AMAN?", set_cmd="AMAN {}", val_mapping={"manual": 0, "pid": 1}, )¶
Select manual output or PID control.
- output_monitor: Parameter[float, Self] = self.add_parameter( "output_monitor", unit="V", get_cmd="OMON?", set_cmd=False, get_parser=float, )¶
Single measurement of the output voltage.
- polarity: Parameter[str, Self] = self.add_parameter( "polarity", get_cmd="APOL?", set_cmd="APOL {}", val_mapping={"negative": 0, "positive": 1}, )¶
Controller polarity. Setting polarity overrides the sign of gain.
- proportional_enable: Parameter[bool, Self] = self.add_parameter( "proportional_enable", get_cmd="PCTL?", set_cmd="PCTL {}", val_mapping={False: 0, True: 1}, )¶
Enable proportional action.
- ramp_enable: Parameter[bool, Self] = self.add_parameter( "ramp_enable", get_cmd="RAMP?", set_cmd="RAMP {}", val_mapping={False: 0, True: 1}, )¶
Enable constant-slew-rate internal setpoint changes.
- ramp_rate: Parameter[float, Self] = self.add_parameter( "ramp_rate", unit="V/s", get_cmd="RATE?", set_cmd="RATE {:.2g}", get_parser=float, vals=Numbers(1e-3, 1e4), )¶
Slew rate for internal setpoint ramps.
- ramp_status: Parameter[str, Self] = self.add_parameter( "ramp_status", get_cmd="RMPS?", set_cmd=False, val_mapping={"idle": 0, "pending": 1, "ramping": 2, "paused": 3}, )¶
Current setpoint ramp state.
- setpoint: Parameter[float, Self] = self.add_parameter( "setpoint", unit="V", get_cmd="SETP?", set_cmd="SETP {:.3f}", get_parser=float, vals=Numbers(-10, 10), )¶
Internal setpoint, with millivolt resolution.
qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR570 module¶
- class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR570.SR570(*args: Any, **kwargs: Any)[source]¶
Bases:
VisaInstrumentQCoDeS 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.
qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR844 module¶
- class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR844.ChannelTrace(name: str, channel: int, **kwargs: Any)[source]¶
Bases:
ParameterWithSetpointsParameter 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_raw() Any[source]¶
get_rawis called to perform the actual data acquisition from the instrument. This method should either be overwritten to perform the desired operation or alternatively forParametera suitable method is automatically generated ifget_cmdis supplied to the parameter constructor. The method is automatically wrapped to provide agetmethod on the parameter instance.
- 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:
ParameterA parameter that generates a setpoint array from start, stop and num points parameters.
- get_raw() Any[source]¶
get_rawis called to perform the actual data acquisition from the instrument. This method should either be overwritten to perform the desired operation or alternatively forParametera suitable method is automatically generated ifget_cmdis supplied to the parameter constructor. The method is automatically wrapped to provide agetmethod on the parameter instance.
- set_raw(value: Iterable[float | int]) None[source]¶
set_rawis 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 forParametera suitable method is automatically generated ifset_cmdis supplied to the parameter constructor. The method is automatically wrapped to provide asetmethod on the parameter instance.
- class qcodes_contrib_drivers.drivers.StanfordResearchSystems.SR844.SR844(*args: Any, **kwargs: Any)[source]¶
Bases:
VisaInstrumentThis 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.
- 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.
- 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}¶