Contec CNT24-4(PCI), CNT24-4(PCI)H User Manual

Page 1
PC-HELPER
4ch 24Bit Up/Down Counter Board for PCI
CNT24-4(PCI)H
User’s Guide
CONTEC CO.,LTD.
Page 2

Check Your Package

Thank you for purchasing the CONTEC product. The product consists of the items listed below. Check, with the following list, that your package is complete. If you discover damage d or missing item s,
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
First step guide
CD-ROM
[API-PAC(W32)]
i
Page 3

Copyright

Copyright 2005 CONTEC CO., LTD. ALL RIGHTS RESERVED No part of this document may be copied or reproduced in any form by any means without prior written
consent of CONTEC CO., LTD.
CONTEC CO., LTD. makes no commitment to update or keep current the information contained in this document. The information in this document is subject to change 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 no r for re sult s obt ain ed by th e use r as a resu lt of usi ng th is produ ct .

Trademarks

MS, Microsoft, Windows, Windows NT and MS-DOS are trademarks of Microsoft Corporation. Other brand and product names are trademarks of their respective holder.
ii
Page 4

Table of Contents

Check Your Pack ag e............................................................................................................................i
Copyright ............................................................................................................................................ ii
Trademarks .........................................................................................................................................ii
Table of Con tents...............................................................................................................................iii
1. BEFORE USING THE PRODUCT 1
About the Bo ard.................................................................................................................................. 1
Features........................................................................................................................................ 1
Support Softw ar e ......................................................................................................................... 2
Cable & Connect or ( Op ti on ) ..................................................................................................... 3
Accessories ( Op ti on ) ................................................................................................................. 3
Customer Supp o rt ............................................................................................................................... 4
Web Site....................................................................................................................................... 4
Limited Thre e- Y ear s Wa r ra n t y .......................................................................................................... 4
How to Obtain Serv ic e ....................................................................................................................... 4
Liability............................................................................................................................................... 4
Safety Precau t ion s .............................................................................................................................. 5
Safety Infor mat i on ....................................................................................................................... 5
Handling Pre ca u tio n s................................................................................................................... 6
Environment................................................................................................................................. 7
Inspection..................................................................................................................................... 7
Storage ......................................................................................................................................... 7
Disposal ....................................................................................................................................... 7
2. SETUP 9
What is Setup? .................................................................................................................................... 9
Using the Board un de r W in do w s Us in g th e D riv e r Lib ra r y A PI -PAC ( W 3 2) ............................ 9
Using the Board under Windows Using Software Other than the Driver Library
API-PAC(W32 )............................................................................................................................ 9
Using the Board un d er an OS O th e r th an Wi n do w s ................................................................. 10
Step 1 Installi n g the Software .......................................................................................................... 11
Starting the I ns t all P r og r a m....................................................................................................... 11
Selecting the Counter Bo ard Driver .......................................................................................... 12
Executing the In s tal l a tio n .......................................................................................................... 13
Step 2 Setting th e H ar d wa r e ............................................................................................................. 14
Parts of the Bo ard an d F ac to r y D ef au l ts ................................................................................... 14
Setting the Bo ard ID .................................................................................................................. 15
Plugging the Board .................................................................................................................... 16
iii
Page 5
Step 3 Installi ng th e H ard w a re .........................................................................................................17
Turning on the PC......................................................................................................................1 7
Setting with th e Fou n d Ne w H a rd war e W iz a rd......................................................................... 17
Step 4 Initi alizing the S o f tware........................................................................................................ 20
Invoking API-TOOL Configuration.......................................................................................... 20
Updating the S e ttin g s................................................................................................................. 20
Step 5 Checking Op e r ati o n s w ith th e D i ag no s is P rog ra m ............................................................... 21
What is the Di agno s is P r og r a m?................................................................................................ 21
Check Method ............................................................................................................................ 21
Using the Di agnosis Program.................................................................................................... 22
Setting coun t co nd i t ion s ............................................................................................................ 23
Setup Troubl esh oo ti n g...................................................................................................................... 27
Symptoms and A cti o ns .............................................................................................................. 27
If your proble m c a nno t b e r eso lv ed........................................................................................... 27
3. EXTERNAL CONNECTION 29
Using the On-Board Conne c t ors....................................................................................................... 29
Connecting a Bo ar d to a C onn e c to r........................................................................................... 29
Interface Con n ecto r S ig n al As si g n men t ....................................................................................3 0
Connection Meth o d to th e Ex te rn al de v ice 1 -Ph o to cou p l er is o lat ed I npu t -.................................... 33
Photo couple r is o la te d Inp u t Con n ec ti on .................................................................................. 33
Photo couple r Is o lat e d In pu t Ci r cu it .......................................................................................... 33
Example Connectio n wi th a Ro ta ry En co d er ............................................................................ 34
Example Conne ct io n wi th a Lin e a r Sc a le.................................................................................. 34
Connection Me th od to th e Ex t ern al d ev ic e 2 -TT L- Le v el I np ut - ...................................................... 35
TTL-Level Input Connection..................................................................................................... 35
TTL-Level Input Circuit ............................................................................................................ 35
Example Connectio n wi th a Ro ta ry En co d er ............................................................................ 36
Example Connectio n wi th a L in e ar Scale..................................................................................36
One-shot Pulse Outp u t Con n ec tio n ..................................................................................................37
One-shot Pulse Outp u t Co n n ec tio n ........................................................................................... 37
Output Circuit and an Ex a mpl e Con ne c t ion.............................................................................. 37
Surge Voltage Co un t e r meas u r es....................................................................................................... 38
iv
Page 6
4. FUNCTION 39
Types and Ope rat io n s of Pu l se S ign al s ............................................................................................ 39
Types of pulse si gn al s ................................................................................................................ 39
2-phase Inpu t.............................................................................................................................. 39
Single-phase Input ..................................................................................................................... 40
Single-phase Input with Gate Control....................................................................................... 40
Multiplication of Count In p ut.................................................................................................... 41
Synchronous Cl ear..................................................................................................................... 41
Asynchronous Clear................................................................................................................... 42
Phase Z/CLR In pu t .................................................................................................................... 42
Other Functio n .................................................................................................................................. 43
Compare Regis t er ...................................................................................................................... 43
Digital Filter............................................................................................................................... 43
Programmabl e Timer................................................................................................................. 44
One-shot Pulse ........................................................................................................................... 44
Status Data ................................................................................................................................. 45
5. ABOUT SOFTWARE 47
CD-ROM Directo r y S t ru c tu re .......................................................................................................... 47
About Software for Windo w s........................................................................................................... 48
Accessing the He lp F il e........................................................................................................ ..... 49
Using Sample Programs ............................................................................................................ 50
Uninstalling the Dr i v er Li b ra rie s .............................................................................................. 52
About Software for Linux ....................................................................................................... .......... 53
Driver Softwa re In s tal l Pro c ed ur e ............................................................................................. 53
Accessing the He lp F il e........................................................................................................ ..... 54
Using Sample Programs ............................................................................................................ 54
Uninstalling the driver............................................................................................................... 5 4
6. ABOUT HARDWARE 55
Hardware spe cification..................................................................................................................... 55
Block Diagra m.................................................................................................................................. 56
Differences be tw een C N T2 4 -4 (P C I)H a nd CN T 24 -4( P C I)............................................................. 57
v
Page 7
vi
Page 8

