Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual

Page 40

Advertising
background image

3–14

Developing Applications

Publication 1747-6.5.3 June 1998

/************************************************************************ *
* Entry point:
* main
*
* Description:
* Entry point of the PCI I/O bus interface API sample application.
*
* This program resets, initializes, and autoconfigures the scanner.
* It displays the scanner firmware and hardware versions, and
* the front panel switch position.
* It lights User LED 1, reads inputs from a 32 pt discrete
* input module, and writes data to the M0 file on a BAS module.
*
* Arguments:
* none
*
* External effects:
* none
*
* Return value:
* 0 if no errors were encountered
* 1 if errors
*
* Access: Public
*
*-----------------------------------------------------------------------
* Notes:
*
************************************************************************/
main()
{
int rc;
int i;
int slots;
int BASslot;
int IB32slot;
int fRecreateIOcfg;
OCINIT ocpart;
BYTE status;
OCVERSIONINFO verinfo;
BYTE swpos;
WORD wData,wLen;
BYTE temp;

BASslot = IB32slot = 0;
fRecreateIOcfg = 0;

/* Open the scanner */

if (SUCCESS != (rc = OC_OpenScanner(&OChandle)))
{
printf("\nERROR: OC_OpenScanner failed: %d\n", rc);
Ioexit(1);
}

/* Create an error-handling thread */
if (-1 == (long) _beginthread(tErrorEvent, 0, NULL))
printf("\nERROR: _beginthread tErrorEvent failed.\n");

Access the
scanner
See page
6-48.

Advertising
This manual is related to the following products: