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

QDAC2 current measurements should be returned as floats #126

Merged
merged 5 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
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
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