1. Before Using the Product

1. Before Using the Product
This chapter provides information you should know before using the product.

About the Board

The CNT24-4(PCI)H is a PCI bus-compliant interface board that counts input pulse signals from external devices.
The CNT24-4(PCI)H has four channels of 24-bit up/down counters, allowing external devices such as a rotary encoder and a linear scale to be connected. Given below are examples of using the board for “detecting a position of the table of a machine tool” and “detecting a change in weight”.
The pulse signal inputting interface is photo coupler isolated or TTL-level input. Using the bundled driver library [API-PAC(W32)], you can create Windows application software for
this board in your favorite programming language supporting Win32 API functions, such as Visual Basic or Visual C/C++.
< Example >
- Detecting a position of the table of a machine tool
Tool
Processing thing
- Detecting a change in weight
CNT24-4(PCI)H
Encoder
Rack
CNT24-4(PCI)H
RelayBOX
Linear Scale
Power supply
Power supply

Features

- It is equipped with four channels of 24-bit up/down counters.
- The board can count two-phase signals, which can be outputs of some rotary encoders and linear scales
- You can select either a photo coupler isolated input or a TTL-level input for each channel by software command.
- Each channel can generate an interrupt request signal and a one-pulse output signal when the count data matches a pre-specified value.
- The board is equipped with a programmable timer to allow interrupts to be generated periodically according to a specified timer value.
- Each Channel is equi pped with a general-purpose input signal (both photo coupler and TTL-level).
1
Page 9
1. Before Using the Product

Support Software

