Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C# System.IO.Ports.SerialPort

Options
  • 20-10-2010 1:06pm
    #1
    Registered Users Posts: 5,379 ✭✭✭


    Has anyone got the Serial Port Read Timeouts to function correctly using System.IO.Ports.SerialPort??

    I'm seeing that if I set the ReadTimeout value to Infinite, any calls to read the serial port will hang as expected till a character comes in. But If its set to a value in milliseconds, say 600, the calls will return immediately if no data is available and raise a timeout exception.


Comments

  • Registered Users Posts: 2,781 ✭✭✭amen


    have tried setting it to 10,000 thats 10 seconds to ensure it works as you think it does?

    600 is just over half a second which is fairly fast


  • Registered Users Posts: 5,379 ✭✭✭DublinDilbert


    amen wrote: »
    have tried setting it to 10,000 thats 10 seconds to ensure it works as you think it does?

    600 is just over half a second which is fairly fast

    I've been using the system tick count, saving it before I do the Read, then when i return i can work out how long the call lasted.

    Something funny has happened, after setting the ReadTimeOut to infinite, then setting it back to a normal value it appears to work now :eek:


Advertisement