background image

2. Setup

 

                                                                                                                                                 

CNT24-4(PCI)H

15

Setting the Board ID

If you install two or more CNT24-4(PCI)H boards on one personal computer, assign a different ID value

to each of the boards to distinguish them.

The board IDs can be set from 0 to Fh to identify up to sixteen boards.

If only one board is used, the original factory setting (Board ID = 0) should be used.

Setting Procedure

To set the board ID, use the rotary switch on the board.  Turn the SW1 knob to set the board ID as shown

below.

BOARD ID

(Board ID= 0)

Factory setting:

SW1

01

2

3

4

5

6 7

9A

B

C

D

E

F

Figure 2.2. Board ID Settings (SW1)

Summary of Contents for CNT24-4(PCI)H

Page 1: ...PC HELPER 4ch 24Bit Up Down Counter Board for PCI CNT24 4 PCI H User s Guide CONTEC CO LTD ...

Page 2: ...low Check with the following list that your package is complete If you discover damaged or missing items contact your retailer Product Configuration List CNT24 4 PCI H 1 First step guide 1 CD ROM 1 API PAC W32 1 1 The CD ROM contains the driver software and User s Guide this guide Board CD ROM API PAC W32 First step guide ...

Page 3: ...without notice All relevant issues have been considered in the preparation of this document Should you notice an omission or any questionable item in this document please feel free to notify CONTEC CO LTD Regardless of the foregoing statement CONTEC assumes no responsibility for any errors that may appear in this document nor for results obtained by the user as a result of using this product Trade...

Page 4: ...ion 5 Handling Precautions 6 Environment 7 Inspection 7 Storage 7 Disposal 7 2 SETUP 9 What is Setup 9 Using the Board under Windows Using the Driver Library API PAC W32 9 Using the Board under Windows Using Software Other than the Driver Library API PAC W32 9 Using the Board under an OS Other than Windows 10 Step 1 Installing the Software 11 Starting the Install Program 11 Selecting the Counter B...

Page 5: ...he On Board Connectors 29 Connecting a Board to a Connector 29 Interface Connector Signal Assignment 30 Connection Method to the External device1 Photo coupler isolated Input 33 Photo coupler isolated Input Connection 33 Photo coupler Isolated Input Circuit 33 Example Connection with a Rotary Encoder 34 Example Connection with a Linear Scale 34 Connection Method to the External device2 TTL Level I...

Page 6: ...er 43 Digital Filter 43 Programmable Timer 44 One shot Pulse 44 Status Data 45 5 ABOUT SOFTWARE 47 CD ROM Directory Structure 47 About Software for Windows 48 Accessing the Help File 49 Using Sample Programs 50 Uninstalling the Driver Libraries 52 About Software for Linux 53 Driver Software Install Procedure 53 Accessing the Help File 54 Using Sample Programs 54 Uninstalling the driver 54 6 ABOUT ...

Page 7: ...vi CNT24 4 PCI H ...

Page 8: ...your favorite programming language supporting Win32 API functions such as Visual Basic or Visual C C Example Linear Scale Detecting a position of the table of a machine tool Processing thing Tool Power supply RelayBOX CNT24 4 PCI H Encoder Detecting a change in weight Power supply Rack CNT24 4 PCI H Features It is equipped with four channels of 24 bit up down counters The board can count two phase...

Page 9: ...requires 50 MB of free hard disk space Linux version of general purpose COUNT driver API CNT LNX Supplied within the same CD ROM of API PAC W32 This driver is used to control CONTEC counter boards PC Cards You can control CONTEC counter boards easily using the shared library used by gcc Kylix the device driver module for each kernel version and the board PC Cards configuration program config CONTE...

Page 10: ...P 5 5m Shield cable with one end 37 pin D SUB connector PCA37PS 0 5P 0 5m PCA37PS 1 5P 1 5m PCA37PS 3P 3m PCA37PS 5P 5m 30 pin Pinhead Connector to 37 pin D SUB Connector DT B2 0 5m Conversion Flat Cable DT O 1 5m 37 pin D SUB male connector Five piece set CN5 D37M Accessories Option Screw terminal EPD 37A 1 Screw terminal Screw Up type EPD 37 1 Terminal unit for solderless terminal M3 DTP 3 PC Te...

Page 11: ...rge only when this device is returned freight prepaid with a copy of the original invoice and a Return Merchandise Authorization to the distributor or the CONTEC group office from which it was purchased This warranty is not applicable for scratches or normal wear but only for the electronic circuitry and original boards The warranty is not applicable if the device has been tampered with or damaged...

