diff --git a/unilabos/devices/pump_and_valve/runze_multiple_backbone.py b/unilabos/devices/pump_and_valve/runze_multiple_backbone.py index ab6b286f..51d1ea28 100644 --- a/unilabos/devices/pump_and_valve/runze_multiple_backbone.py +++ b/unilabos/devices/pump_and_valve/runze_multiple_backbone.py @@ -145,6 +145,16 @@ class RunzeMultiplePump: total_steps_vel = 48000 if mode == RunzeSyringePumpMode.AccuratePosVel else 6000 return total_steps, total_steps_vel + def _receive(self, data: bytes) -> str: + """ + Keep this method as original. Always use chr to decode, avoid "/0" + """ + if not data: + return "" + # **Do not use decode method + ascii_string = "".join(chr(byte) for byte in data) + return ascii_string + def send_command(self, full_command: str) -> str: """Send command to hardware and get response""" full_command_data = bytearray(full_command, "ascii") @@ -175,11 +185,6 @@ class RunzeMultiplePump: output = self.send_command(full_command)[3:-3] return output - def _receive(self, data: bytes) -> str: - if not data: - return "" - ascii_string = "".join(chr(byte) for byte in data) # *Do not use decode('ascii', errors='ignore') - return ascii_string def _run(self, address: str, command: str) -> str: """