You should use CONTEC support software according to your purpose and development environment.
Driver Library
API-PAC(W32) is the library software that provides the commands for CONTEC hardware products in the form of Windows standard Win32 API functions (DLL). It makes it easy to create high-speed application software taking advantage of the CONTEC hardware using various programming languages that support Win32 API functions, such as Visual Basic and Visual C/C++. It can also be used by the installed diagnosis progra m to check hardware operations . CONTEC provides download services (at http://www.contec.com /apipac/) to supply the updated drivers and differential files. For details, read Help on the bundled CD-ROM or visit the CONTEC’s Web site.
< Operating environment > OS Windows XP, 2000, NT, Me, 98, etc.. Adaptation language Visual C/C++, Visual Basic, Delphi, Builder, etc.. Others Each piece of library software requires 50 MB of free hard disk space.
API-PAC(W32)
Linux version of general-purpose COUNT driver: 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). CONTEC provides download services (at http://www.contec.co.jp/enom/apipac/) to supply the updated drivers and differential files. For details, read Help on the bundled CD-ROM or visit the CONTEC’s Web site.
(Bundled)
API-CNT(LNX)
(Suppli ed wi th in th e s ame
< Operating environment > OS RedHatLinux, TurboLinux, etc..
(For details on supported distributions, refer to Help available after installation.) Adaptation language gcc, Kylix Others Each piece of library software requires 3 MB of free hard disk space.
Data acquisition VI library for LabVIEW
This is a VI library to use in National Instruments LabVIEW. VI-DAQ is created with a function form similar to that of LabVIEW's Data Acquisition VI, allowing you to use various devices without complicated settings. See http://www.contec.com/vidaq/ for details and download of VI-DAQ.
2
VI-DAQ
(Free download)
Page 10
1. Before Using the Product

Cable & Connector (Option)

Flat cable with both-ends 37-pin D-SUB connector : PCB37P-1.5 (1.5m)
: PCB37P-3 (3m) : PCB37P-5 (5m)
Shield cable with both-ends 37-pin D-SUB connector : PCB37PS-0.5P (0.5m)
: PCB37PS-1.5P (1.5m) : PCB37PS-3P (3m) : PCB37PS-5P (5m)
Flat cable with one-end 37-Pin D-SUB connector : PCA37P-1.5 (1.5m)
:PCA37P-3 (3m) :PCA37P-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 Co nnecto r : 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) Terminal unit for leads : DTP-4(PC) *1 Option cable PCB37P or PCB37PS is required separately.
* Check the CONTEC’s Web site for more information on these options.
3
Page 11
1. Before Using the Product

Customer Support

CONTEC provides the following sup port services for you t o use CONTEC products m ore efficiently and comfortably.

Web Site

Japanese http://www.contec.co.jp/ English http://www.contec.com/ Chinese http://www.contec.com.cn/
Latest product information CONTEC provides up-to-date information on products.
CONTEC also provides product manuals and various technical documents in the PDF.
Free download You can download updated driver software and differential files as we ll as sample program s available in
several languages.
Note! For product information Contact your retailer if you have any technical question about a CONTEC product or need its price, delivery time, or estimate information.

Limited Three-Years Warranty

CONTEC Interface boards are warranted by CONTEC CO ., LTD. to be free from defects in m aterial and workmanship for up to three years from the date of purchase by the original purchaser.
Repair will be free of charge only when this device is returned freight pre paid with a c opy of the ori ginal 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 through abuse, mistreatment, neglect, or unreasonable use, or if the ori ginal invoice is not included, in whi ch case repairs will be considered beyond the warranty policy.

How to Obtain Service

For replacement or repair, return the device freight prepaid, with a copy of the original invoice. Please obtain a Return Merchandise Authorization number (RMA) from the CONTEC group office where you purchased before returning any product.
* No product will be accepted by CONTEC group without the RMA number.

Liability

The obligation of the warrantor is solely to repair or replace the product. In no event will the warrantor be liable for any incidental or consequentia l damages due to s uch defect or consequences t hat arise from inexperienced usage, misuse, or malfunction of this device.
4
Page 12
1. Before Using the Product

Safety Precautions

Understand the following definitions and precautions to use the product safely.

Safety Information

This document provides safety i nformation usin g the following sym bols to prevent accidents resulting in injury or death and the destruction o f equipment and r esource s. Understa nd the meanings of the se labels to operate the equipment safely.
DANGER
WAR NI NG
CAUTION
DANGER indicates an imminently hazardous situation which, if not avoided, will result in death or serious injury.
WARNING indicates a potentially hazardous situation which, if not avoided, could result in death or serious injury.
CAUTION indicates a potentially hazardous situation which, if not avoided, may result in minor or moderate injury or in property damage.
5
Page 13
1. Before Using the Product

Handling Precautions

DANGER
Do not use the product where it is ex posed to flamm able or corro sive gas. Doing so may result i n an explosion, fire, electric shock, or failure.
CAUTION
- There are switches and jumpers on the board that need to be set in advance. Be sure to check these before installing the board.
- Only set the switches and jumpers on the board to the specified settings. Otherwise, the board may malfunction, overheat, or cause a failure.
- Do not strike or bend the board. Otherwise, the board may malfunction, overheat, cause a failure or breakage.
- 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 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 malfunction, overheat, or cause a failure.
- The specifications of this product are subject to change without notice for enhancement and quality improvement. Even when using the product continuously, be sure to read the manual and understand the contents.
- Do not modify the product. CONTEC will bear no responsibility for any problems, etc., resulting from modifying this product.
- Regardless of the foregoing statements, CONTEC is not liable for any damages whatsoever (including damages for loss of business profits) arising out of the use or inability to use this CONTEC product or the information contained herein.
6
Page 14
1. Before Using the Product

Environment

Use this product in the following environment. If used in an unauthorized environment, the board may overheat, malfunction, or cause a failure.
Operating temperature
0 - 50°C
Operating humidity
10 - 90%RH (No condensation)
Corrosive gases
None
Floating dust particles
Not to be excessive

Inspection

Inspect the product periodically as follows to use it safely.
- Check that the bus connector of the board and its cable have been plugged correctly.
- Check that the board has no dust or foreign matter adhering.
- The gold-plated leads of the bus connector have no stain or corrosion.

Storage

When storing this product, keep it in its original packing form. (1) Put the board in the storage bag. (2) Wrap it in th e pack ing mat eri al, t h en pu t it in th e bo x. (3) Store the package at room temperature at a place free from direct sunlight, moisture, shock,
vibration, magnetism, and static electricity.

Disposal

When disposing of the product, follow the disposal procedures stipulated under the relevant laws and municipal ordinances.
7
Page 15
1. Before Using the Product
8
Page 16

2. Setup

2. Setup
This chapter explains how to set up the board.

What is Setup?

Setup means a series of steps to take before the product can be used. Different steps are required for software and hardware. The setup procedure varies with the OS and applications used.
Using the Board under Windows
Using the Driver Library API-PAC(W32)
This section describes the setup procedure to be performed before you can start developing application programs for the board using the bund led C D -ROM “Driver Library API-PAC(W32)”.
Taking the following steps sets up the software 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.
Using the Board under Windows
Using Software Other than the Driver Library API-PAC(W32)
For setting up software other than API-PAC(W32), refer to the manual for that software. See also the following parts of this guide as required.
This chapter Step 2 Setting the Hardware This chapter Step 3 Installing the Hardware Chapter 3 External Connection Chapter 6 About Hardware
9
Page 17
2. Setup

Using the Board under an OS Other than Windows

For using the board under Linux, see the following parts of 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
10
Page 18

Step 1 Installing the Software

This section describes how to install the Driver libraries.
Before installing the hardware on your PC, install the Driver libraries from the bundled API-PAC(W32) CD-ROM.
The following description assumes the operating 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.
2. Setup
CAUTION
Before installing the software in Windows XP, 2000, or NT, log in as a user with administrator privileges.
11
Page 19
2. Setup

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.
.
.
12
Page 20
2. Setup

Executing the Installation

(1)
Follow the on-screen instructions to proceed to install.
(2) When the required files have been copied, the “Perform a hardware setup now” and “Show readme
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 software.
13
Page 21
2. Setup

Step 2 Setting the Hardware

This section describes how to set the board and plug it on your PC. The board may have some switches and jumpers that need to be preset.
Check the on-board switches and jumpers before plugging the board into an expansion slot. The board 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.
- Interface connector for TTL level inp ut (CN2)
CNT24-4(PCI)H
CN2
CN1
SW1
BOARD ID
- BOARD ID Setting Switch
8
9
7
A
6
B
5
4
3
E
2
F
1
0
SW1
BOARD ID
C
D
- Interface connector for opto-coupler resistance input (CN1)
Figure 2.1. Component Locations
14
Page 22
2. Setup

Setting the Board ID

If you install two or more CNT24-4(P CI)H boards on one pers onal com puter, ass ign a dif ferent ID value to each of the boards to di stin gu ish the m.
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 boar d. Turn t he SW1 knob to s et the boar d ID as shown
below.
SW1
BOARD ID
9
A
7
B
6
5
C
D
4
3
E
F
1
0
Factory setting:
(Board ID= 0)
2
Figure 2.2. Board ID Settings (SW1)
15
Page 23
2. Setup

Plugging the Board

(1) Before plugging the board, shut down the sys te m, unplug the po wer code of you r PC. (2) Remove the cover from the PC so that the board can be mounted. (3) Plug the board into an expansion slot. (4) Attach the board bracket to the PC with a screw. (5) Put the cover back into place.
Applicable PCI bus slots PCI bus slots used in PCs have keys to prevent 5V and 3.3V PCI bus boards from being accidentally
plugged into wrong bus slots. This board can be plugged into both of the 5V and 3.3V PCI bus slots.
<PCI bus slot> <PCI bus board>
5-V PCI bus slot
3.3-V PCI bus slot
3.3V key
CAUTION
5V key
A :
Slit for 5-V PCI bus slot
B :
Slit for 3.3-V PCI bus slot
AB
- 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 computer's or expansion unit’s pow er is turned on. Otherwise, the board may malfunction, overheat, or cause a failure. Be sure that the personal computer 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 malfunction, overheat, or cause a failure.
- A +5VDC Power supply from the PCI bus slot is required.
16
Page 24
2. Setup

Step 3 Installing the Hardware

For using an expansion board under Windows, you have to let the OS detect the I/O addresses and interrupt level to be used by the board . Th e proc ess is re f erred to as in st allin g th e h ardwa re.
In the case of using two or more boards, m ake sure y ou install one by on e with the Fo und Ne w Hardware Wizard.

Turning on the PC

Turn on the power to your PC.
CAUTION
- The board cannot be properly installed unless the resources (I/O addresses and interrupt level) for the board can be allocated. Before attempting t o install the boar d, first determ ine 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 previou sly assigned to the two boards is assigned to the remounted board. In this case, you must check the resource settings.

Setting with the Found New Hardware Wizard

(1) The “Found New Hardware Wizard” will be started.
Select “Install from a list or specific location[Advanced]”, then click on the [Next] button.
If you are using Windows NT 4.0, the “Found New Hardware Wizard” is not started.
Go to Step 4 “Initializing the Software”.
17
Page 25
2. Setup
(2) Specify that folder on the CD-ROM which contains the setup information (INF) file to register the
board.
* The name of the board you have just added is displayed.
- CNT24-4(PCI)H
Source folder The setup information (INF) file is contai ned 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
18
Page 26
2. Setup
CAUTION
- In Windows XP, the Hardware Wizard displays the following alert dialog box when you have located the INF file. This 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
19
Page 27
2. Setup

Step 4 Initializing the Software

The API function library requires the initial setting to recognize the execution environment. It is called the initialization of th e Dr iv er li b rary.

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.
20
Page 28
2. Setup

Step 5 Checking Operations with the Diagnosis Program

Use the diagnosis program to check that the board and driver software work normally, thereby you can confirm that they have been set up correctly.

What is the Diagnosis Program?

The diagnosis program diagnoses the states of the board and driver s of tware. It can also be used as a simple checker when an ex t ern al dev i ce i s actu al l y con ne ct ed . Using the “Diagnosis Report” feature reports the driver settings, the presence or absence of the board,
I/O status, and interrupt status.

Check Method

The diagnosis program tests the board actually connected to 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".
Encoder
Power supply
Phase-A
Phase-B
Phase-Z
0V
(Pin No. of Connector) CH0 : 8 CH2 : 27 CH1 : 18 CH3 : 37
CH0 : 9 CH2 : 28
R
CH1 : 14 CH3 : 33
CH0 : 10 CH2 : 29
R
CH1 : 15 CH3 : 34
CH0 : 11 CH2 : 30
R
CH1 : 16 CH3 : 35
Phase-A
Phase-B
Phase-Z
Plus Common
CN1
CNT24-4(PCI)H
Shield
* If you apply a 12V external power supply for this test, the resister R should be about 400Ω.
. However in case of 5V power supply, the R is not required.
Figure 2.3. Connection diagram
21
Page 29
2. Setup

Using the Diagnosis Program

Starting the Diagnosis Program Select the board in the API-TOOL Configuration Windows, then run the Diagnosi s Program. Follow the
instructions on screen.
* The name of the board you are testing is displayed.
- CNT24-4(PCI)H
22
Page 30
2. Setup
]
put]

