Skip to content

Commit

Permalink
Merge pull request #126 from QDevil/master
Browse files Browse the repository at this point in the history
QDAC2 current measurements should be returned as floats
  • Loading branch information
jenshnielsen authored Apr 21, 2022
2 parents 1038d28 + 8adfd35 commit 155e292
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/examples/QDevil/QDAC2/MultiGenerator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
"source": [
"channel = qdac.ch03\n",
"square = channel.square_wave()\n",
"sine = qdac.ch03.sine_wave()\n",
"triangle = qdac.ch03.triangle_wave()\n",
"sine = channel.sine_wave()\n",
"triangle = channel.triangle_wave()\n",
"scope.write('run')\n",
"qdac.start_all()"
]
Expand Down
11 changes: 6 additions & 5 deletions qcodes_contrib_drivers/drivers/QDevil/QDAC2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Any, NewType, Sequence, List, Dict, Tuple, Optional
from packaging.version import parse

# Version 0.11.2
# Version 0.12.1
#
# Guiding principles for this driver for QDevil QDAC-II
# -----------------------------------------------------
Expand All @@ -31,7 +31,7 @@
#
# 4. Any generator should by default be set to start on the bus trigger
# (*TRG) so that it is possible to synchronise several generators without
# further set up; which also eliminates the need for special cases for the
# further setup; which also eliminates the need for special cases for the
# bus trigger.


Expand Down Expand Up @@ -1011,7 +1011,8 @@ def available_A(self) -> Sequence[float]:
# Bug circumvention
if self.n_available() == 0:
return []
return comma_sequence_to_list(self._ask_channel('sens{0}:data:rem?'))
return comma_sequence_to_list_of_floats(
self._ask_channel('sens{0}:data:rem?'))

def peek_A(self) -> float:
"""Peek at the first available current measurement
Expand All @@ -1022,7 +1023,7 @@ def peek_A(self) -> float:
return float(self._ask_channel('sens{0}:data:last?'))

def _set_aperture(self, aperture_s: Optional[float], nplc: Optional[int]
) -> None:
) -> None:
if aperture_s:
return self._write_channel(f'sens{"{0}"}:aper {aperture_s}')
self._write_channel(f'sens{"{0}"}:nplc {nplc}')
Expand Down Expand Up @@ -2117,7 +2118,7 @@ def _set_up_debug_settings(self) -> None:

def _set_up_serial(self) -> None:
# No harm in setting the speed even if the connection is not serial.
self.visa_handle.baud_rate = 921600 # type: ignore
self.visa_handle.baud_rate = 921600 # type: ignore

def _check_for_wrong_model(self) -> None:
model = self.IDN()['model']
Expand Down
2 changes: 2 additions & 0 deletions qcodes_contrib_drivers/tests/QDevil/test_sim_qdac2_current.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def test_measurement_remove_two(qdac): # noqa
'sens2:data:rem?'
]
assert len(available) == 2
assert isinstance(available[0], float)
assert isinstance(available[1], float)


def test_measurement_last(qdac): # noqa
Expand Down

0 comments on commit 155e292

Please sign in to comment.