04-05-2006 03:46 PM
04-06-2006
01:05 PM
- last edited on
05-23-2025
05:09 PM
by
Content Cleaner
Hi CME12345,
What version of the NI-Serial driver are you using in your setup? This may be something that was corrected in a later version of the driver.
Current Serial Drivers Page
Regards,
Matt S.
04-06-2006 01:15 PM
04-07-2006 10:32 AM
04-10-2006 03:47 PM
04-11-2006 11:15 AM
05-10-2006 01:13 PM
I have discovered what is causing my problem. The problem is caused by the values I am using in the COMMTIMEOUTS structure (see the original attached file with the code snippets).
Here is the MSDN reference regarding COMMTIMEOUTS: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecoreos5/html/wce50lrfcommtimeout...
The bottom line is that my code is allowing 10 msec per byte for the transmit to complete. This code has worked for years on a 3rd-party PCI RS-485 card. I believe that this timeout value is occasionally being exceeded with the ENET-485, perhaps due to network latencies or some other communication delay between the computer and the ENET-485. It is interesting (and frustrating) that in this case, the call to GetOverlappedResult appears to complete with no error (i.e., the return value is nonzero).
If I make the following change, which sets the timeout to 5 seconds, I no longer have this problem:
Comm_Timeouts.WriteTotalTimeoutMultiplier = 0;
Comm_Timeouts.WriteTotalTimeoutConstant = 5000;