Oc_getextendederror, Oc_getextendederror -19, Syntax – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 79: Parameters: description, Return value

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

Library of Routines 6-19

OC_GetExtendedError

OC_GetExtendedError reads extended error information from the
scanner.

Syntax:

int

OC_GetExtendedError(HANDLE handle, OCEXTERR

*buf);

Parameters:

Description:

The extended error information is written during Scan mode or its
configuration. An API function that determines that the scanner has
responded with an error returns an error code of ERR_OCEXTERR.
OC_GetExtendedError retrieves the extended error information
written by the scanner and removes the error from the scanner.

The library buffers extended errors in a queue. The queue can hold as
many as 5 extended errors at one time. If the queue is full when a
new extended error is received from the scanner, the oldest extended
error is lost and ERR_OCOVERRUN is returned. The host application
must call this function periodically to remove existing extended errors
from the buffer.

The

OCEXTERR

structure is defined as:

#define OCERRDATASIZE3/* number of bytes of error data */

typedef struct tagOCEXTERR

{

BYTE

ErrorCode;/* Extended error code */

BYTE

SlotNum;/* Associated slot number */

BYTE

ErrorData[OCERRDATASIZE];/* Error code data */

} OCEXTERR;

See appendix A for error codes.

Return Value:

Parameter:

Description:

handle

Must be a valid handle returned from OC_OpenScanner

buf

Contains the extended error information
If no extended error information is available, the error code field of

buf

will be 0.

Name:

Value:

Description:

SUCCESS

0

extended error information was read successfully

ERR_OCACCESS

2

handle

does not have access to scanner

ERR_OCOVERRUN

16

an error message has been discarded

Advertising
This manual is related to the following products: