diff --git a/qcodes/instrument_drivers/QuTech/D5a.py b/qcodes/instrument_drivers/QuTech/D5a.py index ad5d8a3518d..152807f2f09 100644 --- a/qcodes/instrument_drivers/QuTech/D5a.py +++ b/qcodes/instrument_drivers/QuTech/D5a.py @@ -27,7 +27,7 @@ class D5a(Instrument): """ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, - reset_voltages=False, mV=False, **kwargs): + reset_voltages=False, mV=False, number_dacs=16, **kwargs): """ Create instrument for the D5a module. The D5a module works with volts as units. For backward compatibility @@ -49,11 +49,13 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, dac_step (float): max step size (V or mV), passed to dac parameters of the object reset_voltages (bool): passed to D5a_module constructor mV (bool): if True, then use mV as units in the dac parameters + number_dacs (int): number of DACs available. This is 8 for the D5mux """ super().__init__(name, **kwargs) self.d5a = D5a_module(spi_rack, module, reset_voltages=reset_voltages) self._mV = mV + self._number_dacs = number_dacs self._span_set_map = { '4v uni': 0, @@ -72,7 +74,7 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, self._gain = 1 unit = 'V' - for i in range(16): + for i in range(self._number_dacs): validator = self._get_validator(i) self.add_parameter('dac{}'.format(i + 1), @@ -95,7 +97,7 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, docstring='Change the output span of the DAC. This command also updates the validator.') def _set_dacs_zero(self): - for i in range(16): + for i in range(self._number_dacs): self._set_dac(i, 0.0) def _set_dac(self, dac, value):