Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-CAN ncWrite C API returns error "0xBFF62008"

We are sending periodic frames to the controller and the test last for almost an hour.

 

"ncWrite" C API returns error "0xBFF62008", after search for waht this error means I found out following

0xBFF62008 : Write queue overflow. Solutions for CAN Object: Increase the write queue length; wait for Write Success state prior to calling Write; to transmit recent data only, set the write queue length to zero. Solutions for Net Interface: Wait for Write Mult state, then repeat Write; get the Number of Entries Free attribute and Write that number of frames.

 

 

"ncConfig" call the attribute value for "NC_ATTR_READ_Q_LEN" and "NC_ATTR_WRITE_Q_LEN" are set to 20.

 

I am using "NI PCI-8512/2" board.

 

Is there a way to diagnose the queue or find out when this write queue gets filled?

 

 

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

You can wait for the write success as the error suggestion recommends.  Or, if you want to look at how much space is left you can use 

NC_ATTR_WRITE_ENTRIES_FREE (Write Entries Free)

http://www.ni.com/pdf/manuals/370289r.pdf#page=556

 

Clemens | Technical Support Engineer | National Instruments
0 Kudos
Message 2 of 6
(4,362 Views)

Thanks Kemens for your reply. I will add a check of this attribute to find out when the queue gets full.

 

I am still not sure if this error message I am seeing is actual cause or effect of some other error. The reason I say this because

- I have noticed at times out device driver process starts failing with "0xBFF62008" from ncWrite or else

- We call "ncWaitForState" with 5ms timeout before we start reading frames (ncRead), and at times we see following errors. (these error text we get from ncStatusToString)
'NI-CAN: (Hex 0xBFF62001) 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.'
'Unknown NI-CAN status code bff62009 (-3) '

 

Brief description of our test process

- Our software uses NI-CAN device driver API's for communication and we use 2 NI PCI-8512/2 cards for CAN communication.
- The test goes on for more than a hour.
Card 1 : communicates with Cycler unit by CAN communication.
Card 2 : port 1 communicates with GLAN protocol sending diagnostic frames across to ECU
port 2 communicates with CAN by sending periodic message to ECU
- We start noticing error "0xBFF62008" on Card 2 port 2 and after this the test goes on for a while and then aborts. We have notice some random behaviour of different error codes from NI-CAN device drivers or sometimes the test just works with no errors.
- To recover from this error a PC restart is required.

 

 

 

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

From the error code and description, it looks like we should be able to narrow down the issue by extending the timeout period.  After you started checking the queue, are you still getting the same issue or has it been resolved?  If it is resolved now, then the queue overflow sounds like the issue.

Clemens | Technical Support Engineer | National Instruments
0 Kudos
Message 4 of 6
(4,322 Views)

Thanks for your reply Kemens. Finally we were able to debug this issue further and figured that one of the NI CAN module/board was bad and was not sending frames to the controller.

As far as debugging goes I added a check on attribute for  "NC_ATTR_WRITE_PENDING" to check on number of frames waiting which helped me narrow down the reasoning of this issue. 

0 Kudos
Message 5 of 6
(3,856 Views)

Thanks for the update.  Glad to hear that you were able to track down the root cause!

Clemens | Technical Support Engineer | National Instruments
0 Kudos
Message 6 of 6
(3,848 Views)