Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I have a vb.net app (.net 4) which writes serial data (no more than 10 bytes, via System.IO.Ports.SerialPort) and there seems to be a delay in the send. An external device tells me to do something. It takes my program about 15ms to process this request and send the result back to the host. The host is timing me to see how long it takes. I can guarantee that I am sending the serial string within the 15ms, but the host doesn’t get it for 80ms and some times as much as 150ms! What external force is causing this delay? I was original using a USB to serial adapter but have since switched to a PCIe card and am getting the same results.
Posted
Comments
[no name] 20-Nov-15 0:42am    
That's life: http://www.codeproject.com/Articles/110670/Improving-the-Performance-of-Serial-Ports-Using-C
Member 8153852 20-Nov-15 11:06am    
Thanks. That was an insightful link. However, it would seem as if the "blame" is put on the "receiving" side of the equation. Here is a bit more to my scenario...I only have control over my app (sender). The receiving app does not have this problem with other applications (which I have no knowledge of) so the burden is on me (the sender) to fix. I also tried my app on Windows Embedded with not change what so ever. Should I be using something other than .net's system.io? Is that my problem, or is it a Windows thing?
[no name] 24-Dec-15 13:18pm    
Look for delays on receiving serial data. There are serial port options for (a) defining an event character and (b) defining timeouts for how long to wait for successive bytes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900