Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitoring CAN hardware status.

I am trying to display the status of each CAN (network and frame) object that I have configured in a C++ application. We are required to support both Series 1 and Series 2 cards.

I tried to extract the status from the NC_ATTR_STATE attribute. It displays the correct state most of the time. Unfortunately, the returned state does not seem to be returning consistent values. I have two CAN channels connected with terminating resistors. I start transmitting on both channels. I disconnect the cable. The state that is returned is mostly 0x20 (NC_ST_WARNING) but occasionally the state 0x02 NC_ST_WRITE_SUCCESS is returned. How can a write be successful if there is no communication?

Is there any other way to monitor the hardware status that works on both Series 1 and Series 2 cards?

Thanks in advance.
0 Kudos
Message 1 of 2
(3,310 Views)
Hi scottw,

take a look a the description of the desired state: NC_ST_WRITE_SUCCESS
"When communication starts, the NC_ST_WRITE_SUCCESS state is true by default."
and
"The state is set when the last frame in the write queue is transmitted successfully. The state is cleared when a write function is called."
Thus, you could see a NC_ST_WRITE_SUCCESS state, even though there is/was no communication.

-B2k
0 Kudos
Message 2 of 2
(3,305 Views)