Oc_getlastfaultcause, Oc_getlastfaultcause -22, Return value: considerations – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 82: Example, Syntax, Parameters

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

6-22 Library of Routines

BYTE

Rack3Size;/* number of slots in Rack 3 */

OCSLOTCFG

SlotCfg[OCMAXSLOT];/* configuration for each

slot */

} OCIOCFG;

Return Value:

Considerations:

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

Example:

HANDLE

Handle;

OCIOCFG

iocfg;

int

retcode;

retcode = OC_GetIOConfiguration( Handle, &iocfg );

/* Use OC_DownloadIOConfiguration() to download the

information */

OC_GetLastFaultCause

OC_GetLastFaultCause retrieves the cause of the last fault.

Syntax:

int

OC_GetLastFaultCause(HANDLE handle, BYTE

*FaultCode, int *SlotNum);

Parameters:

Name:

Value:

Description:

SUCCESS

0

I/O configuration was read successfully

ERR_OCACCESS

2

handle

does not have access to scanner

ERR_OCINIT

5

scanner has not been initialized, see OC_InitScanner

ERR_OCRESPONSE

10

scanner did not respond to request

Parameter:

Description:

handle

Must be a valid handle returned from OC_OpenScanner

FaultCode

Points to the address that contains the fault cause
If the value returned in

FaultCode

is 0, the scanner has not

received any faults since it has been reset.

SlotNum

Slot number that caused the fault

Advertising
This manual is related to the following products: