Oc_getresetcause, Oc_getresetcause -25 – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 85

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

Library of Routines 6-25

OC_GetResetCause

This function can only be used on the 1747-OCF controller. The
1747-PCIS cannot reset the host.

Syntax:

int

OC_GetResetCause (HANDLE, handle, int *Cause);

Description:

OC_GetResetCause returns the reason the scanner was last reset.
Handle must be a valid handle returned from OC_OpenScanner.

The cause of the last scanner reset is written to the address pointed to
by Cause. If Cause is RESET_HOST_WD, the last scanner reset was
caused by a Host Watchdog timeout. If Cause is
RESET_NOT_HOST_WD, the last scanner reset was not caused by a
Host Watchdog timeout.

If an application enables the host watchdog function and selects the
WATCHDOG_RESET mode (see OC_SetHostWatchdog), this function
may be called during initialization to determine if the system was reset
due to a host watchdog timeout.

Return Value:

Example:

HANDLE Handle;

int

nResetCause;

/* if reset caused by host watchdog timeout, notify the

operator */OC_GetResetCause(Handle,&nResetCause);

if (nResetCause == RESET_HOST_WD) {printf("\nHost Watchdog

timed out and reset the system!!!\n");

Name:

Value:

Description:

SUCCESS

0

Scanner watchdog count read successfully

ERR_OCACCESS

1

handle does not have access to scanner

Advertising
This manual is related to the following products: