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

Driver bugfixes [Needs testing Keysight 34465 and Triton 450] #6076

Merged
merged 8 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
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 @@ -39,14 +39,14 @@
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:

Check warning on line 42 in src/qcodes/instrument_drivers/Harvard/Decadac.py

View check run for this annotation

Codecov / codecov/patch

src/qcodes/instrument_drivers/Harvard/Decadac.py#L42

Added line #L42 was not covered by tests
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))

Check warning on line 49 in src/qcodes/instrument_drivers/Harvard/Decadac.py

View check run for this annotation

Codecov / codecov/patch

src/qcodes/instrument_drivers/Harvard/Decadac.py#L49

Added line #L49 was not covered by tests
# 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 @@ -62,7 +62,7 @@
based on the minimum/maximum values of a given channel.
Midrange is 32768.
"""
frac = code/65536.0
frac = code/65535.0

Check warning on line 65 in src/qcodes/instrument_drivers/Harvard/Decadac.py

View check run for this annotation

Codecov / codecov/patch

src/qcodes/instrument_drivers/Harvard/Decadac.py#L65

Added line #L65 was not covered by tests
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 @@ -501,7 +501,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 @@ -461,7 +461,7 @@
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

Check warning on line 464 in src/qcodes/instrument_drivers/oxford/triton.py

View check run for this annotation

Codecov / codecov/patch

src/qcodes/instrument_drivers/oxford/triton.py#L464

Added line #L464 was not covered by tests
# 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
Loading