Skip to content

Commit

Permalink
add update for D5mux (#888)
Browse files Browse the repository at this point in the history
* add update for D5mux

* autopep
  • Loading branch information
peendebak authored and WilliamHPNielsen committed Nov 30, 2017
1 parent 79d1b6e commit ec64567
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions qcodes/instrument_drivers/QuTech/D5a.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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),
Expand All @@ -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):
Expand Down

0 comments on commit ec64567

Please sign in to comment.