QDev Drivers

Classes:

QDevQDac(name, address[, num_chans, ...])

Channelised driver for the QDev digital-analog converter QDac

QDevQDacChannel(parent, name, channum, **kwargs)

A single output channel of the QDac.

class qcodes.instrument_drivers.QDev.QDevQDac(name: str, address: str, num_chans: int = 48, update_currents: bool = True, **kwargs: Unpack[VisaInstrumentKWArgs])[source]

Bases: VisaInstrument

Channelised driver for the QDev digital-analog converter QDac

Based on “DAC_commands_v_13.pdf” Tested with Software Version: 0.170202

The driver assumes that the instrument is ALWAYS in verbose mode OFF

Instantiates the instrument.

Parameters:
  • name – The instrument name used by qcodes

  • address – The VISA name of the resource

  • num_chans – Number of channels to assign. Default: 48

  • update_currents – Whether to query all channels for their current current value on startup. Default: True.

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

Returns:

QDac object

Attributes:

max_status_age

cal

Parameter cal

verbose

Parameter verbose

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).

printslopes()

Print the finite slopes assigned to channels

write(cmd)

QDac always returns something even from set commands, even when verbose mode is off, so we'll override write to take this out if you want to use this response, we put it in self._write_response (but only for the very last write call)

read()

connect_message([idn_param, begin_time])

Override of the standard Instrument class connect_message.

print_overview([update_currents])

Pretty-prints the status of the QDac

max_status_age = 1
cal: Parameter = self.add_parameter( name="cal", set_cmd="cal {}", vals=self.channel_validator )

Parameter cal

verbose: Parameter = self.add_parameter( name="verbose", set_cmd="ver {}", val_mapping={True: 1, False: 0} )

Parameter verbose

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 only update if the state is known to be invalid. If False, just use the latest values in memory and never update.

  • 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:

dict

visabackend: str = visabackend
visa_handle: pyvisa.resources.MessageBasedResource = visa_handle

The VISA resource used by this instrument.

visalib: str | None = visalib
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] = {}
printslopes() None[source]

Print the finite slopes assigned to channels

write(cmd: str) None[source]

QDac always returns something even from set commands, even when verbose mode is off, so we’ll override write to take this out if you want to use this response, we put it in self._write_response (but only for the very last write call)

In this method we expect to read one termination char per command. As commands are concatenated by ; we count the number of concatenated commands as count(‘;’) + 1 e.g. ‘wav 1 1 1 0;fun 2 1 100 1 1’ is two commands. Note that only the response of the last command will be available in _write_response

read() str[source]
connect_message(idn_param: str = 'IDN', begin_time: float | None = None) None[source]

Override of the standard Instrument class connect_message. Usually, the response to *IDN? is printed. Here, the software version is printed.

print_overview(update_currents: bool = False) None[source]

Pretty-prints the status of the QDac

class qcodes.instrument_drivers.QDev.QDevQDacChannel(parent: Instrument, name: str, channum: int, **kwargs: Unpack[InstrumentBaseKWArgs])[source]

Bases: InstrumentChannel

A single output channel of the QDac.

Exposes chan.v, chan.vrange, chan.slope, chan.i, chan.irange

Parameters:
  • parent – The instrument to which the channel is attached.

  • name – The name of the channel

  • channum – The number of the channel in question (1-48)

  • **kwargs – Forwarded to base class.

Attributes:

v

Parameter v

vrange

Parameter vrange

i

Parameter i

irange

Parameter irange

slope

Parameter slope

sync

Parameter sync

sync_delay

Parameter sync_delay

sync_duration

Parameter sync_duration

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).

v: Parameter = self.add_parameter( "v", label=f"Channel {channum} voltage", unit="V", set_cmd=partial(self._parent._set_voltage, channum), get_cmd=partial(self._parent._get_voltage, channum), get_parser=float, vals=vals.Numbers(-10, 10), )

Parameter v

vrange: Parameter = self.add_parameter( "vrange", label=f"Channel {channum} atten.", set_cmd=partial(self._parent._set_vrange, channum), get_cmd=partial(self._parent._get_vrange, channum), vals=vals.Enum(0, 1), )

Parameter vrange

i: Parameter = self.add_parameter( "i", label=f"Channel {channum} current", get_cmd=f"get {channum}", unit="A", get_parser=self._parent._current_parser, )

Parameter i

irange: Parameter = self.add_parameter( "irange", label=f"Channel {channum} irange", set_cmd=f"cur {channum} {{}}", get_cmd=f"cur {channum}", get_parser=int, )

Parameter irange

slope: Parameter = self.add_parameter( "slope", label=f"Channel {channum} slope", unit="V/s", set_cmd=partial(self._parent._setslope, channum), get_cmd=partial(self._parent._getslope, channum), vals=vals.MultiType(vals.Enum("Inf"), vals.Numbers(1e-3, 100)), )

Parameter slope

sync: Parameter = self.add_parameter( "sync", label=f"Channel {channum} sync output", set_cmd=partial(self._parent._setsync, channum), get_cmd=partial(self._parent._getsync, channum), vals=vals.Ints(0, 5), )

Parameter sync

sync_delay: Parameter = self.add_parameter( name="sync_delay", label=f"Channel {channum} sync pulse delay", unit="s", get_cmd=None, set_cmd=None, initial_value=0, )

Parameter sync_delay

sync_duration: Parameter = self.add_parameter( name="sync_duration", label=f"Channel {channum} sync pulse duration", unit="s", get_cmd=None, set_cmd=None, initial_value=0.01, )

Parameter sync_duration

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. If False, 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:

dict

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] = {}