Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling a large message queue

I am receiving a stream of data via CAN using fast CAN. After a large number
of
frames are received I receive this message

NON-FATAL RUN-TIME ERROR
"Prueba 1.c", line 188, col 18, thread id 0x000031D4
Function ncReadMult: (return value == -1074388952 [0xbff62028]).
Error 0xbff62028 (CanErrOverflowRead); Read queue overflow. Solutions:
Use Read
Mult notification and function to read multiple frames at a time;
Increase the
length of the read queue; To receive recent data only, set read queue
length to
zero.

The basis for my program is hte NI example that uses

Status = ncCreateNotification(NetIntfObjh, NC_ST_READ_MULT,
TIME_EACH_CALLBACK,
&Queue, AnalyzerCallback);

So I though I was handling read multiple frames
. Ihave increased my queue
lenght to 20000.

How do I set read queue lenght to 0 to receive only recent data?

Thanks

LV
0 Kudos
Message 1 of 2
(3,792 Views)
Hi,

You just need to set the read queue lenght to 0. You will get an error if you set the notification for Read multiple. You'll have to change that to a Notification for a single read NC_ST_READ_AVAILABLE.

Hope this helps.

DiegoF
0 Kudos
Message 2 of 2
(3,792 Views)