I don't think there is going to be a problem.  The counters on that device
are 32 bits long, which gives a count length of some 4 billion.  By your
calculation of 126k counts per race you are going to have to run

2^32 / 126000 = 34087

races before you wrap the counters.  Just for fun-with-numbers sake, that's
93 years of daily races!

Anyway, even if you did stand a chance of wrapping the counter, the issue is
not actually wrapping the counter but wrapping the counter **more than once
during a race. This is because you typically care only about the differences
between counter readings taken during a race. If you use the right
(unsigned) subtraction algorithm you get the right answer subtracting a
number taken before the wrap-around from one taken after the wrap-around -
as long as you can guarantee that there weren't two or more wraparounds
during that interval.

Forgive me if I am being pedantic here but it sounded like you didn't really
understand that wrapping counters should not be a problem, even if it could
happen.

On Fri, Jan 2, 2009 at 01:55, Jaap Struyk <[email protected]> wrote:

> Matthias Urlichs schreef:
>
> >> One thing remaining do, is there a way to reset the counters after every
> >> reading?
> >
> > No. Why? Just remember the old value and subtract.
>
> Yes, but the engine gives 2 counts every rotation so at idle it's 30 per
> second and at full throttle it's 300 per second.
> At a race  we have about 1 hour idle time (warming up, driving to the
> track) and 1 minute full throttle (3 runs) so that is 30*60*60 + 300*60
> = 126000 counts for each race, 15 races a year not counting various test
> at our own yard, will the counter end one day? or will it start again at
> zero then?
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to