Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 44

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

3-12 Developing Applications

*
* External effects:
* The program is terminated.
*
* Return value:
* none
*
* Access: Public
* -----------------------------------------------------------------------
* Notes:
*
*************************************************************************/
void Ioexit
int rc
) {
OCEXTERR exterr;
char *msg;
if (OC_GetExtendedError(OChandle, &exterr) == SUCCESS)
{
if ( exterr.ErrorCode != 0 )
{
OC_ExtendedErrorMsg(OChandle, &exterr, &msg);
printf("\n\nERROR: %d %s\n", msg, exterr.ErrorCode);
}
}
OC_CloseScanner(OChandle);
exit(rc);
} /* end Ioexit() */
/*************************************************************************
* Entry point:
* tErrorEvent
*
* Description:
* Thread to handle errors.
*
* Arguments:
* none
*
* External effects:
* none
*
* Return value:
* none
*
* Access: Public
*
*-----------------------------------------------------------------------
* Notes:
*
************************************************************************/
void tErrorEvent( void *dummy )
{
while(1)
{
/* Sleep until the scanner reports an error */
OC_WaitForExtError(OChandle, INFINITE);
/* An error has occurred. Perform whatever error handling */
/* that is necessary. In this case, we just print a message */
/* and exit the process. */
Ioexit(1);
}
} /* end tErrorEvent() */

Advertising
This manual is related to the following products: