diff --git a/src/instruments/abstract_instruments/instrument.py b/src/instruments/abstract_instruments/instrument.py index 424f0c97..34e2498d 100644 --- a/src/instruments/abstract_instruments/instrument.py +++ b/src/instruments/abstract_instruments/instrument.py @@ -271,7 +271,7 @@ def binblockread(self, data_width, fmt=None): as EOL terminators naturally can not be used in binary transfers. The format is as follows: - #{number of following digits:1-9}{num of bytes to be read}{data bytes} + #{number of following digits:1-F}{num of bytes to be read}{data bytes} :param int data_width: Specify the number of bytes wide each data point is. One of [1,2,4]. @@ -291,7 +291,7 @@ def binblockread(self, data_width, fmt=None): ) else: # Read in the num of digits for next part - digits = int(self._file.read_raw(1)) + digits = int(self._file.read_raw(1), 16) # Read in the num of bytes to be read num_of_bytes = int(self._file.read_raw(digits)) @@ -313,7 +313,7 @@ def binblockread(self, data_width, fmt=None): tries -= 1 if tries == 0: raise OSError( - "Did not read in the required number of bytes" + "Did not read in the required number of bytes " "during binblock read. Got {}, expected " "{}".format(len(data), num_of_bytes) )