CAN BUS communication issue - ID number does not match setting

3 次查看(过去 30 天)
I am using a Kvaser USBcan Pro 1 device to communicate with a TI processor board. I am using the Vehicle Network Toolbox bloxks CAN REceive and CAN Unpack to transmit signals back to a HOST model. Sometimes it works fine, and other times, I seem to lose communication. When I inspect the data coming back out the CAN Receive block while communication is working fine, I see that the ID outputted matches what i have set in the CAN Receive block. When there is a problem with communication, the ID is 4.295e9. Sometimes i see it bounce back and forth betweent he correct ID and 4.295e9, and sometimes it is just stuck at 4.295e9. Can someone explain why this is?

回答(1 个)

Ayush Anand
Ayush Anand 2023-11-22
Hi Jeremy,
I understand you are using a Kvaser USBcan Pro 1 to communicate with a TI processor board with the help of the Vehicle Network Toolbox, and sometimes losing connection.
The ID value 4.295e9 that you are observing is very close to the maximum value for a 32-bit unsigned integer (2^32 - 1 = 4294967295). In the context of CAN communication and the Vehicle Network Toolbox in MATLAB, this value is often indicative of an error or a special condition rather than a valid CAN ID. Here are a few potential reasons why you might be seeing this value:
  1. Error Frame: The CAN protocol specifies that an error frame will have an ID of all dominant bits, which could be interpreted as the maximum value for an unsigned 32-bit integer. This could be an indication that there is a transmission error on the CAN bus.
  2. Bus Off State: If the CAN controller on your Kvaser device goes into a bus-off state due to too many errors, it might stop participating in bus activities, and this could somehow manifest as receiving the maximum integer value as the ID.
  3. Overrun Error: Sometimes the CAN controller's receive buffer overruns (i.e., messages arrive faster than they are being processed), this could also result in erroneous data being read, potentially including this maximum value.
You should also look for any error flags or messages from the Vehicle Network Toolbox that might indicate what the problem is. You can also check for any physical layer issues like loose connections or bad terminations. The toolbox might provide diagnostic information that can help you determine whether you're seeing error frames or other issues.
You can refer to the following page for reading more on CAN hardware:
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 Vehicle Network Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by