04-23-2009 08:14 AM
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.
04-24-2009 02:39 PM
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?
01-06-2023 12:51 AM
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 .
01-06-2023 07:56 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord