Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-CAN autorecovery

I am using PCI-CAN hardware with NI-CAN 2.3.1 software to send/receive messages to a unit under test (UUT).
The test setup works fine while the can bus is connected to the UUT, however it is necessary
to disconnect the UUT to replace it with the next unit to be tested. If the UUT is disconnected more than a few
seconds while the application (written in LabVIEW 7.1) software is running, the PCI-CAN / LabVIEW software
crashes by generating errors. It is then necessary to stop the LabVIEW application and restart it with the UUT
connected for the CAN bus to recover.
 
Is this issue inherent in the PCI-CAN hardware or NI-CAN 2.3.1, or is there a way to program a LabVIEW application
so the CAN bus will autorecover when a UUT is reconnected ?
 
Thanks for your help.
 
 
0 Kudos
Message 1 of 3
(3,694 Views)
Hi Mike,
 
The problem you are facing with is normal behavior. The CAN Controller tries to send his frames, but if there is no Acknowledge, he assumes a bus problem and if he reaches a certain error count he reports an error state. The second  state is (error passive) gives you a warning and the third state (bus off) causes an error and the controller stops sending frames immediately. This is automatically handled by the controller and there is no way to avoid it.
 
You should change your application in a way to stop the communication if the UUT is disconnected using the stop communication command and to restart the communication using the start communication command. You can do this by hand or using a digital device for triggering this situation.
 
hope that helps
 
DirkW
0 Kudos
Message 2 of 3
(3,673 Views)

I agree with what DirkW stated.  Another way to eliminate this problem might be to permenently add a second CAN device on the bus, even if that device does not send or receive anything as part of the test.  I have seen some companies add a second CAN unit similar to what they are testing to the test bench, just program it to not send CAN data or respond to CAN messages.  (another easy way to do this is to add a second NI-CAN port somewhere.)

 

0 Kudos
Message 3 of 3
(3,654 Views)