beautypg.com

Rockwell Automation 2711P Software Development Kit User Manual User Manual

Page 39

background image

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

PanelView Plus CE-Specific Extensions to the WinCE API 39

Return Values:

Remarks:

The function Watchdog_SW_TagEx() is initially called by the thread
(USE_THREAD_ID) that wants to be monitored by the software
watchdog. The watchdog service determines the thread ID of the
caller, starts a unique dedicated monitor and returns a new WDTagID.
The caller should use the returned WDTagID for all subsequent calls
such as tagging or stopping the watchdog monitor or changing the
timeout. This mechanism permits multiple threads in the same process
to be monitored.

The process is terminated when the timeout action is
WATCHDOG_APP_STOP and a timeout occurs for one of the threads
in a monitored process. The Software Monitor sends a WM_CLOSE
message to the process and if the process does not terminate within
10 seconds, the process is terminated by a call to TerminateProcess()
that terminates the process and all of its threads.

The system is reset when the timeout action is
WATCHDOG_SYSRESET and a timeout occurs for one of the threads
in a monitored process.

If the value of dwTimeout is 0, the watchdog timeout value is not
changed, but if the timer is running, it is tagged (reset).

If the value of dwTimeout is WATCHDOG_DISABLE, then the
watchdog is disabled. A thread that is being monitored must disable
the watchdog before it terminates; otherwise a timeout occurs and the
timeout action is performed.

Software Watchdog - Return Codes

Value

Description

WATCHDOG_OK

Success. The watchdog was tagged and/or a new
timeout was set.

WATCHDOG_NOT_PRESENT

Communication with the watchdog could NOT be
established.

WATCHDOG_TIMEOUT_FAILED

The new requested timeout could not be set. The
watchdog was not tagged.

WATCHDOG_INVALID_PARAMETER

An invalid parameter was passed to the interface.
The watchdog was not tagged.