Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

ncWaitForState BFF62001on state NC_ST_READ_AVAIL

I am using a PCI_CAN (Series 2) card to flash ECU's. After every 8 frames of data are sent to the module, a flow control frame is expected. I use ncWaitForState with state NC_ST_READ_AVAIL when the software tries to read the flow control frame. At random spots in the data transfer process the ncWaitForState times out. However, using CANalyzer to monitor the bus activity, I can see that the flow control frame has actually been put on the bus. If I force and ncRead after ncWaitForState times out, the expected data is in the read buffer. I tried the forced read as a workaround, but after this situation occurs the module stops responding. The module does expect communication every 2 seconds or it will shutdown. I am well within this limit. I also upgraded my drivers from v.2.2 to v.2.5.1.32772 and I get the same results. It appears the something is preventing the state of the read buffer from changing to indicate data is available. Any ideas on how to correct this?
0 Kudos
Message 1 of 3
(6,096 Views)
Hey Kathleen!

I have found the knowledge base article below that will give you information on how to set the timeout for ncWaitForState so that you avoid the random ncWaitForState time outs.  Try it out and tell me your results!  Thanks!

http://digital.ni.com/public.nsf/allkb/3C89E2ED19D3C8368625714E0059258A?OpenDocument
Best Regards,
Song Mu
National Instruments San Diego
0 Kudos
Message 2 of 3
(6,083 Views)

Kathleen,

If this is reproduceable, could you run the NI-SPY in parallel and log all the NI-CAN api calls? Before you run the spy please disable the stop on error condition. Please zip the log file and post it to this thread.

DirkW

0 Kudos
Message 3 of 3
(6,079 Views)