VBA RS232 Class - serial port I/O ReHash

  • In:
    VBA RS232 Class - serial port I/o with modcomm

    Brendan has provided a great service to those of us having to do Serial communications.... still.;(


    I have however found a small bug when a time delay between writes and reads spans midnight. In this case, the application will hang indefinitely waiting for Timer to reach a value greater than 86400 seconds. Since Timer is seconds since midnight, it has values ranging only from 0 to 86400.


    Here is a patch to the Delay subroutine I believe will resolve this issue. I welcome others to make suggestions on improving this workaround. This solution has a downside in that all events are paused up until midnight. At most, this should be a couple of seconds. More typically, this would be nearer 0.1 seconds.


    Note that since the time delay value T is typically much less than one second any new solutions will need more precision in the wait than a single second.