Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Some issues in working with NI-CAN (BFF6211A)

Hi,

 

I'm using NI-CAN to read data from a measurement system. The idea is quite simple:

 

- intialize measurement (using CAN Init Start.vi)

- read data in while loop (using CAN Read.vi)

- while loop can be stopped manually using stop button

- after the loop, CAN Clear.vi is used to clear the configuration

 

 

Sometimes, I get this error code BFF6211A after just few seconds the program get started, sometimes after few minutes, some other time I didnt get this error after 3hours. I tried to find help for this error, but I didnt get much information.

 

I've tried to vary the sample rate in CAN Init Start.vi between 1000 and 100 and the number of samples to read in CAN Read.vi between 100 and 10.

But somehow the error is still randomly occurs, sometimes there, sometimes no error.

  

I've tried to put Wait(ms).vi inside the while loop with different values, but doesnt really help. 

 

regards,

Yan.  

0 Kudos
Message 1 of 4
(6,099 Views)

Hi,

 

I found the following information to your error code:

 

-1074388710 BFF6211A

 

NI-CAN copies received CAN frames from the card to a large kernel-level queue. There is one queue for each Channel API message and one queue for each Frame API Network Interface. If your application does not read fast enough to empty this queue over time, the newest frames are lost.

 

Solutions: Call Read more frequently (such as by reducing user interface code); Frame API: use filter attributes to reduce receive traffic; Channel API: reduce the number of messages in your tasks; use single sample Input (sample rate 0).


--Can this error occur due to task level buffer overrun or if this error is thrown can it only be due to the kernel level buffer? Additionally, are there any tools or diagnostics that can be used to get details on the kernel level buffer?

 

Let me know if this solved your problem.

 

Regards,

Michael

0 Kudos
Message 2 of 4
(6,082 Views)

Hi Michael,

 

I have seen the error code and its suggestion of solution before I was posting the problem here in the forum. But I dont really understand what doesn it mean. I'm using a simple read method:

 

Initialize task -> read data (in a while loop) -> clear task

 

I've got the VI from someone else who worked in the project before me and I need to modify it, but the person who made it is not here anymore. In the initialisation VI, the frequency has been set into 1000Hz and in the while loop the data is read (with CAN Read.vi) in 100data per read. I assume this is the reason, why the process takes 100ms per iteration eventhough there is no Time VI in the while loop (the index of while loop goes up in every 100ms). I'm not sure I understand about kernel-level buffer or task level buffer, which you have mentioned.. But I can say what happens in the while loop is simply reading the values in all channels and calculate their mean value. As I say, the error is not always occuring. Sometimes there, some other time no error.

 

regards,

Yan   

0 Kudos
Message 3 of 4
(6,075 Views)

Hi,

 

the problem is, that you do not read your data fast enough. So you have to read the frames faster. Try to increase the time of your while loop.

 

Regards,

Michael

0 Kudos
Message 4 of 4
(6,056 Views)