Advantech PC-LabCard PCI-1784 User Manual
Advantech PC-LabCard PCI-1784 User Manual

Advantech PC-LabCard PCI-1784 User Manual

Advantech counter card user's manual

Advertisement

Quick Links

Copyright
This documentation and the software included with this product are
copyrighted 2002 by Advantech Co., Ltd. All rights are reserved.
Advantech Co., Ltd. reserves the right to make improvements in the
products described in this manual at any time without notice. No part of this
manual may be reproduced, copied, translated or transmitted in any form or
by any means without the prior written permission of Advantech Co., Ltd.
Information provided in this manual is intended to be accurate and reliable.
However, Advantech Co., Ltd. assumes no responsibility for its use, nor for
any infringements of the rights of third parties which may result from its
use.
Acknowledgments
PC-LabCard is a trademark of Advantech Co., Ltd. IBM and PC are
trademarks of International Business Machines Corporation. MS-DOS,
Windows, Microsoft Visual C++ and Visual BASIC are trademarks of
Microsoft Corporation. Intel and Pentium are trademarks of Intel
Corporation. Delphi and C++ Builder are trademarks of Inprise
Corporation.
CE notification
The PCI-1784, developed by ADVANTECH CO., LTD., has passed the CE
test for environmental specifications when shielded cables are used for
external wiring. We recommend the use of shielded cables. This kind of
cable is available from Advantech. Please contact your local supplier for
ordering information.
On-line Technical Support
For technical support and service, please visit our support website at:
http://www.advantech.com/support
Note:
Concerning the environment protection, we'd like to reduce the paper
using for the user's manual. Starting the page of Appendix C, please find
the PDF file of the CD-ROM.
Part No. 2003178400
Printed in Taiwan
1
1st Edition
July 2002

Advertisement

Table of Contents
loading

Summary of Contents for Advantech PC-LabCard PCI-1784

  • Page 1 No part of this manual may be reproduced, copied, translated or transmitted in any form or by any means without the prior written permission of Advantech Co., Ltd. Information provided in this manual is intended to be accurate and reliable.
  • Page 3: Table Of Contents

    Contents 1. INTRODUCTION... 1 1.1 F ... 1 EATURES 1.2 A ... 4 PPLICATIONS 1.3 I ... 4 NSTALLATION UIDE 1.4 S ... 6 OFTWARE VERVIEW 1.5 D EVICE RIVERS ROGRAMMING 1.6 A ... 9 CCESSORIES 2. INSTALLATION... 10 2.1 U ...
  • Page 4 C.10 S — BASE+28H ... 41 OFTWARE LATCH C.11 B ID — BASE+28H... 42 OARD C.12 R — BASE+2CH... 43 ESET COUNTER C.13 D — BASE+30H... 44 IGITAL OUTPUT C.14 D IGITAL INPUT OUTPUT APPENDIX D. OPERATION ... 47 D.1 Q UADRATURE ENCODER INTRODUCTION D.2 C ...
  • Page 5: Introduction

    1. Introduction Thank you for buying the Advantech PCI-1784. The PCI-1784 is a 4- axis quadrature encoder and counter card for PCI bus. This card includes four 32-bit quadruple AB phase encoder counters, 8-bit timer with multi range time-base selector and four isolated digital input and four isolated digital output.
  • Page 6 Counters The PCI-1784 has four independent 32-bit counters. The maximum quadrature input rate is 2 MHz, and the maximum input rate in counter mode is 8 MHz. You can individually configure each counter for quadrature decoding, pulse/direction counting or up/down counting. Digital Input and Interrupts The PCI-1784 provides four digital input channels.
  • Page 7 default configuration, depending on jumper setting. This practical function eliminates danger caused by miss-operation during unexpected system reset. Board ID The PCI-1784 has a built-in DIP Switch that helps define each card’s ID when multiple PCI-1784 cards have been installed on the same PC chassis.
  • Page 8: Applications

    Installation procedures. Figure 1-1 on the next page provides a concise flow chart to give users a broad picture of the software and hardware installation procedures: Advantech DLL drivers (included in the companion CD-ROM) PCL-10137H (option) ADAM-3937 (option)
  • Page 9 Install Driver from CD-ROM, then power-off PC Install Hardware and power-on PC Use driver utility to configure hardware Use test utility to test hardware Read examples & driver manual Start to write your own application Fig. 1-1 Installation Flow Chart...
  • Page 10: Software Overview

    Device Drivers The Advantech Device Drivers software is included on the companion CD-ROM at no extra charge. It also comes with all the Advantech DA&C cards. Advantech’s device drivers features a complete I/O function library to help boost your application performance. The...
  • Page 11: Device Drivers Programming Roadmap

    1.5 Device Drivers Programming Roadmap This section will provide you a roadmap to demonstrate how to build an application from scratch using Advantech Device Drivers with your favorite development tools such as Visual C++, Visual Basic, Delphi and C++ Builder. The step-by-step instructions on how to build your own applications using each development tool will be given in the Device Drivers Manual.
  • Page 12 Device Drivers Manual. Programming with Device Drivers Function Library Advantech Device Drivers offers a rich function library to be utilized in various application programs. This function library consists of numerous APIs that support many development tools, such as Visual C++, Visual Basic, Delphi and C++ Builder.
  • Page 13: Accessories

    1.6 Accessories Advantech offers a complete set of accessory products to support the PCI-1784 card. These accessories include: Wiring Cable PCL-10137H The PCL-10137H shielded cable is specially designed for PCI-1784 cards to provide high resistance to noise. To achieve a better signal quality, the signal wires are twisted in such a way as to form a “twisted-pair cable”,...
  • Page 14: Installation

    2. Installation This chapter gives users a package item checklist, proper instructions about unpacking and step-by-step procedures for both driver and card installation. 2.1 Unpacking After receiving your PCI-1784 package, please inspect its contents first. The package should contain the following items: ! PCI-1784 card ! Companion CD-ROM (DLL driver included) ! User’s Manual...
  • Page 15 Also pay extra caution to the following aspects to ensure proper installation: ! Avoid physical contact with materials that could hold static electricity such as plastic, vinyl and Styrofoam. ! Whenever you handle the card, grasp it only by its edges. DO NOT TOUCH the exposed metal pins of the connector or the electronic components.
  • Page 16: Driver Installation

    1784 card into your system, since this will guarantee a smooth installation process. The Advantech Device Drivers Setup program for the PCI-1784 card is included on the companion CD-ROM that is shipped with your DA&C card package. Please follow the steps below to install the driver software: Step 1: Insert the companion CD-ROM into your CD-ROM drive.
  • Page 17: Hardware Installation

    Fig. 2-2 Different options for Driver Setup For further information on driver-related issues, an online version of Device Drivers Manual is available by accessing the following path: Start/Programs/Advantech Device Drivers V2.0/Device Driver Manual 2.3 Hardware Installation Note: Make sure you have installed the driver first before you install the card (please refer to 2.2 Driver Installation)
  • Page 18 Step 1: Turn off your computer and unplug the power cord and cables. TURN OFF your computer before installing or removing any components on the computer. Step 2: Remove the cover of your computer. Step 3: Remove the slot cover on the back panel of your computer. Step 4: Touch the metal part on the surface of your computer to neutralize the static electricity that might be on your body.
  • Page 19 Fig. 2-3 The device name listed on the Device Manager Note: If your card is properly installed, you should see the device name of your card listed on the Device Manager tab. If you do see your device name listed on it but marked with an exclamation sign “!”, it means your card has not been correctly installed.
  • Page 20: Device Setup & Configuration

    These settings will be used when you call the APIs of Advantech Device Drivers. Board selection After your card is properly inserted, the Windows system will install the drivers properly.
  • Page 21 Setting Up and configure the device Click Setup to configure each parameter. The dialog box will appear as seen below (Fig. 2-5): Fig. 2-5 The ‘Setup’ dialog box...
  • Page 22 Fig. 2-6 The “Operation” dialog box After your card is properly installed and configured, you can click the Operation button to test your hardware. For more detailed information, please refer to Chapter 2 of the Device Drivers Manual. You can also find the rich examples on the CD-ROM to speeding up your programming.
  • Page 23: Signal Connections

    3. Signal Connections 3.1 Overview Maintaining signal connections is one of the most important factors in ensuring that your application system is sending and receiving data correctly. A good signal connection can avoid unnecessary and costly damage to your PC and other hardware devices. This chapter provides useful information about how to connect input and output signals to the PCI-1784 via the I/O connector.
  • Page 24 Setting the time to reset the digital outputs and the counter value Some users will want the capability of clearing each counter and the isolated digital output when the system (or PC) issues a reset signal on the PCI bus. Some users will want to clear their counter and digital output only as part of system power-on.
  • Page 25: Signal Connections

    3.3 Signal Connections Pin Assignment Figure 3-2 shows the pin assignments for the 37-pin I/O connector on the PCI-1784. IDI COM Fig. 3-2 I/O connector pin assignments for the PCI-1784 I/O Connector Signal Description Table 3-2 I/O Connector Signal Description Signal Name Reference Direction...
  • Page 26 Quadrature encoder input Single ended outputs of Encoder Differential outputs of Encoder or Line driver PULSE Pulse/Direction Counter Figure 3-3: Quadrature encoder input connections CHnA+ CHnB+ CHnZ+ PCI-1784 connector EGND CHnA+ CHnA- CHnB+ CHnB- CHnZ+ CHnZ- PCI-1784 connector EGND CHnA+ CHnB+ PCI-1784 connector...
  • Page 27 Up/Down Counter Two_Pulse Up Counter Two_Pulse Down Counter Figure 3-4: Quadrature encoder (up/down counter) input connections Note: In case you want to connect the Up/Down counter signal into the PCI-1784, be sure that all the signals must be connected. The floating connection will cause unexpected result.
  • Page 28 Isolated digital input External IDI0~IDI3 (5-30V) IDI COM Figure 3-4: Isolated digital input connections Isolated digital output Internal level Isolated Protection Circuit Figure 3-5: Isolated digital output connections Internal External IDO0~IDO3 level EGND...
  • Page 29: Appendix A. Specifications

    Appendix A. Specifications Encoder Output Number of Axis Resolution w/ Digital Filter Max. Quadrature w/o Digital Input Frequency Filter Digital Filter Drive Type Single-ended or differential Counter Mode Quadrature, Up/Down, Count/Direction Optical Isolation Max. Input Pulse Frequency Sample Clock Frequency Timer Resolution Time base...
  • Page 30 Interrupt Counter overflow, Counter underflow, Source Index input, Compare, Timer, Digital input Counter Latch Source Software, Timer, Index input, Digital input General I/O Connector Type Dimensions 175 mm x 100 mm (6.9" x 3.9") Typical Power Consumption Max. Operation Temperature Storage Relative Humidity Certification...
  • Page 31: Appendix B. Block Diagram

    Appendix B. Block Diagram 32-B IT U P /D O W N C O U N TE R 32-B IT M U LTI-M O D E U P /D O W N C O U N TE R 32-B IT M U LTI-M O D E U P /D O W N C O U N TE R 32-B IT M U LTI-M O D E U P /D O W N C O U N TE R...
  • Page 33: Appendix C. Register Structure And Format

    Windows 2000/95/98/NT/ME/XP operating system. We advise users to program the PCI-1784 using the 32-bit DLL driver provided by Advantech to avoid the complexity of low-level programming by register. The most important consideration in programming the PCI-1784 the register level is to understand the function of the card's registers.
  • Page 34 Table C-1 PCI-1784 register format (Part 1) Base Address + HEX PCI-1784 Register Format Counter 0 Mode Counter 0 Latch Data Counter 1 Mode Counter 1 Latch Data Counter 2 Mode Counter 2 Latch Data Counter 3 Mode Counter 3 Latch Data...
  • Page 35 Table C-1 PCI-1784 register format (Part 2) Base Address + HEX PCI-1784 Register Format Counter 0 Compare Data Counter 0 Compare Data Counter 1 Compare Data Counter 1 Compare Data Counter 2 Compare Data Counter 2 Compare Data Counter 3 Compare Data Counter 3 Compare Data...
  • Page 36 Table C-1 PCI-1784 register format (Part 3) Base Address + HEX DM3 DM2 DM1 DM0 DM3 DM2 DM1 DM0 PCI-1784 Register Format Interrupt Control UN3 UN2 UN1 UN0 OV3 OV2 OV1 UC3 UC2 UC1 UC0 OC3 OC2 OC1 Interrupt Status UN3 UN2 UN1 UN0 OV3 OV2 OV1 UC3 UC2 UC1 UC0 OC3 OC2 OC1 Clock Control...
  • Page 37: Counter 0/1/2/3 Mode - Base+00/04/08/0Ch

    C.3 Counter 0/1/2/3 mode — BASE+00/04/08/0CH Table C-2 PCI-1784 Register for counter 0/1/2/3 mode Base Addr. 00H W 04H W 08H W 0CH W M2 ~ M0 Counter input mode control Set counter reset value Counter overflow lock control Counter 0 Mode Counter 1 Mode Counter 2 Mode Counter 3 Mode...
  • Page 38 Counter underflow lock control Digital Filter Software latch counter data Index latch counter data Timer latch counter data DI0 latch counter data DI1 latch counter data DI2 latch counter data DI3 latch counter data Counter continues counting (wraps over) when counter underflow Counter locked when counter underflow Quadrature input frequency without digital filter...
  • Page 39: Counter 0/1/2/3 Latch Data - Base+00/04/08/0Ch

    C.4 Counter 0/1/2/3 latch data — BASE+00/04/08/0CH Table C-3 PCI-1784 Register for counter 0/1/2/3 latch data Base Addr. 0CH R D31 ~ D0 Counter latch data Counter 0 Latch Data Counter 1 Latch Data Counter 2 Latch Data Counter 3 Latch Data...
  • Page 40: Counter 0/1/2/3 Compare Data - Base+10/14/18/1Ch

    C.5 Counter 0/1/2/3 compare data — BASE+10/14/18/1CH Table C-4 PCI-1784 Register for counter 0/1/2/3 compare data Base Addr. D31 ~ D0 Counter compare data Counter 0 Compare Data Counter 0 Compare Data Counter 1 Compare Data Counter 1 Compare Data Counter 2 Compare Data Counter 2 Compare Data Counter 3 Compare Data...
  • Page 41: Interrupt Control Register - Base+20H

    C.6 Interrupt control register — BASE+20H Table C-5 PCI-1784 Register for interrupt control Base Addr. 20H W Interrupt by overflow bit (n: 0 ~ 3) Interrupt by underflow bit (n: 0 ~ 3) Interrupt by index status bit (n: 0 ~ 3) Interrupt by digital input bit (n: 0 ~ 3) Interrupt by counter over compare bit (n: 0 ~ 3) Interrupt by counter under compare bit (n: 0 ~ 3)
  • Page 42: Interrupt Status Register - Base+20H

    C.7 Interrupt status register — BASE+20H Table C-6 PCI-1784 Register for interrupt status Base Addr. Counter overflow interrupt flag (n: 0 ~ 3) Counter underflow interrupt flag (n: 0 ~ 3) Index input interrupt flag (n: 0 ~ 3) Digital input interrupt flag (n: 0 ~ 3) Counter over compare interrupt by flag (n: 0 ~ 3) Counter under compare interrupt flag (n: 0 ~ 3) Timer pulse interrupt flag...
  • Page 43: Clear Interrupt - Base+24H

    C.8 Clear Interrupt — BASE+24H Table C-7 PCI-1784 Register for clock control Base Addr. 24H W SC1 ~ SC0 Sampling clock select DV7 ~ DV0 Timer divider control TB2 ~ TB0 Timer time base select Clock Control DV7 DV6 DV5 DV4 DV3 DV2 DV1 8 MHz sampling clock 4 MHz sampling clock 2 MHz sampling clock...
  • Page 44: Clear Interrupt - Base+24H

    C.9 Clear Interrupt — BASE+24H Read this register to clear the interrupt. Table C-8 PCI-1784 Register for clear interrupt Base Addr. Clear Interrupt...
  • Page 45: Software Latch - Base+28H

    C.10 Software latch — BASE+28H Table C-9 PCI-1784 Register for software latch Base Addr. 28H W Software latch command (n: 0 ~ 3) Software Latch Latch counter to latch register...
  • Page 46: Board Id - Base+28H

    C.11 Board ID — BASE+28H The PCI-1784 offers Board ID register BASE+28H. With correct Board ID settings, user can easily identify and access each card during hardware configuration and software programming. Table C-10 PCI-1784 Board ID data Base Addr. BD3 ~ DB0 Board ID BD3 BD2 BD1 BD0 Board ID Board ID...
  • Page 47: Reset Counter - Base+2Ch

    C.12 Reset counter — BASE+2CH Table C-11 PCI-1784 Register for reset counter Base Addr. 2CH W Reset counter command (n: 0 ~ 3) Reset Counter Reset counter to default value SR3 SR2 SR1...
  • Page 48: Digital Output - Base+30H

    C.13 Digital output — BASE+30H Table C-12 PCI-1784 Register for digital output Base Addr. 30H W DM3 DM2 DM1 DM0 DO3 ~ DO0 Digital output data Digital output by over compare register (n: 0 ~ 3) Digital output by under compare register (n: 0 ~ 3) Digital output level control (n: 0 ~ 3) Digital output mode control (n: 0 ~ 3) Digital Output...
  • Page 49: Digital Input/Output - Base+30H

    C.14 Digital input/output — BASE+30H Table C-13 PCI-1784 Register for digital input/output Base Addr. 30H R DM3 DM2 DM1 DM0 DO3 ~ DO0 Digital output data DI3 ~ DI0 Digital input data Digital output by over compare register (n: 0 ~ 3) Digital output by under compare register (n: 0 ~ 3) Digital output level control (n: 0 ~ 3) Digital output mode control (n: 0 ~ 3)
  • Page 51: Appendix D. Operation

    Appendix D. Operation D.1 Quadrature encoder introduction In typical closed-loop control systems, also know as servo system, the encoder interface senses motor position and sends a position signal to the controller. The diagram below shows a typical servo system. The encoder generates pulses which indicate the shaft position. The encoder output includes two signals, commonly called channel A and channel B, which generate N pulses revolution.
  • Page 52: Counter Modes

    Single-ended vs. differential input Most encoders produce square wave signals with TTL levels. Industrial systems often use encoder with differential signals, i.e. channel A and B and their complements. Differential signals can reduce sensitivity to noise and allow longer transmission distances. Encoders may also produce a third signal once per revolution know as the index or marker.
  • Page 53: Digital Noise Filter

    2-pulse mode In 2-pulse mode the PCI-1784 uses two input pulses as counting sources: one for clockwise (CW) and one for counterclockwise (CCW) counting. The counter will increment whenever a rising edge occurs on channel A. It will decrement whenever a rising edge occurs on channel pulse/direction mode In pulse/direction mode the PCI-1784 uses one input line (A) for pulse input and one line (B) for direction.
  • Page 54: Latch Mode

    to 500 KHz quadrature input frequency. A 3600 rpm motor with 2000 ppr encoder will nave a maximum quadrature frequency of 3600×2000÷60=120 KHz. In the above example the 2 MHz sampling clock will have the noise immunity and will meet the required input frequency. The following table shows the maximum noise pulse width that the filter will reject for each system clock frequency: Clock frequency...
  • Page 55: Counter Reset Value

    DI0 latch A rising edge on the board's DI0 line will latch the counter value for the channel. DI1 latch A rising edge on the DI1 line will latch the counter value for the channel. DI2 latch A rising edge on the board's DI2 line will latch the counter value for the channel.
  • Page 56: Interrupt Function

    D.7 Interrupt function The PCI-1784 can generate an interrupt to the PC for any of the following conditions: 1. Counter 0 overflow 2. Counter 1 overflow 3. Counter 2 overflow 4. Counter 3 overflow 5. Counter 0 underflow 6. Counter 1 underflow 7.
  • Page 57 registers at BASE+20H. You will need to set the chip's interrupt mask register to exclude all but one of the interrupt lines.

Table of Contents