Setting count conditions

(1) Change counter mode settings. Click on the [Counter Mode…].
The Counter Mode setting dialog box appears.
Click on the [Counter Mode
Button
(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.
Select the [Photo coupler isolated in
Click on the [Use Same
23
Page 31
2. Setup
(3) Click on the [End] button to finish condition setting.
Click on the [End] Button.
24
Page 32
Checking counter operations The following commands can be used to 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].
Click on the [Counter Start] Button
2. Setup
(2) The count value of each counter and their status (AI, U, A, B,and Z) will be displayed.
25
Page 33
2. Setup
Diagnosis Report (1) Clicking on the [Diagnosis Report] button displays detailed data such as board settings and the
diagnosis results while saving them in text format. The results are saved and displayed as a text file (CntRep.txt) in the install folder (Program Files\CONTEC\API-PAC(W32)). The Diagnosis Program performs “board presence/a bsence check”, “interrupt test”, “driver file test”, “board setting test”, and so on.
Click on the [Diagnosis Report] Button
(2) A diagnosis report is shown below.
* The name of the board you have tested is displayed.
- CNT24-4(PCI)H
CAUTION
Before executing diagnosis report output, unplug the cable from the board.
26
Page 34

Setup Troubleshooting

Symptoms and Actions

2. Setup
The board cannot be initialized [Windows NT 4.0 The driver may not yet be activated. When using the board under an OS not compliant with Plug and
Play, such as Windows NT 4.0, make sure that the [PnP OS] BIOS option has been set to [NO]. For details on BIOS settings, refer to the user’s guide for your PC.
Could not read counter data
- Confirm if the I/O address has been set correctly.
- The counter mode setting may be incorrect. The counter mode must be set according to the input signal format before the board can operate normally. Read the function description in API-CNT HELP or this manual to 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.
- Confirm whether the counter mode has been set correctly or not.
The OS won’t normally get started or detect the board. [Windows XP Turn off the power of your PC, then unplug the board. Restart the OS and delete the board settings of
API-TOOL Configuration. Turn off the PC again, plug the board, and restart the OS. Let the OS detect the board and use API-TOOL Configuration to register board settings.
]
2000]
,

If your problem cannot be resolved

Contact your retailer.
27
Page 35
2. Setup
28
Page 36

3. External Connection

3. External Connection
This chapter describes the interface connectors on the board and the external I/O circuits. Check the information available here when connecting an external device.

Using the On-Board Connectors

Connecting a Board to a Connector

To input external pu ls e sign a ls , use th e in te rf ace co nnec t or on th e boar d. 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)
CN2
Photo coupler isolated input
(CH0 to CH3)
Matched pulse output
(CH0 to CH3)
(CN1)
Option cable
DT/B2
Figure 3.1. Connecting the Interface Connector
CNT24-4(PCI)H
SW1
BOARD ID
TTL level input
(CH0 to CH3)
29
Page 37
3. External Connection

Interface Connector Signal Assignment

Use the on-board connector to connect the interface board to an external device.
Interface connector for the photo coupler isolated input(CN1)
37 36 18
21 2 20
CN1
- Connector used
19
37 pin D-SUB connector (Female type) DCLC-J37SAF-20L9 (made by JAE) or equivalent to it Rock nut UNC#4-40 (Thumbs screw)
- Applicable connector 17JE-23370-02 (D8C) [made by DDK, Male type]
1
FDCD-37P [made by Hirose, Male type] DC-37P-N [made by JAE, Male type]
Figure 3.2. Connector used(CN1)
19
37
18
36
17
35
16
34
15
33
14
32
13
31
12
30
11
29
10
28
9
27
8
26
7
25
6
24
5
23
4
22
3
21
2
20
1
CH3
CH2
Count-equal
matched pulse output
Plus Common
General-purpose Input
Phase-Z / CLR
Phase-B / DOWN
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
Each channel has an independent plus common. (Same for match outpu t)
P3P P3U P3Z P3B P3A N.C. P2U P2Z P2B P2A P2P N.C. OUTN OUT3 OUT2 OUT1 OUT0 OUTP
Figure 3.3. Pin Assignment of an interface connector(CN1)
N.C.
Not Connected
P1P
Plus Common
P1U
General-purpose Input
P1Z
Phase-Z / CLR
P1B
Phase-B / DOWN
P1A
Phase-A / UP
N.C.
Not Connected
P0U
General-purpose Input
P0Z
Phase-Z / CLR
P0B
Phase-B / DOWN
P0A
Phase-A / UP
P0P
Plus Common N.C. N.C. N.C. N.C.
Not Connected
N.C. N.C. N.C.
CH1
CH0
30
Page 38
Interface connector for the TTL-level input(CN2)
A15 A14 A13
A3 A2 A1
- Connector used PS-30PE-D4T1PN1(made by JAE) or equivalent to it
- Applicable connector PS-30SEN-D4P1-1C (made by JAE)
3. External Connection
B15 B14 B13
B3 B2 B1
Figure 3.4. Connector used(CN2)
B1
Not Connected General-purpose Input Phase-Z / CLR
CH1
Phase-B / DOWN Phase-A / UP Ground General-purpose Input Phase-Z / CLR
CH0
Phase-B / DOWN Not Connected General-purpose Input Phase-Z / CLR
CH3
Phase-B / DOWN
CH2
Phase-A / UP +5V*2
*1: The VCC and GND signals are all common. *2: Outputs +5V power supplied from the +5V pin in the PC to the external device.
The maximum current flowing through these two Vcc pins together is 500mA. Use this pin to supply +5V power to an external device (such as an encoder) for simple checking.
N.C. T1U T1Z T1B T1A GND*1 T0U T0Z T0B N.C. T3U T3Z T3B T2A Vcc*1
A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15
B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15
T0A
Phase-A / UP
N.C.
Not Connected
GND*1
Ground
GND*1
Ground
GND*1
Ground
GND*1
Ground
GND*1
Ground
GND*1
Ground
GND*1
Ground
T3A
Phase-A / UP
GND*1
Ground
T2U
General-purpose Input
T2Z
Phase-Z / CLR
T2B
Phase-B / DOWN
Vcc*1
+5V*2
Figure 3.5. Pin Assignment of an interface connector(CN2)
1
19
20 212
3618 37
CH0
CH3
CH2
30 pin connector (Connect to the CN2)
* 37 pin D-SUB connector is the same as with the CN1.
37 pin D-SUB connector (Connect to the external device)
Figure 3.6. Optional Cable DT/B2
31
Page 39
3. External Connection
1
20
2
21
3
22
4
23
5
24
6
25
7
26
8
27
9
28
10
29
11
30
12
31
13
32
14
33
15
34
16
35
17
36
18
37
19
+5V*2
Vcc*1
+5V*2
Vcc*1 N.C. N.C. N.C. N.C. N.C. N.C. T2A T2B T2Z T2U GND*1 T3A T3B T3Z T3U N.C.
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
Not Connected Phase-A / UP Phase-B / DOWN
CH0
Phase-Z / CLR General-purpose Input Ground Phase-A / UP Phase-B / DOWN
CH1
Phase-Z / CLR General-purpose Input Not Connected Not Connected
GND*1 GND*1
Ground
*1: The VCC and GND signals are all common. *2: Outputs +5V power supplied from the +5V pin in the PC to the external device.
The maximum current flowing through these two Vcc pins together is 500mA. Use this pin as +5V power supply to an external device (such as an encoder) for simple checking.
GND*1 GND*1 GND*1 GND*1 GND*1 N.C. T0A T0B T0Z T0U GND*1 T1A T1B T1Z T1U N.C. N.C.
Figure 3.7. Pin Assignments of an optional cable 37-Pin D-SUB
CH2
CH3
32
Page 40
3. External Connection
Connection Method to the External device 1
-Photo coupler isolated Input-

Photo coupler isolated Input Connection

Photo coupler isolated input connection with a rotary encoder or a linear scale open collector output circuit is shown in the Figure. The maximum input frequency is 500KHz.
For a two-phase input, connect both phase A and phase B. For a single phase input, connect to either phase A or phase B. If not using the Z ph ase, this does not need to be connected .

Photo coupler Isolated Input Circuit

External device
Board
2.2k Photo coupler
220
Plus Common
+5V
2.2k Photo coupler
220
Input pin
Input pin
400
R
Signal output of
external device
Plus Common +12V
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 structure.
- To use external power (other than 5V); insert a current limiting resistor at the R position. The following expression is used to calculate current limiting resistance R with the external power supply as PV:
P-5
20
P-5
<
<
Rk
15
If P=12, use a 350Ω < R < 470Ω resistor.
33
Page 41
3. External Connection

Example Connection with a Rotary Encoder

(Pin No. of Connector)
Power supply
Phase-A
Phase-B
Phase-Z
Encoder
* If using 12V, 400 register is required in the position of R.
If using 5V, it is not required.
0V
Shield
CH0 : 8 CH2 : 27 CH1 : 18 CH3 : 37
CH0 : 9 CH2 : 28
R
CH1 : 14 CH3 : 33
CH0 : 10 CH2 : 29
R
CH1 : 15 CH3 : 34
CH0 : 11 CH2 : 30
R
CH1 : 16 CH3 : 35
Phase-A
Phase-B
Phase-Z
Plus Common
CN1
CNT24-4(PCI)H
Figure 3.9. Example Connection with a Rotary Encoder (photo coupler isolated input)

Example Connection with a Linear Scale

Power supply
Phase-A
Phase-B
Phase-Z
(Pin No. of Connector) CH0 : 8 CH2 : 27 CH1 : 18 CH3 : 37
CH0 : 9 CH2 : 28
R
CH1 : 14 CH3 : 33
CH0 : 10 CH2 : 29
R
CH1 : 15 CH3 : 34
CH0 : 11 CH2 : 30
R
CH1 : 16 CH3 : 35
Phase-A
Phase-B
Phase-Z
Plus Common
CN1
CNT24-4(PCI)H
0V
Shield
* If using 12V, 400 register is required in the position of R.
If using 5V, it is not required.
Figure 3.10. Example Connection with a Linear Scale (photo coupler isolated input)
34
Page 42
3. External Connection
Connection Method to the External device 2
-TTL-Level Input-

TTL-Level Input Connection

Use the TTL-Level Input for the connection with a rotary encoder or a linear scale TTL-level output circuit. The maximum input frequency is 1MHz.
For a two-phase input, connect both phase A and phase B. For a single phase input, connect to either phase A or phase B. If not using the ph ase Z, this does not need to be conn ected .

TTL-Level Input Circuit

External Power Supply
+5VDC
Board
Remote Device
ALS541
+5V
Diode
+5V
10k
Plus
Common
Internal Circuits
Input pin
Diode
Ground
Output pin
Minus
Common
Figure 3.11. TTL-Level Input Circuit and Connection Example
CAUTION
- The general input signal uses the same circuit structure.
- The cable should be 1.5m or less.
- To prevent malfunction caused by noise, separate the circuit as much as possible from other signal cables and noise sources.
35
Page 43
3. External Connection

Example Connection with a Rotary Encoder

Power supply
(Pin No. of Connector)
CN2
Encoder
Phase-A
Phase-B
Phase-Z
0V
CH0 : 9 CH2 : 28 CH1 : 14 CH3 : 33
CH0 : 10 CH2 : 29 CH1 : 15 CH3 : 34
CH0 : 11 CH2 : 30 CH1 : 16 CH3 : 35
1 to 7, 13, 32
Phase-A
Phase-B
Phase-Z
GND
CN2
CNT24-4(PCI)H
Shield * Pin numbers in the diagram shows 37 pin D-SUB connector on the Option Cable.
Option cable
Figure 3.12. Example Connection with a Rotary Encoder (TTL-level Input)

Example Connection with a Linear Scale

Power supply
(Pin No. of Connector) CH0 : 9 CH2 : 28
Phase-A
CH1 : 14 CH3 : 33
CH0 : 10 CH2 : 29
Phase-B
CH1 : 15 CH3 : 34
CH0 : 11 CH2 : 30
Phase-Z
CH1 : 16 CH3 : 35
0V
1 to 7, 13, 32
Shield
* Pin numbers in the diagram shows 37 pin D-SUB connector on the Option Cable.
Figure 3.13. Example Connection with a Linear Scale (TTL-level Input)
Phase-A
Phase-B
Phase-Z
GND
Option cable
CN2
CNT24-4(PCI)H
36
Page 44
3. External Connection

One-shot Pulse Output Connection

One-shot Pulse Output Connection

When the count value of each channel and the user set value match, the circuit outputs a matched signal for one shot (1 pulse). The signal output part uses the open collector method by photo c oupler ins ulation. As a result, an external power supply is needed to run the board output.

Output Circuit and an Example Connection

Vcc
1k
Photo coupler
18k
Plus Common
Load
1k
Photo coupler
Output pin
Minus Common
Load
External Power Supply 5V - 12VDC
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, apply surge voltage protection to the load side. For surge voltage protection, see “Surge Voltage Countermeasures” in the next section.
37
Page 45
3. External Connection

Surge Voltage Countermeasures

When connecting a load that generates surge voltages and inrush currents, such as an induction load (relay coil) or an incandesc en t ligh t bulb , to the control output signal, appropriate protection must be provided in order to prevent damage to t he output sta ge or a malfunc tion due to no ise. The rapid shutof f of a coil, such as a relay, generates a sudden high-voltage pulse. If this voltage exceeds the voltage tolerance level of the output transistor, it 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
Diode
Output pin
Ground
Examples of use of lump
Surge current prevention
Output pin
resistor
Output pin
Relay c oil
Ground
External power voltage < Zener diode voltage
Output pin
Relay coil
Zener diode
Dark-lighting bypass resistor
Ground
Ground
Figure 3.15. Samples of Surge Voltage Protection
CAUTION
The protection circuit will not be effective unless it is installed less than 50cm from the load and contact.
38
Page 46

4. Function

4. Function
This section describes the features of the board.

Types and Operations of Pulse Signals

Types of pulse signals

The following types of pulse signals (o peration modes) can be set.
- 2-phase Input, Synchronous Clear, Multiply by 1
- 2-phase Input, Synchronous Clear, Multiply by 2
- 2-phase Input, Synchronous Clear, Multiply by 4
- 2-phase Input, Asynchronous Clear, Multiply by 1
- 2-phase Input, Asynchronous Clear, Multiply by 2
- 2-phase Input, Asynchronous Clear, Multiply by 4
- Single-phase Input, Asynchronous Clear, Multiply by 1
- Single-phase Input with Gate Control, Asynchronous Clear, Multiply by 1
- Single-phase Input with 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.
Phase-A (Phase-A/UP)
Phase-B (Phase-B/DOWN)
Phase-Z (Phase-Z/CLR)
Count value
* Count operation for incremental counting in the CW direction.
When decremental counting in the CW direction is set, the PC Card performs decremental counting at the rising edge of the phase-A signal.
* The minimum phase difference between phases-A and B is 300 nsec.
Counting is not performed normally if the phase difference is less than 300 nsec.
01 2
Phase-A difference of 300 nsec is required.
Figure 4.1. Example counting during 2-phase input
39
Page 47
4. Function

Single-phase Input

For a single-phase input, the count increments when an UP pulse is inputted and decremented wh en a DOWN pulse is inputted. T he coun t re ma ins un chan ged if UP and DOWN pu lse s a re inpu tted simultaneously.
UP pulse (Phase-A/UP)
DOWN pulse (Phase-B/DOWN)
Count value
* Count operation for incremental counting in the CW direction. When decremental counting in the CW direction is set, the PC Card performs decremental counting at the rising edges of positive pulse and incremental counting at the rising edges of negative pulses.
67 85 76
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.
Series of single-phase pulses (Phase-A/UP)
Gate control signal (Phase-B/DOWN)
No counting
Count value
* Count operation for incremental counting in the CW direction.
When decremental counting in the CW direction is set, the PC Card performs decremental counting at the rising edges of the single-phase pulse train (phase-A/UP) while the gate control signal (phase-B/DOWN) goes high and stops counting while the gate control signal goes low.
Figure 4.3. Example counting during single-phase input with gate control
786 9
40
Page 48
4. Function

Multiplication of Count Input

Setting the count input multiplication setting to two or four times enables you to fine-tune controlling.
During 2-phase input
When clockwise is specified
A
BB
When counterclockwise is specified
A
Multiply by 1
Multiply by 2
Multiply by 4
Single-phase input
UP
DOWN
Multiply by 1
Single-phase input is set only to multiply-by-1 mode. Multiply-by-2 or any other higher setting is not available.
Multiply by 1 Multiply by 2 Multiply by 4
Single-phase input with gate control attached
A
B
Multiply by 1 Multiply by 2
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; afte r this phase-Z input signal goes to low level, the following rising edge of the phase-A signal will start the counting operation..
Phase-A (Phase-A/UP)
Phase-B (Phase-B/DOWN)
Phase-Z (Phase-Z/CLR)
Count value
* When decremental counting in the CW direction is set, the board performs
decremental counting at the rising edge of the phase-A signal while the phase-B input remains low.
2011
Figure 4.5. Example counting during synchronous clear
41
Page 49
4. Function

Asynchronous Clear

If a counter is set for CW (clockwise) direction Up-count and phase-Z positive logic, whenever the phase-Z input goes high will reset the count value no matter which signal level the phase-A and phase­B is. The counter will start counting from ne xt rising e dge of the phas e-A no matter what signal level t he phase-Z is.
Phase-A (Phase-A/UP)
Phase-B (Phase-B/DOWN)
Phase-Z (Phase-Z/CLR)
Count value
* When incremental counting in the CW direction is set with phase-Z positive logic,
the board performs decremental counting at the rising edge of the phase-A signal while the phase-B input remains low. When phase-Z negative logic is used, the signal is enabled while the phase-Z input remains low.
23 11 0
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.
Disable phase-Z input
Phase-Z input
Counter 0
Enable the next phase-Z input only once
Phase-Z input
Counter 0
Enable every phase-Z input
Phase-Z input
Counter 0
Ignored
Start
0
Start
0
Figure 4.7. Phase-Z enable frequency(Positive logic)
CAUTION
- The default setting is “o nly t he n ex t pha se-Z in pu t is enab le d o nce”.
- If phase-Z is set as negative logic, a valid signal of phase-Z input is low level.
- If the phase-Z/CLR input is not used, be sure to set the phase-Z to “disable the phase-Z input.”
Ignored Ignored Ignored
Ignored
000
Ignored Ignored
42
Page 50
4. Function

Other Function

Compare Register

Compare the count value of a corresponding channel with the compare register value. If these two values match, set status bit "EQ" to "0" (remains 0 as long as they are in agreem ent). This regi ster can be set to any value from 0h to FFFFFFh. It is possible either to cause an interrupt or to output a one-shot pulse to an external device when the two values match.

Digital Filter

The digital filter allows the counter to operate normally even when noise enters into pu ls es inpu t to th e counter and/or into A-, B-, and Z-phase signals. The sampling clock cycle of the digital filter is determined by clock setting data for the digital filter.
When the input signal is sampled with this sampling clock and if HIGH (or LOW) is detected for duration of four continuous clocks, the digital filter outputs HIGH (or LOW) and c ommunicates 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 after a delay of 0.4µsec.
Externally input signal
Externally input signal
Input to the PC
* The same applies also to the LOW level.
Digital filter
Four set-sampling-cycle clocks
Not valid Valid
Input to the PC
Figure 4.8. Digital filter
CAUTION
- The initial state is set to 0.1µsec. (When the cycle is not specified, the cycle also defaults to
0.1µsec.)
- A delay of more than four set-cycle clocks may occur depending on noise.
- If a level changes at a frequency faster than the set-sampling-clock cycle, that level change is invalidated and not correctly counted. Be sure to input signals which are less than the input frequency.
43
Page 51
4. Function

Programmable Timer

The programmable timer can generate interrupts at cycles according to a 32-bit setting data. The timer can be set in a range of 1msec through 200sec.

One-shot Pulse

When the count value of a channel matches a preset compare value, this channel will ge nerate 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 load.
44
Page 52
4. Function

Status Data

You can monitor each signal input, counting direction, count matching and abnormal input statuses. AI…………This bit is set to "1" to indicate an abnormal pulse input if a simultaneous change of
phases A and B is detected during 2-phase input or a simultaneous change of UP and DOWN pulses is detected during up/down input.
1 : Detect abnormal input. 0 : Do not detect abnormal input.
Z……………Indicates phase Z input status. < When set to positive logic >
1 : Phase Z input status[1] 0 : Phase Z input status[0]
< When set to negative logic >
1 : Phase Z input status[0] 0 : Phase Z input status[1]
A…………….Indicates phase A input status.
1 : Phase A 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 : The count value does not match compare register's contents.
U…………….Indicates the general-purpose input status.
1 : General-purpose input status[1] 0 : General-purpose input status[0]
CAUTION
- The initial state varies with external connection states.
- A, B, and Z phase statuses lag by four cyclical clocks since the stat us data is a vailable a fter the filter function is processed. The general-purpose input status indicates the external input status as it is.
45
Page 53
4. Function
46
Page 54

5. About Software

CD-ROM Directory Structure

\ |– Autorun.exe Installer Main Window
| Readmej.html Version information on each API-TOOL (Japanese) | Readmeu.html 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)
5. About Software
47
Page 55
5. About Software

About Software for Windows

The bundled CD-ROM “Driver library API-PAC(W32)” contains the functions that provide the following features:
- Read current count value of a specified ch annel
- Read current status register 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 program development and troublesh ooting.
48
Page 56
5. About Software

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.
49
Page 57
5. About Software

Using Sample Programs

Sample programs have been prepared for specific basic applications. To use each sample program, enter its driver num ber and gr oup num b er set by API-TO OL Configurati on 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.
50
Page 58
5. About Software
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]
51
Page 59
5. About Software

