OPTO 22 PCI-AC51 User manual

PCI-AC51 USER’S GUIDE
Form 1459-121024—October 2012
43044 Business Park Drive
•
Temecula
•
CA 92590-3614
Phone: 800-321-OPTO (6786) or 951-695-3000
Fax: 800-832-OPTO (6786) or 951-695-2712
www.opto22.com
Product Support Services
800-TEK-OPTO (835-6786) or 951-695-3080
Fax: 951-695-3017
Email: support@opto22.com
Web: support.opto22.com

PCI-AC51 User’s Guide
ii
PCI-AC51 User’s Guide
Form 1459-121024—October 2012
Copyright © 2003 – 2012 Opto 22.
All rights reserved.
Printed in the United States of America.
The information in this manual has been checked carefully and is believed to be accurate; however, Opto 22 assumes no
responsibility for possible inaccuracies or omissions. Specifications are subject to change without notice.
Opto 22 warrants all of its products to be free from defects in material or workmanship for 30 months from the
manufacturing date code. This warranty is limited to the original cost of the unit only and does not cover installation, labor,
or any other contingent costs. Opto 22 I/O modules and solid-state relays with date codes of 1/96 or later are guaranteed
for life. This lifetime warranty excludes reed relay, SNAP serial communication modules, SNAP PID modules, and modules
that contain mechanical contacts or switches. Opto 22 does not warrant any product, components, or parts not
manufactured by Opto 22; for these items, the warranty from the original manufacturer applies. These products include,
but are not limited to, OptoTerminal-G70, OptoTerminal-G75, and Sony Ericsson GT-48; see the product data sheet for
specific warranty information. Refer to Opto 22 form number 1042 for complete warranty information.
Wired+Wireless controllers and brains and N-TRON wireless access points are licensed under one or more of the following
patents: U.S. Patent No(s). 5282222, RE37802, 6963617; Canadian Patent No. 2064975; European Patent No. 1142245;
French Patent No. 1142245; British Patent No. 1142245; Japanese Patent No. 2002535925A; German Patent No. 60011224.
Opto 22 FactoryFloor, Optomux, and Pamux are registered trademarks of Opto 22. Generation 4, ioControl, ioDisplay,
ioManager, ioProject, ioUtilities, mistic, Nvio, Nvio.net Web Portal, OptoConnect, OptoControl, OptoDataLink, OptoDisplay,
OptoEMU, OptoEMU Sensor, OptoEMU Server, OptoOPCServer, OptoScript, OptoServer, OptoTerminal, OptoUtilities, PAC
Control, PAC Display, PAC Manager, PAC Project, SNAP Ethernet I/O, SNAP I/O, SNAP OEM I/O, SNAP PAC System, SNAP
Simple I/O, SNAP Ultimate I/O, and Wired+Wireless are trademarks of Opto 22.
ActiveX, JScript, Microsoft, MS-DOS, VBScript, Visual Basic, Visual C++, Windows, and Windows Vista are either registered
trademarks or trademarks of Microsoft Corporation in the United States and other countries. Linux is a registered
trademark of Linus Torvalds. Unicenter is a registered trademark of Computer Associates International, Inc. ARCNET is a
registered trademark of Datapoint Corporation. Modbus is a registered trademark of Schneider Electric. Wiegand is a
registered trademark of Sensor Engineering Corporation. Nokia, Nokia M2M Platform, Nokia M2M Gateway Software, and
Nokia 31 GSM Connectivity Terminal are trademarks or registered trademarks of Nokia Corporation. Sony is a trademark of
Sony Corporation. Ericsson is a trademark of Telefonaktiebolaget LM Ericsson. CompactLogix, MicroLogix, SLC, and RSLogix
are trademarks of Rockwell Automation. Allen-Bradley and ControlLogix are a registered trademarks of Rockwell
Automation. CIP and EtherNet/IP are trademarks of ODVA.
All other brand or product names are trademarks or registered trademarks of their respective companies or organizations.

