From f3e83a12c8a0b932400bbaf16cac998293da2248 Mon Sep 17 00:00:00 2001 From: lrlunin Date: Thu, 25 Apr 2024 12:58:01 +0200 Subject: [PATCH] resolved #2 --- tangods_phymotion/PhyMotionAxis.py | 6 ------ tangods_phymotion/PhyMotionCtrl.py | 10 ++++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tangods_phymotion/PhyMotionAxis.py b/tangods_phymotion/PhyMotionAxis.py index 819520e..84a4c3b 100644 --- a/tangods_phymotion/PhyMotionAxis.py +++ b/tangods_phymotion/PhyMotionAxis.py @@ -636,12 +636,6 @@ def abort(self): def reset_errors(self): self.send_cmd("SEC") - @command(dtype_out=str) - def write_to_eeprom(self): - self._send_cmd("SA") - self.info_stream("parameters written to EEPROM") - return "parameters written to EEPROM" - @command() def read_all_parameters(self): self._all_parameters = {} diff --git a/tangods_phymotion/PhyMotionCtrl.py b/tangods_phymotion/PhyMotionCtrl.py index 543615c..4509796 100644 --- a/tangods_phymotion/PhyMotionCtrl.py +++ b/tangods_phymotion/PhyMotionCtrl.py @@ -48,6 +48,12 @@ def delete_device(self): @command(dtype_in=str, dtype_out=str) def write_read(self, cmd): + """ + see phymotion reference for command syntax (page 12) + address is always 0 (except for rotary switch) + then the command follows + :XX is the flag to skip the checksum-verify + """ cmd = self.__STX + "0" + cmd + ":XX" + self.__ETX self.debug_stream("write command: {:s}".format(cmd)) self.con.send(cmd.encode("utf-8")) @@ -64,6 +70,10 @@ def write_read(self, cmd): # no acknowledgment in response return self.__NACK + @command + def dump_to_eprom(self): + self.write_read("SA") + def is_write_allowed(self): if self.get_state() in [DevState.FAULT, DevState.OFF]: return False