Uninstalling the Driver Libraries

To uninstall API-PAC(W32), follow the procedure 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/Rem ove] button. Foll ow the
on-screen instructions to uninstall the function libraries.
52
Page 60
5. About Software

About Software for Linux

The Linux version of counter driver, API-CNT(LNX), provides functions that execute the following features:
- Pulse input mode setting
- Count value acquisition
- Count-match or time-based interrupt response
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 program development and troublesh ooting.

Driver Software Install Procedure

The Linux version of counter driver, API-CNT(LNX), is supplied 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.
Decompression and setup procedure
# cd # mount /dev/cdrom /mnt/cdrom Mount the CD-ROM. # cp /mnt/cdrom/linux/dio/cdioXXX.tgz ./ Copy the compressed file. # tar xvfz cdioXXX.tgz Decompress the compressed file.
................
# cd contec/cdio # make
Compile the file.
................
# make install Install.
................
# cd config # ./config Set up the board to be used.
..... Set as follows.........
# ./contec_dio_start.sh Start the driver. # cd
53
Page 61
5. About Software

Accessing the Help File

(1) Invoke a web browser in your X-Window environment. (2) In the browser, open cnthelp.htm in the contec/ccnt/help directory.

Using Sample 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.
54
Page 62

6. About Hardware

6. About Hardware
This chapter provides hardware specifications and hardware-related supplementary information.