PCI-AC51 User’s Guide iii
iii
Table of Contents
Chapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What’s in this Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
For Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Chapter 2: Installing the PCI-AC51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Chapter 3: Setting Up and Using the SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Running the SDK Setup Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Using the SDK on Windows 7 and Vista . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
SDK Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Using the PamScan Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Developing an I/O Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Function Reference for Windows 7 and Vista . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
Porting Programs Developed with the Older SDK (Using OptoPM32.dll) to Windows 7 and
Vista . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Using the SDK on Windows 2000/XP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
SDK Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
Pamux Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Required Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Banks and Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Common Function Parameters and Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Developing an I/O Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Special Directions for Visual Basic Programmers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
Special Directions for Visual C++ Programmers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
Function Reference for Windows 2000/XP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
PCI-AC51 Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
Digital Bank Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
Digital Point Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
Digital “Fast” Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Analog Bank Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Analog Point Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Analog Watchdog Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Analog Status Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Pamux Utility Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Bit Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22

PCI-AC51 User’s Guide
iv
Pack/Unpack Utility Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Scaling Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Pamux Bus Reset Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Purpose of the Reset Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Reset Line Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
“LOW” and “HIGH” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Brain Reset Configuration: “Active HIGH” and “Active LOW” . . . . . . . . . . . . . . . . . . . . . . . 24
Special Precautions for the Software Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Appendix A: Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
Error Messages for Windows 7 and Vista . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Error Codes for Windows 2000/XP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Appendix B: Requirements, Specifications, & LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Appendix C: Converting Applications to the PCI-AC51 . . . . . . . . . . . . . . . . . . . . . . . . . .35
Applications that Used the OptoPMUX.DLL for the AC5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Converting Applications that Use Inp( ) and Outp( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Appendix D: PCI-AC51 Technical Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
PCI Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
PCI Base Address Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
BAR1 Register Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Powerup Conditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Controlling the Reset Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Controlling the Reset Line Using the Pamux Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Controlling the Reset Line When Not Using the Pamux Driver . . . . . . . . . . . . . . . . . . . . . . . . . 40
Default Power-Up State of Reset Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Reset Configuration of Brains When Using PamScan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
DIP Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Strobe Duration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
High and Low Latency Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Performing Pamux Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Issuing Pamux Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Reading the State Machine Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Reading the Switch Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Polled PCI-AC51 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Performing A Pamux Bank Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Performing Pamux Bank Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Notes for the SNAP-B6 (Digital Aspect) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

PCI-AC51 User’s Guide
1
1
Chapter 1
1: Introduction
The PCI-AC51 adapter card brings industry-standard Pamux
®
to the world of Peripheral Component
Interconnect (PCI), a local bus standard developed by Intel
®
. The PCI-AC51 adapter card is an ideal
choice for customers who must replace an older ISA bus-based PC that currently uses an Opto 22
AC28 adapter card. The PCI-AC51 is compatible with computers that feature a 33 MHz PCI bus. The
PCI-AC51 requires a 5.0- and 3.3-volt environment.
NOTE: The PCI-AC51 itself is no faster than its ISA cousin, the AC28, but it is the better choice if you have no
available ISA slots or available I/O addresses. The PCI-AC28 is not recommended for new designs; use the
PCI-AC51 instead.
With the PCI-AC51 adapter card, your PCI computer can communicate with Opto 22 classic B4, B5,
and B6 brain boards and with SNAP-B4 and SNAP-B6 brains.
•Each Pamux bus can access up to 32 remote brains.
•Each Pamux bus supports up to 512 points.
Free with these adapter cards is the PCI-AC51 Pamux SDK, included on the CD that came with the
card and also available on our website, www.opto22.com. The PCI-AC51 Pamux SDK supports up to
32 PCI-AC51 adapter cards. This file includes two SDKs:
• Windows 7 and Vista operating systems—samples, source code, and the driver. This SDK
supports C#, VB.NET and other .NET languages. Existing applications can be updated to Win 7
using this SDK.
• Microsoft Windows 2000 and XP operating systems—sample applications, utility
applications, and the driver. This SDK supports Microsoft Visual Basic (version 6) and Microsoft
Visual C++ (version 6). Up to 64 AC5, PCI-AC5, and PCIe-AC5 devices are supported by the
driver.
Use the DLL file for your OS, application, and language:
For this OS: Windows 7 and Vista Windows
95/98/ME/NT/2000/XP
For existing or
new application: Existing app New app in
C++
New app in C# or
other .NET language Existing app New app in VB6
or Visual C++
Use this DLL file: OptoPM32.dll OptoPM32.dll PCIAC5.dll OptoPM32.dll OptoPM32.dll

WHAT’S IN THIS GUIDE
PCI-AC51 User’s Guide
2
What’s in this Guide
This guide assumes that you are familiar with Pamux and the brains, racks, and input/output
modules used with Pamux. For more information on Pamux, see Opto 22 form 726, the Pamux User’s
Guide. If you are going to program the PCI-AC51 using the PCI-AC51 SDK, this guide assumes that
you are already familiar with programming in Microsoft.NET, Microsoft
®
Visual Basic
®
, or Visual C++
®
.
This guide includes the following chapters and appendixes:
Chapter 1: Introduction provides a Quick Start section to install the card, Product Support
information, and specifications for the card.
Chapter 2: Installing the PCI-AC51 describes how to install the PCI-AC51 adapter card before you
install the SDK software.
Chapter 3: Setting Up and Using the SDK describes how to set up and use the SDK.
Appendix A: Error Codes lists and describes the error codes that you might encounter when
working with the PCI-AC51 SDK.
Appendix B: Requirements, Specifications, & LEDs provides system requirements and
specifications for the PCI-AC51 adapter card. It also shows the location and function of the
card’s LEDs.
Appendix C: Converting Applications to the PCI-AC51 describes how to convert applications
that used the AC28 and PCI-AC28 adapter cards.
Appendix D: PCI-AC51 Technical Reference provides technical information for authoring a
device driver for an unsupported operating system or a Windows kernel-mode driver.
For Help
If you have problems installing or programming the PCI-AC51 adapter card and cannot find the help
you need in this guide, contact Opto 22 Product Support.
Phone: 800-TEK-OPTO (835-6786)
951-695-3080
(Hours are Monday through Friday,
7 a.m. to 5 p.m. Pacific Time)
Fax: 951-695-3017
Email: supp[email protected]
Opto 22 website: www.opto22.com
When calling for technical support, be prepared to provide the following information about your
system to the Product Support engineer:
•PC configuration (type of processor, speed, memory, operating system, and service packs)
•A complete description of your hardware and operating systems, including:
– additional accessories installed (such as sound cards, NICs, etc.)
–typeofpowersupply
– types of I/O units installed
NOTE: Email messages and phone
calls to Opto 22 Product Support
are grouped together and
answered in the order received.

CHAPTER 1: INTRODUCTION
PCI-AC51 User’s Guide
3
3
– third-party devices installed (for example, barcode readers)
•Software and version being used
•Specific error messages and/or numbers seen.

FOR HELP
PCI-AC51 User’s Guide
4

PCI-AC51 User’s Guide
5
5
Chapter 2
2: Installing the PCI-AC51
Follow the steps below to install the PCI-AC51 adapter card before you install the SDK software. The
PCI-AC51 adapter card installs into any PCI expansion slot of a PCI-capable computer.
The OptoPM32.dll supports a maximum of 64 of these cards. The newer Windows 7 driver does not
have a card limit. You may add multiple PCI-AC51 adapter cards for convenience, but note that
multiple cards do not increase Pamux throughput. The number of Pamux accesses per computer is
constant. Note the power requirements listed in the Specifications table on page 32.
NOTE: The adapter card should be installed before you install the SDK software.
The PCI-AC51 adapter card installs into any PCI expansion slot of a computer. Note the power
requirements listed in the Specifications table on page 32.
1. Turn off the computer. Remove the power cord and the computer’s cover.
The power cord must be removed, as a sudden spike may cause the computer to boot.
2. Before handling the card, discharge excess static electricity by touching the computer’s metal
chassis.
3. Install the card in the expansion slot. Verify that the card is properly seated in the motherboard
socket. Secure the card with the screw.
4. Attach the cable to the adapter card. Connect the other end of the cable to the I/O mounting
rack. See page 28 for cable part numbers and pinouts.
CAUTION: Do not scratch this card or other cards in the computer, as scratching may irreversibly
damage the card or other devices.
Pin 1

PCI-AC51 User’s Guide
6
5. Reinstall the power cord. Leave the computer cover off temporarily to see the card’s LEDs for
the exercise on page 9.
6. Turn on the computer.
Because the card is self-configuring, it has no jumpers. Configuration is automatically
performed by the BIOS when the card is installed.
If you are using Windows Vista or an earlier version of Windows and a “Found New Hardware”
message appears, simply click Cancel. The setup program will install the device driver
automatically.
If you have been using an AC28 adapter card for the ISA bus, you will need to make some changes
to your application because of the new PCI adapter card. See Appendix C: Converting Applications
to the PCI-AC51 for specific information.

PCI-AC51 User’s Guide
7
7
Chapter 3
3: Setting Up and Using the SDK
This chapter describes how to set up and use the SDK. Before you install the SDK software, first make
sure to install the adapter card. See Chapter 2: Installing the PCI-AC51.
In this chapter:
Running the SDK Setup Program ........................................page 7
Using the SDK on Windows 7 and Vista...........................page 9
Using the SDK on Windows 2000/XP............................. page 14
Pamux Bus Reset Line............................................................ page 24
Special Precautions for the Software Developer ....... page 25
NOTE: Version 2.0 and higher support only the PCI-AC51—not the AC28 and PCI-AC28 adapter cards.
Running the SDK Setup Program
The PCI-AC51 SDK comes on a CD with the card. If you do not have the CD, you can order it through
Product Support, or you can download the SDK free from our website, www.opto22.com.
This PCI-AC51 Pamux SDK includes a sample application, Windows drivers, and user documentation.
NOTE: If you are using a different operating system or a non-PC hardware platform, you will need to write
your own driver. See Appendix D: PCIe/PCI-AC5 Register Set and Memory Locations and Appendix E: AC5
Hardware Description for more information.
1. Insert the CD in your CD-ROM drive to start the PCI-AC51 SDK Setup Wizard.
2. Follow the wizard’s instructions.
3. On the Select Components screen, select your computer’s operating system.

RUNNING THE SDK SETUP PROGRAM
PCI-AC51 User’s Guide
8
There is a 64-bit version and a 32-bit version for Windows 7 and Vista.
`
4. If a Windows Security dialog box appears, click the Run or Install button to continue.
Select the operating system

CHAPTER 3: SETTING UP AND USING THE SDK
PCI-AC51 User’s Guide
9
9
NOTE: If you have already installed the driver for another adapter card, you will receive an error that there
is currently 1 open application using WinDriver. If this happens, simply click Cancel to continue with the rest
of the install.
5. When setup is complete, click the Finish button.
Using the SDK on Windows 7 and Vista
SDK Contents
The PCI-AC51 SDK includes a driver, sample applications, and tools to help you develop applications
for the PCI-AC51 adapter card and integrate it with your system. The SDK saves you time and effort
that would otherwise be spent learning the intricacies of the Pamux bus structure.
The SDK supports C#, VB.NET and other .NET languages.
NOTE: Version 2.0 and higher support only the PCI-AC51—not the AC28 and PCI-AC28 adapter cards.
Using the PamScan Utility
The PamScan utility is available on the Windows Start menu. It demonstrates turning digital points
on and off and configuring points as either input or output. In addition, analog point values can be
displayed and output values can be changed. PamScan is written in C# and all the source code is
included.
To use PamScan:
1. Select Start > All Programs > Opto 22 > PCI-AC51 > PamScan.exe
2. Make sure the reset level matches the reset level configured on the Pamux brain.
3. If you have more than one PCI-AC51 card installed, click the card selector button.
NOTE: Normally you will use the default Adapter Card ID, which is 0.
4. In the dialog box that opens, select a card.
Reset level
Card selector button

USING THE SDK ON WINDOWS 7 AND VISTA
PCI-AC51 User’s Guide
10
5. Optional Step—Flash LEDs: This step is optional because it requires you to open your computer in
order to see the LEDs on the PCI-AC51 card.
a. With your computer open so that you can see the LEDs, choose the PCI-AC51 card, and
then click the Flash LEDs button.
b. Notice the result on the card’s LEDs.
The program flashes the LEDs five times. If no flashing occurs, you may have selected the
wrong card. Select the next card in the list and click the Flash LEDs button again.
6. Click OK to close the dialog box. In the PamScan graphical user interface (GUI), click Open
PCI-AC51.
This screen shows all four banks available on a 32-channel Pamux board. Each bank has eight
I/O points and has a unique address. For example, the banks shown here have addresses 0, 1, 2,
and 3 on the attached I/O mounting rack.
Click Open PCI-AC51

CHAPTER 3: SETTING UP AND USING THE SDK
PCI-AC51 User’s Guide
11
11
7. Choose a bank on the Pamux mounting rack that has I/O installed. Then in the PamScan GUI,
make sure the address matches the bank’s address on the mounting rack.
In the following example, 5 is entered as the address to match the address on the
mounting rack:
8. Select the I/O type, either Analog or Digital.
9. For output modules: select each point that is an output, then click Configure Selected Points As
Outputs.
The first bank on
the attached rack
has an address of 0
Match the bank’s
address on the rack
Select the I/O type

USING THE SDK ON WINDOWS 7 AND VISTA
PCI-AC51 User’s Guide
12
Notice that the selected points change to “Output.”
For input modules: when an input changes state, its value will be updated in the display.
10. With the same output points selected, click Turn Selected Output Points On.
Notice that the selected output points change from “Off” to “On.”
11. Continue to experiment as you like with selecting points, configuring points as inputs or
outputs, and turning points on and off.
Developing an I/O Application
Your application should include the following basic steps.
Select outputs
Click here
The selected points
change to “Output”
Click here
The selected points
change to “On”

CHAPTER 3: SETTING UP AND USING THE SDK
PCI-AC51 User’s Guide
13
13
These steps apply to any application using the PCIAC51.dll, which should be added as a reference to
your project. The line, “using Opto22.Adapters.DirectIO” should also be added near the top of your
source code file.
1. Instantiate the PCIAC51_CardList object by accessing the public property TheCardList such as:
pciac51cards=PCIAC51_CardList.TheCardList
2. Call GetCard ( ) on the PCIAC51_CardList object such as:
myCard=pciac51Cards.GetCard (0)
3. Inspect the error code of the GetCard ( ) function.
4. Configure input and output points using the WriteConfig ( ) function. Inspect the error code
from the configuration function.
5. Start an application loop that continuously reads or writes points. At the same time, continue
to inspect the error codes from the PCIAC51.dll.
6. When the application loop is complete, call ReleaseCard ( ) to close the card properly.
Function Reference for Windows 7 and Vista
The function reference for the Windows 7 and Vista SDK is available on your computer once you
have installed the software (see “Running the SDK Setup Program” on page 7).
To open the function reference, go to the Start menu on your computer and select
Start > All Programs > Opto 22 > PCI-AC51 > PCI-AC51 Function Reference. If your browser blocks
the ActiveX controls, make sure to unblock it so that you can see the navigation pane.

USING THE SDK ON WINDOWS 2000/XP
PCI-AC51 User’s Guide
14
Porting Programs Developed with the Older SDK (Using
OptoPM32.dll) to Windows 7 and Vista
Programs developed previously with the older OptoPM32.dll SDK will not work with Windows 7 or
Vista due to an incompatibility at the driver level of these operating systems. If you want to convert
your existing program to work on Windows 7 or Windows Vista, follow these steps:
1. Copy the files from the existing application to the Windows 7 or Vista computer.
2. Install the PCI-AC51 SDK on the same computer.
The setup program will install the appropriate files and driver for the target operating system.
3. Use the files in the directory listed below based on the target operating system:
– For 64-bit Windows 7 or Vista
C:\Program Files\Opto22\PCI-AC51\Legacy-OptoPM32\FilesFor32BitAppsOn64BitSystems
– For 32-bit Windows 7 or Vista
C:\Program Files\Opto22\PCI-AC51\Legacy-OptoPM32\FilesFor32BitAppsOn32BitSystems
4. (For Development) If you want to compile the old program on Windows 7 or Vista, use the files
as follows. If you just want to run the old program, skip to the next step.
– OptoPM32.h – Include this file in your existing application.
– OptoPM32.lib – Link this file into your existing application.
5. (For Deployment) To run the old program on Windows 7 or Vista, use the files as follows.
– OptoPM32.dll – Put this file in the same directory as your application.
– wdapi1031.dll – Put this file in the same directory as your application.
NOTE for VB Applications: Be sure to register any OCX files. For example, to register the file,
COMCT232.OCX, open a command prompt with “run as administrator” permissions. Navigate to the
directory where COMCT232.OCX resides, type regsvr32 COMCT32.OCX, then press Enter. If successful,
a dialog box will notify you.
Using the SDK on Windows 2000/XP
Use this section if you have Windows 2000/XP. If you are using the SDK for Windows 7 or Vista, see
“Using the SDK on Windows 7 and Vista” on page 9.
This section shows you what’s in this version of the PCI-AC51 SDK and how to use it to simplify
application development with the PCI-AC51 adapter card.
NOTE: If you are migrating current applications to use with the newer PCI card, also see Appendix C:
Converting Applications to the PCI-AC51.
This version of the SDK runs in 32-bit Windows XP as well the 32-bit version of Windows 2000. The
SDK supports Microsoft Visual Basic (version 6) and Microsoft Visual C++ (version 6).
SDK Contents
The PCI-AC51 SDK includes a driver, sample applications, and tools to help you develop applications
for the PCI-AC51 adapter card and integrate it with your system. The driver saves you time and effort

CHAPTER 3: SETTING UP AND USING THE SDK
PCI-AC51 User’s Guide
15
15
by providing a simplified interface between input/output modules and application programs
written in Microsoft Visual C++ and Visual Basic.
In addition to the driver, the SDK includes sample Visual Basic and Visual C++ applications as well as
tools to locate, test, and diagnose the adapter card. All examples include source code.
Pamux Functions
Required Function Calls
For many applications, only four Pamux functions are required:
1. Open a PCI-AC51 to get a handle.
2. Configure outputs.
3. Read and write to I/O.
4. Close the PCI-AC51 when the application is about to end.
Naming Conventions
Function names in the Pamux library start with “Pamux.” Example: “PamuxDigPointRead.”
Function names follow the object-operation format, with the object first and the operation second.
Example: “PamuxDigPointRead,” where “PamuxDigPoint” (the object) is first and “Read” (the
operation) follows.
Utility functions, provided primarily for Visual Basic, start with “PamuxUtil.” Example:
“PamuxUtilBitEqual.”
Specific PCI-AC51 functions start with “PamuxPCI.”
Banks and Points
Some I/O points can be addressed in multiple ways. A 16-channel I/O board has two banks. Point 0,
the first point, is accessed using a bank number of 0 and a point number of 0. Point 8 can be
accessed in two ways:
•A bank number of 0 and a point number of 8, or
•A bank number of 1 and a point number of 0.
Common Function Parameters and Return Values
int hHandle
Handle to a PCI-AC51 card. Handles are acquired usingPamuxPCICardOpen().
int Bank
A bank number (0 to 63).
int Point
A point or channel number on a rack starting with zero.
OutputMask
A “1” bit represents an output. Used to configure outputs.
Return Values.
All functions in the OptoPM32.dll return an error value. A non-zero value indicates
an error has occurred. For proper application operation, make sure your program checks error codes.
See the list of error codes on page 27.

USING THE SDK ON WINDOWS 2000/XP
PCI-AC51 User’s Guide
16
Developing an I/O Application
Use the following basic steps in your application (in Visual Basic or Visual C++):
1. Open a handle to the board using the function PamuxPCICardOpen.
2. Inspect the error code of the device open function.
3. Configure the direction of the points.
4. Start the application loop that continuously reads or writes points. At the same time, continue
to inspect the error codes from the OptoPM32.DLL.
5. When the application loop is complete, close the handle to the board using
PamuxPCICardClose.
Special Directions for Visual Basic Programmers
Include the OptoPM32.bas file as a module in your project. This file includes subroutine declarations,
function declarations, and access paths to the OptoPM32.dll.
These files may be found in the SDK under \Vb\VB dll header.
Special Directions for Visual C++ Programmers
Include the header OptoPM32.h in your source code modules that reference the OptoPM32.dll
functions. Also include the DLL link library OptoPM32.lib in your project so the DLL references are
resolved.
These files may be found in the SDK under \Vc\VC Project Includes.
Other manuals for PCI-AC51
2
Table of contents
Other OPTO 22 Computer Hardware manuals

OPTO 22
OPTO 22 Modular M4RTU User manual

OPTO 22
OPTO 22 AC24AT User manual

OPTO 22
OPTO 22 PCI-AC48 User manual

OPTO 22
OPTO 22 PCI-AC5 User manual

OPTO 22
OPTO 22 Optomux B1 User manual

OPTO 22
OPTO 22 PCI-AC51 User manual

OPTO 22
OPTO 22 Optomux B1 User manual

OPTO 22
OPTO 22 AC24AT User manual

OPTO 22
OPTO 22 BD-DEVNET User manual

OPTO 22
OPTO 22 AC422AT User manual
Popular Computer Hardware manuals by other brands

Intel
Intel SL8K2 - Pentium 4 3.20EGHz 800MHz 1MB Socket 478... specification

Rabbit
Rabbit 2000 Designers handbook

Moxa Technologies
Moxa Technologies Industrial Serial Board CI-132 Quick installation guide

Intel
Intel 486MIS quick start guide

protech
protech PCI-531LF Operation manual

Commell
Commell LE-375 user manual