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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C# System.IO.Ports.SerialPort

  • 20-10-2010 12:06pm
    #1
    Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 Posts: 5,401 ✭✭✭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