Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

ncWaitForState Timeout Waiting for Write Success During Periodic Transfer

Primary Software: Driver Software>>NI-CAN
Primary Software Version: 2.3.2
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Industrial Communications>>CAN

Problem:
I am using ncWaitForState to wait for the Write Success condition, to ensure that all written frames have been transmitted. When I am performing a period transfer, I receive a timeout error (0xBFF62001) on my second iteration. My first write works fine. Why does my second write cause this timeout error?

Solution:
The problem can easily be caused by a misconfigured timeout value when calling ncWaitForState. When performing a periodic transfer, the value you have written using ncWrite will only be transmitted at the time interval specified by the period in the Can Object Configuration. This means that you may have to wait one full period before the frame will be transmitted. For this reason, the timeout on ncWaitForState should be at least slightly longer than the period specified for the CAN Object.

Due to the timing characteristics involved, your application may seem to work in some instances. This is because while the maximum delay before the write is equal to the transmit period, in some instances the frame could be transmitted almost immediately. In either case, the timeout error will likely occur at some point in your application if the timeout value is smaller than the transmit period.

Related Links:
KnowledgeBase 3DNBCA4B: Interpreting Values Written to and Returned by ncWaitForState

Attachments:





Report Date: 04/12/2006
Last Updated: 04/21/2006
Document ID: 3WBA7R2W

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit