Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Error handling

Hi all!
 
I want to handle bus errors and frames errors on a CAN bus ! Well, i can get the bus errors using the status bit, and status code, but my problem is if i  have a bus off state, how is it possible to restart the communication ? I started the reset, or the start function.. it doesn't seems to work ... In the labview help, i read, it's possible to restart the communication using an API function.. ok well , but which one ???
 
To get the frame errors, i will use the ncgetAttr function, but again i have a problem, how can i simulate a crc or a form error for example (in order to check my code ???) !
 
Thanks a lot for your future answers ..
0 Kudos
Message 1 of 3
(4,152 Views)
Sorry to get your hopes high as I don't have the answer but I  have similar problems to you and is interested in hearing the answer.
0 Kudos
Message 2 of 3
(4,116 Views)
If you get a Bus off with your CAN communication, you cannot communicate as long as the Bus off condition is present.
In order to recover within LabVIEW you have to call the "ncaction" with opcode reset and after that the "ncaction" with opcode start using the network interface handle (port handle).
Before you call these two function make sure you are passing no error, because any error would cause the function calls to fail.
See the attached example for more details.
It works that, whenever the Busoff occures, it clears the error cluster, resets the CAN controller and restarts the CAN communication.

DirkW
0 Kudos
Message 3 of 3
(4,101 Views)