Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add update for D5mux #888

Merged
merged 5 commits into from
Nov 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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