Hi,
No.
The simple fact is that there is no real-time access to serial data (or any
other resource) under Windows, much less subordinated by the Windows serial
driver and the classes that implement the framework. Also, realize that the
standard PC UART implements a 16-byte receive FIFO (and some other
hardware/software devices even deeper FIFOs). The processing of the
receive FIFO is interrupt driven, but also is processed by timeouts at the
diver level.
YOU can set the rx-trigger level to 1 to improve this, but not to eliminate
the timing issues.
Also, if you depend on the DataReceived event, you are relying on a
Background (worker) thread for notification from each port. There is no
assurance of which thread will be processed first. You CAN poll, instead of
using DataReceived -- but even this process offers no guaranty.
The only way to tackle this with any assurance is outside the relm of
managed code. It would involve a laborious process or writing your own
serial device driver to do the time-stamp for you at a much lower level.
From managed code, the best that you can do is to get "sorta close." BTW,
your second post illustrates this. If that is good enough, then, OK.
Problem solved.
Dick
--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See
www.hardandsoftware.net for details and contact information.