Page 12: ...estruction of equipment and resources Understand the meanings of these labels to operate the equipment safely DANGER DANGER indicates an imminently hazardous situation which if not avoided will result in death or serious injury WARNING WARNING indicates a potentially hazardous situation which if not avoided could result in death or serious injury CAUTION CAUTION indicates a potentially hazardous s...

Page 13: ...terminals with industrial alcohol Do not install or remove the board to or from the expansion slot while the computer s power is turned on Otherwise the board may malfunction overheat or cause a failure Be sure that the personal computer s power is turned off Make sure that your PC or expansion unit can supply ample power to all the boards installed Insufficiently energized boards could malfunctio...

Page 14: ...ads of the bus connector have no stain or corrosion Check that the board has no dust or foreign matter adhering Check that the bus connector of the board and its cable have been plugged correctly Storage When storing this product keep it in its original packing form 1 Put the board in the storage bag 2 Wrap it in the packing material then put it in the box 3 Store the package at room temperature a...

Page 15: ...1 Before Using the Product 8 CNT24 4 PCI H ...

Page 16: ...ware and hardware You can use the diagnosis program later to check whether the software and hardware function normally Step 1 Installing the Software Step 2 Setting the Hardware Step 3 Installing the Hardware Step 4 Initializing the Software Step 5 Checking Operations with the Diagnosis Program If Setup fails to be performed normally see the Setup Troubleshooting section at the end of this chapter...

Page 17: ... this guide This chapter Step 2 Setting the Hardware Chapter 3 External Connection Chapter 5 About Software Chapter 6 About Hardware For using the board under an OS such as MS DOS other than Windows see the following parts of this guide This chapter Step 2 Setting the Hardware Chapter 3 External Connection Chapter 6 About Hardware ...

Page 18: ...ng system as Windows XP Although some user interfaces are different depending on the OS used the basic procedure is the same Starting the Install Program 1 Load the CD ROM API PAC W32 on your PC 2 The API PAC W32 Installer window appears automatically If the panel does not appear run CD ROM drive letter AUTORUN exe 3 Click on the Install the drivers button CAUTION Before installing the software in...

Page 19: ... H Selecting the Counter Board Driver 1 The following dialog box appears to select Driver Type and Install Type 2 Select For Counter Board API CNT 98 PC NT 3 Select Driver Help etc Full install 4 Click on the Install button ...

Page 20: ... file check boxes are displayed When you are installing the software or hardware for the first time 1 Uncheck Perform a hardware setup now 2 Click on the Finish button Go to Step 2 to set and plug the hardware When the hardware has already been installed Check Perform a hardware setup now API TOOL Configuration then go to Step 4 Initializing the Software You have now finished installing the softwa...

Page 21: ... can be set up even with the factory defaults untouched You can change board settings later Parts of the Board and Factory Defaults Figure 2 1 shows the names of major parts on the board Note that the switch setting shown below is the factory default SW1 BOARD ID CN2 BOARD ID Setting Switch 0 1 2 3 4 5 6 7 9 A B C D E F 8 CN1 CNT24 4 PCI H SW1 BOARD ID Interface connector for TTL level input CN2 I...

Page 22: ...them The board IDs can be set from 0 to Fh to identify up to sixteen boards If only one board is used the original factory setting Board ID 0 should be used Setting Procedure To set the board ID use the rotary switch on the board Turn the SW1 knob to set the board ID as shown below BOARD ID Board ID 0 Factory setting SW1 0 1 2 3 4 5 6 7 9 A B C D E F Figure 2 2 Board ID Settings SW1 ...

Page 23: ...I bus slot 3 3 V PCI bus slot A B Slit for 5 V PCI bus slot Slit for 3 3 V PCI bus slot CAUTION Do not touch the board s metal plated terminals edge connector with your hands Otherwise the board may malfunction overheat or cause a failure If the terminals are touched by someone s hands clean the terminals with industrial alcohol Do not install or remove the board to or from the slot while the comp...

Page 24: ...stall the board first determine what PC resources are free to use The resources used by each PCI bus board do not depend on the location of the PCI bus slot or the board itself If you remove two or more boards that have already been installed and then remount one of them on the computer it is unknown that which one of the sets of resources previously assigned to the two boards is assigned to the r...

Page 25: ...oard Source folder The setup information INF file is contained in the following folder on the bundled CD ROM Windows XP 2000 INF Win2000 Cnt PCI Windows Me 98 95 INF Win95 Cnt PCI Example of specifying the folder for use under Windows XP INF Win2000 Cnt PCI The name of the board you have just added is displayed CNT24 4 PCI H ...

