(Page 8 of 8 in this chapter)
5.7 Using On-board Timers
AG Access supports one on-board timer per port on an AG board. This on-board timer has 10-ms resolution. The timer generates periodic events. You specify both the period and number of events when invoking
adiStartTimer
.
The functions in AG Access for starting or stopping the on-board timers are:
To...
Use...
Start an on-board timer
adiStartTimer
Stop an on-board timer
adiStopTimer
5.7.1 Starting the Timer
Start a timer by calling
adiStartTimer,
passing a context handle, a timeout value, and an event count value. A
DONE
event will be generated when the timer has expired.
If the count value is greater than one, a "tick" event will be generated for each expiration of the timeout with a
DONE
event for the final expiration.
The timer may be reset/restarted with an additional call to
adiStartTimer
. When restarted, previous timer definitions are discarded and the timer begins with the new parameters.
Note:
Unlike most AG Access asynchronous functions, the timer is not stopped automatically when a call is released.
5.7.2 Start Timer Events
The start timer events are:
Event
Description
ADIEVN_TIMER_DONE
Once the timer has completed (expired), AG Access generates a
DONE
event with the
value
field set to
CTA_REASON_FINISHED
. A
DONE
event will be received with an error in the
value
field only if the board has an error. If the timer is stopped by calling adiStopTimer, the value field will be
CTA_REASON_STOPPED
.
ADIEVN_TIMER_TICK
If count is greater than 1, AG Access generates a "tick" event for the first count-1 expirations.
5.7.3 Stopping the Timer
adiStopTimer
stops the timer started with
adiStartTimer
. Once the timer has stopped, a
DONE
event is generated.
5.7.4 Stop Timer Event
The stop timer event is:
Event
Description
ADIEVN_TIMER_DONE
When the timer is stopped, a
DONE
event is generated with the
value
field set to
CTA_REASON_STOPPED
.
(Page 8 of 8 in this chapter)
tech_support@nmss.com
Copyright © 1997, Natural MicroSystems, Inc. All rights reserved.