Oc_getextendederror -23 – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual
Page 77

OC_GetExtendedError
Library of Routines
6–23
Publication 1747-6.5.3 June 1998
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 OCERRDATASIZE
3
/* 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