07-16-2009 09:44 AM
Hello,
I am using the NI CAN frame API and I turned on the CAN Bus Error frame logging and wanted to know if there is a way to determine the source of the CAN bus error, specifically whether the error was generated by the NI USB CAN controller itself or a CAN device on the bus?
Regards,
Russell
07-17-2009 05:22 PM
After perusing the NI-CAN Hardware & Software Manual I did not see anything with regards to getting an address on which device sent the error message. You may however want to take another look at it verify that I didn't miss anything as it is an extensive document.
Looking at the CAN bus error it looks like the ARB ID is change and encrypts the error message in the ARB ID. I therefore don't believe there is anyway of determining where the error was sent from.
Sorry to be the bearer of bad news
07-20-2009 08:03 AM
Hi Russell,
Because of the way CAN works, it is not possible to determine where an error came from. You can check the error cluster information to see the type of error which may provide some insight.
Take a look at the low-layer workings of CAN here:
http://zone.ni.com/devzone/cda/tut/p/id/2732
There's an "ACK" bit that all the controllers acknoweldge on a successful message receive. If any controller thinks the message is bad, it "vetoes" the message by not pulling the bit high. All of the other controllers then know the message was potentially bad and throw it out. However, it's not possible to determine which controller vetoed the message with this scheme.
If you are having intermittant bus error problems, 99% of the time it is related to baud rates, cabling and termination. CAN buses running at high speeds (over 500kbps) can't be over 40-50m in length, and can't have stubs from the main network more than a meter or two. The ends of the network need terminating resistors between the CAN_H and CAN_L lines.
http://digital.ni.com/public.nsf/allkb/E64E8655D2B41DBA86256A530055E6BA