Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -1074388710 occuring with CAN_Read.vi

I am using the Channel API to read a single channel  using CAN_Read.vi.  The CAN_Read is in a while loop running every 20ms.  I initialized the read task for input with a sample rate of 0.  I ran the vi overnight and at some point, there was an error message:

"Error -1074388710 occurred at CAN Read (Single-Chan Single-Samp Dbl).vi

Possible reason(s):

NI-CAN:  (Hex 0xBFF6211A) 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)."

 

I am not sure how to correct this.  I have attached a screen shot of the portion of the vi which is failing.

Thank you.

0 Kudos
Message 1 of 4
(7,422 Views)

buff,

 

Why are we only reading every 20ms?  What timing are we trying to control here?  If we speed up this read does the problem still happen?  If this loop timing is just to control the speed of your write can we read and write in two seperate loops?

Sincerely,
Jason Daming
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 4
(7,411 Views)

hello ,i think ten years later, you must have solved this question.

i meet the same question today,can you give me some advice?

thank you .

0 Kudos
Message 3 of 4
(1,736 Views)

My advice 14 years ago would have been the same as it is today.  Start with one of the examples installed with NI-CAN.  From LabVIEW that is Help >> Find Examples.  In general the best approach is to wait a small amount of time, then query how many frames there are to read.  If there are 0 do nothing.  If there are some read them.  If you are getting weird queue errors, try one of the examples, or the bus monitor and see if it works fine.

 

Also XNet has replaced NI-CAN, and is way better for a bunch of reasons.  Any new projects in the last 10 years or so for CAN should use XNet hardware.

0 Kudos
Message 4 of 4
(1,718 Views)