def readRegister(self, registerAddress, command, channel, moduleID=None, signed=False): value = self.send(command, registerAddress, channel, 0, moduleID).value return TMC_helpers.toSigned32(value) if signed else value
def readRegister(self, registerAddress, signed=False): datagram = struct.pack(DATAGRAM_FORMAT, registerAddress, 0) reply = self.__connection.send_datagram(datagram, DATAGRAM_LENGTH, self.__channel) values = struct.unpack(DATAGRAM_FORMAT, reply) value = values[1] return TMC_helpers.toSigned32(value) if signed else value
def parameter(self, pCommand, pType, pAxis, pValue, moduleID=None, signed=False): value = self.send(pCommand, pType, pAxis, pValue, moduleID).value return TMC_helpers.toSigned32(value) if signed else value
def actualVelocity(self): return TMC_helpers.toSigned32(self.axisParameter(self.APs.ActualVelocity))
def actualPosition(self): return TMC_helpers.toSigned32(self.axisParameter(self.APs.ActualPosition))
def actualTorque(self): return TMC_helpers.toSigned32(self.axisParameter(self.AP.ActualTorque))
def targetTorque(self): return TMC_helpers.toSigned32(self.axisParameter(self.AP.TargetTorque))
def targetPosition(self): return TMC_helpers.toSigned32(self.axisParameter(self.AP.TargetPosition))
def actualVolume(self): reg_value = self.axisParameter(self.APs.ActualVolume) return TMC_helpers.toSigned32(reg_value)
def globalParameter(self, commandType, bank, moduleID=None, signed=False): value = self.send(TMCL_Command.GGP, commandType, bank, 0, moduleID).value return TMC_helpers.toSigned32(value) if signed else value
def axisParameter(self, commandType, axis, moduleID=None, signed=False): value = self.send(TMCL_Command.GAP, commandType, axis, 0, moduleID).value return TMC_helpers.toSigned32(value) if signed else value
def globalParameter(self, commandType, axis): return TMC_helpers.toSigned32(self.send(self.moduleAddress, TMCL_Command.GGP, commandType, axis, 0).value)
def actualVelocity(self): return TMC_helpers.toSigned32( self.readRegister(self.tmc4671_reg.PID_VELOCITY_ACTUAL))