API Software for
1746 I/O PCI
Interface and
1747-OC Open
Controller
1747-OCF, -PCIS
User Manual
Important User Information
Because of the variety of uses for the products described in this
publication, those responsible for the application and use of this
control equipment must satisfy themselves that all necessary steps
have been taken to assure that each application and use meets all
performance and safety requirements, including any applicable laws,
regulations, codes and standards.
The illustrations, charts, sample programs and layout examples shown
in this guide are intended solely for purposes of example. Since there
are many variables and requirements associated with any particular
installation, Allen-Bradley does not assume responsibility or liability
(to include intellectual property liability) for actual use based upon
the examples shown in this publication.
Allen-Bradley publication SGI-1.1, Safety Guidelines for the
Application, Installation and Maintenance of Solid-State Control
(available from your local Allen-Bradley office), describes some
important differences between solid-state equipment and
electromechanical devices that should be taken into consideration
when applying products such as those described in this publication.
Reproduction of the contents of this copyrighted publication, in whole
or part, without written permission of Rockwell Automation, is
prohibited.
Throughout this manual we use notes to make you aware of safety
considerations:
ATTENTION
Identifies information about practices or
circumstances that can lead to personal injury or
death, property damage or economic loss
!
Attention statements help you to:
• identify a hazard
• avoid a hazard
• recognize the consequences
IMPORTANT
Allen-Bradley is a trademark of Rockwell Automation
Identifies information that is critical for successful
application and understanding of the product.
European Communities (EC)
Directive Compliance
If this product has the CE mark it is approved for installation within
the European Union and EEA regions. It has been designed and
tested to meet the following directives.
EMC Directive
This product is tested to meet the Council Directive 89/336/EC
Electromagnetic Compatibility (EMC) by applying the following
standards, in whole or in part, documented in a technical
construction file:
• EN 50081-2 EMC — Generic Emission Standard, Part 2 —
Industrial Environment
• EN 50082-2 EMC — Generic Immunity Standard, Part 2 —
Industrial Environment
This product is intended for use in an industrial environment.
Low Voltage Directive
This product is tested to meet Council Directive 73/23/EEC Low
Voltage, by applying the safety requirements of EN 61131-2
Programmable Controllers, Part 2 - Equipment Requirements and
Tests. For specific information required by EN 61131-2, see the
appropriate sections in this publication, as well as the Allen-Bradley
publication Industrial Automation Wiring and Grounding Guidelines
For Noise Immunity, publication 1770-4.1.
This equipment is classified as open equipment and must be
mounted in an enclosure during operation to provide safety
protection.
Preface
Who Should Use this
Manual
Terminology
Reference Material
Use this manual if you are responsible for developing control
applications using the 1746 I/O PCI Interface API (application
programming interface) software or Open Controller API software in
an MS-DOS or Windows NT environment.
This manual documents the 1746 I/O PCI Interface API and Open
Controller API software packages for DOS and Windows NT. The APIs
use most of the same calls. Differences are noted as appropriate.
Throughout the language of this document, we refer to the 1746 I/O
PCI Interface card (1747-PCIS) as the scanner and the 1747-PCIL
chassis interface module as the adapter. We also refer to the open
controller (1747-OCF) as a scanner.
There are two versions of the PCI Bus Interface Card. 1747-PCIS has a
256k memory capacity and the 1747-PCIS2 has a 1M capacity.
The following books might be useful as you develop your 1746 I/O
PCI Interface applications:
This document:Written by:Has this ISBN number:
PC System Architecture Series
PCI System Architecture
PCI Hardware and Software Architecture and Design Edward Solari and George WillseISBN: 0-929392-28-0
In addition to the books listed above, the following books might be
useful as you develop your 1746 I/O PCI Interface applications:
This document:By:Has this ISBN number:
PC System Architecture Series
ISA System Architecture
PC System Architecture Series
ISA System Architecture
The PCMCIA Developerÿs GuideMichael T. Mori and W. Dean Welder ISBN: 0-9640342-1-2
MindShare, Inc.
Addison-Wesley Publishing Company
MindShare, Inc.
Addison-Wesley Publishing Company
MindShare, Inc.
Addison-Wesley Publishing Company
ISBN: 0-201-40993-3
ISBN: 0-201-40996-8
ISBN: 0-201-40991-7
1Publication 1747-UM002A-US-P - June 2000
Preface 2
Additional Open Controller
Documentation
This document:Has this
1747 Open Controller PCI Expansion Bus Installation Instructions1747-5.16
1747 Open Controller PCMCIA Interface Module Installation Instructions1747-5.13
1747 Open Controller A-B Communication Interface Module Installation
Instructions
1747 Open Controller Video Interface Module Installation Instructions1747-5.15
1747 Open Controller A-B Communication Interface Module User Manual1747-6.18
1747 Open Controller IDE Interface Module for IDE-Compatible ATA Devices
(PCCards) Installation Instructions
1747 Open Controller IDE Interface Module for an Internally-Mounted 2.5" IDE
Drive Installation Instructions
The following documents are available for additional information
about the open controller and its options.
publication:
1747-5.14
1747-5.29
1747-5.30
Each open controller component ships with installation instructions.
The user manuals are part of the open controller documentation set
(catalog number 1747-OCDOC1) so you can order as many copies as
you need. The documentation set includes one copy of each open
controller document (as listed above).
In addition to the above documentation, the:
• 1747-OCVGA1 video interface module and the 1747-OCVGAE
video and Ethernet interface module include a disk with
documentation for the video drivers
interface module plus CardSoft™ for DOS) includes a disk with
CardSoft documentation.
Publication 1747-UM002A-US-P - June 2000
Preface 3
Support
Due to the PC-based architecture of the 1746 I/O PCI Interface and
open controller, the telephone support provided with the purchase
price of either product consists primarily of determining if the system
software and hardware is operating within documented specifications.
The tools for this support are:
• diagnostic utility disks that ship with the 1746 I/O PCI Interface
and open controller
• system diagnostic LEDs for 1746 I/O PCI Interface and
open controller
The diagnostic utility disk uses the DOS API as its programming
interface, which provides examples of how to use the API. The
diagnostic utility disk is a good tool to help diagnose your API
application software. See appendix B for more information.
When you purchase either product (1746 I/O PCI Interface system or
open controller system), you also receive firmware upgrades during
the 12-month warranty period.
You can purchase extended support in blocks of 5 hours by ordering
support contracts (1747-OCTS).
This chapter provides an overview of the 1746 I/O PCI Interface and
the API software. This chapter also describes how to install the API.
You should have one of the following APIs:
• API for DOS (catalog number 1747-PCIDOS or 1747-OCAPID)
• API for Windows NT (catalog number 1747-PCINT or
1747-OCAPINT)
The API software license agreement allows you to freely distribute the
executable.
The API software for the 1746 I/O PCI Interface is compatible with the
API for the 1747 Open Controller. The sample code and header files
contain comments and functions that are supported by the Open
Controller but not supported by the 1746 I/O PCI Interface. The
following table lists the differences between the 1747-OCF Open
Controller and the 1746 I/O PCI Interface.
Open Controller (1747-OCF)1746 I/O PCI Interface (1746-PCIS)
Watchdog can reset the entire system.Watchdog cannot reset entire system.
API function call OC_GetResetCause returns
reason scanner was reset
Dual-port memory not battery-backedJumper to enable battery-backup for the
IMPORTANT
1Publication 1747-UM002A-US-P - June 2000
All references to Open Controller in the example
code or header files apply to the 1746 I/O PCI
Interface.
No function call OC_GetResetCause because
the watchdog cannot reset the entire system
dual-port memory
1-2 Overview
Interface API to
the Scanner
You must develop a software interface between your application and
a scanner to control local I/O and to control remote I/O via the
1747-SN or 1747-SDN scanners. Develop a software interface in one of
the following methods:
• Use the 1746 I/O PCI Interface API to develop the interface
between your application and the 1746 I/O PCI
Interface scanner.
• Use the API for 1747 Open Controller to develop the interface
between your application and the 1747 Open Controller.
In either application type (1746 I/O PCI Interface or 1747 Open
Controller), the API provides calls for typical control functions,
such as:
• configuring I/O files
• initializing the scanner
• accessing the user LEDs, user jumper, and 3-position switch
• reading 1746 I/O PCI Interface status
• enabling/disabling forces
Application
API
1746 I/O PCI
Interface/Open Controller
dual port memory
remote I/O via
1747-SN or 1747-SDN
local I/O
API Software for DOS
The DOS API software provides a library of C function calls for DOS
application programs to interface with the dual port memory. The
DOS API supports any language compiler that uses the Pascal calling
convention.
Publication 1747-UM002A-US-P - June 2000
Overview 1-3
API Software for Windows NT
The Windows NT API supports any programming languages that use
the Win32 _stdcall calling convention for application interface
functions. The Windows NT API function names are exported from a
DLL in undecorated format to simplify access from other
programming languages.
The Windows NT API software consists of two main components:
• the OCdriver (depending on your application, either 1746 I/O
PCI Interface device driver or Open Controller device driver)
• the API library, which is a DLL (dynamically-linked library)
The Windows NT API library is a DLL and must be installed on the
system in order to run an application which uses it. The Windows NT
API accesses the scanner via the driver created for the bus interface
The driver:
• allocates resources (interrupt and memory window)
• initializes scanner hardware
• provides access to the scanner’s dual port RAM
• services interrupts from the scanner (priority messages)
• provides access to SRAM
IMPORTANT
Only access the OCdriver through the API library
functions.
When the OCdriver is loaded it tries to allocate an interrupt and a
memory window for the memory and interrupt that were allocated
using the settings by the PCI bus at power-up for the dual port RAM.
If IRQ 11 and address oxC8000 are not available (i.e., another device
already allocated the resource), OCdriver tries to allocate any resource
for which the scanner hardware can be configured (IRQ 10, 12, and
15; memory address 0xCA000 - 0xDE000). OCdriver fails to load if an
interrupt and memory window cannot be allocated.
Once an interrupt and memory window are allocated, OCdriver
initializes the scanner hardware to match the allocated resources.
Publication 1747-UM002A-US-P - June 2000
1-4 Overview
Understanding the 1746 I/O
PCI Interface Architecture
PCI bus
Scanner
The 1746 I/O PCI Interface architecture consists of a PCI card that
plugs into a PC and cables to a 1746 I/O chassis. The scanner scans
the 1746 local I/O bus and reads/writes inputs and outputs to/from
the dual port registers.
The open controller architecture consists of two CPUs (scanner and
controller) that share dual-port memory. The scanner scans the 1746
local I/O bus and reads/writes inputs and outputs to/from the
dual-port registers. The controller has a PC-based architecture with a
266Mhz Pentium to run your application software.
PCI
dual port memory
Partition: Bytes:
register1K
commands
responses
output image
input image variable
host datavariable
variable
variable
variable
controller (PC-based architecture)
266MHz
Pentium
disk bus
memory
BIOS
OS
application
software
Publication 1747-UM002A-US-P - June 2000
to 1746 PCI bus
Overview 1-5
Common Attributes of the 1746 I/O PCI Interface and 1747 Open
Controller Architectures
The functionality described in the rest of this chapter is shared by
both architectures, 1746 I/O PCI Interface and 1747 Open Controller.
The dual port is an 8K byte memory partition (optionally
battery-backed) that provides an interface between the integrated
scanner and your application software that resides on the host.
IMPORTANT
Your application (the code you develop using the API) uses the dual
port memory to communicate with the scanner to handle control
functions on the 1746 backplane, such as:
• scanner commands and responses
• battery and scanner status
• scan rate frequency and timing
• I/O image counters
• priority messages and interrupts
• semaphores to ensure data integrity
• software-generated watchdogs
• control of the 4 user-definable LEDs, the 2-position jumper, and
the 3-position switch
On the 1747-PCIS only, the jumper for the
battery-backup dual-port memory is disabled by
default. You must switch the jumper to enable the
battery-backup feature.
The 1747-OCF dual port is NOT battery-backed.
The scanner functionality of the dual port supports I/O control
functions, such as:
• synchronizing scans to the application
• forcing I/O
• defining discrete-input interrupts
• defining I/O module-driven interrupts (such as for the 1746-BAS
module)
• enabling and disabling I/O slots
• resetting I/O
Publication 1747-UM002A-US-P - June 2000
1-6 Overview
In addition to providing access to the control scanner, the dual port
memory also provides non-volatile (optional battery-backed) storage
for:
In both application types, the scanner CPU operates in six
basic modes:
• performing POST (power-on self test)
• waiting for host initialization
• Idle
• Scan
• Faulted
• non-recoverable fault
After the scanner successfully completes the POST, the scanner waits
for an initialization complete command from the application. Once the
scanner receives this command, the scanner enters Idle mode.
Before the scanner can enter Scan mode, the application must
download a valid I/O configuration to the scanner.
If a recoverable fault occurs, the scanner enters Faulted mode. Use the
OC_ClearFault API function to clear the fault before the scanner can
resume operating in Scan mode.
If a non-recoverable fault occurs, reset the scanner (cycle power).
Some possible non-recoverable faults include:
Publication 1747-UM002A-US-P - June 2000
• POST failure
• background diagnostic failure
• internal watchdog timeout
Checking LED Indicators
The graphics below show LED displays.
1746 PCI I/O Interface1747 Open Controller
Overview 1-7
PCI INTERFACE
STATUSBATT
LED 1LED 2
LED 3LED 4
OC 266 PENTIUM
STATUSBATT
COM 1COM 2
LED 1LED 2
LED 3LED 4
STATUS
The STATUS indicator reports the status of the scanner. The following
table lists the LED states for STATUS:
This state:Means:Take this action:
YellowThe scanner is running POST.None
Flashing greenThe scanner is in idle mode and
is not scanning I/O.
Solid greenThe scanner is scanning I/O.None
None
Flashing redAn I/O fault has occurred.Check software to identify
fault condition.
Solid redA scanner internal fault has
occurred.
Power system off and back on.
If the problem persists, service
may be required.
OffThe adapter is not powered up. Turn on power.
Publication 1747-UM002A-US-P - June 2000
1-8 Overview
Installing the DOS API
Installing the
Windows NT API
To install the DOS API, copy the following files to a directory you
create. The sample code files are optional, but they show how to use
the API functions.
This file:Contains:
ocapil.libAPI functions that you link to your application
ocapi.hAPI header file that contains API-referenced structures
sample.cSample application program calling the API functions
sampleb.makSample make file for the Borland C compiler
samplem.makSample make file for the Microsoft C compiler
To install the Windows NT API, use the setup utility:
TIP
It is recommended that you exit all applications
before starting the setup process.
1. Copy the contents of the API diskette to a temporary directory
on the open controllerÿs disk drive. (This step is not necessary if
a local diskette drive is connected.) The device driver file is
OCdriver.sys.
2. Select Run from the startup menu, then select the setup.exe
program from the temporary directory.
3. Click on OK to execute the setup utility. Follow the displayed
instructions. Click on Continue.
4. The next dialog lets you choose whether to install the API
executable alone (Runtime) or the API executable and the
development files (Runtime and & Development). To develop
applications with the API, you need the development files. To
only run applications, the development files are not necessary.
The development files consist of an include file, import library,
and sample code.
IMPORTANT
Runtime files may only be installed on a Windows
NT system. However, the development files may be
installed on either Windows NT or Windows 95
systems.
Publication 1747-UM002A-US-P - June 2000
Choose the appropriate installation option and click on Next.
Overview 1-9
5. Click on Continue.
6. If the development files were selected in the last dialog, the next
dialog allows a destination directory to be specified. Click on
Continue after you select the directory.
7. The necessary files are copied to the disk, and the system
registry is updated to include the OCdriver information.
8. Press OK to exit the setup utility. The contents of the
temporary directory can now be deleted.
IMPORTANT
You must shutdown and reboot the scanner before
using the API. (The setup utility sets the registry Start
parameter for OCdriver to Automatic; therefore, the
service manager starts the OCdriver when the system
is booted.)
The Windows NT API uses these files:
This file:Contains:
ocapi.libImport library in Microsoft COFF format
ocapi.hAPI header file that contains API-referenced structures
ocapi.dllAPI DLL
sample.cSample application program calling the API functions
sampleb.makSample make file for the Borland C compiler
samplem.makSample make file for the Microsoft C compiler
Installation Details
This section describes the actions the setup utility performs to install
the API and OCdriver.
If you select Runtime (Complete), the setup utility:
1. copies the device driver file,
driver directory (
%SystemRoot%\system32\drivers).
OCdriver, to the system device
Publication 1747-UM002A-US-P - June 2000
1-10 Overview
2. adds this key and these values to the system registry:
If you select Runtime & Development, the setup utility performs the
same steps as for Runtime only and the setup utility copies
ocapi.h, and the sample source files to a development directory.
,
ocapi.lib
If you want to develop your application on a computer other than the
open controller, copy the ocapi.lib and ocapi.h files to the
development computer (do not run the setup utility on the
development computer). You won’t be able to run your application
on the development computer. The runtime API only works on an
open controller.
Uninstalling the Windows NT API
To uninstall Windows NT API, use the following instructions.
1. From the Control Panel, select Add/Remove Programs.
2. From the list of installed programs, select Open Control API.
Publication 1747-UM002A-US-P - June 2000
3. Click on Add/Remove.
4. Click on Yes.
All of the API files and registry keys will be deleted.
Using the API
Chapter
2
Introduction
Getting Started
This chapter describes the API and how to use its components. For
more information about developing applications using the API, see
chapter 3.
To use the API, make sure you have copied the following files to your
development directories. The sample files are optional.
This file:Contains:
ocapil.libAPI functions that you link to your application (DOS only)
ocapi.libImport library in Microsoft COFF format (Windows NT
only)
ocapi.hAPI header file that contains API-referenced structures
ocapi.dllAPI DLL (Windows NT only)
sample.cSample application program calling the API functions
sampleb.makSample MAKE file for the Borland C compiler
samplem.makSample MAKE file for the Microsoft C compiler
Your application must link to the appropriate library (
DOS or
copy the sample files and adapt them for your application.
ocapi.lib for Windows NT) and include ocapi.h. You can
ocapil.lib for
1Publication 1747-UM002A-US-P - June 2000
2-2 Using the API
Programming Conventions
This convention:Considerations:
calling conventionThe DOS API functions are specified using the C programming language syntax. To
header filesThe API includes a header file (ocapi.h) that contains API function declarations,
sample codeThe API comes with sample files to provide an example application that communicates
compiler supportThe DOS API is supplied in the large memory model, compatible with both Microsoft
The API is supplied as an object code library file [DOS (ocapil.lib)]
or a DLL [NT (
ocapi.dll)] that you link with the host application’s
object code using commercially-available tools.
allow you to develop control applications in other programming languages, the API
functions use the standard Pascal calling convention.
The Windows NT API supports any programming languages that use the Win32 _stdcall
calling convention for application interface functions. The Windows NT API function
names are exported from the DLL in undecorated format to simplify access from other
programming languages.
data structure definitions, and other constant definitions. The header file is in standard
C format.
with the scanner. The sample files include all source files and MAKE files required to
build the sample application.
and Borland compilers. The DOS library (ocapil.lib) is compiled as a 16-bit
MS-DOS library using the 80386 instruction set.
The Windows NT library (ocapi.dll) is compiled for use with Microsoft Visual C++
or Borland C++.
DOS Considerations
The DOS API is as consistent as possible with APIs for other operating
system platforms. This makes it easier for you to migrate applications
and it simplifies support. To create a consistent API, careful
consideration was given to these requirements:
This requirement:Considerations:
memory mappingThe dual port RAM, or shared memory, is mapped automatically at power-up by the PCI bus in the
host processor’s memory address space on any even 8K boundary between 0xC0000 and 0xDFFFF.
For MS-DOS, it is important that any installed memory managers (such as EMM386) or other TSR
software avoid accessing the 8K dual port memory window.
Place the base memory select jumper in 1M position to allow the PCI BIOS to assign a base
memory address.
DOS interruptsAn interrupt is automatically assigned to the scanner by the PCI bus at power-up.
control-break handlerBecause communication with the scanner requires memory and interrupt resources (as described
above), improper termination of the host application can leave these resources allocated by the
scanner and unusable by other applications. For this reason the API includes a default
control-break handler.
The default control-break handler is installed by OC_OpenScanner. If you press a [Ctrl-C] or
[Ctrl-Break] key sequence, the following prompt is displayed:
Terminate Application? (Y/N) _
A response of Y properly exits the application; a response of N causes the application to continue.
If you need a different control-break handler, you must install it after calling the OC_OpenScanner
function. Always call the OC_CloseScanner function before exiting an application.
Publication 1747-UM002A-US-P - June 2000
Windows NT Considerations
During development, the application must be linked with an import
library that provides information about the functions contained within
the DLL. The API import library is compatible with the Microsoft
linker. You can generate import libraries for other programming
languages from the DLL.
The Windows NT API can only be accessed by one process at a time.
The API is designed to be multi-thread safe, so that multi-threaded
control applications can be developed. Where necessary, the API
functions acquire a mutex before accessing the scanner interface. In
this way, access to the scanner device is serialized. If the mutex is in
use by another thread, a thread will be blocked until it is freed.
To create a consistent API, careful consideration was given to these
requirements::
This requirement:Considerations:
Using the API 2-3
memory mappingThe NT API device driver detects the Scanner Adapter and automatically configures the
memory window address and interrupt assignment. The base memory address jumper
must be positioned to choose 32 bit addressing. The API and device driver must be
installed on the system.
Place the base memory select jumper in 32-bit position to allow the PCI BIOS to assign a
base memory address anywhere in 32-bit memory for protected-mode applications
(WinNT). NT device drivers (1747-PCINT) use the PCI BIOS or OS services to determine
the memory window base address and provide access to the dual port memory.
• To determine the allocated memory base address and interrupt, run the
Windows NT diagnostic found in Administrative Tools.
NT interruptsAn interrupt is automatically assigned to the scanner by the PCI bus at power-up
• To determine the allocated memory base address and interrupt, run the
Windows NT diagnostic found in Administrative Tools.
A group of thread-blocking functions are provided to aid
multi-threaded application development. The functions are:
• OC_WaitForDII
• OC_WaitForEos
• OC_WaitForEosDmdOut
• OC_WaitForIoInt
• OC_WaitForDmdIn
• OC_WaitForExtError
For more information, see chapter 6.
Publication 1747-UM002A-US-P - June 2000
2-4 Using the API
Tools to Use
The API functions support both Microsoft and Borland C compilers.
The API disk includes sample MAKE files for each compiler.
When you use the DOS API and link to
ocapil.lib, use the
appropriate command-line switch to select the large memory model.
For more information, see your user manual for your compiler.
If you plan to use a programming language other than C, make sure
the programming language follows the appropriate calling convention
(Pascal for the DOS API; Win32 _stdcall for Windows NT). After you
write your application, use your compiler to link to
(DOS) or
ocapi.lib (Windows NT).
ocapil.lib
The follow pages offer sample MAKE files for DOS and Windows NT
systems on Microsoft and Borland compilers.
Sample DOS MAKE file for Borland compilers
The following sample file shows how to use a Borland MAKE file. The
bold headings indicate the statements you need to modify for your
environment.
#************************************************************************
#
# Title: Makefile for Open Controller API Sample
#
# Abstract:
# This file is used by the Borland MAKE utility to build the
# sample application.
#
# Environment:
# 1747-OCE Open Controller
# MS-DOS
# Borland C/C++ Compiler (16-bit)#
#************************************************************************
#
# Paths to Tools
#
# Note: Modify the following paths to
# correspond to your environment.
#
#---------------------------------------------CPATH = D:\BC5 # Location of Borland tools
CC = $(CPATH)\bin\Bcc # compiler
LINK = $(CPATH)\bin\TLink # linker
MAKE = $(CPATH)\bin\Make # make utility
#---------------------------------------------# Path to API Library and Include file
#
# Note: Modify the following path to
# correspond to your environment.
#
#---------------------------------------------APILIB = ..\ocapil.lib # Path to Open Controller API library
Publication 1747-UM002A-US-P - June 2000
APIINC = .. # Path to Open Controller API include file
# Abstract:
# This file is used by the Microsoft NMake utility to build the
# sample application.
#
# Environment:
# 1747-OCE Open Controller
# MS-DOS
# Microsoft C/C++ Compiler (16-bit)
#************************************************************************
#---------------------------------------------# Note: The environment variables LIB and
# INCLUDE must be set to the path to the
# Microsoft C library and include files.
# For example:
#
# set LIB=D:\MSVC15\LIB
# set INCLUDE=D:\MSVC15\INCLUDE
#
#---------------------------------------------# Paths to Tools
#
# Note: Modify the following paths to
# correspond to your environment.
#
#---------------------------------------------CPATH = D:\MSVC15 # Location of Microsoft tools
CC = $(CPATH)\bin\cl # compiler
LINK = $(CPATH)\bin\link # linker
MAKE = $(CPATH)\bin\nmake # make utility
#---------------------------------------------# Path to API Library and Include file
Publication 1747-UM002A-US-P - June 2000
2-6 Using the API
#
# Note: Modify the following path to
# correspond to your environment.
#
#---------------------------------------------APILIB = ..ocapil.lib # Path to Open Controller API library
APIINC = .. # Path to Open Controller API include file
Sample Windows NT MAKE file for Microsoft compilers
The following sample file shows how to use a Microsoft MAKE file.
The bold headings indicate the statements you need to modify for
your environment.
#************************************************************************
# Title: Makefile for Open Controller NT API Sample
#
# Abstract:
# This file is used by the Microsoft NMake utility to build the
# sample application.
#
# Environment:
# 1747-OCE Open Controller
# Microsoft Windows NT 4.0
# Microsoft Visual C++
#
# (c)Copyright Allen-Bradley
#
#************************************************************************
#---------------------------------------------# Note: The environment variable LIB
# must be set to the path to the
# Microsoft C library files.
# For example:
#
# set LIB=D:\MSDEV\LIB
#
#----------------------------------------------
Publication 1747-UM002A-US-P - June 2000
Using the API 2-7
# Paths to Tools
#
# Note: Modify the following paths to
# correspond to your environment.
#
#---------------------------------------------CPATH = D:\MSDEV # Location of Microsoft tools
CC = $(CPATH)\bin\cl # compiler
LINK = $(CPATH)\bin\link # linker
MAKE = $(CPATH)\bin\nmake # make utility
#---------------------------------------------# Path to API Library and Include file
#
# Note: Modify the following paths to
# correspond to your environment.
#
#---------------------------------------------APILIB = ..\api\lib\ocapi.lib # Path to Open Controller API library
APIINC = ..\api\include # Path to Open Controller API include file
The following sample file shows how to use a Borland MAKE file. The
bold headings indicate the statements you need to modify for your
environment.
#************************************************************************
#
# Title: Makefile for Open Controller API Sample
#
# Abstract:
# This file is used by the Borland MAKE utility to build the
# sample application.
#
# Environment:
# 1747-OCE Open Controller
# Microsoft Windows NT 4.0
# Borland C++ Compiler
#
# (c)Copyright Allen-Bradley
#
#************************************************************************
#---------------------------------------------# Paths to Tools
#
# Note: Modify the following paths to
Publication 1747-UM002A-US-P - June 2000
Loading...
+ 144 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.