Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way with NI-CAN to determine the source of the CAN bus error?

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

Director of Engineering
G Systems, www.gsystems.com
Certified LabVIEW Architect
Certified LabVIEW Embedded Systems Developer
Certified Professional Instructor
GCentral
0 Kudos
Message 1 of 3
(6,691 Views)

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

 

Charley Dahan

Global Account Manager
0 Kudos
Message 2 of 3
(6,669 Views)

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

 

 

 

 

--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 3 of 3
(6,653 Views)