D
Dave West
On Mon, 24 Jan 2000, Jiri Baum wrote:
> On Sat, Jan 22, 2000 at 03:46:10PM +0000, Dave West wrote:
> > On Sun, 23 Jan 2000, Jiri Baum wrote:
> > > To turn the question around, how *else* are you going to implement a
> > > timer?
>
> > Dead simple count interrupts like Linux does.
>
> Not as simple as it sounds. For one thing, you're going to miss clock ticks
> and get errors unless you really know what you are doing. For another
> thing, you don't want to be updating a thousand timers from your interrupt handler.
>
> > Remember that Linux has no concept of time just an elapsed time ticker
> > that it initialises from your BIOS RTC at boot time or even from a time
> > server on the internet. Almost all PLC's I have worked with have
> > absolutely no concept of wall-time at all yet they still run lots of timers.
>
> Hmm, I suspect they do work off the concept of wall-time, it's just that
> since they are only interested in differences, they don't bother asking for
> it and just assume they were turned on at midnight 1st January AD 1.
This implies an understanding of minutes, hours, days, weeks, months, years and leap days etc. None of the PLC's I was refering to has any
knowledge, concept or idea of these things. Indeed, I have worked on projects where we designed and built embedded controllers they had timers but no concept of wall-time. I know this to be the case because I wrote all the code in 8085 asm myself.
> A very private concept of wall-time, I admit, but it suffices for the
> purposes.
>
> The other way of looking at it is that there is one interrupt-driven
> "master timer", and all the other timers work off that. In linux, the
> master timer happens to run on GMT.
No it does not. It runs on seconds since 00:00 1/1/1970 (or similar). The library routines sort that count into GMT/UTC or whatever on request and
it is not accurate to the millisecond. It may be accurate to within +/- 9 msec depending on when the timer interrupt was initialised and assuming
the clock it initialised the counter from was correct.
Dave West E-Mail: [email protected]
Semiras Projects Ltd. PGP public key available on request.
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
> On Sat, Jan 22, 2000 at 03:46:10PM +0000, Dave West wrote:
> > On Sun, 23 Jan 2000, Jiri Baum wrote:
> > > To turn the question around, how *else* are you going to implement a
> > > timer?
>
> > Dead simple count interrupts like Linux does.
>
> Not as simple as it sounds. For one thing, you're going to miss clock ticks
> and get errors unless you really know what you are doing. For another
> thing, you don't want to be updating a thousand timers from your interrupt handler.
>
> > Remember that Linux has no concept of time just an elapsed time ticker
> > that it initialises from your BIOS RTC at boot time or even from a time
> > server on the internet. Almost all PLC's I have worked with have
> > absolutely no concept of wall-time at all yet they still run lots of timers.
>
> Hmm, I suspect they do work off the concept of wall-time, it's just that
> since they are only interested in differences, they don't bother asking for
> it and just assume they were turned on at midnight 1st January AD 1.
This implies an understanding of minutes, hours, days, weeks, months, years and leap days etc. None of the PLC's I was refering to has any
knowledge, concept or idea of these things. Indeed, I have worked on projects where we designed and built embedded controllers they had timers but no concept of wall-time. I know this to be the case because I wrote all the code in 8085 asm myself.
> A very private concept of wall-time, I admit, but it suffices for the
> purposes.
>
> The other way of looking at it is that there is one interrupt-driven
> "master timer", and all the other timers work off that. In linux, the
> master timer happens to run on GMT.
No it does not. It runs on seconds since 00:00 1/1/1970 (or similar). The library routines sort that count into GMT/UTC or whatever on request and
it is not accurate to the millisecond. It may be accurate to within +/- 9 msec depending on when the timer interrupt was initialised and assuming
the clock it initialised the counter from was correct.
Dave West E-Mail: [email protected]
Semiras Projects Ltd. PGP public key available on request.
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc