Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 May : High frequency pooling thread

www.cryer.info
Managed Newsgroup Archive

High frequency pooling thread

Subject:High frequency pooling thread
Posted by:"Ricardo Villela Coppola" (coppo..@csp.com.br)
Date:Tue, 23 May 2006 11:20:39

Hi folks,

I have a hardware related question. I'm developing a speed
measuring device that needs to pool a digital port state once
every 0.1  milessecond to be able to track objects going as
fast as 180 Kph. My device card has sensors that mark the
status of two points in the path of the tracked objects.
Every time an object reaches the first I have to time how
long it takes to reach the second. I tryed it with a critical
time priority Thread that sleeps 1 ms (Sleep(1), for  lack of
an alternative way like the usleep in C) when the port's status
remains the same for a hole second. But Windows gives me a 10 ms
wait time instead of the 1 ms requested. Even if the delay was
of 1 ms I would already have an aleatory error for losing any
thing between 0 to 1 ms of the first point activation just for
been asleep. I imagine that this is some kind of escalation issue
that only allows me to have 10 milesseconds slices of sleeping
time. But, since the CPU's operating frequency is 600MHz it
seems quite reasonable that it can check the port's state and
do all the other things a CPU running Windows XP should do
without any problem. As far as I already manage to find browsing
the web, it seems that I'll need to write a specific driver for
pooling my hardware. Can any one give me some directions on what
should I study in order to achieve my goal? I'm planning to start
with the MS Windows DDK.

TIA


--
Ricardo Villela Coppola (CSP Controle e Automação Ltda)

Replies:

www.cryer.info
Managed Newsgroup Archive