Hardware specification

Tables 6.1 list the hardware specifications of the board.
Table 6.1. Specification
Item Specification
Counter Input
Number of Channels 4 Channels Count system Up/down counting Max. count FFFFFFH (binary data) Counter input type Photo coupler isolated input or TTL-level input Counter input signal Phase-A/UP 1 x 4 channels
Input register Input protection circuit None Response frequency Photo coupler isolated input 500KHz duty 50% (Max.)
Interrupt level One interrupt caused upon channel count match or timer time-out External power 5V - 12VDC ±10% Min. 400mA
Photo coupler input current Digital filter
Timer 1msec - 200sec
Match signal output
Output point 1 x 4 channels Output type Photo coupler isolated open collector output Output rating 35VDC, 50mA(Max.) (per 1 point) Output signal width 0 - 104.45msec (All channels) Output protection circuit None External power 5V - 12VDC±10%
Common
I/O address 8 bits x 32 ports boundary Power consumption 5VDC 250mA Max. Operating condition 0 - 50°C, 10 - 90%RH (No condensation) PCI bus specification 32bit, 33MHz, Universal key shapes supported *1 Dimension (mm) 176.41(L) x 105.68(H) Weight 130g
*1 This board requires power supply at +5V from an expansion slot (it does not work on a machine with a +3.3V power supply alone).
Phase-B/DOWN 1 x 4 channels Phase-Z/CLR 1 x 4 channels General-purpose input 1 x 4 channels
220 (photo coupler insulation) or more, 1TTL loading (TTL-level)
TTL-level input 1MHz duty 50% (Max.)
(Required for photo coupler isolated input) Photo coupler primary current 15 - 25mA
0.1µsec - 1056.1µsec (can be independently set for each channel.)
55
Page 63
6. About Hardware
Board Dimensions
176.41(L)
105.68(H)
[mm]
The standard outside dimension (L) is the distance from the end of the board to the outer surface of the slot cover.

