Oc_sethostwatchdog -66 – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual

Page 120

Advertising
background image

6–66

Library of Routines

OC_SetHostWatchdog

Publication 1747-6.5.3 June 1998

OC_SetHostWatchdog

OC_SetHostWatchdog sets the host-to-scanner watchdog delay and mode of the
scanner.

Syntax:

int

OC_SetHostWatchdog(HANDLE handle, int mode, WORD delay);

Parameters:

Description

Once the Host Watchdog is enabled, the host application must call OC_PetHostWatchdog more often than
the time specified as the watchdog timeout. If the host application does not call OC_PetHostWatchdog for
a time longer than the watchdog timeout, then the action specified by

mode

is performed.Return Value

Return Value:

Considerations:

Supported in the DOS API library and the Windows NT API library

Example:

HANDLE

Handle;

int

retcode;

retcode = OC_SetHostWatchdog(Handle, WATCHDOG_IDLE, 10 );

/* Watchdog times out in 1 second and places scanner in idle mode */

Parameter:

Description:

handle

Must be a valid handle returned from OC_OpenScanner

mode

If

mode

is:

WATCHDOG_IGNORE

the host-to-scanner watchdog is
disabled (default)

WATCHDOG_IDLE

a watchdog timeout causes the scanner to fault.
The status LED is set to flashing red, the I/O is
reset, I/O scanning stops, and internal scanner
error of 0x0B is set, and the major error code is
set to 0x40. Use OC_ClearFault before the
scanner can be set to Scan mode

delay

Specifies the watchdog timeout in multiples of 100ms and can have any
value from 1 (100ms) to 65535 (6553.5s).

Name:

Value:

Description:

SUCCESS

0

host watchdog was set successfully

ERR_OCACCESS

2

handle

does not have access to scanner

ERR_OCINIT

5

scanner has not been initialized, see OC_InitScanner

ERR_OCPARAM

8

parameter contains invalid value

Advertising
This manual is related to the following products: