Programming example for windows nt, Programming example for windows nt -11 – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual
Page 43

Publication 1747-UM002A-US-P - June 2000
Developing Applications 3-11
OC_ExtendedErrorMsg(Handle, &exterr, &msg);
printf(”\nERROR: %s\n”, msg);
}
}
OC_CloseScanner(Handle);
exit(retcode);
}
/* end Ioexit() */
Programming Example for
Windows NT
The following Windows NT example (
sample.c
on your Windows
NT API disk) shows how to program the above steps. Callouts on the
right margin identify the code for each step.
/********************************************************************
* Title: Simple application sample code for 1746 I/O PCI Interface API
*
* Abstract:
*
* This file contains a simple application using the PCI
* bus interface API.
*
* Environment:
* 1747-PCIS 1746 I/O PCI Interface
* Microsoft Windows NT 4.0
* Microsoft Visual C++ / Borland C++
* (c)Copyright Allen-Bradley *
************************************************************************/
/*=======================================================================
= INCLUDE FILES =
=======================================================================*/
#include
#include
#include
#include
#include
#include
#include
#include "ocapi.h"
/*=======================================================================
= MODULE WIDE GLOBAL VARIABLES =
=======================================================================*/
HANDLE OChandle;
OCIOCFG OCcfg;
/************************************************************************
* Entry point:
* Ioexit
*
* Description:
* Common error handling routine. This routine displays any
* extended error and exits the program.
*
* Arguments:
* rc : int ( input )
* This error code is passed to the exit() routine.