Creates an alarm object. You can program the alarm for either a one-shot or repeating mode, and program the interval.
RTHANDLE CreateRtAlarm( DWORD dwAlarmFlags, // alarm flags DWORD dwMicroseconds // alarm time interval, in microseconds );
dwAlarmFlags
ALARM_REPETITION_MASK
, which specifies whether the alarm generates a single event or repeated events. The relevant values for this field include:KN_SINGLE_SHOT |
Generates a single event. This alarm is inactive after the initial time interval elapses. You must reset it for reuse (see ResetRtAlarm). |
KN_REPEATER |
Generates repeated alarm events. This alarm resets after each generated event of the handler, causing the event to occur again after the next interval elapses. Repetitive alarms generate periodic events until explicitly deleted. |
dwMicroseconds
0 or 1 tick |
The alarm is signaled on the next system timer tick, and for repetitive alarms, on every system timer tick. Only the remainder of the current system timer tick elapses, not necessarily one full clock tick. (The value 0 is treated the same as 1.) |
>1 |
The event is signaled on the nth system timer tick. If you set the value 5 and only half a tick currently remains, the alarm is called after 4-1/2 clock intervals. |
Supersedes the knCreateRtAlarmEvent call, which is deprecated.
Returns the handle for the alarm.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 4.0 | intime/rt/include/rtbase.h | rt.h | rt.lib |