Contec CNT16-8GY User Manual

F&eit series, 16bits isolated up-counter module 12 - 24vdc type, 5vdc type

Advertisement

Quick Links

F&eIT Series
16Bits Isolated
Up-Counter Module
12 - 24VDC type
CNT16-8(FIT)GY
5VDC type
CNT16-8L(FIT)GY
User's Manual
CONTEC CO.,LTD.

Advertisement

Table of Contents
loading

Summary of Contents for Contec CNT16-8GY

  • Page 1 F&eIT Series 16Bits Isolated Up-Counter Module 12 - 24VDC type CNT16-8(FIT)GY 5VDC type CNT16-8L(FIT)GY User’s Manual 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 damaged or missing items, contact your retailer. Product Configuration List Module (One of the following) ...1...
  • Page 3: Copyright

    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.
  • Page 4: Table Of Contents

    Table of Contents Check Your Package..........................i Copyright ............................ii Trademarks ............................ii Table of Contents..........................iii Before Using the Product About the Module ..........................1 Features ............................1 Functions and control method by controller connected .............. 2 Customer Support ..........................4 Web Site............................
  • Page 5 Using the I/O Address Map Starting I/O Address ......................... 15 List of I/O Address Maps ......................... 16 Specifications Common to F&eIT Products..................20 Product Information ........................20 Bit Assignments for I/O Ports ......................22 Flow of Count Values ........................22 Operation Commands ........................
  • Page 6: Before Using The Product

    1. Before Using the Product 1. Before Using the Product This chapter provides information you should know before using the product. About the Module This product is an expansion module (device module) that up-counts pulse signals input from an external device.
  • Page 7: Functions And Control Method By Controller Connected

    1. Before Using the Product Functions and control method by controller connected The CNT16-8(FIT)GY and CNT16-8L(FIT)GY can be connected to a variety of controllers. Supported controllers Microcontroller Unit : CPU-SBxx(FIT)GY I/O Controller Module : CPU-CAxx(FIT)GY Monitoring & Control Server Unit : SVR-MMF2(FIT) Monitoring &...
  • Page 8 1. Before Using the Product Control method by controller connected Control using the I/O address map Ο Ο Control using the memory address map FIT Protocol Ο Control via the Windows driver * Ο API-CAP(W32) API-SBP(W32) Ο Control over the web Ο...
  • Page 9: Customer Support

    You can download updated driver software and differential files as well as sample programs 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 One-Year Warranty CONTEC products are warranted by CONTEC CO., LTD.
  • Page 10: Safety Precautions

    Handling Precautions CAUTION - Do not modify the module. CONTEC will bear no responsibility for any problems, etc., resulting from modifying this module. - Do not use or store the equipment in a hot or cold place, or in a place that is subject to severe temperature changes.
  • Page 11 1. Before Using the Product - The module contains switches that need to be properly set. Before using the module, please check its switch settings. - To avoid malfunction, please do not change the module switch settings in an unauthorized manner.
  • Page 12: Environment

    1. Before Using the Product Environment Use this product in the following environment. If used in an unauthorized environment, the module 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...
  • Page 13 1. Before Using the Product CNT16-8(FIT)GY, CNT16-8L(FIT)GY...
  • Page 14: Module Nomenclature And Settings

    2. Module Nomenclature and Settings 2. Module Nomenclature and Settings Nomenclature of Module Components Figure 2.1 shows the names of module components. In the figure, the indicated switch settings represent factory settings. CNT16-8(FIT)GY CNT16-8L(FIT)GY 0 1 2 3 0 1 2 3 LED indicator LED indicator 4 5 6 7...
  • Page 15: Led Indicator

    2. Module Nomenclature and Settings LED Indicator Table 2.1. LED Indicator Name Function LED indicator Input indicator (0 - 7): ON: Indicates current flowing in the input pin GREEN (Counting pulse signal) Status LED OFF: Indicates no current flowing in the input pin (Not counting pulse signal) CNT16-8(FIT)GY, CNT16-8L(FIT)GY...
  • Page 16: Connecting To An External Device

    3. Connecting to an External Device 3. Connecting to an External Device Interface Connector How to Connect an Interface Connector When connecting the Module to an external device, you can use the supplied connector plug. To wire the Module, strip the sheath about 9 - 10mm from an end of the wire and insert the exposed wire into an opening.
  • Page 17: Signal Layout On The Interface Connector

    3. Connecting to an External Device Signal Layout on the Interface Connector The Module can be connected to an external device using a 12-pin connector that is provided on the Module face. Common plus/minus COM 0--- +/-COM for input port N.C.
  • Page 18: External I/O Circuits

    3. Connecting to an External Device External I/O Circuits Input section Figure 3.3 or 3.4 shows the input equivalent circuit for the interface section. The signal input section consists of an opto-isolated input (compatible with both current sink output and current source output).
  • Page 19 3. Connecting to an External Device Module External circuit 3k Ω Plus External common power supply 12V - 24VDC Input Optocoupler Current sink output Figure 3.5. Example of a Connection to Current Sink Output < CNT16-8(FIT)GY > Module External circuit 1.2kΩ...
  • Page 20: Using The I/O Address Map

    4. Using the I/O Address Map 4. Using the I/O Address Map Starting I/O Address When connected to a CPU-SBxx(FIT)GY, the Module can directly receive I/O commands from the controller module. Depending on how the Device ID is set, the I/O addresses indicated below will be used exclusively by the Module.
  • Page 21: List Of I/O Address Maps

    4. Using the I/O Address Map List of I/O Address Maps CNT16-8(FIT)GY Starting address Input Products Category Rivision Data Rivision Rivision Rivision Rivision (00h) Data 3 Data 2 Data 1 Data 0 Products ID Number (01h) Interrupt Status Enable Status IRQ 9 IRQ 7 IRQ 5...
  • Page 22 4. Using the I/O Address Map Starting address Output (00h) (01h) Interrupt Status Enable IRQ 9 IRQ 7 IRQ 5 (02h) (04h) (0Fh) Command Command Command Command Command Command Command Command Command (10h) Data 07 Data 06 Data 05 Data 04 Data 03 Data 02 Data 01...
  • Page 23 4. Using the I/O Address Map CNT16-8L(FIT)GY Starting address Input Products Category Rivision Data Rivision Rivision Rivision Rivision (00h) Data 3 Data 2 Data 1 Data 0 Products ID Number (01h) Interrupt Status Enable Status IRQ 9 IRQ 7 IRQ 5 (02h) (03h) (10h)
  • Page 24 4. Using the I/O Address Map Starting address Output (00h) (01h) Interrupt Status Enable IRQ 9 IRQ 7 IRQ 5 (02h) (04h) (0Fh) Command Command Command Command Command Command Command Command Command (10h) Data 07 Data 06 Data 05 Data 04 Data 03 Data 02 Data 01...
  • Page 25: Specifications Common To F&Eit Products

    Figure 4.5. Product Information < CNT16-8(FIT)GY > Revision Data [D3 - D0]: This is product update information, subject to change without notice, that is managed by CONTEC. Product Category [D7 - D4]: This is a module function classification code. For the CNT16-8(FIT)GY and CNT16-8L(FIT)GY, the code is "1h".
  • Page 26 4. Using the I/O Address Map Interrupt status This is a common port on which the interrupt status requested by the Module can be verified. Information on interrupt sources varies from module to module. Starting address Input Interruput Status Enable Status IRQ 9 IRQ 7...
  • Page 27: Bit Assignments For I/O Ports

    4. Using the I/O Address Map Bit Assignments for I/O Ports The I/O ports for the counting function have command-section and data-section registers. A register can be set as follows: First, a command is issued (OUT) to a port located at starting I/O address + 16 to make the register available for setting.
  • Page 28: Operation Commands

    4. Using the I/O Address Map Operation Commands Table 4.3. Output Commands Data Command Function Size CH0 initial count vaule CH0 initial count vaule 16-bit CH1 initial count vaule CH1 initial count vaule 16-bit CH2 initial count vaule CH2 initial count vaule 16-bit CH3 initial count vaule CH3 initial count vaule...
  • Page 29: Description Of Input Commands

    4. Using the I/O Address Map Description of Input Commands Reading a Count (command 00h - 07h) By reading the contents of the READ register for a corresponding channel, this command reads a count value. By issuing the command to the output port +16 and reading the input port +17 two times, you can read low, middle, and high count values.
  • Page 30: Status (Command 12H)

    4. Using the I/O Address Map Status (command 12h) Command Function Data length Status 8-bit Indicates a carry-up occurred for the count on each channel. By issuing 12H to the output port +16 and reading the input port +17, you can monitor the status. The corresponding bit is set to "1"...
  • Page 31: Description Of Output Commands

    4. Using the I/O Address Map Description of Output Commands Initial Count Value (command 00h - 07h) The command is issued to the output port +16, and an initial count value is set on the output port +17. Because count data consists of 16 bits, count values are output two times in low, middle, and high order, 8 bits each time.
  • Page 32: Status Reset (Command 12H)

    4. Using the I/O Address Map Status Reset (command 12h) Command Function Data length Status Reset 8-bit The interrupt sense sets an applicable bit to "1" when carry-up condition is detected on a given channel. When the applicable bit is "1", an interrupt signal is not generated when another carry-up condition arises.
  • Page 33: Digital Filter (Command 15H)

    4. Using the I/O Address Map Digital Filter (command 15h) Using this function digitally filters the signals at all input pins by means of hardware. Use it to prevent input signal noise and chattering from being detected by mistake. The level is checked at each clock sampling time. If the signal level remains the same for longer than the time set for the digital filter, the signal is treated as a valid input and the level of the PC signal is changed.
  • Page 34 4. Using the I/O Address Map Set Digital Filter Time Output setting data "ST4 - ST0" to the "time setting" output port to set the digital filter time. The table below lists the relationships between digital filter time and setting data. Digital Filter Time [sec] = 2 / (8 x 10 n: Setting Data (0 - 20)
  • Page 35: Examples

    4. Using the I/O Address Map Examples Pulse Count (no interrupts) Flowchart Start Set digital filter Status reset Initialization Set initial counter value Data latch command Data input Enter data Keyboard input Figure 4.12. Pulse Count (No Interrupts) CNT16-8(FIT)GY, CNT16-8L(FIT)GY...
  • Page 36 4. Using the I/O Address Map Sample Program =========================================================================== Sample program 1 DEVICE ID: Initial Data: 0000H Channel: Digital Filter 1024 usec Interrupt: =========================================================================== #include <stdio.h> #include <conio.h> /* ----- Constant --------------------------------------------------------- */ #define 0x0800 /* I/O address */ #define /* channel */ /* ----- Declarations ------------------------------------------------------ */ struct...
  • Page 37 4. Using the I/O Address Map /* ----- Read Data ---------------------------------------------------------- void ReadData( unsigned char ch, unsigned short *data, unsigned char *sts ) outp( ADR+0x10, 0x10 ); /* data latch */ outp( ADR+0x11, 0xff ); outp( ADR+0x10, ch ); /* read data */ CountData.Byte[ch].lower = inp( ADR+0x11 );...
  • Page 38: Pulse Count (With Interrupts)

    4. Using the I/O Address Map Pulse Count (with interrupts) Flowchart Start Interrupt processing Interrupt vectors Count the number processing of interrupts Status acquiring Initialize Set an interrupt Status reset level Reset the interrupt mask Return Start couner Count value acquiring Show data End of interrupt?
  • Page 39 4. Using the I/O Address Map Sample Program =========================================================================== Sample program 2 DEVICE ID: Initial Data: 0000H Channel: 0 to 3ch Digital Filter 1024 usec Interrupt: IRQ5 10 times =========================================================================== #include <stdio.h> #include <conio.h> #include <dos.h> /* ----- Constant ---------------------------------------------------------- */ #define 0x0800 /* I/O address */...
  • Page 40 4. Using the I/O Address Map void ReadData( void ); /* read data */ void Display( void ); /* display */ void ResVect( void ); /* restore vector */ void _interrupt _far inthandler( void ); /* interrupt handler */ void ( _interrupt _far *OrgVect)();...
  • Page 41 4. Using the I/O Address Map for (i = 0; i < CH; i++) { printf("%dch %04XH, ", i, CountData.Whole[i].count ); printf("interrupt count = %03d, status = %02X\n", intcnt, (int)intstatus); /* ------ restore vector ----------------------------------------------------- void ResVect( void ) _disable(); /* disable */ if ( IrqLevel >...
  • Page 42 4. Using the I/O Address Map outp( ADR+0x10, 0x11 ); /* interrupt mask open */ outp( ADR+0x11, 0x00 ); outp( ADR+0x10, 0x14 ); /* count start */ outp( ADR+0x11, 0xff ); while( intcnt < 10 && kbhit() == 0) { ReadData();...
  • Page 43 4. Using the I/O Address Map CNT16-8(FIT)GY, CNT16-8L(FIT)GY...
  • Page 44: Using The Memory Address Map

    5. Using the Memory Address Map 5. Using the Memory Address Map When connected to a CPU-CAxx(FIT)GY, the CNT16-8(FIT)GY, CNT16-8L(FIT)GY can be accessed by a host computer through a network. In addition, the Module can be allocated to the memory controlled by the Controller Module according to a given Device ID.
  • Page 45: Module Information Area

    5. Using the Memory Address Map Module Information Area A module information area, which is a 128-byte (80h) area beginning with address 301000h and corresponding to a given Device ID, is where the settings for the given device are read and written. The starting address can be determined according to the following expression: Starting address = 301000h + 80h x (Device ID) Table 5.1.
  • Page 46 5. Using the Memory Address Map Table 5.1. Module Information Area < 2 / 3 > Access Initial Initial Address(h) Area Item Size type value(h) settings Starting address+20 Startup register Starting address+21 Status reset Starting address+22 Counter initialization Starting address+23 Preset counter value 0000 - Starting address+24...
  • Page 47 5. Using the Memory Address Map Table 5.1. Module Information Area < 3 / 3 > Access Initial Initial Address(h) Area Item Size type value(h) settings Starting address+58 Startup register Starting address+59 Status reset Starting address+5A Counter initialization Starting address+5B Preset counter value 0000 - Starting address+5C...
  • Page 48 5. Using the Memory Address Map Module-specific information Module type (category) The CNT16-8x(FIT)GY belongs to the counter module (03h) category. Module type (serial No.) The CNT16-8(FIT)GY is a counter module with a serial No. 1 (01h). The CNT16-8L(FIT)GY is a counter module with a serial No. 2 (02h). Supported functions The CNT16-8x(FIT)GY supports the basic input function (01h).
  • Page 49 5. Using the Memory Address Map Items common to modules Module startup register Setting the module startup option (01h) causes the device module to be started. Setting the module startup option when the module is being started causes the module to be restarted.
  • Page 50 5. Using the Memory Address Map Channel settings Startup register This command controls the corresponding count operation of the channel. The command controls the count operation by setting the data of corresponding channel to 01h. Setting "01h" to the setting for each channel starts counting on that channel. Setting "00h" stops counting.
  • Page 51 5. Using the Memory Address Map Startup register mask Use this function when you want to start or stop channels simultaneously. Write the settings and mask for CH0 - CH7 in a single write operation. Table 5.4. Startup register mask +60h Update the "startup register"...
  • Page 52: Module Information Area

    5. Using the Memory Address Map Module Information Area The module information area, which is a 128-byte (80h) area beginning with address 300000h and corresponding to a given Device ID, is the area into which settings are read. The starting address can be determined according to the following expression: Starting address = 300000h + 80h x (Device ID) Table 5.8.
  • Page 53 5. Using the Memory Address Map Table 5.8. Module Information Area < 2 / 2 > Access Initial Address(h) Area Item Size type value (h) Starting address+20 Startup register Starting address+21 Status Starting address+22 Reserved None - Starting address+27 Starting address+28 Startup register Starting address+29 Status...
  • Page 54 5. Using the Memory Address Map Counter resolution This can be used to check the counter resolution for the CNT16-8x(FIT)GY. Digital filter setting This can be used to check the digital filter setting. Channel settings Startup register This register displays the count operating status of each channel. 00h : Stopping 01h : Operating Status...
  • Page 55: Basic I/O Data Area

    5. Using the Memory Address Map Basic I/O Data Area The basic Input data area, which is a 128-byte (80h) area beginning with address 304000h and corresponding to a given Device ID The starting address can be determined according to the following expression: Starting address = 304000h + 80h x (Device ID) Table 5.9.
  • Page 56: Examples

    5. Using the Memory Address Map Examples Flowchart The following flowchart illustrates an example where the CNT16-8x(FIT)GY is installed at device ID: 0. Start Open processing Opened successfully? Counter module type? Digital filter setting Counter initialization Status reset Preset counter Set Module Startup in module startup register Any error in...
  • Page 57 5. Using the Memory Address Map Sample Program /*=========================================================================== F&eIT I/F Sample Program DEVICE ID: Channel: ========================================================================== */ #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <conio.h> #include "Fit.h" /* Address(common) */ #define FIT_IO (0x00300000) #define FIT_IO_DEVICE_INFOR (0x0000) #define FIT_IO_DEVICE_CONFIG (0x1000) #define FIT_IO_INPUT (0x4000)
  • Page 58 5. Using the Memory Address Map BYTE byModuleStart; BYTE byData[0x80]; BYTE byErrorStatus; BYTE byChStatus; /* Open */ dwIpAddress = FIT_IpChenge((BYTE *)FIT_SAMPLE_IP_ADDRESS); hHandle = FIT_Open((BYTE *)&dwIpAddress, FIT_SAMPLE_PORT, NULL); if (hHandle == 0) { printf("Error! FIT_Open = %04X(H)\n", hHandle); return 1; /* Offset Address */ dwVaOffset = FIT_IO_DEVICE_SIZE * FIT_SAMPLE_DEVICE_ID;...
  • Page 59 5. Using the Memory Address Map /* Write 'Module Start' */ dwVaBase = FIT_IO + FIT_IO_DEVICE_CONFIG; byModuleStart = FIT_MODULE_START_ON; wStatus = FIT_Write(hHandle, dwVaBase + dwVaOffset + FIT_MODULE_START, 1, &byModuleStart); if (wStatus != 0) { printf("Error! FIT_Write = %04X(H)\n", wStatus); /* Read 'Error Status' */ dwVaBase = FIT_IO + FIT_IO_DEVICE_INFOR;...
  • Page 60 5. Using the Memory Address Map printf("Counter CH%d Data:%02X%02X CarryUpCount: %d\r", FIT_SAMPLE_CH, byData[1], byData[0], dwChCarryCnt); /* Close */ FIT_Close(hHandle); return 0; CNT16-8(FIT)GY, CNT16-8L(FIT)GY...
  • Page 61 5. Using the Memory Address Map CNT16-8(FIT)GY, CNT16-8L(FIT)GY...
  • Page 62: System Reference

    6. System Reference 6. System Reference Block Diagram Interface Connector IN00 - IN07 Opto-Coupler & Transistor Output Data Latch Device ID Control Circuit Stack Connector Figure 6.1. Circuit Block Diagram CNT16-8(FIT)GY, CNT16-8L(FIT)GY...
  • Page 63: Specifications

    6. System Reference Specifications CNT16-8(FIT)GY Table 6.1. Specifications Item Specification Counter input section Channel count 8 (8 points/common) Counting system Up/down counting Max. count FFFFH (binary data) Response frequency 5kHz (Max.) Duty 50% (Max.) Input format Opto-isolated input (Compatible with both current sinking output and courrent source output) Input resistance 3k Ω...
  • Page 64 6. System Reference CNT16-8L(FIT)GY Table 6.3. Specifications Item Specification Counter input section Channel count 8 (8 points/common) Counting system Up/down counting Max. count FFFFH (binary data) Response frequency 10kHz (Max.) Duty 50% (Max.) Input format Opto-isolated input (Compatible with both current sinking output and courrent source output) Input resistance 1.2k Ω...
  • Page 65: Physical Dimensions

    6. System Reference Physical Dimensions (1.2) (1.2) 0 1 2 3 4 5 6 7 Device COM 0 COM 1 CNT16-8L 25.2 64.7 [mm] Figure 6.2. Physical Dimensions CNT16-8(FIT)GY, CNT16-8L(FIT)GY...
  • Page 66 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 be copied or reproduced in any form by any means without prior written consent of CONTEC CO., LTD. [08222008] [07262004] Management No. A-40-668 [08222008_rev4] Parts No. LYDQ283...

This manual is also suitable for:

Cnt16-8lgyCnt16-8fitgyCnt16-8lfitgy

Table of Contents