Click here to Skip to main content
Sign Up to vote bad
good
Hello,
 
I am trying to synchronize the clocks of 2 external devices down to 1/10th of a second using C# and the .NET System.IO.Ports.SerialPort class.
 
I send a command and wait for a response. I divide the time it takes to get the first byte of the response by 2, and send a command to the device to set its clock with the delay added on to the computer time. I then repeat the process on the other device. I can then take a picture of a digital readout of the time, and the clocks are never the same, sometimes differing up to 100ms.
 
I printed out a detailed account of the communications (what I sent and when) with the devices, and that all checks out. So my question is: does the SerialPort have a significant delay when receiving or sending data? Did I get data, and then only know about it 20ms later?
 
PS, I am checking SerialPort.BytesToRead and not using the dataReceived event.
Posted 12 Mar '12 - 12:00


1 solution

Hello
Does the SerialPort have a significant delay when receiving or sending data?Did I get data, and then only know about it 20ms later?
The Short answer is No. There is not any specified time.
 

I am checking SerialPort.BytesToRead and not using the dataReceived event.
maybe this helps, Look at this please:
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.datareceived.aspx[^]
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 223
1 Ron Beyer 220
2 Aarti Meswania 200
3 Mahesh Bailwal 175
4 Rohan Leuva 170
0 Sergey Alexandrovich Kryukov 8,553
1 OriginalGriff 6,899
2 CPallini 3,648
3 Rohan Leuva 2,963
4 Maciej Los 2,308


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 12 Mar 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid