Skip to content

Commit

Permalink
Merge pull request #6076 from qutech/bugfix/drivers
Browse files Browse the repository at this point in the history
Driver bugfixes [Needs testing Keysight 34465 and  Triton 450]
  • Loading branch information
jenshnielsen authored Jun 17, 2024
2 parents a4f45ca + fc7d3a7 commit 1d820ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/changes/newsfragments/6076.improved_driver
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Fix the Harvard DecaDAC range not including the highest bit
- Fix Keysight 34465A DMM firmware version parsing
- Fix Oxford Instruments Triton section parsing
6 changes: 3 additions & 3 deletions src/qcodes/instrument_drivers/Harvard/Decadac.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ def _dac_v_to_code(self, volt):
based on the minimum/maximum values of a given channel.
Midrange is 32768.
"""
if volt < self.min_val or volt >= self.max_val:
if volt < self.min_val or volt > self.max_val:
raise ValueError(
f"Cannot convert voltage {volt} V to a voltage code, value out of range "
f"({self.min_val} V - {self.max_val} V)."
)

frac = (volt - self.min_val) / (self.max_val - self.min_val)
val = int(round(frac * 65536))
val = int(round(frac * 65535))
# extra check to be absolutely sure that the instrument does nothing
# receive an out-of-bounds value
if val > 65535 or val < 0:
Expand All @@ -65,7 +65,7 @@ def _dac_code_to_v(self, code):
based on the minimum/maximum values of a given channel.
Midrange is 32768.
"""
frac = code/65536.0
frac = code / 65535.0
return (frac * (self.max_val - self.min_val)) + self.min_val

def _set_slot(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def __init__(
"DIG" in options
or version.parse(convert_legacy_version_to_supported_version("A.03"))
<= version.parse(
convert_legacy_version_to_supported_version(idn["firmware"])
convert_legacy_version_to_supported_version(idn["firmware"])[:11]
)
)
# Note that the firmware version check is still needed because
Expand Down
2 changes: 1 addition & 1 deletion src/qcodes/instrument_drivers/oxford/triton.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def _get_temp_channel_names(self, file: str) -> None:
options = config.options(section)
namestr = '"m_lpszname"'
if namestr in options:
chan_number = int(section.split("\\")[-1].split("[")[-1]) + 1
chan_number = int(re.findall(r"\d+", section)[-1]) + 1
# the names used in the register file are base 0 but the api and the gui
# uses base one names so add one
chan = "T" + str(chan_number)
Expand Down

0 comments on commit 1d820ef

Please sign in to comment.