Page 26: ...s dialog box appears only indicating that the relevant driver has not passed Windows Logo testing and it can be ignored without developing any problem with the operation of the board In this case click on the Continue Anyway button You have now finished installing the software The name of the board you have just added is displayed CNT24 4 PCI H ...

Page 27: ... the Driver library Invoking API TOOL Configuration 1 Open the Start Menu then select Programs CONTEC API PAC W32 API TOOL Configuration 2 Click on the CNT icon API TOOL Configuration detects hardware automatically The detected boards are listed Updating the Settings 1 Select Save settings to registry from the File menu You have now finished installing the initial setting of Software ...

Page 28: ... an external device to check whether count values are displayed correctly and whether signals are successfully turned on off See the following section about how they are connected Connection diagram Use the following connection to connect the rotary encoder to the photo coupler isolated input For the details on the example connection of input and signal position see Chapter 3 External Connection I...

Page 29: ...e Diagnosis Program Starting the Diagnosis Program Select the board in the API TOOL Configuration Windows then run the Diagnosis Program Follow the instructions on screen The name of the board you are testing is displayed CNT24 4 PCI H ...

Page 30: ...ode setting dialog box appears 2 Setting the channel 0 Select Photo coupler isolated input for Signal Source Use default data for other settings Because other three channels should be the same settings click Use Same Mode then Click on the Counter Mode Button Select the Photo coupler isolated input Click on the Use Same ...

Page 31: ...2 Setup 24 CNT24 4 PCI H 3 Click on the End button to finish condition setting Click on the End Button ...

Page 32: ... check the basic operations of the counter Counter Start Starts the counter Zero Clear Clears the counter to zero Counter Stop Stops the counter 1 Click on the Counter Start 2 The count value of each counter and their status AI U A B and Z will be displayed Click on the Counter Start Button ...

Page 33: ...ed as a text file CntRep txt in the install folder Program Files CONTEC API PAC W32 The Diagnosis Program performs board presence absence check interrupt test driver file test board setting test and so on 2 A diagnosis report is shown below CAUTION Before executing diagnosis report output unplug the cable from the board Click on the Diagnosis Report Button The name of the board you have tested is ...

Page 34: ...o set an appropriate mode The board works with the Diagnosis Program but not with an application The Diagnosis Program is coded with API TOOL functions As long as the board operates with the Diagnosis Program it should operate with other applications as well In such cases review your program while paying attention to the following points Check the arguments to functions and their return values Con...

Page 35: ...2 Setup 28 CNT24 4 PCI H ...

Page 36: ...o input external pulse signals use the interface connector on the board Use CN1 for the photo coupler isolated input For TTL level input connect CN2 to an external device by connecting the optional cable CN2 Matched pulse output is output from CN1 Photo coupler isolated open collector output SW1 BOARD ID CN2 CNT24 4 PCI H CN1 Photo coupler isolated input CH0 to CH3 Matched pulse output CH0 to CH3 ...

Page 37: ...N Phase A UP Not Connected General purpose Input Phase Z CLR Phase B DOWN Phase A UP Plus Common Not Connected Minus Common CH3 Output CH2 Output CH1 Output CH0 Output Plus Common 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 P3P P3U P3Z P3B P3A N C P2U P2Z P2B P2A P2P N C OUTN OUT3 OUT2 OUT1 OUT0 OUTP N C P1P P1U P1Z P1B P1A N C P0U P0Z P0B ...

Page 38: ...A7 A8 A9 A10 A11 A12 A13 A14 A15 T0A N C GND 1 GND 1 GND 1 GND 1 GND 1 GND 1 GND 1 T3A GND 1 T2U T2Z T2B Vcc 1 Phase A UP Not Connected Ground Ground Ground Ground Ground Ground Ground Phase A UP Ground General purpose Input Phase Z CLR Phase B DOWN 5V 2 CH1 CH3 CH2 CH0 CH2 CH3 1 The VCC and GND signals are all common The maximum current flowing through these two Vcc pins together is 500mA 2 Outpu...

Page 39: ...Phase A UP Phase B DOWN Phase Z CLR General purpose Input Not Connected Not Connected CH1 5V 2 5V 2 Not Connected Phase A UP Phase B DOWN Phase Z CLR General purpose Input Ground Phase A UP Phase B DOWN Phase Z CLR General purpose Input Not Connected CH2 CH3 1 The VCC and GND signals are all common The maximum current flowing through these two Vcc pins together is 500mA 2 Outputs 5V power supplied...

