Rockwell-automation 1747-PCIS API Software - Open Controller Uživatelský manuál Strana 43

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 174
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 42
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 <windows.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <string.h>
#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.
Zobrazit stránku 42
1 2 ... 38 39 40 41 42 43 44 45 46 47 48 ... 173 174

Komentáře k této Příručce

Žádné komentáře