Oc_setuppowerfail action, Oc_setuppowerfailaction -66 – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 126

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

6-66 Library of Routines

OC_SetupPowerFail
Action

OC_SetupPowerFailAction registers the action to be taken when a
power fail interrupt is received from the scanner.

Syntax:

int

OC_SetupPowerFailAction(HANDLE handle,

BYTE *bufptr, WORD offset, WORD length, void

(*callback)() );

Parameters:

Description:

You can configure the power failure action in four ways:

No action (default); the power failure interrupt is ignored
(

bufptr

is NULL;

callback

is NULL)

Copy a block of data to the host retentive data partition in dual
port RAM (

bufptr

points to the data to save;

callback

is

NULL)

Execute a user callback function (

bufptr

is NULL;

callback

points to the routine to call)

Copy a block of data and execute a callback function (

bufptr

points to the data to save;

callback

points to the routine to

call)

Parameter:

Description:

handle

Must be a valid handle returned from OC_OpenScanner

bufptr

If

bufptr

is:

NULL

no data is copied (default)

Not NULL

at power fail

length

bytes of data are copied

from

bufptr

to the host retentive data partition

starting at

offset

.

offset

Specifies the offset within the host retentive data partition to begin
copying

length

Number of bytes to copy
If

length

points beyond the end of the host retentive data partition,

it is truncated

callback

If

callback

is:

NULL

no callback function is executed (default)

Not NULL

the power fail interrupt routine calls this function
after copying the data to the host retentive data
partition (if configured)

Advertising
This manual is related to the following products: