PCI Win32 Driver Software by bzs12927


									PCI Win32 Driver Software
PCI Win32 Driver Software

  Software consists of low-level drivers and Windows 32
  Dynamic Link Libraries (DLLs)
  Used with Windows 98, Me, 2000, XP and XP Embedded
  Support for PMC, PCI, and cPCI products
  Uses Windows _stdcall calling convention. Compatible with
  numerous programming languages including C/C++, Visual
  Basic and LabVIEW
  Includes ActiveX control for interrupt notifications in
  languages that do not support callback functions
PCI Win32 Driver Software
Topics Covered

  Software Installation
  Hardware Installation
  Overview of Software Use and Features
  Microsoft Visual C++ Walkthrough
  Developer Resources
PCI Win32 Driver Software
Software Installation

  Installs from PCI Win32 Driver CD or downloadable
  installation file
  Software is installed to
        Program Files\Acromag\PCISW_API_WIN
  Link to User’s Manual is provided off Programs menu.
PCI Win32 Driver Software
Installed Software
 c_examples         Microsoft Visual C++ and Borland Builder examples
 c_include          Header files
 c_lib              COFF format import libraries
 docs               User’s manual, DLL references, application notes
 labview examples   LabVIEW 6i and 7 examples

 redist             INF files, Kernel drivers, DLLs and ActiveX control files
 utility            PCIEnum utility
 vb_examples        Visual Basic 6 and .NET examples
 vb_include         Visual Basic function prototype modules
PCI Win32 Driver Software
Hardware Installation

  Plug and Play installation on Windows 98, Me, 2000 and XP
  Direct the Plug and Play Wizard to
     PCI Win32 Driver Disk or
     Acromag\PCISW_API_WIN\redist directory
PCI Win32 Driver Software
Software Overview – Function Format

All DLL functions have the following form:
   PCIXXX_FunctionName (arg1, arg2, … argn)

   PCIXXX indicates the PCI module the function is used with
   (e.g. PCM730)
   arg1 is typically an integer “handle” to a specific card
PCI Win32 Driver Software
Software Overview – Status Codes

All DLL functions return 16-bit status codes:
   status = PCIXXX_FunctionName (arg1, arg2, … argn)

   A status of 0 indicates the function completed successfully
   A negative status value indicates an error occurred
      -1        invalid device handle
      -14       function timed out before completing
PCI Win32 Driver Software
Software Overview – Calling Sequence
                                     PCIXXX_Open( )

             PCIXXX_SetUserCallback( )            PCIEvent.EnablePCIXXXEvents( )

                            PCIXXX Hardware Access Function Calls

                                                    PCIEvent.DisablePCIXXXEvents( )

                                     PCIXXX_Close( )

  Note: Callback functions and ActiveX events are mutually exclusive
PCI Win32 Driver Software
Software Overview – Callback Functions

  A function in your application that is called by the DLL’s
  internal interrupt service routine
  Supported in C/C++ and Visual Basic .NET
  Using a callback function is optional
  Callback can be configured to override the DLL’s internal ISR
  Format must match that specified in the module’s Function
  Reference document
  Example C format:
  void _stdcall ISR(short Handle, WORD Status);
PCI Win32 Driver Software
Software Overview – Base Address Pointer

  Each DLL provides a function that returns the base address of
  the user mode mapping of the module’s I/O space
  C and C++ programmers can cast this value to pointer and
  access memory using normal pointer mechanisms
  This method can be used to write additional functions that
  complement those provided through the DLL
PCI Win32 Driver Software
Visual C++ 6 Walkthrough – Prerequisites

  PMC, PCI or cPCI device installed successfully
  Corresponding DLL copied to system directory
  (e.g. windows\system32)
  The necessary header files (PCIXXX.h, PCIErrorCodes.h) and
  import library file (PCIXXX.lib) are present on the PC.
PCI Win32 Driver Software
Visual C++ 6 Walkthrough – Step 1
  Add the path to the include files to the project
PCI Win32 Driver Software
Visual C++ 6 Walkthrough – Step 2
  Add the path to the import library to the project
PCI Win32 Driver Software
Visual C++ 6 Walkthrough – Step 3
  Include the windows.h, PCIXXX.h and PCIErrorCodes.h header
  files at the beginning of your .c or .cpp source code files

  e.g. #include <windows.h>
       #include “PCI341.h”
       #include “PCIErrorCodes.h”

  The DLL functions are now available for use in your
PCI Win32 Driver Software
Developer Resources

The following resources are included with the software
  PCI Win32 Driver Software User’s Manual
  Function Reference documents for each DLL
  C source code example projects (Visual C++, Borland Builder)
  for each DLL
  Visual Basic and LabVIEW examples for selected modules

To top