30 channel compactpci digital input controller (60 pages)
Summary of Contents for PEP CP380
Page 1
CP380 Digital I/O Board for CompactPCI Applications Manual ID 19313, Rev. Index 0100 Feb 99 The product described in this manual is in compliance with all applied CE stan- dards.
Page 2
This page was intentionally left blank. ® PEP Modular Computers GmbH...
Special Handling and Unpacking Instructions ..0 - 6 General Instructions on Usage......... 0 - 7 Two Years Warranty ............ 0 - 8 Table of Contents............0 - 9 ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 0 - 3...
This document contains information proprietary of PEP Modular Computers. It may not be copied or transmitted by any means, disclosed to others or stored in any retrieval system or media, without the prior written consent of PEP Modular Computers GmbH or one of its autho- rized agents.
This symbol and title emphasize advantages or positive aspects of a product and/or procedure. Troubleshooting This symbol and title characterize a message containing useful information on troubleshooting and problem solving. ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 0 - 5...
However, the life expectancy of your product can be drastically reduced by improper treat- ment during unpacking and installation. Therefore, in the interests of your own safety and of the correct operation of your new PEP product, you are requested to conform with the follow- ing guidelines.
Preface General Instructions on Usage In order to maintain PEP’s product warranty, this product must not be altered or modi- fied in any way. Changes or modifications to the device, which are not explicitly approved by PEP Modular Computers and described in this manual or received from PEP Technical Support as a special handling instruction, will void your warranty.
However, no other warranties that may HARDWARE WARRANTY be granted or implied by anyone on behalf of PEP are valid unless the consumer has the express written consent of PEP Modular Computers. PEP Modular Computers warrants their own products, excluding software, to be free from manufacturing and material defects for a period of 24 consecutive months from the date of purchase.
1. Introduction 1.1 System Overview The PEP Modular Computers CompactPCI systems described in this chapter operate with the PCI bus architecture to support additional I/O and memory-mapped devices as required by various industrial applications. In the following you will find the most impor- tant information on all system relevant CompactPCI features.
PEP Modular Computers’ SMART2 or VMEbus systems using up-to-date transmission standards for example: • CAN fieldbus control • PROFIBUS control Industrial I/O Functions PEP’s CompactPCI systems support an ever increasing number of industrial I/O func- tionalities in the fields of: • Digital I/O • Analog I/O Self-Testing A special PEP self-testing board provides a trouble-spotting capability within your PEP system.
Page 15
• Width: 1 HP = 5.08 mm On certain boards/carriers with PMC connectors, PMC add-on modules can also be installed. Please note that the form factor of PEP Modular Computers PMC modules is: • 149mm x 74mm (single-size standard). For a detailed description of the PEP Modular Computers CompactPCI modules please consult the specific component’s manuals or data sheets.
Page 16
CP380 Introduction Figure 1-1: Example of a PEP Modular Computers CompactPCI System Page 1 - 6 ® PEP Modular Computers GmbH ID 19313, Rev. 0100...
PC electronics. The inputs have been designed for the usual voltage, typically 24 V. On the CP380-I and CP380-I/O there are 2 modes of operation: with or without interrupt control. The interrupt channel and base address are configured by the BIOS.
1.7.1 Modes of Operation The CP380 uses an 8255 compatible PIO device. The operational modes of the device are described in the following chapters. For further information on the 8255 device con- sult the manufacturer’s data sheet.
Page 21
(group A and group B) each containing an 8 bit data port and a 4 bit control/data port are available. The 8 bit ports are used for data input. The CP380-I uses only the PC4 (inter- rupt input for port A) and PC2 (interrupt input for port B) control port lines. All input ports are latched.
D-sub connector are labelled “ext.V+“ and “ext.GND“ (see Chapter 3, Section 3.2 on page 3-3). The inputs and outputs of the CP380-I, CP380-O and CP380- I/O can be powered typically with 24V signals. The interrupt inputs of the CP380-I and CP380-I/O trigger on a falling edge.
CP380 Introduction 1.9 Specifications Table 1-2: CP380 Specifications CP380 Specifications Type Compact-PCI Addressing Automatic assignment of base address under Windows NT Interrupts Automatic assignment of interrupt chan- nel under Windows NT Number CP380-I: 18; CP380-I/O: 10 Type 8255 (PIO) Input Voltage Low: 0…12 V...
CP380-O: max. 400mA/5V (of board only, does not include I/O chan- nels) CP380-I/O: max. 380mA/5V 1.10Applied Standards 1.10.1 CE Compliance The PEP Modular Computers’ CompactPCI systems comply with the requirements of the following CE-relevant standards: • Emission EN50081-1 • Immission EN50082-2 •...
1.11.2 PMC Add-On Modules/Carriers • Draft Standard for a Common Mezzanine Card Family, P1386/Draft 2.0 • Draft Standard Physical and Environment Layers for PCI Mezzanine Cards, P1386.1/Draft 2.0 ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 1 - 15...
Page 26
This page was intentionally left blank. ® PEP Modular Computers GmbH...
Page 27
Uninstall a Single Board..........2 - 4 2.3.2 Uninstall the Driver System......... 2 - 5 2.4 Test Program............... 2 - 5 2.5 Software ................2 - 6 ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 2 - 1...
Page 28
This page was intentionally left blank. ® PEP Modular Computers GmbH...
2.1 Hardware Installation The CP380 family are Plug & Play compatible under Windows NT and will be configured by software. There are no settings required before installing the board into the com- puter.
With the help of the install and uninstall program included with the disk "Windows NT Driver Disk for CP380", you can remove individual boards from the Windows registry. The individual components such as the system driver, API-DLL, and the high level lan- guage libraries are not removed by using this method.
2.3.2 Uninstall the Driver System Using the following procedure, the entire CP380 Driver System will be removed from your computer. All files will be removed, including the system driver, API-DLL, high level language libraries, demo, and test programs (for all installed boards of the board family CP380), which are installed in the "ME-9x"...
Test and Demo Software (included) Table 2-1 provides an overview of the software which is available from PEP Modular Computers GmbH for the CP380 board. Included means that the software is delivered with the board. Optional means that the software must ordered separately from PEP Modular Computers GmbH.
Page 34
This page was intentionally left blank. ® PEP Modular Computers GmbH...
Page 35
CP380 Configuration 3. Configuration 3.1 Jumper Settings The boards of the CP380 family are Plug and Play compatible under Windows NT and are configured by software. There are no settings required before installing the board into the computer. 3.2 Pinouts The CP380-I front panel is provided with a 25-Pin DSUB male input connector, the CP380-O with a 25-Pin DSUB male output connector.
Page 36
CP380 Configuration Figure 3-2: Pinout of the CP380-I/O Upper Connector (Output Connector) Figure 3-3: Pinout of the CP380-I/O Lower Connector (Input Connector) Page 3 - 4 ® PEP Modular Computers GmbH ID 19313, Rev. 0100...
Page 37
User Objects ............... 4 - 4 4.3 LabVIEW™ Programming ........... 4 - 5 4.3.1 LabVIEW™ Example Programs........4 - 5 4.3.2 Virtual Instruments ............4 - 5 ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 4 - 1...
Page 38
This page was intentionally left blank. ® PEP Modular Computers GmbH...
4. Programming 4.1 High Level Language Programming For high level language programming, the following files are required: • ME9x_32.DLL (CP380 family system driver DLL in the Windows system directory) • MEDLG32.DLL (Dialogue DLL in the Windows system directory) • ME9x.H, ME9x.PAS or ME9x.BAS (CP380 family header/include files matching programming environment) •...
The HP VEE components for the CP380 family are delivered on (a) separate disk(s). The CP380 versions are supported under HP VEE. The full versions (4.0 or later) under Windows95/98/NT. For installation of HP VEE components and for further information please see the README file on the disks delivered with the HP VEE driver system.
The CP380 is supported by LabVIEW™ full version 4.x or higher under Windows95/98/ NT. For installation of LabVIEW™ driver components and for further information please see the README file on the disks delivered with the CP380 LabVIEW™ driver. For basics of LabVIEW™ programming please use your LabVIEW™ documentation and the LabVIEW™...
Page 42
This page was intentionally left blank. ® PEP Modular Computers GmbH...
Page 43
5.4.2 Digital Input ..............5 - 6 5.4.3 Digital Output ............5 - 13 5.4.4 Interrupt Handling ............. 5 - 20 5.4.5 Error Handling............5 - 25 ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 5 - 1...
Page 44
This page was intentionally left blank. ® PEP Modular Computers GmbH...
Function Reference 5. Function Reference 5.1 Functional Overview of the 32 Bit Driver The 32-bit driver for the boards of the CP380 family was developed for Windows NT 4.0 and consists of the following components: • Kernel driver (ME9x_32.SYS) for Windows NT, loaded automatically on power up.
Lib "me9x_32" Alias "_VBme9xGetBoardVersion@8" ( ByVal iBoardNumber As Long, ByRef iDevices As Long, ) As Long Description Determines the board version number of an installed board of the board family CP380. Page 5 - 4 ® PEP Modular Computers GmbH ID 19313, Rev. 0100...
Page 47
Syntax (Basic) Declare Function me9xGetDLLVersion Lib "me9x_32" Alias "_VBme9xGetDLLVersion@0" () As Long Description Returns the version number of the board DLL for the board family CP380. Parameters None Returns Version number. This 32 bit value has the main version in the upper 16 bits and the sub version in the lower 16 bits.
Page 48
ByVal iBitNo As Long, ByRef iBitValue As Long ) As Long Description This function is only for the CP380-I. This function determines the status of a single input line. Page 5 - 6 ® PEP Modular Computers GmbH ID 19313, Rev. 0100...
Page 49
CP380 Function Reference Parameters Board number for 1., 2., 3...16 installed CP380-I, <BoardNumber> CP380-O or CP380-I/O; possible values: 0…15 Input line (number); possible values: 0…7: for port A <BitNo> 8...15: for port B 16, 17: for bits C2 and C4 of port C <BitValue>...
Page 50
ByVal iPortNo As Long, ByRef iValue As Long ) As Long Description This function is only for the CP380-I. This function reads a byte (8 bits) from an input port. Page 5 - 8 ® PEP Modular Computers GmbH ID 19313, Rev. 0100...
Page 51
CP380 Function Reference Parameters Board number for 1., 2., 3...16 installed CP380-I, <BoardNumber> CP380-O or CP380-I/O; possible values: 0…15 Port name; possible values: <PortNo> Description <PortNo> PORTA (00hex) Input port A PORTB (01hex) Input port B PORTC (02hex) (only bits C2 and C4 sig- nificant;...
Page 52
ByVal iBitNo As Long, ByRef iBitValue As Long ) As Long Description This function is only for the CP380-I/O. This function determines the status of a single input line. Page 5 - 10 ® PEP Modular Computers GmbH ID 19313, Rev. 0100...
Page 53
CP380 Function Reference Parameters Board number for 1., 2., 3...16 installed CP380-I, <BoardNumber> CP380-O or CP380-I/O; possible values: 0…15 Input line (number); possible values: <BitNo> 0…7: for port B 8, 9: for bits C2 and C4 of ports C Pointer to an integer value which corresponds with the <BitValue>...
Page 54
Description This function is only for the CP380-I/O. This function reads a byte (8 bits) from an input port. Parameters Board number for 1., 2., 3...16 installed CP380-I, BoardNumber> CP380-O or CP380-I/O; possible values: 0…15 Port name; possible values: <PortNo>...
Page 55
ByVal iBitNo As Long, ByVal iBitValue As Long ) As Long Description This function is only for the CP380-O. Sets a single digital output line to 0 or 1. ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 5 - 13...
Page 56
CP380 Function Reference Parameters Board number for 1., 2., 3...16 installed CP380-I, <BoardNumber> CP380-O or CP380-I/O; possible values: 0…15 <BitNo> Output line (number) to be set; possible values: 0…7 (for port A) 8…15 (for port B) <BitValue> Bit value for output line to be set; possible values:...
Page 57
ByVal iPortNo As Long, ByVal iValue As Long ) As Long Description This function is only for the CP380-O. Writes a byte to a digital output port. ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 5 - 15...
Page 58
CP380 Function Reference Parameters Board number for 1., 2., 3...16 installed CP380-I, <BoardNumber> CP380-O or CP380-I/O; possible values: 0…15 Port name; possible values: <PortNo> <PortNo>Description PORTA (00hex)Output port A PORTB (01hex)Output port B Output value, possible values: 00Hex…FFHex (decimal: <Value>...
Page 59
ByVal iBitNo As Long, ByVal iBitValue As Long ) As Long Description This function is only for the CP380-I/O. Sets a single digital output line to 0 or 1. ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 5 - 17...
Page 60
CP380 Function Reference Parameters <BoardNumber> Board number for 1., 2., 3...16 installed CP380-I, CP380-O or CP380-I/O; possible values: 0…15 <BitNo> Output line (number) to be set; possible values: 0…7 (for port A) <BitValue> Bit value for output line to be set; possible values:...
Page 61
ByVal iBoardNumber As Long, ByVal iValue As Long ) As Long Description This function is only for the CP380-I/O. Writes a byte to a digital output port. ID 19313, Rev. 0100 ® PEP Modular Computers GmbH Page 5 - 19...
Page 62
CP380 Function Reference Parameters <BoardNumber> Board number for 1., 2., 3...16 installed CP380-I, CP380-O or CP380-I/O; possible values: 0…15 Output value, possible values: 00Hex…FFHex (decimal: <Value> 0…255); Returns If the function is successfully executed, a '1' is returned. If an error occurs, a '0' is returned.
Page 63
Important Note! As interrupt source, you can use one of the both interrupt inputs PC2 or PC4 of the CP380-I. Make sure, that the channel an inter- rupt signal was switched on first remains the interrupt input. ID 19313, Rev. 0100 ®...
Page 64
CP380 Function Reference Parameters <BoardNumber> Board number for 1., 2., 3...16 installed CP380-I, CP380-O or CP380-I/O; possible values: 0…15 <IrqFunc> Address of a user defined function of type (void SERVICE_PROC (void)) in C resp. of type pointer in Delphi, which is processed if an interrupt occures.
Page 65
CP380 Function Reference Parameters <BoardNumber> Board number for 1., 2., 3...16 installed CP380-I, CP380-O or CP380-I/O; possible values: 0…15 Returns If the function is successfully executed, a '1' is returned. If an error occurs, a '0' is returned. cause error...
Page 66
CP380 Function Reference Parameters <BoardNumber> Board number for 1., 2., 3...16 installed CP380-I, CP380-O or CP380-I/O; possible values: 0…15 <IrqFunc> Address of a user defined function of type (void SERVICE_PROC (void)) in C resp. of type pointer in Delphi, which is processed if an interrupt occures.
Page 67
) As Long Description This function is for the CP380-I, CP380-O, CP380-I/O. If an error occurs during the processing of one of the API functions of the CP380 driver, this routine returns the matching error code and text. Parameters <Errortext>...
Page 68
This page was intentionally left blank. ® PEP Modular Computers GmbH...