예제 #1
0
 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
예제 #2
0
    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
예제 #3
0
 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
예제 #4
0
 def actualVelocity(self):
     return TMC_helpers.toSigned32(self.axisParameter(self.APs.ActualVelocity))    
예제 #5
0
 def actualPosition(self):
     return TMC_helpers.toSigned32(self.axisParameter(self.APs.ActualPosition))    
예제 #6
0
 def actualTorque(self):
     return TMC_helpers.toSigned32(self.axisParameter(self.AP.ActualTorque))
예제 #7
0
 def targetTorque(self):
     return TMC_helpers.toSigned32(self.axisParameter(self.AP.TargetTorque))
예제 #8
0
 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)
예제 #10
0
 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
예제 #11
0
 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
예제 #12
0
 def globalParameter(self, commandType, axis):
     return TMC_helpers.toSigned32(self.send(self.moduleAddress, TMCL_Command.GGP, commandType, axis, 0).value)
예제 #13
0
 def actualVelocity(self):
     return TMC_helpers.toSigned32(
         self.readRegister(self.tmc4671_reg.PID_VELOCITY_ACTUAL))