Re: Com Port Response time measurement

From: Dick Grier (dick_grierNOSPAM_at_msn.com)
Date: 03/25/04


Date: Thu, 25 Mar 2004 08:40:05 -0700

Hi,

The first step is to disable the UART receive FIFO. You do this by going to
Control Panel/System/Device Manager/ComPorts/device in
question/Properties/Advanced/ and move the slider to 1. Otherwise, the
receive FIFO processing will distort time measurements substantially.

Then, you need to use the timeGetTime API, not GetTickCount. The
timeGetTime API allows 1 mS time resolution, with is not possible with
GetTickCount.

Lastly, you need to make sure that no other programs are executing that will
cause Windows multitasking to throw off your time measurement. And, at the
end-of-the-day, you have to realize that Windows is not a real-time OS, so
deterministic time measurement is not possible. If you need 1 mS
resolution, with reasonable accuracy (and repeatability), the Windows on a
sufficiently fast PC will work well. Anything more may be asking too much.

-- 
Richard Grier  (Microsoft Visual Basic MVP)
See www.hardandsoftware.net for contact information.
Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.