Page 40: ... this does not need to be connected Photo coupler Isolated Input Circuit 220Ω Photo coupler 2 2kΩ Board External device Input pin 5V Plus Common Signal output of external device 220Ω 2 2kΩ 12V 400Ω R Photo coupler Plus Common Input pin Signal output of external device Figure 3 8 Example Connection with the Photo Coupler Isolated Input Circuit CAUTION The general input signal uses the same circuit ...

Page 41: ...position of R If using 5V it is not required Figure 3 9 Example Connection with a Rotary Encoder photo coupler isolated input Example Connection with a Linear Scale Pin No of Connector CH0 8 CH2 27 CH1 18 CH3 37 CNT24 4 PCI H CN1 Power supply 0V Shield CH0 9 CH2 28 CH1 14 CH3 33 CH0 10 CH2 29 CH1 15 CH3 34 CH0 11 CH2 30 CH1 16 CH3 35 Phase A Plus Common R R R Phase B Phase Z Phase A Phase B Phase ...

Page 42: ... connect to either phase A or phase B If not using the phase Z this does not need to be connected TTL Level Input Circuit Board Internal Circuits Ground Output pin Remote Device Plus Common Minus Common Diode 5V Input pin ALS541 5V 10kΩ External Power Supply 5VDC Diode Figure 3 11 TTL Level Input Circuit and Connection Example CAUTION The general input signal uses the same circuit structure The ca...

Page 43: ...eld Encoder Phase A Phase B Phase Z Phase A Phase B Phase Z Figure 3 12 Example Connection with a Rotary Encoder TTL level Input Example Connection with a Linear Scale CNT24 4 PCI H 0V CH0 10 CH2 29 CH1 15 CH3 34 CH0 11 CH2 30 CH1 16 CH3 35 Option cable GND 1 to 7 13 32 CN2 Pin No of Connector CH0 9 CH2 28 CH1 14 CH3 33 Power supply Shield Phase A Phase B Phase Z Phase A Phase B Phase Z Pin number...

Page 44: ...ernal power supply is needed to run the board output Output Circuit and an Example Connection Output pin Photo coupler 1kΩ Plus Common Minus Common Vcc 18kΩ External Power Supply 5V 12VDC Photo coupler Load Load 1kΩ Figure 3 14 Output Circuit and an Example Connection CAUTION The output of this board has no surge voltage protector To drive an inductive load such as a relay or lamp using this board...

Page 45: ...can cause the transistor to gradually deteriorate or even completely damage the transistor Therefore when driving an induction load such as a relay coil you should always connect a surge absorbing device The following illustrates a surge voltage countermeasure that can be employed Examples of use of relay coil Examples of use of lump Diode Relay coil External power voltage Zener diode voltage Zene...

Page 46: ...ith Gate Control Asynchronous Clear Multiply by 2 2 phase Input Two phase pulse input consists of a phase A pulse advanced signal and a phase B delayed signal pulse that have 90 degrees of phase difference If the phase Z reference position signal is used a Z pulse will reset count value of the two phase pulse input to zero 0 1 2 Count operation for incremental counting in the CW direction When dec...

Page 47: ... pulse Phase B DOWN Count value Figure 4 2 Example counting during single phase input Single phase Input with Gate Control The counter can be started and stopped by using a gate control signal along with the single phase pulse stream 7 8 6 9 Series of single phase pulses Phase A UP Gate control signal Phase B DOWN Count operation for incremental counting in the CW direction When decremental counti...

Page 48: ...ultiply by 2 Multiply by 4 Figure 4 4 Example counting when count input multiplication is set Synchronous Clear If a counter is set for CW clockwise direction Up count and phase Z positive logic within a low level input of phase B a high level signal of phase Z input will reset the count value of this counter after this phase Z input signal goes to low level the following rising edge of the phase ...

Page 49: ...ut remains low When phase Z negative logic is used the signal is enabled while the phase Z input remains low Figure 4 6 Example counting during asynchronous clear Phase Z CLR Input Phase Z is the signal to clear the counter to zero The number of phase Z inputs can be specified by software Phase Z input Disable phase Z input Counter 0 Ignored Phase Z input Enable the next phase Z input only once Co...

Page 50: ... the digital filter outputs HIGH or LOW and communicates it to the counter circuit The cycle can be set in a range of 0 1µsec through 1 056 1µsec All externally input signals except for general purpose input signals are fetched through the digital filter into the internal counter They are fetched after a delay of four set sampling cycle clocks When initialized externally input signals are fetched ...

Page 51: ...ot Pulse When the count value of a channel matches a preset compare value this channel will generate a one shot pulse The width of this pulse is the same for all channels and is determined by set data The width can be set in a range of 0 through 104 45msec CAUTION The default state is set to pulse width 0 do not output Pulse widths may slightly vary depending on the specifications of a connected l...

