beautypg.com

Hardware monitor functions, Hm_registermonitorwarningevent – Rockwell Automation 2711P Software Development Kit User Manual User Manual

Page 59

background image

Publication 2711P-UM005A-EN-P - March 2007

PanelView Plus CE-Specific Extensions to the WinCE API 59

Hardware Monitor Functions

These functions permit an application to set the warning levels and
register for a warning event. When the event occurs the application
can read the current value of the monitored parameters.

hm_RegisterMonitorWarningEvent

This function registers an application to receive a warning event when
a monitored parameter is above the upper level or below the lower
level bounds.

BOOL hm_RegisterMonitorWarningEvent (DWORD
dwMonitorIDMask, HANDLE *phEventHandle);

Parameters:

dwMonitorIDMask

Bitmask combination of the Table that will return an event to the
application when any parameter enters the warning state.

phEventHandle

Pointer to an application-allocated HANDLE.

Return Values:

Returns TRUE if the monitor warning event has been successfully
registered; otherwise returns FALSE on failure.

Remarks:

Applications that need to be notified when one or more monitored
parameters enter the warning state should register for an event with
this function. The application specifies in dwMonitorIDMask what
monitored parameters should signal an event when entering the
warning state. If this function succeeds, the event handle is returned
to the caller in *phEventHandle and the application can wait on the
event using one of the standard Win32 WaitForxxx() functions. Once
the event is triggered and the application's thread fall through the
WaitForxxx() condition, the application can determine which
parameter is currently in the warning state using the function
hm_GetMonitorWarnings(). If any parameter is still in a warning state,
the application can act accordingly.