Skip to content

Commit

Permalink
resolved #2
Browse files Browse the repository at this point in the history
  • Loading branch information
lrlunin committed Apr 25, 2024
1 parent a65e542 commit f3e83a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 0 additions & 6 deletions tangods_phymotion/PhyMotionAxis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
10 changes: 10 additions & 0 deletions tangods_phymotion/PhyMotionCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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
Expand Down

0 comments on commit f3e83a1

Please sign in to comment.