Discussion:
ncWaitForState BFF62001on state NC_ST_READ_AVAIL
(too old to reply)
KathleenJ
2008-07-22 21:10:08 UTC
Permalink
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?
Song_M
2008-07-23 18:10:08 UTC
Permalink
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
DirkW
2008-07-23 18:40:08 UTC
Permalink
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

Loading...