1.1FEATURES AND APPLICATIONS ........................................................................................................3
1.1.1. Features .........................................................................................................................................3
5.1DEMO PROGRAMS FOR WINDOWS .................................................................................................36
5.2DEMO PROGRAMS FOR DOS..........................................................................................................37
5.3PIO_PISO.EXE FOR WINDOWS ....................................................................................................38
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 1
1 . Introduction
Model Number Isolated Digital Input Output Type
PCI-P8R8 8 Channel 8 Channel Relay Output
PCI-P16R16 16 Channel 16 Channel Relay Output
PCI-P16C16 16 Channel 16 Channel Open Collector Output
PCI-P8POR8
PEX-P8POR8i
PCI-P16POR16
PEX-P16POR16i
8 Channel 8 Channel PhotoMos-Relay Output
16 Channel 16 Channel PhotoMos-Relay Output
•PCI-P8R8/PCI-P16R16
The PCI-P16R16/PCI-P8R8 is a PCI card supporting 5 V PCI bus and "Plug &
Play" feature to get I/O address automatically without manually setting. This
card contains 16/8 photo coupler digital input channels that provide 5000 Vrms
isolation protection, allowing the input signals to be completely floated so as to
prevent ground loops. They are also equipped with 16/8 relay output channels to
enable the control of the ON/OFF state of external devices, drive external relays or
small power switches, or activate alarms, etc.
•PCI-P16C16
The PCI-P16C16 is a 5 V PCI card that support “Plug & Play” functionality to
automatically obtain I/O resources from the BIOS. This card contains 16 optically
isolated digital input channels and 16 open collector (sink, NPN) digital output
channels. The DI channels provide 5000 Vrms isolation protection that allows the
input signals to be completely floated so as to prevent ground loops and isolate
the host computer from damaging voltages. The open collector output (DO)
channels are typically used for alarm and warning notification, control of signal
output, control of external circuits that require a higher voltage level, and signal
transmission applications, etc. The PCI-P16C16 contains a single DB-37
connector and a single 40-pin box header and includes a 40-pin to DB-37 flat
cable for easy wiring.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 1
•PCI-P8POR8/P16POR16 and PEX-P8POR8i/P16POR16i
The PCI-P8ROR8/P16POR16 supports 5 V PCI bus while the PEX-
P8POR8i/P16POR16i supports PCI Express bus. Each contain 8 or 16 optically
isolated input channels and 8 or 16 PhotoMos relay output channels. Both the
isolated DI channels and the PhotoMos relay channels use a short optical
transmission path to transfer an electronic signal between elements of a circuit
and keep them electrically isolated. The DI channels provide 5000 Vrms isolation
protection, allowing the input signals to be completely floated so as to cut down
ground loops, block voltage spikes, and isolate the host computer from damaging
voltages. PhotoMos relays are used where it is necessary to control a circuit using
a low-power signal (with complete electrical isolation between the control and
controlled circuits), or where several circuits must be controlled by one signal.
The PCI-P8POR8/P16POR16 and PEX-P8POR8i/P16POR16i can be used in
various applications, such as controlling the ON/OFF state of external devices,
driving external relays or small power switches, activating alarms, contact closure,
sensing external voltages or switches, etc. The card can be installed in PCI/PCI
Express slot and supports true "Plug & Play", with two DB-37 connectors provided
for easy wiring.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 2
1.1 Features and Applications
1.1.1. Features
Bus Type 5 V PCI Bus
Common
Features
Input Channel 8 16 16
Input Type Optically Isolated Digital Input
Output Channel 8 16 16
Output Type Relay Output
Led Indicators None External Power status
Table 1-1: Features of PCI-P8R8/P16R16/P16C16 card
PCI-P8POR8 PCI-P16POR16PEX-P8POR8i PEX-P16POR16i
Bus Type 5 V PCI Bus PCI Express x 1
PCI-P8R8 PCI-P16R16 PCI-P16C16
z Optically Isolated Digital Input
z AC/DC Digital Signed Input
z AC Digital Input With Filter By Jumper Setting
Transistor
(Open Collector)
Common
Features
Input Channel 8 16 8 16
Input Type Optically Isolated Digital Input
Output Channel 8 16 8 16
Output Type PhotoMos Relay
Led Indicators Output Status
Table 1-2: Features of PCI-P8POR8/P16POR16 and PEX-P8POR8i/P16POR16i
card
z Optically Isolated Digital Input
z AC/DC Digital Signed Input
z AC Digital Input With Filter By Jumper Setting
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 3
1.1.2. Applications
Factory automation
Laboratory automation
Communication switching
Security control
Product test
Energy management
1.2 Block Diagram
EEPROM
PCI BUS
PCI Controller
Buffers
&
Drivers
Buffers
&
Filters
P8R8 / P16R16
Relay
Relay
Transistor
Transistor
Relay
Relay
Transistor
Transistor
Photo Couple
Photo Couple
Photo Couple
Photo Couple
P16C16
PhotoMos
PhotoMos
P16POR16
PhotoMos
PhotoMos
Figure 1-1: Functional Block diagram.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 4
1.3 Specifications
1.3.1 PCI-P8R8/P16R16
Model Name PCI-P8R8 PCI-P16R16
Digital Input
Isolation Voltage 3750 Vrms (Photo-couple)
Channels 8 16
Input Voltage
Response Speed
Relay Output
Channels 8 16
Relay Type 4 SPDT 4SPST 8 SPDT 8 SPST
Contact Rating
Operating Time 5 ms (typical)
Release Time 10 ms (typical)
Insulation Resistance
Life
General
Bus Type 5 V PCI, 32-bit, 33 MHz
Logic 1:AC/DC 5 ~ 24 V(AC 50 ~ 1 kHz)
Logic 0: AC/DC 0 ~ 1 V
Without Filter: 50 kHz (Typical)
With Filter: 0.455 kHz (Typical)
AC:120 V@0.5 A
DC: 24 V@1 A
1000 MΩ
Mechanical: 5000000 ops.
Electrical: 100000 ops.
Data Bus 16-bit
Card ID No
I/O Connector Female DB37 x 1
Dimensions (L x W x D) 183 mm x 105 mm x 22 mm
Power Consumption 500 mA @ +5 V 800 mA @ +5 V
Operating Temperature 0 ~ 60 °C
Storage Temperature -20 ~ 70 °C
Humidity 5 ~ 85% RH, non-condensing
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 5
Female DB37 x 1
40-pin box header x 1
1.3.2 PCI-P16C16
Model Name PCI-P16C16
Digital Input
Isolation Voltage 3750 Vrms (Photo-couple)
Channels 16
Input Voltage
Response Speed
Digital Output
Isolation Voltage 3750 Vrms
Channels 16
Compatibility Transistor(Open Collector)
Output Capability DC:600 mA/+30 V for one channel @ 100% duty
Response Speed 1 kHz (Typical)
General
Bus Type 5 V PCI, 32-bit, 33 MHz
Data Bus 16-bit
Card ID No
I/O Connector
Logic 1:AC/DC 5 ~ 24 V(AC 50 ~ 1 kHz)
Logic 0: AC/DC 0 ~ 1 V
Without Filter: 50 kHz (Typical)
With Filter: 0.455 kHz (Typical)
Female DB37 x 1
40-pin box header x 1
Dimensions (L x W x D) 183 mm x 105 mm x 22 mm
Power Consumption 800 mA @ +5 V
Operating Temperature 0 ~ 60 °C
Storage Temperature -20 ~ 70 °C
Humidity 5 ~ 85% RH, non-condensing
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 6
1.3.3 PCI-P8POR8/P16POR16 and PEX-P8POR8i/
R16i P16PO
Model Name
Digital Input
Isolation Voltage 3750 Vrms (Photo-couple)
Channels 8 16 8 16
Input Voltage
Response Speed
Relay Output
Channels 8 16 8 16
Relay Type PhotoMos Relay (Form A)
Contact Rating AC:350 V/130 mA (Peak AC)
Operating Time 0.7 ms (typical)
Release Time 0.05 ms (typical)
Insulation Resistance
Special
PCI-P8POR8PCI-P16POR16 PEX-P8POR8i PEX-P16POR16i
Logic 1:AC/DC 5 ~ 24 V(AC 50 ~ 1 kHz)
Logic 0: AC/DC 0 ~ 1 V
Without Filter: 50 kHz (Typical)
With Filter: 0.455 kHz (Typical)
23 Ω
LED Indicators Output status
General
Bus Type 5 V PCI, 32-bit, 33 MHz PCI Express x1
Data Bus 16-bit
Card ID No Yes (4-bit)
Female
I/O
Connector
Dimensions (L x W x D) 183 mm x 105 mm x 22 mm
Power Consumption 800 mA @ +5 V
Operating Temperature 0 ~ 60 °C
Storage Temperature -20 ~ 70 °C
DB37
40-pin box
header
1 1 1 1
- 1 - 1
Humidity 5 ~ 85% RH, non-condensing
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 7
1.4 Product Check List
The shipping package includes the following items:
One PCI boards as follows:
• PCI-P8R8/PCI-P16R16
• PCI-P16C16
• PCI-P8POR8/PCI-P16POR16
• PEX-P8POR8i/PEX-P16POR16i
One software utility PCI CD.
One Quick Start Guide.
It is recommended that you read the Quick Start Guide first. All the
necessary and essential information is given in the Quick Start Guide, including:
Where to get the software driver, demo programs and other resources.
How to install the software.
How to test the card.
Attention!
If any of these items is missing or damaged, contact the dealer from whom
you purchased the product. Please save the shipping materials and carton
in case you need to ship or store the product in the future.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 8
1.5 Hardware Configuration
This chapter describes how to unpack this I/O card and how to install it to your
system. Both the unpacking information and the jumper settings are described
in the following text. This manual should be carefully read before installation.
1.5.1 Unpacking
This I/O card was well-tested and inspected both mechanically and electrically
before shipping. It was free of marks and scratches our quality delivery policy
requires that all equipment be in perfect order before delivery. However, some
unconditional damages may occur while unpacking!! Please read this section
before unpacking the card. Feel free to contact your carrier and retain your
carton in case there is error.
CAUTION:
This card contains sensitive electronic components that can be easily
damaged by static electricity.
1. This card should be packed with an anti-static mat.
2. The user should wear an anti-static wristband, grounded at the same point to
the anti-static mat.
3. Inspect the carton for obvious damage. Either shipping or handing may
cause damages!! Be sure there are no shipping and handing damages on
the card before using.
4. After opening the carton, place the system board handle on a grounded anti-
static surface and let the component side up.
CAUTION: Do not apply power to the board if it has been damaged!
5. You are now ready to install your card.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 9
1.5.2 Board Layout
PCI-P8R8/P16R16 Board Layout
Figure 1-2: PCI–P8R8 Layout
Figure 1-3: PCI–P16R16 Board Layout
Note:
CN1 D/I/O channel 0~7 for PCI-P8R8/P16R16.
JP1 ~ JP8 Select the input AC or DC signals of D/I channel 0 ~ 7 for CN1.
CN2 D/I/O channel 8~15 for PCI-P16R16.
JP9 ~ JP16 Select the input AC or DC signals for D/I channel 8 ~ 15 for CN2.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 10
PCI-P16C16 Board Layout
Figure 1-4: PCI-P16C16 Layout
Note:
CN1 D/I/O channel 0~7 for PCI-P16C16.
JP1 ~ JP8 Select the input AC or DC signals of D/I channel 0 ~ 7 for CN1.
CN2 D/I/O channel 8~15 for PCI-P16C16.
JP9 ~ JP16 Select the input AC or DC signals for D/I channel 8 ~ 15 for CN2.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 11
PCI-P8POR8/P16POR16 Board Layout
LED indicator
PCI - P8POR8
JP8...........JP1
Figure 1-5: PCI-P8POR8 Layout
LED indicator
PCI - P16POR16
CN2
CN1
JP8...........JP1
JP16
——
JP9
Figure 1-6: PCI-P16POR16 Layout
Note:
CN1 D/I/O channel 0~7 for PCI-P8POR8/P16POR16.
JP1 ~ JP8 Select the input AC or DC signals of D/I channel 0 ~ 7 for CN1.
CN2 D/I/O channel 8~15 for PCI-P16POR16.
JP9 ~ JP16 Select the input AC or DC signals for D/I channel 8 ~ 15 for CN2.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 12
PEX-P8POR8i/P16POR16i Board Layout
Figure 1-7: PEX-P8POR8i Board Layout
Figure 1-8: PEX-P16POR16i Board Layout
Note:
CON1
J1
CON2
J2
JP2
SW1
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 13
D/I/O channel 0~7 for PEX-P8POR8i/P16POR16i.
Select the input type AC or DC signals for D/I channel 0 ~ 7.
D/I/O channel 8~15 for PEX-P16POR16i.
Select the input type AC or DC signals for D/I channel 8 ~ 15.
Ground isolated protection
Card ID dip-switch
1.5.3 Jumper Settings
Input signal type:
You can change the I/O card configuration simply by setting the jumpers on this
board. Each digital input channel can be jumper-configured as a single-pole, RC
filter with a time constant of 1.2 ms. The Figure 1-9 , Figure 1-10 and Table 1-2
listed below shows each digital input channel and the corresponding jumper.
•PCI-P8R8/P16R16/P16C16/P8POR8/P16POR16:
CN1
CN2
DI6
DI4
DI7
Figure 1-9: PCI Series Jumper Settings
DI5
DI2
DI3
DI1
DI0
Jumper
Mapping
Channel
•PEX-P8POR8i/P16POR16i:
1
CON1
..........................
8
Jumper
Mapping
DI14
DI15
DI13
9
.............................
DI12
DI10
DI11
CON2
DI9
DI8
16
DI1
DI3
DI0
Figure 1-10: PEX Series Jumper Settings
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 14
The figure below shows how to select the digital input type:
Channel
PCI seriesPEX series
Channel
J2
16DI15
Figure 1-11: Jumper Settings
1
2
3
Without Filter
For DC Signal
(Default Setting)
1
2
3
With AC Filter
For AC Signal
If you are using
AC input signals, you must short AC FILTER pin2-3 of the
corresponding jumpers. If you are using DC input signals, the AC FILTER
is optional. If the DC input signal response is less than 20 μs, set the filter to off.
If you want a slow response (about 5 to 10 ms) to reject either noise or contact
bouncing, short AC FILTER Pin2-3.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 15
JP2: Ground isolated protection jumper for PEX-P8POR8i/P16POR16i
only
This JP2 jumper is used to select the isolated or non-isolated of ground for PEX-
P8POR8i/P16POR16i only. As shown in Figure 1-7, the user needs to connect
Pin1-2 to obtain the ground isolation protection, which is the default setting.
However, for the ground non-isolation, the Pin2-3 for the JP2 jumper should be
connected.
The figure below shows how to select the ground isolation type:
JP2 JP2
1
2
3
GND Isolation
Protection
(Default Setting)
Figure 1-12: Jumper Settings
1
2
3
GND Non-Isolation
Protection
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 16
1.6 Pin Assignments
1.6.1 PCI-P8R8/P16R16 PCI-P8R8/P16R16
CON 1
CON 2
CON 2
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 17
NO: Normally Open
COM: Common
NC: Normally Closed
DIA: Digital Input (Point A)
DIB: Digital Input (Point B)
Extender Cable
1.6.2 PCI-P16C16
CON 1
CON 2
CON 2
Ext. Power: External Power Input
GND: External Power Ground
OUT: Open Collector Output
DIA: Digital Input (Point A)
DIB: Digital Input (Point B)
External Cable
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 18
1.6.3 PCI-P8POR8/P16POR16i and PEX-P8POR8i/P16POR16i i
CON 1
CON 2
CON 2
External Cable
NO
DIA: Digital Input (Point A)
DIB: Digital Input (Point B)
CM
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 19
2 . Hardware Applications
Model Number OUTPUT INPUT
PCI-P8R8
PCI-P16R16
PCI-P16C16
PCI-P8POR8
PCI-P16POR16
PEX-P8POR8i
PEX-P16POR16i
Relay Output Optical isolation
Transistor Output
(Open Collector)
PhotoMos Relay OutputOptical isolation
Optical isolation
2.1 Relay Output
•For PCI-P8R8/P16R16 Only
Whenever data is written data to the output control register, the relays will switch
to NC or NO as specified by the control code. A`1'in the control register will
energize the corresponding relay. The relay will switch from COM to NO (normally
open). A `0' in the control register will turn off the corresponding relay and the
relay will be switch from COM to NC (normally closed). The control register
powers-on in NC mode. Hardware reset signal or programmable reset signal will
also turn the relay to NC. The following figures show how to use the relay.
Basic Circuitry: (Current Rating < 0.3 A):
Relay Contact
COM
NO
Figure 2-1: Basic Relay Circuit
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 20
AC/ DC
Power Supply
Load
Heavy Loading Application ( > 0.3 A ) :
Figure 2-3. Heavy load relay circuit.
P16R16DI
O Relay
Power Relay
Power Relay
Contact
Heavy Loading
2.2 Open Collector Output
•For PCI-P16C16 Only
The PCI-P16C16 provides 16-channel open collector outputs and 4 channels per
common power. Each common power has designed fuse protection and LED
indicated status.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 21
2.3 PhotoMos Relay Output
• For PCI-P8POR8/P16POR16 and PEX-P8POR8i/P16POR16i
Only
The PCI-P8POR8/P16POR16 and PEX-P8POR8i/P16POR16i includes 8/16
normally open, form A, PhotoMOS relays. The board can eliminate ground-loop
problems and isolate the computer from damaging voltages. Use the PCI-
P8POR8/P16POR16 and PEX-P8POR8i/P16POR16i to switch loads, up to 350
VAC and 130 mA.
PCI-P8POR8
PCI-P16POR16
PEX-P8POR8i
PEX-P16POR16i
130 A @ 350 V
NO
CM
NO
Measurement Meter
Load
AC (max.)
Power
AC/DC
AC/DC Signal CM
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 22
2.4 Isolated Input
• For PCI-P8R8/P16R16/P16C16/P8POR8/P16POR16 and PEX-
P8POR8i/P16POR16i
Reading the isolation input register will give the digital input state of the photo-
couple (isolation input). Figures 2-3 and 2-4 show the basic circuit of the digital
input.
DIA 0
Internal
Circuit
DIB 0
Figure 2-3. Basic Digital Input Circuit.
If Using AC
Signal, JP1 must
be shorted 2-3!!
Switch
5 ~ 24
VAC/DC
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 23
f
Although the normal input voltage range is 5 to 24 VAC or VDC, the input can still be
changed to a larger range by choosing suitable external resistors. The following
figure shows how to connect to a larger input. Please note that the input current
should be limited between 2 mA to 20 mA; too large an input current will burn
down the internal resistor Ri, while too low of an input current will not active the
photo-coupler isolator. Calculate input voltage and current, then replace resister
Ri.
Figure 2-4. Isolated Digital Input
Vin
External Circuit
I
20mA
On board circuits
I
A rough estimate:
if Vin = 120 V and we ignore photo-coupler turn-on voltage.
We’ll get:
I
Vin /
Vin = 120(V) ,
120(V) / 0.01 (A) = 12000 (Ω)
f =
Ri
I
=10(mA) , Ri = Vin/ If
f
R
= 1.2 kΩ /1 W
i
f =
2 mA ~ 20 mA
PC - 814
If you replace12kΩ as resistor Ri, we can calculate the power consumption of Ri
as follows:
P = I2Rex = (10 mA) 2 * 12 KΩ = 1.2 W
The power consumption is 1.2 watts, but choosing 1.5 or 2 watts is better.
Thus, we can choose a 12 K/2 W resistor to replace the resistor Ri.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 24
3 . Software Installation Guide
The PCI-P8R8/P16R16/P16C16/P8POR8/P16POR16 and PEX-P8POR8i/
P16POR16i series can be used in DOS and Windows 98/NT/2K and 32-bit/64-
bit Windows XP/2003/Vista/7. The recommended installation procedure for
windows is given in Sec. 3.1 ~ 3.2. Or refer to Quick Start Guide
UniDAQ SDK driver (32-bit/64-bit Windows XP/2003/Vista/7):
Step 1: Insert the companion CD into the CD-ROM drive and after a few
seconds the installation program should start automatically. If it
doesn’t start automatically for some reason, double-click the
AUTO32.EXE file in the NAPDOS folder on this CD.
Step 2: Click the item: “PCI Bus DAQ Card”.
Step 3: Click the item: “UniDAQ”.
Step 4: Click the item: “DLL for Windows 2000 and XP/2003/Vista 32-bit”.
Step 5: Double-Click “UniDAQ_Win_Setup_x.x.x.x_xxxx.exe” file in the
Driver folder.
Windows driver (Windows 98/NT/2K and 32-bit Windows XP/2003/Vista/7):
Step 1: Insert the companion CD into the CD-ROM drive and after a few
seconds the installation program should start automatically. If it
doesn’t start automatically for some reason, double-click the
AUTO32.EXE file in the NAPDOS folder on this CD.
Step 2: Click the item: “PCI Bus DAQ Card”.
Step 3: Click the item: “PCI-P16R16/PCI-P8R8”.
Step 4: Click the item “DLL and OCX for Windows 98/NT/2K/XP/2003”.
Step 5: Choose the Win2K_XP, Win98 or WinNT folders for setup according
to your PC platform and then double-Click “.exe” to install driver.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 25
The setup program will then start the driver installation and copy the relevant
files to the specified directory and register the driver on your computer. The
directory where the drive is stoned is different for different windows versions, as
shown below.
Windows 64-bit Windows XP/2003/Vista/7:
The UniDAQ.DLL file will be copied into theC:\WINNT\SYSTEM32 folder
The NAPWNT.SYS and UniDAQ.SYS files will be copied into the
C:\WINNT\SYSTEM32\DRIVERSfolder
For more detailed UniDAQ.DLL function information, please refer to
!
UniDAQ SDK user manual (CD:\NAPDOS\PCI\UniDAQ\Manual\).
Windows NT/2K and 32-bit Windows XP/2003/Vista/7:
The P16R16.DLL file will be copied into the C:\WINNT\SYSTEM32 folder
The NAPWNT.SYS and P16R16.SYS files will be copied into the
C:\WINNT\SYSTEM32\DRIVERS folder
Windows 95/98/ME:
The P16R16.DLL and Nappci.Vxd files will be copied into the
C:\Windows\SYSTEM folder
For more detailed P16R16.DLL function information, please refer to
!
“PCI-P16R16 Series Software Manual.pdf” (CD:\NAPDOS\PCI\PCIP16R16\Manual\). http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/pci-
p16r16/manual/
3.2 PnP Driver Installation
Power off the computer and install the PCI-P8R8/P16R16/P16C16/
P8POR8P16POR16 and PEX-P8POR8i/P16POR16i cards. Turn on the
computer and Windows 98/ME/2K and 32-bit/64-bit Windows XP/2003/Vista/7
should automatically defect the new PCI device(s) and then ask for the location
of the driver files for the hardware. If a problem is encountered during
installation, refer to the PCI-P16R16_PnP_Driver_Installation.pdf
(CD:\NAPDOS\PCI\PCI-P16R16\Manual\) for more information.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 26
3.3 Confirm the Successful Installation
Make sure the PCI-P8R8/P16R16/P16C16/P8POR8P16POR16 and PEX-
P8POR8i/P16POR16i card installed are correct on the computer as follows:
Step 1: Select “Start” Æ “Control Panel” and then double click the “System”
icon on Windows.
Step 2: Click the “Hardware” tab and then click the “Device Manager” button.
Step 3: Check the PCI-P8R8/P16R16/P16C16/ P8POR8P16POR16 and PEX-
P8POR8i/P16POR16i card which listed correctly or not, as illustrated
below.
Successful
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 27
4 . I/O Control Register
4.1 How to find the I/O Address
The Plug&Play BISO assigns a proper I/O address to every PCI-P8R8/P16R16/
P16C16/P8R8/P16POR16 and PEX-P8POR8i/P16POR16i card in the power-on
stage. The IDs of PCI-P8R8/P16R16/ P16C16/P8R8/P16POR16 and PEX-
P8POR8i/P16POR16i are as follows:
PCI-P16R16
PCI-P16C16
PCI-P16POR16
PEX-P16POR16i
Model Name
PCI-P8R8
PCI-P8POR8
PEX-P8POR8i
Vendor ID
Device ID
Sub Vendor ID
Sub Device ID
We provide the following necessary functions:
1. PCI_DriverInit (&wBoards)
This function detects how many PCI-P8R8/P16R16 series cards are installed in
the system, and also records all their I/O resources information in the library.
The function is implemented based on the PCI Plug & Play mechanism. Please
card installed in this system. Then the application program can control all
functions of PCI-P8R8/P16R16 series card directly. Please refer to “PCI-
P16R16 Series Software Manual”.
Note: The PCI-P8R8/P16R16 series card is to use the BAR 2
!
(&wAddress2) to control all functions, please refer to Sec. 4.2 The I/O
Address Map.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 28
The First 16 double words of a PCI device's configuration space are referred to as
the device's configuration region. Within these the 16 (0-15) double words, the 04,
05, 06, 07, 08 and 09 double words are referred to as Base Address0, Base
Address1, Base Address2, Base Address3, Base Address4 and Base Address5.
For more detailed information for about these 16 double words, please referring
the book titled PLUG AND PLAY SYSTEM ARCHITECTURE (written by Tom
Shanley, Addison-Wesley Publish Company, 1995). These base addresses are
utilized as control register and/or I/O register for many data acquisition boards. On
PCI-P16R16 and PCI-P8R8 series boards, the base address2 is utilized as the
base address of digital input and digital output. So the Digital I/O functions for PCI-
P16R16 and PCI-P8R8 series are coded as follows:
#define WORD unsigned int
#define UCHAR unsigned char
void P16R16_DO(WORD BaseAddr, WORD wOutData)
{
outport(BaseAddr,wOutData);
}
WORD P16R16_DI(WORD BaseAddr)
{
WORD DigitalIn;
DigitalIn=inport(BaseAddr);
return DigitalIn;
}
void P8R8_DO(WORD BaseAddr, WORD wOutData)
{
outportb(BaseAddr,wOutData);
}
UCHAR P8R8_DI(WORD BaseAddr)
{
UCHAR DigitalIn;
DigitalIn=inportb(BaseAddr);
return DigitalIn;
}
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 29
Please refer to the following program code to get these six base addresses for
PCI-P16R16 and PCI-P8R8. These codes are based on PCI Plug & Play
mechanism 2.
/******************************************************/
/* Reading PCI card's configuration address space */
/******************************************************/
WORD GetAddress(void)
{
DWORD dConfigAddress,dBaseAddress;
WORD HiWord,LoWord;
WORD ReturnCode;
UCHAR Bus,Device,Function,WhichLong;
WORD VendorID,DeviceID;
WORD wIrqNumber;
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 33
4.2 The I/O Address Map
The I/O address for PIO/PISO series cards is automatically assigned by the ROM
BIOS of the main board. The I/O address can also be re-assigned by user. It is
strongly recommended that users don’t change the I/O address. The Plug &
Play BIOS will assign the proper I/O address to each PIO/PISO series card.
The detailed I/O register address mapping for the PCIP8R8/P16R16/P16C16/P8POR8/P16POR16 and PEX-P8POR8i/P16POR16i card
is as follows:
BAR 2: DI/DO Register
Bar No. Offset
Name Operation Access
0x00 DI Port R 16-bit
Register Function Script
2
(DIO)
0x00 DO Port W 16-bit
0x0C Read D/O Readback R 16-bit
0x3C Read Card ID R 16-bit
4.2.1 Digital Output/Digital Input
The sample code of DI/DO is given as follows:
// DI/DO function of PCI-P16R16/P16C16/P16POR16 and PEX-P16POR16i series
void P16R16_DO(WORD BaseAddr, WORD wOutData)
{
outport (BaseAddr, wOutData);
}
WORD P16R16_DI(WORD BaseAddr)
{
DigitalIn=inportb(BaseAddr);
}
// DI/DO function of PCI-P8R8 /P8POR8 and PEX-P8POR8i series
void P8R8_DO(WORD BaseAddr, WORD wOutData)
{
outportb(BaseAddr, wOutData);
}
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 34
UCHAR P8R8_DI(WORD BaseAddr)
{
DigitalIn=inportb(BaseAddr);
}
4.2.2 D/O Readback Register
The format of the D/O readback register is given as follows:
BaseAddr +0x0C
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
The sample code of reading the given as follows:
// D/O Readback function of PEX-P8POR8i and PEX-P16POR16i
DigitalIn=inportb(BaseAddr+0x0C);
4.2.3 Card ID Register
The format of the Card ID register is given as follows:
BaseAddr +0x3C
X X X X
It can be used to read the card ID set from SW1 switch
The sample code of reading the given as follows:
// Card ID function of PEX-P8POR8i and PEX-P16POR16i
*wID=inportb(BaseAddr+ 0x3C)&0x000f;
N Note:
!
1. Refer to Sec. 4.1
2. The Card ID and D/O Readback function is only supported by the PEXP8POR8i and PEX-P16POR16i (Ver1.0 or above)
Bit3 Bit2 Bit1 Bit0
for more information regarding BaseAddr.
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28) 35
5 Demo Programs
5.1 Demo Programs for Windows
Please note that none of the demo programs will work normally if the DLL driver
has not been installed correctly. During the DLL driver installation process, the
install shield will register the correct kernel driver to the operating system and
copy the DLL driver and demo programs to the correct location depending on
the driver software package you have selected (Win98/Me/NT/2000 and 32-bit
Win XP/2003/Visa/7). After installing the driver, the related demo programs,
development library and declaration header files for the different development
environments will be available in the following folders.