Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing CAN frames

Hello there,

We're having trouble with occasionally missing some CAN Data frames on a PXI-8461 CAN Interface card - (Baud Rate: 50 kBaud).

1. Missing frames
Data frames from our devices come grouped in pairs. For notification about data arrival we use ncWaitForState function. It configured to notify when frames pair arrives by using NC_ATTR_NOTIFY_MULT_LEN parameter. I understand that normally when we receive notification and read data by ncReadMult function, ActualDataSize should not be less than size of data frame multiplied by number of frames (from NC_ATTR_NOTIFY_MULT_LEN).

The problem is that sometimes we receive notification about TWO data frames arrival, but ActualDataSize returned from ncReadMult shows that only ONE of them was renewed in the reading queue. This problem was solved by additional ncWaitForState if ActualDataSize is less than 2 data frames. But we need an advice why this may happen and what side effects we should expect.

2. RTSI rate too fast
For synchronizing data receiving we use timer card (PXI-6602)with RTSI pulses each 100 ms to send a remote frame. Sometimes a warning from NI library appears:
Warning 0x3ff62126 (CanWarnRTSITooFast); You configured CAN transmit when a RTSI input pulses, and the RTSI rate occurs faster than CAN frames can be transmitted at the specified baud rate. Solutions: Configure the source of RTSI pulse (i.e. DAQ counter) for a slower rate.

3. Timeout problem
Each new measurement comes in 100 ms. But sometimes timeout expires without receiving data. This may be due to the problem #2.
0xbff62001 (CanErrFunctionTimeout); The timeout of a wait or notification function expired before any desired state occurred. Solutions: Increase value of Timeout parameter; Verify your cable connections and operation of remote devices.

Questions:
It seems that all these three problems have the same nature – NI library does not handle all the data coming in time. Please can you advise what we should do to avoid these problems.

Thanks, VIV
0 Kudos
Message 1 of 1
(4,066 Views)