Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-CAN error 0xbff620ad

Solved!
Go to solution

I'm currently working on a soft realtime "feedforward" application in which a NI-CAN USB interface is used as a CAN frames sniffer. The idea is to read the CAN frames as fast as possible (~50Hz call to ncReadMulti) in order to apply a correction (on some power supplies) which value is computed using the motor-encoders data encapsulated into the CAN frames.  This application works very well in terms of performances but I get a the NI-CAN error 0xBFF620AD something like 10 times per hour. I switched from NI-CAN 2.5.1 to 2.6.3 but it didn't solve the problem.

 

For the moment, I simply try to recover by resetting/restarting the CAN interface. This action usually takes about 12ms to complete - which is "acceptable" as a temporary workaround. However, I really would like to fix the problem.  So my question is: what is the best NI-CAN driver configuration for such a "listen only" CAN application?

 

Here is my current configuration:

 

NCTYPE_ATTRID can_attribute_names[NUM_CAN_ATTRS];
NCTYPE_UINT32 can_attribute_values[NUM_CAN_ATTRS];
//- set baudrate -----------------------------------------
can_attribute_names[0] = NC_ATTR_BAUD_RATE;
can_attribute_values[0] = 500000;
//- start option -----------------------------------------
can_attribute_names[1] = NC_ATTR_START_ON_OPEN;
can_attribute_values[1] = NC_FALSE;
//- length of the incoming CAN frames Q -----------------
can_attribute_names[2] = NC_ATTR_READ_Q_LEN;
can_attribute_values[2] = 0;

//- no writting ------------------------------------------
can_attribute_names[3] = NC_ATTR_WRITE_Q_LEN;
can_attribute_values[3] = 0;
//--------------------------------------------------------
can_attribute_names[4] = NC_ATTR_CAN_COMP_STD;
can_attribute_values[4] = 0;
//--------------------------------------------------------
can_attribute_names[5] = NC_ATTR_CAN_MASK_STD;
can_attribute_values[5] = NC_CAN_MASK_STD_DONTCARE;
//--------------------------------------------------------
can_attribute_names[6] = NC_ATTR_CAN_COMP_XTD;
can_attribute_values[6] = 0;
//--------------------------------------------------------
can_attribute_names[7] = NC_ATTR_CAN_MASK_XTD;
can_attribute_values[7] = NC_CAN_MASK_XTD_DONTCARE;
//- listen only (no write) -------------------------------
can_attribute_names[8] = NC_ATTR_LISTEN_ONLY;
can_attribute_values[8] = NC_TRUE;

 

I tried to play with the <NC_ATTR_READ_Q_LEN> attribute but it doesn't seem to have any influence on my problem.

 

Thanks for you help.

NL

 

 

0 Kudos
Message 1 of 3
(6,644 Views)

Hi NL,

 

We would to help troubleshoot the error that you are seeing.  Would it be possible to give a bit more information on what function or VI throws the error and also what the error text is?

Cheers,
Kelly R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(6,612 Views)
Solution
Accepted by topic author nl-soleil

I finally found a solution (or at least a stable workaround).

I used to call <ncWaitForState> in order to avoid calling <ncReadMulti> while the input buffer is empty. Removing the call to <ncWaitForState> seems to fix the <0xBFF620AD> error problem. I did modification last friday and everything works smoothly (so far) on the ten of NI-CAN based systems running 7/7 - 24/24 in our accelerator control system.

NL   

 

0 Kudos
Message 3 of 3
(6,591 Views)