Timing Functions
Archiver
Posts: 46,084
Hi there fellow stampers:
I am working on an application where I need to make up to three timing
functions (like a delay on operate) happen on a BS-2 concurrently. I intend
to set each timer up as a subroutine so that when the program goes into that
particular subroutine, I increment a counter. After an accumulated value has
been reached in this counter, then I know that I will have a sufficient time
delay to then execute another function.
That's the easy part. Now for the question: how do I make the timer's
accumulated value equate to a fixed time delay (e.g. a count of "1" would
represent 5 msec of time)? I thought about using a small delay time in each
subroutine but as more subroutines are activated, the program will get
slower. This may not be a big deal for one or two timers but I was hoping to
come up with something a little more universal for future projects where I
could have as many as 8 or 16 timer functions running concurrently.
Is there a better way of doing this? I suspect that the time variable will
probably be a function of the program's cycle time - if so, is there a
utility someone has developed that will read the program and tell me what is
the program's cycle time?
Thanks in advance for your help.
Gerry Shand
gwshand@c...
(780) 471-0470
I am working on an application where I need to make up to three timing
functions (like a delay on operate) happen on a BS-2 concurrently. I intend
to set each timer up as a subroutine so that when the program goes into that
particular subroutine, I increment a counter. After an accumulated value has
been reached in this counter, then I know that I will have a sufficient time
delay to then execute another function.
That's the easy part. Now for the question: how do I make the timer's
accumulated value equate to a fixed time delay (e.g. a count of "1" would
represent 5 msec of time)? I thought about using a small delay time in each
subroutine but as more subroutines are activated, the program will get
slower. This may not be a big deal for one or two timers but I was hoping to
come up with something a little more universal for future projects where I
could have as many as 8 or 16 timer functions running concurrently.
Is there a better way of doing this? I suspect that the time variable will
probably be a function of the program's cycle time - if so, is there a
utility someone has developed that will read the program and tell me what is
the program's cycle time?
Thanks in advance for your help.
Gerry Shand
gwshand@c...
(780) 471-0470
Comments
Parkis' Time Machine (not sure where it is, but someone will chime in).
The PAK-VII would allow you to measure 8 input channels, but if you wire a
channel high (or low) it is just a timer. Also, there are two internal
timers that you can use even if you are already using all 8 input channels.
http://www.al-williams.com/awce/pak7.htm
The software timing loops depend on lots of factors and will change as your
program changes. For a lot of loops that is a big headache.
Good luck!
Al Williams
AWC
*NEW: Now in stock, PAK-IX floating point A/D!
http://www.al-williams.com/awce/pak9.htm
>
Original Message
> From: Shand, Gerry W., Celanese/CA [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=O9kkQYFDGceK8gX2FdMI3G1M51iHtISpLHebCjwZ-uxsLvAFArDTQb4Rq4IspdpNAX8tmcv2pxAANg]gwshand@c...[/url
> Sent: Tuesday, April 10, 2001 9:02 AM
> To: 'basicstamps@yahoogroups.com'
> Subject: [noparse][[/noparse]basicstamps] Timing Functions
>
>
> Hi there fellow stampers:
>
> I am working on an application where I need to make up to three timing
> functions (like a delay on operate) happen on a BS-2
> concurrently. I intend
> to set each timer up as a subroutine so that when the program
> goes into that
> particular subroutine, I increment a counter. After an
> accumulated value has
> been reached in this counter, then I know that I will have a
> sufficient time
> delay to then execute another function.
>
> That's the easy part. Now for the question: how do I make the timer's
> accumulated value equate to a fixed time delay (e.g. a count of "1" would
> represent 5 msec of time)? I thought about using a small delay
> time in each
> subroutine but as more subroutines are activated, the program will get
> slower. This may not be a big deal for one or two timers but I
> was hoping to
> come up with something a little more universal for future projects where I
> could have as many as 8 or 16 timer functions running concurrently.
>
> Is there a better way of doing this? I suspect that the time variable will
> probably be a function of the program's cycle time - if so, is there a
> utility someone has developed that will read the program and tell
> me what is
> the program's cycle time?
>
> Thanks in advance for your help.
>
> Gerry Shand
> gwshand@c...
> (780) 471-0470
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>