Usertimergetwaitevent – Rockwell Automation 2711P Software Development Kit User Manual User Manual
Page 52

Publication 2711P-UM005A-EN-P - March 2007
52 PanelView Plus CE-Specific Extensions to the WinCE API
UserTimerGetWaitEvent
This function registers the application to receive notification of the
timeout event.
DWORD UserTimerGetWaitEvent (DWORD dwTimerNumber,
BOOL bManualReset, HANDLE *phWaitEvent);
Parameters:
dwTimerNumber
The Timer Number is 0 based; i.e., if 2 timers are present on the
system, they are timer 0 and timer 1. When specifying a critical timer,
the flag USERTIMER_CRITICAL must be or’d with the Timer Number.
The range is 0 to MAX_TIMER_NUMBER.
bManualReset
Configures how the event is handled when responding to a Wait….()
operation. The bManualReset parameter specifies whether the event
object automatically resets itself from a signaled state to a
non-signaled state or whether it will require a manual reset.
Consult the Win32 documentation on CreateEvent() for further details.
phWaitEvent
Pointer to a caller allocated HANDLE, in which an event handle will
be stored. NOTE: The handle to the *phWaitEvent should not be
closed by the user. Releasing the timer releases the event handle.
Return Values:
Remarks:
Creates an event handle in *phWaitEvent which may be used in a
WaitForSingleObject() call. This event is set whenever the timer counts
down to zero, allowing interrupt driven timer handling.
UserTimerGetWaitEvent - Return Codes
Value
Description
USER_TIMER_OK
Successfully created the event handle.
USER_TIMER_INVALID_TIMER
The timer number is not valid for the system.
USER_TIMER_INVALID_PARAMETER
WaitEvent is NULL or a fatal event creation
failure occurred.
USER_TIMER_NOT_CLAIMED
This application has not claimed this timer.