Beispiel #1
0
 def close(self):
     with self._lock:
         if not self.device:
             return
         try:
             for i in range(self._info['numaxes']):
                 AMC.setMove(self.device, i, False)
                 AMC.setOutput(self.device, i, False)
             AMC.close(self.device)
         except Exception as e:
             print(str(e))
         finally:
             self.device = None
             self._device_info.clear()
Beispiel #2
0
 def setNumaxes_d(self):
     with self._lock:
         if not self.device:
             return
         for i in range(3):  # AMC can only control axis [0..2]
             if AMC.setOutput(self.device, i, True) != 0:
                 break
             else:
                 AMC.setMove(self.device, i, False)
         self._info['numaxes'] = i