I'm developing the python script for PCAN USB, I'm facing problem with reading the CAN msg. The read object is returning with 3-tuple and stored in status, msg, time. The return status is 0 (PCAN_ERROR_OK). The other two return values as follows
<PCANBasic.TPCANMsg object at 0x00000269780E4940>
<PCANBasic.TPCANTimestamp object at 0x0000026978178840>
How can I represent my msg in the readable manner with the timestamp?
Below i found a solution on the internet they have used ProcessMessage and HandleReadError to which my script is returning with ProcessMessage not defined.
Code: Select all
if readResult[0] != PCAN_ERROR_QRCVEMPTY:
# Process the received message
#
print ("A message was received")
ProcessMessage(result[1],result[2])
else:
# An error occurred, get a text describing the error and show it
#
result = objPCAN.GetErrorText(readResult[0])
print (result[1])
HandleReadError(readResult[0])