Block Diagram

Sampling clock 16-bit counter for digital filter
PCI Bus
System clock 20MHz
24-bit read register
24-bit counter
PCI Bus Interface
24-bit comparator
24-bit compare register
One-shot pulse output
Selector
Digital filter
CNT24-4(PCI)H
Photo coupler isolated input x 4 channels
TTL-level input
Buffer
x 4 channels
One-shot pulse output x 4 channels (Photo coupler open collector output)
Figure 6.1. Block Diagram
56
Page 64
6. About Hardware

Differences between the CNT24-4(PCI)H and CNT24-4(PCI)

The CNT24-4(PCI)H partially enhan ced ver sion of the conventio nal pr oducts of CNT2 4-4( PCI) and it is upper compatible with CNT24-4(PCI).
There are some 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
Interrupt signal resource setting
Dimension (mm) 121.69(L) x 106.68(H) 121.69(L) x 105.68(H)
Set to select whether to use jumper JP1
(Supply 5V to the 5V pin)
Automatically set by PC
57
Page 65
CNT24-4(PCI)H
User’s Guide
CONTEC CO., LTD. Octover 2006 Edition
3-9-31, Himesato, Nishiyodogawa-ku, Osaka 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 b e co pied o r rep rod uc ed in an y fo r m by an y mea ns wi thou t p rio r written consent of CONTEC CO., LTD. [10172006]
[02082005] Management No. A-51-004 [10172006] Parts No. LYES101
Loading...