Page 52: ...input status 1 0 Phase A input status 0 B Indicates phase B input status 1 Phase B input status 1 0 Phase B input status 0 U D Count direction operating status This status bit indicates the direction in which the current up down counter is operating 0 Engaged in counting up 1 Engaged in counting down EQ Detects and outputs match or mismatch 0 The count value matches compare register s contents 1 T...

Page 53: ...4 Function 46 CNT24 4 PCI H ...

Page 54: ...ml Version information on each API TOOL English APIPAC Each installer AIO DISK1 DISK2 DISKN AioWdm CNT DIO HELP HELP file Aio Cnt INF Each INF file for OS WDM Win2000 Win95 linux Linux driver file cnt dio Readme Readme file for each driver Release Driver file on each API TOOL API_NT For creation of a user specific install program API_W95 UsersGuide Hardware User s Guide PDF files ...

Page 55: ...ster of a specified channel Set for using hardware digital filter function to prevent signal chattering Pre set a target data and to allow the counter to output a one shot pulse when the count data of this specified channel matched this target data For details refer to the help file The help file provides various items of information such as Function Reference Sample Programs and FAQs Use them for...

Page 56: ...out Software CNT24 4 PCI H 49 Accessing the Help File 1 Click on the Start button on the Windows taskbar 2 From the Start Menu select Programs CONTEC API PAC W32 Cnt API CNT HELP to display help information ...

Page 57: ...sic applications To use each sample program enter its driver number and group number set by API TOOL Configuration in the DrvNo and GrpNo fields Use these sample programs as references for program development and operation check The sample programs are stored in Program Files CONTEC API PAC W32 Cnt Samples ...

Page 58: ...T24 4 PCI H 51 Sample Programs Examples Counter Sample CNT1 Basic actions of counting input signals Timer Sample CNT2 Using programmable timer to generate interrupt requests periodically Sample program 1 Sample program 2 ...

Page 59: ...re below 1 Click on the Start button on the Windows taskbar From the Start Menu select Control Panel 2 Double click on the Add or Remove Programs in the Control Panel 3 Select CONTEC API CNT 98 PC xx and then click on the Change Remove button Follow the on screen instructions to uninstall the function libraries ...

Page 60: ...d as a compressed file linux cnt ccntXXX tgz on the bundled API PAC W32 CD ROM Note XXX represents the driver version Mount the CD ROM as shown below copy the file to an arbitrary directory and decompress the file to install the driver For details on using the driver refer to readme txt and the help file in HTML format extracted by installation To install the driver log in as a super user Decompre...

Page 61: ...le Programs Sample programs have been prepared for specific basic applications Sample programs for each language are contained in the contec ccnt samples directory For compiling them refer to the manual for the desired language Uninstalling the driver To uninstall the driver use the uninstall shell script contained in the contec ccnt directory For details check the contents of the script ...

Page 62: ... input 1MHz duty 50 Max Interrupt level One interrupt caused upon channel count match or timer time out External power 5V 12VDC 10 Min 400mA Required for photo coupler isolated input Photo coupler input current Photo coupler primary current 15 25mA Digital filter 0 1µsec 1056 1µsec can be independently set for each channel Timer 1msec 200sec Match signal output Output point 1 x 4 channels Output t...

Page 63: ...T24 4 PCI H PCI Bus Interface Sampling clock 16 bit counter for digital filter 24 bit read register 24 bit counter 24 bit comparator 24 bit compare register One shot pulse output System clock 20MHz Photo coupler isolated input x 4 channels TTL level input x 4 channels One shot pulse output x 4 channels Photo coupler open collector output PCI Bus Digital filter Selector Buffer Figure 6 1 Block Diag...

Page 64: ...differences in specifications as shown below CNT24 4 PCI CNT24 4 PCI H I O address 8 bits x 4 ports boundary 8 bits x 32 ports boundary Power consumption 5VDC 400mA Max 5VDC 250mA Max PCI bus specification 32bit 33MHz 5V 32bit 33MHz Universal key shapes supported Supply 5V to the 5V pin Interrupt signal resource setting Set to select whether to use jumper JP1 Automatically set by PC Dimension mm 1...

Page 65: ...ka 555 0025 Japan Japanese http www contec co jp English http www contec com Chinese http www contec com cn No part of this document may be copied or reproduced in any form by any means without prior written consent of CONTEC CO LTD 10172006 02082005 Management No A 51 004 10172006 Parts No LYES101 ...

Reviews: