Starts (or restarts) a timer on this port.
DWORD cdiStartTimer ( CTAHD ctahd, DWORD timeout, DWORD count)
|
Argument |
Description |
|
ctahd |
Context handle. |
|
timeout |
Time out value in milliseconds. |
|
count |
Number of events. |
|
Return value |
Description |
|
SUCCESS |
|
|
CTAERR_BAD_ARGUMENT |
Argument is not in the valid range. |
|
CTAERR_INVALID_CTAHD |
Handle is invalid. |
|
Event |
Description |
|
CDIEVN_TIMER_DONE |
The timer stopped. The event value field contains one of the following reason codes: CTA_REASON_TIMEOUT CTA_REASON_STOPPED |
|
CDIEVN_TIMER_START |
The timer started. |
|
CDIEVN_TIMER_TICK |
The timer ticked. Refer to the Details section for more information. |
The CDI service supports one on-board timer per context on a CX board. You can set up this timer to run for a specified amount of time and then expire, returning an event to the application. Alternatively, you can configure the timer to tick, generating a specified number of tick events at a periodic rate before expiring:
|
Timer task |
Steps |
|---|---|
|
Run once and then expire |
When the timer is started, CDIEVN_TIMER_START is generated. When the timer expires, CDIEVN_TIMER_DONE is returned. The value field of this event contains CTA_REASON_FINISHED. |
|
Tick |
When the timer is started, CDIEVN_TIMER_START is generated. As the timer ticks, CDIEVN_TIMER_TICK events are generated. On the final tick, CDIEVN_TIMER_DONE is returned. The value field of this event contains CTA_REASON_FINISHED. |
The timer has a 2 ms resolution.
You can abort a timer by invoking cdiStopTimer.
A running timer can be restarted at any time before normal expiration by a subsequent call to cdiStartTimer.