INtime SDK Help
CreateRtAlarm
INtime SDK v7.1 > About INtime > INtime Kernel > Time management > CreateRtAlarm

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
);

Parameters

dwAlarmFlags
Attributes of the alarm. The relevant field is masked with the value 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
Time until the alarm triggers, in microseconds. The value is truncated to system timer ticks. If the value is less than one system clock tick, then relevant values are:
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.

Additional Information

Supersedes the knCreateRtAlarmEvent call, which is deprecated.

Return Values

Returns the handle for the alarm.

Requirements

Versions Defined in Include Link to
INtime 4.0 intime/rt/include/rtbase.h rt.h rt.lib

See Also

Time management system calls, ResetRtAlarm