Skip to content

Commit ec64567

Browse files
peendebakWilliamHPNielsen
authored andcommitted
add update for D5mux (#888)
* add update for D5mux * autopep
1 parent 79d1b6e commit ec64567

File tree

1 file changed

+5
-3
lines changed
  • qcodes/instrument_drivers/QuTech

1 file changed

+5
-3
lines changed

qcodes/instrument_drivers/QuTech/D5a.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class D5a(Instrument):
2727
"""
2828

2929
def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3,
30-
reset_voltages=False, mV=False, **kwargs):
30+
reset_voltages=False, mV=False, number_dacs=16, **kwargs):
3131
""" Create instrument for the D5a module.
3232
3333
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,
4949
dac_step (float): max step size (V or mV), passed to dac parameters of the object
5050
reset_voltages (bool): passed to D5a_module constructor
5151
mV (bool): if True, then use mV as units in the dac parameters
52+
number_dacs (int): number of DACs available. This is 8 for the D5mux
5253
"""
5354
super().__init__(name, **kwargs)
5455

5556
self.d5a = D5a_module(spi_rack, module, reset_voltages=reset_voltages)
5657
self._mV = mV
58+
self._number_dacs = number_dacs
5759

5860
self._span_set_map = {
5961
'4v uni': 0,
@@ -72,7 +74,7 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3,
7274
self._gain = 1
7375
unit = 'V'
7476

75-
for i in range(16):
77+
for i in range(self._number_dacs):
7678
validator = self._get_validator(i)
7779

7880
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,
9597
docstring='Change the output span of the DAC. This command also updates the validator.')
9698

9799
def _set_dacs_zero(self):
98-
for i in range(16):
100+
for i in range(self._number_dacs):
99101
self._set_dac(i, 0.0)
100102

101103
def _set_dac(self, dac, value):

0 commit comments

Comments
 (0)