def get_mean_velocity(self): port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) mean_vel = cia402.GetMeanVelocity() self.meanvelocity.delete('0', END) self.meanvelocity.insert(0, str(mean_vel))
def get_filtered_amps(self): port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) famp = cia402.GetFilterdAmps() self.filtamps.delete('0', END) self.filtamps.insert(0, str(famp))
def get_amps(self): port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) amps = cia402.GetAmps() self.amps.delete('0', END) self.amps.insert(0, str(amps)) m_tor.append(amps)
def get_velocity(self): port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) vel = cia402.GetVelocity() self.velocity.delete('0', END) self.velocity.insert(0, str(vel)) m_vel.append(vel)
def get_position(self): port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) pos = cia402.GetPosition() self.position.delete('0', END) self.position.insert(0, str(pos)) m_pos.append(pos)
def SwitchOff(self): port = int(self.port.get()) pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) cia402.SwitchOff() self.var1.set(False) self.var2.set(True) self.port.delete('0', END)
def SwitchOn(self): global porter porter = int(self.port.get()) pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(porter, pm1) cia402.Reset() cia402.SwitchOn() self.var1.set(True) self.var2.set(False)
def torquemode(self): self.varv.set(False) self.varp.set(False) port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) cia402.Setup_Torque_Mode() self.spos['state'] = 'disabled' self.svel['state'] = 'disabled' self.stor['state'] = 'active'
def bspos(self): port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) posit = float(self.setpos.get()) cia402.SetPosition(posit)
def bstorque(self): port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) torq = float(self.settorq.get()) cia402.SetTorque(torq)
def bsvel(self): port = porter pm1 = SocketCanPort.SocketCanPort("can1") cia402 = Cia402device.CiA402Device(port, pm1) veloc = float(self.setvel.get()) cia402.SetVelocity(veloc)
import Cia402device cia402 = Cia402device.CiA402Device() cia402.GetPosition()
import SocketCanPort import Cia402device pm1 = SocketCanPort.SocketCanPort("can1") cia402_pos = Cia402device.CiA402Device(31, pm1); cia402_pos.Reset(); cia402_pos.SwitchOn();