diff --git a/docs/changes/newsfragments/6076.improved_driver b/docs/changes/newsfragments/6076.improved_driver new file mode 100644 index 00000000000..8a980a73d21 --- /dev/null +++ b/docs/changes/newsfragments/6076.improved_driver @@ -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 diff --git a/src/qcodes/instrument_drivers/Harvard/Decadac.py b/src/qcodes/instrument_drivers/Harvard/Decadac.py index 1384fe0523e..2ae3bc9a801 100644 --- a/src/qcodes/instrument_drivers/Harvard/Decadac.py +++ b/src/qcodes/instrument_drivers/Harvard/Decadac.py @@ -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: @@ -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): diff --git a/src/qcodes/instrument_drivers/Keysight/private/Keysight_344xxA_submodules.py b/src/qcodes/instrument_drivers/Keysight/private/Keysight_344xxA_submodules.py index fca2ce19f89..1f026fc2c7f 100644 --- a/src/qcodes/instrument_drivers/Keysight/private/Keysight_344xxA_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/private/Keysight_344xxA_submodules.py @@ -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 diff --git a/src/qcodes/instrument_drivers/oxford/triton.py b/src/qcodes/instrument_drivers/oxford/triton.py index c25c229aff8..08a3dda777a 100644 --- a/src/qcodes/instrument_drivers/oxford/triton.py +++ b/src/qcodes/instrument_drivers/oxford/triton.py @@ -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)