Hello, my CAN communication works and I can send a position command or set the state to closed loop.
But I’m having issues reading the voltage: my python code and a call for axis_id = 1
→ seems like there is no response as the while loop never stops
def can_vbus(msg_axis_id, data=, format=’’):
data_frame = struct.pack(format, *data)
msg = can.Message(arbitration_id=((msg_axis_id << 5) | 0x17), data=data_frame, is_extended_id=False)
try:
bus.send(msg)
except can.CanError:
print(“can_vbus NOT sent!”)
while (1):
msg = bus.recv()
if (msg.arbitration_id == (msg_axis_id << 5) + 0x17):
data = struct.unpack(‘ff’, msg.data)
return data[0]
print(can_vbus(1))