Omron CJ1-CT021 Operation Manual

High-speed counter unit
Table of Contents

Advertisement

Quick Links

Cat. No. W401-E1-01
CJ1W-CT021
High-speed Counter Units
23(5$7,21 0$18$/

Advertisement

Table of Contents
loading

Summary of Contents for Omron CJ1-CT021

  • Page 1 Cat. No. W401-E1-01 CJ1W-CT021 High-speed Counter Units 23(5$7,21 0$18$/...
  • Page 2 CJ1W-CT021 High-speed Counter Units Operation Manual Produced October 2001...
  • Page 4 OMRON Product References All OMRON products are capitalised in this manual. The word “Unit” is also capitalised when it refers to an OMRON product, regardless of whether or not it appears in the proper name of the product.
  • Page 6: Table Of Contents

    TABLE OF CONTENTS PRECAUTIONS ........Intended Audience ............General Precautions .
  • Page 7 TABLE OF CONTENTS SECTION 5 Error Processing, Maintenance and Inspection ..131 Error Indicators ............Error codes .
  • Page 8 About this Manual: This manual describes the installation and operation of the CJ1W-CT021 High-speed Counter Unit and includes the sections described below. Please read this manual carefully and be sure you understand the information provided before attempting to install or operate the CJ1W-CT021 High-speed Counter Unit. Be sure to read the precautions provided in the following sections.
  • Page 9 !WARNING Failure to read and understand the information provided in this manual may result in personal injury or death, damage to the product, or product failure. Please read each section in its entirety and be sure you understand the informa- tion provided in the section and related sections before attempting any of the pro- cedures or operations given.
  • Page 10: Precautions

    PRECAUTIONS 7KLV VHFWLRQ SURYLGHV JHQHUDO SUHFDXWLRQV IRU XVLQJ WKH 3URJUDPPDEOH &RQWUROOHU 3/& DQG WKH +LJKVSHHG &RXQWHU 8QLW 7KH LQIRUPDWLRQ FRQWDLQHG LQ WKLV VHFWLRQ LV LPSRUWDQW IRU WKH VDIH DQG UHOLDEOH DSSOLFDWLRQ RI WKH +LJKVSHHG &RXQWHU 8QLW <RX PXVW UHDG WKLV VHFWLRQ DQG XQGHUVWDQG WKH LQIRUPDWLRQ FRQWDLQHG EHIRUH DWWHPSWLQJ WR VHW XS RU RSHUDWH D +LJKVSHHG &RXQWHU 8QLW DQG 3/&...
  • Page 11: Intended Audience

    It is extremely important that a PLC and all PLC Units be used for the specified purpose and under the specified conditions, especially in applications that can directly or indirectly affect human life. You must consult with your OMRON repre- sentative before applying a PLC system to the above mentioned applications.
  • Page 12: Operating Environment Precautions

    Operating Environment Precautions !WARNING Do not touch any of the terminals or terminal blocks while the power is being supplied. Doing so may result in electric shock. !WARNING Do not attempt to disassemble, repair, or modify any Units. Any attempt to do so may result in malfunction, fire, or electric shock.
  • Page 13: Application Precautions

    Application Precautions Application Precautions Observe the following precautions when using the High-speed Counter Unit or the PLC. !WARNING Failure to comply with the following precautions could lead to serious or possibly fatal injury. Always follow these precautions. œ Always ground the system with 100 W or less when installing the system, to pro- tect against electrical shock.
  • Page 14 Application Precautions œ Install the Units properly as specified in the operation manuals. Improper !Caution installation of the Units may result in malfunction. œ Be sure that all the mounting screws, terminal screws, and cable connector screws are tightened to the torque specified in the relevant manuals. Incorrect tightening torque may result in malfunction.
  • Page 15: Ec Directives

    Concepts EMC Directives OMRON devices that comply with EC Directives also conform to the related EMC standards so that they can be more easily built into other devices or the overall machine. The actual products have been checked for conformity to EMC stand- ards (see the following note).
  • Page 16: Introduction

    6(&7,21  ,QWURGXFWLRQ 7KLV VHFWLRQ JLYHV VSHFLILFDWLRQV RI WKH &-:&7 DQG D EULHI GHVFULSWLRQ RI WKH IXQFWLRQV DQG IHDWXUHV RI WKH 8QLW DQG WKH DUHDV RI DSSOLFDWLRQ Features and Functions ......... . Basic Configuration .
  • Page 17: Features And Functions

    Section 1-1 Features and Functions Features and Functions The CJ1W-CT021 High-speed Counter Unit is equipped with 2 Counters and counts over a maximum binary range of 32-bits. Accepting input pulse frequencies of up to 500 kHz allows precise control of fast motions. The Unit’s bi-directional counting ability enables detecting movement in either direction.
  • Page 18 Section 1-1 Features and Functions Digital Input Function The Unit is equipped with 2 Digital Inputs (I0 and I1) that can be freely assigned to any Counter. To meet the requirements of your application every Digital Input can be configured according to one out of 17 available functions. The functions make it possible to use a Digital Input with Gate-, Preset-, Reset- or Capture Func- tionality (among other functions).
  • Page 19 Section 1-1 Features and Functions Noise Filtering For the purpose of suppressing noise on the signal lines A and B of every Counter and on the Digital Input lines noise filters can be used. A noise filter can be con- figured.
  • Page 20: Basic Configuration

    Section 1-2 Basic Configuration Basic Configuration RUN ERC ERH MODE Typical applicable Sensors for Digital Inputs: Typical applicable Actuators for Digital Outputs: Photo Electric Relais Sensor Push Button Lamp Motor Interface Limit Switch ON/OFF High/Low Speed Forward/Reverse Proximity Switch Brake ON/OFF Other Sensors Other Actuators Typical applicable Pulse Generators for...
  • Page 21 1. Directly connecting the wires by soldering them to the external connector. 2. Indirectly connecting the wires by connecting them to screw terminals on a Ter- minal Block Unit. The Omron Terminal Block Unit (XW2B-40G4 or XW2B- 40G5) is connected to the Unit via standard available Omron flat-cables (XW2Z-xxxB).
  • Page 22: Specifications And Characteristics

    Section 1-3 Specifications and Characteristics Specifications and Characteristics 1-3-1 General Specifications Item CJ1W-CT021 Unit type CJ-series Special I/O Unit General Specifications Conform to general specifications for SYSMAC CJ-series 0 to 55 • C Operating Temperature - 20 to 70 • C Storage Temperature Humidity 10% to 90% without condensation...
  • Page 23: Functional Specifications

    Section 1-3 Specifications and Characteristics 1-3-2 Functional Specifications Item CJ1W-CT021 Number of Counters œ Simple Counter (refer to 3-2-1 "Simple Counter") Counter Type œ Circular Counter (refer to 3-2-2 "Circular Counter") œ Linear Counter (refer to 3-2-3 "Linear Counter") The Counter Type can be chosen by DIP switch at the front of the Unit. By default the Counters are set to Simple Counter (refer to 2-1-3 "Counter Type Switch").
  • Page 24 Section 1-3 Specifications and Characteristics Item CJ1W-CT021 Output State Control On changing the Operating Mode of the PLC from RUN/MONITOR ññññññññññ“ PROGRAM, an I/O Bus Error or an Overflow/Underflow Error, the Digital Outputs can be configured to: œ Continue automatic updating Output States œ...
  • Page 25 Section 1-3 Specifications and Characteristics Item CJ1W-CT021 IORD- and IOWR-instructions Run-time configuration and operation of the High-speed Counter Unit is possible by using IORD- and IOWR-instructions. The following data can be read or written: œ DM-configuration data* (refer to 4-5-1 "DM-data") œ...
  • Page 26: Input Specifications

    Section 1-3 Specifications and Characteristics 1-3-3 Input Specifications Item Counter Inputs A and B Digital Inputs (I0 and I1) Input Voltage 24 VDC 12 VDC 5 VDC Line Driver 24 VDC (19.6 to 26.4 V) (9.8 to 13.2 V) (4.5 to 5.5 V) (19.6 to 26.4 V) Input Current 8 mA...
  • Page 27 Section 1-3 Specifications and Characteristics &RXQWHU ,QSXWV $ % = DQG 'LJLWDO ,QSXWV Counter Inputs A, B a nd Z 9 LQSXW VLJQDOV 56 /LQH 'ULYHU VLJQDOV 5/12/24V input signals RS-422 Line Driver signals 8‚ˆ‡r…Ãvƒˆ‡†Ã6ÃhqÃ7 8‚ˆ‡r…Ãvƒˆ‡†Ã6ÃhqÃ7 Dƒˆ‡Ãƒˆy†r†Ãv‡uÃhÃqˆ‡’Ãshp‡‚…ÂsÃ$È Dƒˆ‡Ãƒˆy†r†Ãv‡uÃhÃqˆ‡’Ãshp‡‚…ÂsÃ$È Counter inputs A and B Counter inputs A and B Input pulses with a dut y factor of 50% Input pulses with a dut y factor of 50%...
  • Page 28: Output Specifications

    Section 1-3 Specifications and Characteristics you use an E6B2-type Open Collector encoder (e.g. E6B2-CWZ6C) at 24 V with 10 m cable, you can typically generate count pulses up to 20 kHz. Therefore, if you want to generate count pulses with higher frequencies, you should use a different type of encoder (e.g.
  • Page 29 Section 1-3 Specifications and Characteristics Maximum Switching The maximum switching current depends upon the power supply voltage, as Capacity shown below. 10. 2 20. 4 26. 4 External Supply Voltage (VDC)
  • Page 30: Quick Start Up Reference Guide

    Section 1-4 Quick Start Up Reference Guide Quick Start Up Reference Guide Operation and Every Counter of the High-speed Counter Unit can be configured as Simple, Cir- Configuration cular or Linear Counter (refer to the section 1-5 "Operating Procedure Guidelines" for quick start up information).
  • Page 31 Section 1-4 Quick Start Up Reference Guide Exchanging data with CPU The diagram below shows you all the functional blocks that the Unit has available to you to exchange data with the CPU (refer to SECTION 4 "Exchanging Data with CPU").
  • Page 32 Section 1-4 Quick Start Up Reference Guide Simple Counter Circular / Linear Counter Reference section Input Signal Types œ Phase Differential (x1) (=default) œ Phase Differential (x1, x2, x4) 3-3-1 œ Up & Down 3-3-2 œ Pulse & Direction 3-3-3 Counter Control using CIO-software bits œ...
  • Page 33 Section 1-4 Quick Start Up Reference Guide Simple Counter Circular / Linear Counter Reference section Reset Signals œ Software Reset Bit œ Software Reset Bit œ Digital Input œ Z-signal Programmable Output Pulses 3-7-1 œ No (=default) œ Yes 3-7-1 Rate Measurement 3-7-2 œ...
  • Page 34: Configuring The High-Speed Counter Unit

    Section 1-4 Quick Start Up Reference Guide 1-4-1 Configuring the High-speed Counter Unit Configuration Configuring every Counter starts with choosing the Counter Type (Simple, Circu- lar or Linear). Simple Counter For Simple Counters you do not have to make any DM-configuration settings, since for Simple Counters all default (DM-) settings are used.
  • Page 35 Section 1-4 Quick Start Up Reference Guide Depending on the Output Control Mode, Counter Range or Comparison Data can be set. Like this, for every Counter, up to a maximum of 32 Ranges or Comparison Values can be assigned. You can set the Range or Comparison Data in a part of DM or EM which is not being used.
  • Page 36: Operating Procedure Guidelines

    Section 1-5 Operating Procedure Guidelines Operating Procedure Guidelines The DIP switch at the front of the Unit can be used to operate every Counter as Simple Counter or as Circular/Linear Counter. Setting the DIP switch in the appro- priate position defines the Counter Type. The Operation Procedure Guidelines consists of 5 steps.
  • Page 37 Section 1-5 Operating Procedure Guidelines 3. Install and wire the Unit. Refer to 2-2 "Installation" and 2-3 "Wiring" for further details. 4. Turn ON the Power to the PLC. Power ON 5. Create the I/O table. The I/O table can be created by using CX-Programmer Support Software or a Programming Console.
  • Page 38 Section 1-5 Operating Procedure Guidelines Refer to 3-2-1 "Simple Counter" for more details about the Simple Counter. Configuration 2 All Counters as Circular or Linear Counter: 1, 2, 3… 1. Every Counter can now be separately (DM-) configured. For this purpose you can use a Programming Console or CX-Programmer Support Software.
  • Page 39: Application Areas

    Section 1-6 Application Areas Application Areas The main application areas of the High-speed Counter Unit is where signals with high frequencies are counted and high-speed responses have to be triggered at predefined Counter Values. Application areas include: œ Packaging and Sorting plants œ...
  • Page 40: Components, Installation And Wiring

    6(&7,21  &RPSRQHQWV ,QVWDOODWLRQ DQG :LULQJ 7KLV VHFWLRQ SURYLGHV GHWDLOV RI WKH FRPSRQHQWV VZLWFK VHWWLQJV DQG RWKHU LQIRUPDWLRQ UHTXLUHG WR LQVWDOO DQG RSHUDWH &-:&7 +LJKVSHHG &RXQWHU 8QLWV Components and Switch Settings ........2-1-1 Components .
  • Page 41: Components And Switch Settings

    Section 2-1 Components and Switch Settings Components and Switch Settings 2-1-1 Components Front and Side View 66.5 CT021 RUN ERC ERH Indicators Machine Number Switch Counter Mode Switch MODE Dimensions with Connector (112.5) 66.5 Connecting Cable...
  • Page 42: Indicators

    Section 2-1 Components and Switch Settings 2-1-2 Indicators CT021 The indicators on the LED-display show the operating status of the Unit. The fol- lowing table shows the meaning of the indicators. Colour State Description Green Unit is in operation (i.e. Unit has initialised normally after (re-) starting the Unit).
  • Page 43: Counter Type Switch

    Section 2-1 Components and Switch Settings 2-1-3 Counter Type Switch The Counter Type Switch, at the front of the Unit, is used to set the Counter Type for every individual Counter separately. By default all Counters are set to Simple Counter.
  • Page 44: Machine Number Switch

    Section 2-1 Components and Switch Settings 2-1-4 Machine Number Switch MACH The CPU Unit and the High-speed Counter Unit exchange data via the Special I/O Unit Area (CIO) and the Special I/O Unit DM Area. The High-speed Counter Unit is allocated the words for 4 Units. This means that 40 words in the Special I/O Unit Area (CIO) and 400 words in the Special I/O Unit DM Area are allocated.
  • Page 45: Installation

    Section 2-2 Installation Switch Machine I/O Refresh Data Area Special I/O Unit DM Setting Number Addresses Area Addresses Cannot be Not Applicable Not Applicable Cannot be Not Applicable Not Applicable Note 1. If two or more Special I/O Units are assigned the same Machine Number, a fatal error “Unit No.
  • Page 46 Section 2-2 Installation Use the following procedure to install CJ1W-CT021 High-speed Counter Units. Connect the Units before mounting them to DIN-rail. 1, 2, 3… 1. Align the connectors and hooks accurately and press the Units together firmly when connecting them. Hook Hook holes Connector...
  • Page 47: Wiring

    Section 2-3 Wiring Wiring 2-3-1 Connector Pin-layout The 40-pin connector (CN1) on the front of the Unit is divided in Row A and Row B, each row containing 20-pins as indicated on front of the Unit. The Digital Out- puts, Digital Inputs and the Counter Inputs of the Unit are logically grouped together and allocated to the pins of connector 1.
  • Page 48: Connector Wiring Methods

    Section 2-3 Wiring Digital Outputs Every Digital Output (O0 and O1) can be used in a NPN- or PNP-configuration depending on your application needs. This configuration is done by making the cor- responding DM-setting (refer to 3-5-4 "Output Control Configuration" for more details).
  • Page 49 Section 2-3 Wiring Wiring the soldering terminals Insulating tube Wire (cross section: 0. 3 m m m ax.) Connector (jack) with soldering terminals Numbering of the soldering terminalson connector (jack). For an overview of the connector Pin-layout refer to 2-3-1 "Connector Pin-layout". Cable separation In put an d/or Output cable Encoder cable...
  • Page 50 Section 2-3 Wiring 3. When using multi-conductor cables, separate the input- and output cables. Terminal Block Unit Besides direct connection as described above, it is also possible to make all the connections for the external signals to screw-terminals. This is easier and less time-consuming than soldering the wires to the external connector.
  • Page 51: Important Wiring Considerations

    Section 2-3 Wiring Refer to Appendix A "Using Terminal Block Units with Screw-terminals" for infor- mation on the numbering of the screw-terminals. You need this information in case you want to connect the external signals via Terminal Block Units to the High- speed Counter Unit.
  • Page 52 Section 2-3 Wiring Counter Input Circuitry Counter 1: Counter 2: Phase A 24 V B9 (24 V) B16 (24 V) 5 V/12 V A9 (5 V) A16 (12 V) B8 (LD+) B15 (LD+) 0 V/LD− A8 (0 V/LD−) A15 (0 V/LD−) Counter 1: Counter 2: Phase B...
  • Page 53 Section 2-3 Wiring Digital Output Circuitry High-speed Counter Unit Fuse B1 : 12-24 VDC Power Supply for Digital Outputs O0 and O1 B2 : Digital Output O0 (PNP) B3 : Digital Output O1 (PNP) A2 : Digital Output O0 (NPN) A3 : Digital Output O1(NPN) Fuse A1 : 0V COM for Digital Outputs O0 and O1...
  • Page 54: Digital I/O Circuit Configurations

    Section 2-3 Wiring 2-3-5 Digital I/O Circuit Configurations The following examples make clear how to wire the Digital Inputs and the Digital Outputs. 24 VDC NPN Sensor 24 VDC Power Supply +24 V High-speed Counter Shielded twisted-pair cable NPN Sensor Digital Input I0 on Connec tor CN1 24 VDC PNP Sensor +24 V...
  • Page 55 Section 2-3 Wiring Wiring example NPN/PNP Digital Output 12 to 24 VDC Power Supply Fuse(1A) B1: PS+ + 12 to 24 V Load B2 : O0 (PNP) A3 : O1 (NPN) Load Fuse(1A) A1: PS- Digital Output O0 (PNP) Digital Output O1 (NPN) Set the software switches for every Digital Output in the appropriate position...
  • Page 56: Counter Input Configurations

    Section 2-3 Wiring 2-3-6 Counter Input Configurations The following examples make clear how to wire the Counter Inputs in different con- figurations according to the output-driver of the encoder or proximity switch that you want to use. The configurations that are shown here, related to a specific out- put-driver, can also be referred to in case you want to use other pulse generating equipment with similar output-drivers.
  • Page 57 Section 2-3 Wiring 5/12/24 VDC PNP Open Collector High-speed Counter Terminals (CN1): Black: Phase A B9 (Phase A 24 V) A8 (Phase A 0 V) Encoder White: Phase B B11 (Phase B 24 V) A10 (Phase B 0 V) Orange: Phase Z B13 (Phase Z 24 V) A12 (Phase Z 0 V) Counter 1...
  • Page 58 Section 2-3 Wiring Line Driver (RS422) High-speed Counter Terminals (CN1): Black: Phase A+ B15 (Phase A, LD+) Black/red: Phase A- A15 (Phase A, LD−) Encoder White: Phase B+ B17 (Phase B, LD+) White/red: Phase B- A17 (Phase B, LD−) Orange: Phase Z+ B19 (Phase Z, LD+) Orange /red: Phase Z - A19 (Phase Z, LD−)
  • Page 60: Operation And Configuration

    6(&7,21  2SHUDWLRQ DQG &RQILJXUDWLRQ 7KLV VHFWLRQ GHVFULEHV KRZ WR FRQILJXUH WKH &-:&7 +LJKVSHHG &RXQWHU 8QLW DQG KRZ WR RSHUDWH WKH 8QLW DFFRUGLQJ WR WKH VSHFLILF UHTXLUHPHQWV RI \RXU DSSOLFDWLRQ Overview........... . . Counter Types .
  • Page 61: Overview

    Section 3-1 Overview Overview After you have installed and wired the CJ1W-CT021 High-speed Counter Unit as described in 2-2 "Installation" and 2-3 "Wiring", you have to configure the Unit by making DM-settings. Only Counters that have been configured for Circular/Linear Counter (corresponding DIP switch on the front of the Unit in the ON-position) can be DM-configured.
  • Page 62: Counter Types

    Section 3-2 Counter Types Counter Types Every single Counter of the High-speed Counter Unit can be set independently to one of the following Counter Types (for an overview of the differences between Simple and Circular/Linear Counters refer to 1-4 "Quick Start Up Reference Guide"): œ...
  • Page 63: Simple Counter

    Section 3-2 Counter Types 3-2-1 Simple Counter The advantage of using a Counter as a Simple Counter is that you do not have to make any DM-configuration settings. Instead, all default DM-settings are used. As a consequence Simple Counters can only be used in a default configuration. If you intend to use the High-speed Counter Unit only with Simple Counters the informa- tion as described in this section “Simple Counter”, covers all the default features and functions that are important and available to you.
  • Page 64 Section 3-2 Counter Types œ The Digital Inputs cannot be assigned to individual Counters and the Function of the Digital Inputs cannot be configured. Only the status of the Digital Inputs is reported in CIO. For information on assigning Functions to Digital Inputs for Circular and Linear Counters refer to 3-4 "Digital Input Functions".
  • Page 65 Section 3-2 Counter Types received count pulses will have no effect. The Over- and Underflow flags can be cleared by forcing a Preset or a Reset. CNT1: CNT2: 15 14 13 12 11 10 9 n+24 n+29 Counter Overflow: 0 = No Overflow 1 = Overflow Counter Underflow: 0 = No Underflow...
  • Page 66 Section 3-2 Counter Types Counter. A rising edge of the Preset Counter Bit triggers a preset in the next I/O Refresh Cycle. CNT1: CNT2: 15 14 13 12 11 10 9 Preset Counter: 0→1 = Preset Counter CNT1: CNT1: 15 14 13 12 11 10 9 Preset Value Set Preset Value for Simple Counter between 80000000 and 7FFFFFFF...
  • Page 67 Section 3-2 Counter Types Forcing ON/OFF Digital After you have set the Automatic/Manual Selection bit to Manual Output Control Outputs (=1), the two Digital Outputs can be forced ON and OFF using the corresponding bits in CIO. General Setting: 15 14 13 12 11 10 9 O1 O0 Manual Output Control: 0 = Force Output OFF...
  • Page 68: Circular Counter

    Section 3-2 Counter Types 3-2-2 Circular Counter Configuring Circular Counters CNT1: CNT2: 15 14 13 12 11 10 9 m+30 m+75 Counter Type: 0 = Circular Counter A Circular Counter has 32-bits (the full counting range) available to count up- or downwards over the positive counting range between 0 and the Upper Count Limit.
  • Page 69: Linear Counter

    Section 3-2 Counter Types 3-2-3 Linear Counter Configuring Linear Counters CNT1: CNT2: 15 14 13 12 11 10 9 m+30 m+75 Counter Type: 1 = Linear Counter A Linear Counter has the full counting range (=32 bits) available to count up- or downwards over the positive and negative counting range between the Minimum Count Limit and the Maximum Count Limit.
  • Page 70 Section 3-2 Counter Types Configuring Error-Code To configure Overflow/Underflow Error Code Generation for a Linear Counter refer Generation to the following: CNT1: CNT2: 15 14 13 12 11 10 9 m+32 m+77 Overflow/Underflow Error-Code generation: 0 = No Error-Code generation 1 = Error-Code generation Reporting Overflow and An Overflow or Underflow of a Linear Counter is reported in the corresponding bits...
  • Page 71: Input Signal Types

    Section 3-3 Input Signal Types Input Signal Types The type of input you require for your application is selected by means of four bits in the Signal Type Word in DM. For every Counter the Signal Type can be selected individually.
  • Page 72: Up & Down

    Section 3-3 Input Signal Types Multiplication x2 To increase the resolution of the incremental encoder the Counter can be config- ured for Multiplication by 2. If the Counter is up-counting (signal A leads to signal B) pulses are taken into account by the Counter on the rising- and falling edges of signal A.
  • Page 73: Pulse & Direction

    Section 3-3 Input Signal Types 3-3-3 Pulse & Direction In this configuration, count pulses are applied to input A. The direction of counting is controlled by the level of the signal applied to input B. If input B is high, the Counter increments on the rising edges of input A.
  • Page 74: Digital Input Functions

    Section 3-4 Digital Input Functions Digital Input Functions Assigning multiple Digital The High-speed Counter Unit is equipped with two Digital Inputs allowing every Inputs to single Counters Counter to be controlled by a Digital Input. For applications that require a Counter to be controlled by more than one Digital Input, multiple Digital Inputs (i) can be assigned to a Counter (i ˆ...
  • Page 75 Section 3-4 Digital Input Functions Note Every Digital Input can be configured to generate an Interrupt to the CPU. For details refer to 4-6-2 "Digital Inputs Generating Interrupts". Gate Function The Gate Function should be assigned to a Digital Input in case you want to use that Digital Input as a Gate.
  • Page 76 Section 3-4 Digital Input Functions the Preset Value at a rising edge of the Preset Counter Bit of the corresponding Counter. CNT1: CNT2: 15 14 13 12 11 10 9 Preset Counter: 0→1 = Preset Counter CNT1: CNT2: 15 14 13 12 11 10 9 Preset Value Set between 00000000 and FFFFFFFF...
  • Page 77 Section 3-4 Digital Input Functions Capture Function A Digital Input configured to have Capture functionality will capture the current Counter Value into the Capture Register on a rising edge (Capture Rising Edge, Function 07) or falling edge (Capture Falling Edge, Function 08) of the Digital Input signal.
  • Page 78 Section 3-4 Digital Input Functions Stop, Capture, Reset and A Digital Input configured to have Stop, Capture, Reset and Continue functionality Continue will Stop the Counter (= close the Gate) and Capture the Counter Value into the Capture Register on a rising edge of the signal applied to the Digital Input (Stop, Capture, Reset and Continue, Function 11).
  • Page 79 Section 3-4 Digital Input Functions Enable, Disable Reset A Digital Input configured to have Enable Reset Functionality (Function 15) or Dis- able Reset Functionality (Function 16) can be used to Enable/Disable resetting a Counter by an external reset signal. The external reset signal can originate from another Digital Input that is configured to have reset functionality (Function 5, 6, 11, 12, 13 or 14) or from the Z-input.
  • Page 80: Output Control

    Section 3-5 Output Control Counting Direction For every Counter the (up or down) counting direction is indicated and can be used in the Ladder Program. CNT1: CNT2: 15 14 13 12 11 10 9 n+24 n+29 Gate Open/Closed: 0 = Gate Closed 1 = Gate Open Counting Direction: 0 = Counter counts down...
  • Page 81 Section 3-5 Output Control Unit Output Pattern Both in Range and Comparison Mode the 32 Outputs of the Unit are represented by the Unit Output Pattern. The Unit uses the Unit Output Pattern internally to con- trol the Outputs. The Unit Output Pattern consists of 30 Soft (internal) Outputs and 2 Digital Outputs.
  • Page 82: Range Mode

    Section 3-5 Output Control 3-5-1 Range Mode If the Unit is configured to control the Outputs in Range Mode, this Mode can be applied to Circular Counters or Linear Counters (refer to 3-2-2 "Circular Counter" and 3-2-3 "Linear Counter" for more information). Example Range Mode with Linear Counter Minimum Count Limit Maximum Count Limit...
  • Page 83 Section 3-5 Output Control Example Range Mode with Circular Counter Range 2 Maximum C ount L imit 4,294,967,295 (=00000000 ) (= FFFFFFFF Range 1 Rollover Range 0 Range 3 Counter Value Range Lower Range Limit Upper Range Limit Output ON 60,000 80,500 45000...
  • Page 84 Section 3-5 Output Control  5DQJH 0RGH 2YHUYLHZ The following figure gives an overview on configuring Counters in Range Mode. Range 0 Counter 1 Upper Range Limit Output Pattern Lower Range Limit Output Pattern Range 31 Upper Range Limit Output Pattern Lower Range Limit Range 0 Counter 2...
  • Page 85 Section 3-5 Output Control  &RQILJXUDWLRQ DQG RSHUDWLRQ LQ 5DQJH 0RGH Specifying Range-Data In Range Mode every Counter can be assigned up to a maximum of 32 Ranges. The Data of every Range is contained by 3 double words: œ Lower Range Limit, specifying the Lower Limit of the Range œ...
  • Page 86 Section 3-5 Output Control A Range becomes active if: Lower Range Limit ˆ Counter Value ˆ Upper Range Reflecting Active / Not Active Ranges Limit. Whether or not a Range is active is reflected in CIO for each Counter. CNT1: CNT2: 15 14 13 12 11 10 9 n+20...
  • Page 87: Comparison Mode

    Section 3-5 Output Control Note The Counter Output Patterns of Counters which are configured to use no (i.e. zero) Ranges, are ignored in the AND-calculation of the Unit Output Pattern. Like this, Counters that you do not want to use, do not influence the AND-calculation of the Unit Output Pattern.
  • Page 88 Section 3-5 Output Control ing direction (-CV crossing), one or multiple Outputs can be Set (S) or Reset (R). For example Output 0 is Set on crossing CV5 in the positive counting direction and Reset on crossing CV7 in the negative counting direction. The crossing of CV3 in the positive counting direction results in the Setting of Output 2 and the Resetting of Output 1.
  • Page 89 Section 3-5 Output Control  &RPSDULVRQ 0RGH 2YHUYLHZ The following figure gives an overview on configuring Counters in Comparison Mode. Counter 1 +Set Pattern CV0 +Reset Pattern CV0 Comparison Value 0 -Set Pattern CV0 Output Set Pattern -Reset Pattern CV0 Output Reset Pattern +Set Pattern CV31 +Reset Pattern CV31...
  • Page 90 Section 3-5 Output Control  &RQILJXUDWLRQ DQG RSHUDWLRQ LQ &RPSDULVRQ 0RGH Specifying Comparison- In Comparison Mode every Counter can be assigned up to a maximum of 32 Com- Data parison Values. The Data of every Comparison Value (CV-Data) is contained by 5 double words: œ...
  • Page 91 Section 3-5 Output Control Note 1. Multiple Comparison Values of a specific Counter may not have the same value. The Unit will generate an error if multiple CV’s have the same value (refer to 5-2 "Error codes" for more details). 2.
  • Page 92: Manual Output Control

    Section 3-5 Output Control Updating Unit Output Besides by crossing CV’s the Unit Output Pattern can also be updated by a Preset Pattern with Preset or Reset or a Reset action. To trigger a Preset or Reset action refer to 3-4 "Digital Input Action Functions"...
  • Page 93: Output Control Configuration

    Section 3-5 Output Control 3-5-4 Output Control Configuration NPN or PNP Output Driver Every single Digital Output (0-1) can be used in a NPN- or PNP-configuration depending on your application needs. By setting the corresponding bit in DM a selection can be made between a NPN- or PNP Output Driver. By default the NPN Output Driver is selected.
  • Page 94: Reset Signals

    Section 3-6 Reset Signals Reset Signals For every Counter a reset of the Counter Value to zero can be triggered by the fol- lowing Sources: œ Software Reset Bit œ Digital Input œ Z-signal In order for a Digital Input or the Z-Signal to trigger a Reset this must be enabled by the Software Reset Enable Bit.
  • Page 95 Section 3-6 Reset Signals Software Reset Enable Bit Resetting the Counter Value to zero by Digital Input or Z-Signal must be enabled. as Reset Enable Source Enabling can be done by setting the Software Reset Enable Bit in CIO for the cor- responding Counter to 1.
  • Page 96: Extra Functions

    Section 3-7 Extra Functions Extra Functions 3-7-1 Programmable Output Pulses Depending on the requirements of your application, the timing characteristics of the two Digital Outputs of the High-speed Counter Unit can be modified. The Unit can be either in Range Mode or in Comparison Mode. The following functionality can be assigned to the Digital Outputs: œ...
  • Page 97: Rate Measurement

    Section 3-7 Extra Functions Note The status of the Outputs is reflected in CIO (words n+14, n+15). If a Digital Out- put is configured to have Programmable Output Pulse functionality, the actual physical status of the Output (Turn ON Delay and/or Pulse Duration included) is reflected in the corresponding bit in CIO.
  • Page 98 Section 3-7 Extra Functions Rate Value Calculation If you want to use Rate Measurement for a Counter you must start by defining the Time Window. You can set the Time Window between 1 ms and 9999 ms, in steps of 1 ms (BCD). The number of pulses which are received during the Time Window are automatically calculated by subtracting the Counter Value at the beginning of the Time Window from the Counter Value at the end of the Time Window.
  • Page 99 Section 3-7 Extra Functions Rate History Log File The Rate Values, which are calculated during consecutive Time Windows, are stored in the Rate History Log File inside the Unit. The Rate History Log File can contain a maximum number of 64 most recent Rate Values. Rate History Log File: Oldest Rate Value Rate Value 1...
  • Page 100 Section 3-7 Extra Functions Configuring Rate Rate Measurement can be configured by setting the Time-Window between 1 ms Measurement and 9999 ms (BCD). By default (=0) the Counters are configured to have no Rate Measurement. CNT1: CNT2: 15 14 13 12 11 10 9 m+39 m+84 Time-Window:...
  • Page 101 Section 3-7 Extra Functions Output Pattern of that Rate Range will be applied to the Unit Output Pattern when that Rate Range becomes active. A Rate Range becomes active if: Lower Rate Range Limit ˆ Rate Value ˆ Upper Reflecting Active / Not Active Rate Ranges Rate Range Limit.
  • Page 102 Section 3-7 Extra Functions Configuring Set & Reset Output Patterns CNT1: CNT2: 15 14 13 12 11 10 9 Rate Range 0: m+44 m+89 15 14 13 12 11 10 9 2 O1 O0 Output Set Pattern Rate Range 0 m+45 m+90 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16...
  • Page 103: Hysteresis

    Section 3-7 Extra Functions 3-7-3 Hysteresis An encoder can come to rest at a particular position and then “oscillate” around this position. This state means that the Counter Value fluctuates around a partic- ular value. If, for example, a Range Limit is in this area of fluctuation, the corre- sponding Range would become active and inactive in the rhythm of these fluctuations.
  • Page 104: Noise Filtering

    Section 3-7 Extra Functions 3-7-4 Noise Filtering Configuring Noise Filter For the purpose of suppressing noise on the signal lines A and B of every Counter Counter Inputs a Noise Filter is available. A Noise Filter can be configured for Counter 1 & 2. 15 14 13 12 11 10 9 General Setting: m+7 Noise Filter Counter 1&2:...
  • Page 105: Initial Counter Value

    Section 3-7 Extra Functions 3-7-5 Initial Counter Value Every Counter is equipped with the Initial Counter Value (double word) in DM. At a transfer of the DM-settings from the CPU to the Unit (triggered by a Power Up or Restart of the Unit) the Initial Counter Value is also transferred. The Initial Counter Value overwrites the Counter Value and becomes the new Counter Value.
  • Page 106: Exchanging Data With Cpu

    6(&7,21  ([FKDQJLQJ 'DWD ZLWK &38 7KLV VHFWLRQ SURYLGHV LQIRUPDWLRQ RQ H[FKDQJLQJ GDWD EHWZHHQ &-:&7 +LJK 6SHHG &RXQWHU 8QLWV DQG &-VHULHV &38 8QLWV Overview........... . . 4-1-1 Basic Setup .
  • Page 107: Overview

    Section 4-1 Overview Overview 4-1-1 Basic Setup The status information of the High-speed Counter Unit is exchanged with the CPU every cyclic I/O Refresh via the Special I/O Unit Area (CIO). The Unit configuration data is exchanged at Power ON or after the Unit has been restarted or after issu- ing the IOWR-instruction “(Re) Configure Unit”...
  • Page 108: Special I/O Units Restart Bits

    Section 4-1 Overview Special I/O Unit Area and The Special I/O Unit Area and the Special I/O Unit DM Area are allocated to the Special I/O Unit DM Area Unit according to the Machine Number (=N) set. For the Special I/O Unit Area 40 CIO words are allocated and for the Special I/O Unit DM Area 400 DM words are allocated.
  • Page 109: Memory Allocation

    Section 4-2 Memory Allocation Memory Allocation 4-2-1 Memory Mapping The following figure shows how the 40 words in the Special I/O Unit Area (CIO) and the 400 words in the Special I/O unit DM Area (DM) are mapped in the mem- ory of the CPU-Unit.
  • Page 110: Indirect Addressing

    Section 4-2 Memory Allocation data and to use this data for all two Counters by using two identical indirect addresses (k1=k2). General Setting: 15 14 13 12 11 10 9 n+19 Range/Comparison Blocks overlap: 0 = No overlapping 1 = One or more blocks overlap 4-2-2 Indirect Addressing The High-speed Counter Unit can be in Range Mode or Comparison Mode (refer...
  • Page 111 Section 4-2 Memory Allocation Unit in Comparison Mode In Comparison Mode Indirect Addressing can be used to define the Comparison Values per Counter that you want to use. The number of CV’s (M) defines the size of the CV Data block (size = M x 10 words). If you want to use multiple CV’s you are recommended to use consecutive CV’s starting from CV 0 (i.e.
  • Page 112 Section 4-2 Memory Allocation The Range/Comparison Data, as part of the Unit configuration data, is transferred to the Unit at Power Up or after the Unit has been restarted. CNT1: CNT2: 15 14 13 12 11 10 9 m+64 m+109 Total number of Ranges/CV’s: Set between 00 and 32...
  • Page 113: Cio-Memory Mapping

    Section 4-2 Memory Allocation Example Comparison Mode Unit is in Comparison Mode. You want to use 5 Comparison Values (CV 0 to Range 4) for Counter 1 and want to allocate them in Extended Memory starting from EM520. CNT1: 15 14 13 12 11 10 9 m+64 5 Comparison Values m+65...
  • Page 114 Section 4-2 Memory Allocation CIO Output Words The 14 Output Words (n to n+13) are divided in 3 groups: General, Counter 1, and Counter 2. Word Item Function (output) General 00, 01 Manual Output Force ON (=1) / OFF (=0) Digital Outputs [0-1] Control Bits 00 and 01 correspond to Digital Outputs O0 and O1.
  • Page 115 Section 4-2 Memory Allocation CIO Input Words The 26 Input Words (n+14 to n+39) are divided in 3 groups: General, Counter 1, and Counter 2. Word Item Function (input) General n+14, n+15 00-15 Output Status Current status of Digital and Soft Outputs n+14, bits 00 and 01: Digital Outputs O0 and O1 n+14, bits 02 and 15: Soft Outputs 2 to 15 n+15, bits 00 and 15: Soft Outputs 16 to 31...
  • Page 116 Section 4-2 Memory Allocation Word Item Function (input) Counter 2 n+25, n+26 00-15 Ranges / Ranges Active (=1) / Inactive (=0) / Comparison Values Comparison Values Active (=1) / Inactive (=0) active** n+27, n+28 00-15 Counter Value Counter Value n+29 Counter Overflow Counter Overflow (=1), Upper Count Limit of Linear Counter is reached...
  • Page 117: Dm-Memory Mapping

    Section 4-2 Memory Allocation 4-2-4 DM-Memory Mapping The High-speed Counter Unit is allocated 400 Words in DM. These 400 Words are divided in 30 General DM-words (m to m+29) and 45 Counter Specific words for every Counter (Counter 1 = m+30 to m+74, Counter 2 = m+75 to m+119). Note Double words in DM are indicated as for example “m+2, m+3”.
  • Page 118 Section 4-2 Memory Allocation Word Item Function 00-07 Input Noise Filter Select Noise Filter for Counters 1 and 2: Counters 00 = 50 kHz (default) 01 = 500 kHz 02 = 10 kHz 08-15 Not used 00-07 Input Noise Filter Select Noise Filter for Digital Inputs 0 and 1: Digital Inputs 00 = 50 kHz (default)
  • Page 119 Section 4-2 Memory Allocation Word Item Function m+17 00-07 Digital Input 0 Function Digital Input 0 (all in BCD): Function 00 = No function 01 = Gate Positive 02 = Gate Negative 03 = Preset Rising Edge 04 = Preset Falling Edge 05 = Reset Rising Edge 06 = Reset Falling Edge 07 = Capture Rising Edge...
  • Page 120 Section 4-2 Memory Allocation Word Item Function Counter 1 m+30 00-15 Counter Type Counter Type: 0 = Circular (=default) 1 = Linear m+31 00-03 Signal Type Signal Type: 0 = Phase Differential (x1) (=default) 1 = Phase Differential (x2) 2 = Phase Differential (x4) 4 = Up &...
  • Page 121 Section 4-2 Memory Allocation Word Item Function m+48, m+49 00-15 Rate-Range 1 Rate-Range 1 Lower Limit Lower Limit m+50, m+51 00-15 Rate-Range 1 Rate-Range 1 Upper Limit Upper Limit m+52, m+53 00-15 Set Pattern Output Set Pattern Rate-Range 1 Rate-Range 1 m+54, m+55 00-15 Reset Pattern...
  • Page 122 Section 4-2 Memory Allocation Word Item Function Counter 2 m+75 00-15 Counter Type Counter Type: 0 = Circular (=default) 1 = Linear m+76 00-03 Signal Type Signal Type: 0 = Phase Differential (x1) (=default) 1 = Phase Differential (x2) 2 = Phase Differential (x4) 4 = Up &...
  • Page 123 Section 4-2 Memory Allocation Word Item Function m+93, m+94 00-15 Rate-Range 1 Rate-Range 1 Lower Limit Lower Limit m+95, m+96 00-15 Rate-Range 1 Rate-Range 1 Upper Limit Upper Limit m+97, m+98 00-15 Set Pattern Output Set Pattern Rate-Range 1 Rate-Range 1 m+99, m+100 00-15 Reset Pattern...
  • Page 124: Range Memory Mapping

    Section 4-2 Memory Allocation 4-2-5 Range Memory Mapping Word Item Function Counter 1 k1, k1+1 00-15 Lower Limit Range 0 Lower Limit Range 0 k1+2, k1+3 00-15 Upper Limit Range 0 Upper Limit Range 0 k1+4, k1+5 00-15 Output Pattern Range 0 Output Pattern Range 0 k1+6 to k1+11 00-15...
  • Page 125 Section 4-2 Memory Allocation Word Item Function Counter 2 k2, k2+1 00-15 Lower Limit Range 0 Lower Limit Range 0 k2+2, k2+3 00-15 Upper Limit Range 0 Upper Limit Range 0 k2+4, k2+5 00-15 Output Pattern Range 0 Output Pattern Range 0 k2+6 to k2+11 00-15 Range Data Range 1...
  • Page 126: Comparison Memory Mapping

    Section 4-2 Memory Allocation 4-2-6 Comparison Memory Mapping Word Item Function Counter 1 k1, k1+1 00-15 Comparison Value 0 Comparison Value 0 k1+2, k1+3 00-15 +Set Pattern Output Set Pattern crossing CV0 in + direction k1+4, k1+5 00-15 +Reset Pattern Output Reset Pattern crossing CV0 in + direction k1+6, k1+7 00-15...
  • Page 127 Section 4-2 Memory Allocation Word Item Function Counter 2 k2, k2+1 00-15 Comparison Value 0 Comparison Value 0 k2+2, k2+3 00-15 +Set Pattern Output Set Pattern crossing CV0 in + direction k2+4, k2+5 00-15 +Reset Pattern Output Reset Pattern crossing CV0 in + direction k2+6, k2+7 00-15 -Set Pattern...
  • Page 128: Iowr-Instruction

    Section 4-3 IOWR-Instruction IOWR-Instruction IOWR(223) @IOWR(223) C Control Code. The IOWR-instruction enables you to send messages to the High-speed Coun- ter Unit. The high-byte (=CC1) and the low-byte (=CC2) of the Control Code specify the type of message that is to be send. 15 14 13 12 11 10 9 CC2 (=Control Code 2) CC1 (=Control Code 1)
  • Page 129 Section 4-3 IOWR-Instruction Example ladder program Refer to the following structure for the ladder program if you want to use the IOWR- instruction. For an overview of the supported IOWR-instructions and how to set the C-, S- and D-operands, refer to 4-5 "Supported IOWR/IORD-Instructions". Start Data Transfer Busy IOWR(223)
  • Page 130: Iord-Instruction

    Section 4-4 IORD-Instruction IORD-Instruction IORD(222) @IORD(222) C Control Code. The IORD-instruction enables you to read data from the High-speed Counter Unit. The high-byte (=CC1) and the low-byte (=CC2) of the Control Code spec- ify the type of data that is to be read. 15 14 13 12 11 10 9 CC2 (=Control Code 2) CC1 (=Control Code 1)
  • Page 131 Section 4-4 IORD-Instruction Unit is ready to execute the IORD-instruction. If an error occurs during the execu- tion of the IORD-instruction the ER-flag turns ON. Note If you omit to include the Data Transfer Busy bit (CIO n+19, bit 02) in the ladder instruction and you start issuing an IORD-instruction while another IOWR/IORD- instruction is in progress the ER-flag turns ON.
  • Page 132: Supported Iowr/Iord-Instructions

    Section 4-5 Supported IOWR/IORD-Instructions Supported IOWR/IORD-Instructions 4-5-1 DM-data  '0ZRUGV 8VHG IRU ,2:5,25' Memory Item IOWR IORD Control Code No. of Location Words General Output Control Mode AND/OR Counter Output Patterns Interrupt Task Offset (outputs) m+2, m+3 Interrupt Mask Outputs Interrupt Task Offset (inputs) Interrupt Mask Digital Inputs Physical Output NPN/PNP...
  • Page 133 Section 4-5 Supported IOWR/IORD-Instructions Memory Item IOWR IORD Control Code No. of Location Words m+68 to m+74 Not used Counter 2 m+75 Counter Type m+76 Signal Type m+77 Z-reset Mode Overflow/Underflow error-code generation m+78, m+79 Max. Count Value Circular/Linear m+80, m+81 Min.
  • Page 134: Range- And Comparison Data

    Section 4-5 Supported IOWR/IORD-Instructions Note Data written with the IOWR instruction is valid only until the Unit is restarted or the power supply is turned OFF. The settings in the DM and EM Area in the CPU Unit will be used after the next time the Unit is restarted or power is turned ON. If the settings made with IOWR instruction need to be used after the Unit is restarted or power is cycled, write the same settings to the DM and EM Area in the CPU Unit.
  • Page 135 Section 4-5 Supported IOWR/IORD-Instructions Note When transferring new Comparison Values to the Unit, be sure that the same Comparison Value is not used more than once in the same Counter. If the same Comparison Value exists more than once in the same Counter, an error will occur when the IOWR-instruction is executed.
  • Page 136 Section 4-5 Supported IOWR/IORD-Instructions Comparison Data If the Unit is in Comparison Mode for every Counter the Comparison Data of one or multiple Comparison Values can be read or written. For every Comparison Value the CV Data is contained in 10 words. Every IORD- and IOWR-instruction can transfer up to a maximum of 128 words.
  • Page 137: Special Data

    Section 4-5 Supported IOWR/IORD-Instructions 4-5-3 Special data  &DSWXUHG &RXQWHU 9DOXH The Counter Value can be captured into the Capture Register by using a Digital Input (Function 07 or 08) or by using the “Capture Counter Value bit” in CIO (refer to 3-4 "Digital Input Functions"...
  • Page 138 Section 4-5 Supported IOWR/IORD-Instructions Item IOWR IORD Control Code No. of Words Rate History Log File data 2 x R* c = Counter Number (1 or 2) * R = Number of Rate Values, 1 ˆ R ˆ 64 Example: The High-speed Counter Unit is assigned Machine Number 7.
  • Page 139 Section 4-5 Supported IOWR/IORD-Instructions  5H &RQILJXUH 8QLW During operation of the Unit (PLC is in RUN/MONITOR-mode), the Unit can be configured by using the IOWR-instruction from the PLC ladder program. Issuing the IOWR-instruction from the PLC ladder program results in transferring all the Unit configuration data to the Unit.
  • Page 140: Interrupts

    Section 4-6 Interrupts Example: The High-speed Counter Unit is assigned Machine Number 2. You want to clear all IOWR/IORD-instruction errors by issuing the IOWR-instruction with the Error Clear command. IOWR(223) #EC00 CC1= EC, CC2= 00 S=Not relevant (fill in valid constant, e.g. D0400 containing #0000) #00010002 D= #0002 (Machine Number) and D+1= #0001 (# words)
  • Page 141 Section 4-6 Interrupts Outputs consists of 32 bits representing the 32 Outputs. By default Outputs are disabled to generate interrupts. General Setting: 15 14 13 12 11 10 9 15 14 13 12 11 10 9 2 O1 O0 Interrupt Enable Data Outputs 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 = Digital Outputs 0-1...
  • Page 142 Section 4-6 Interrupts For every Output the assigned External Interrupt Task number can be calculated with the following formula (‘O’ = Output): Assigned External Interrupt Task Number to the œ rising edge of the Output bit is equal to: Offset + 2xO œ...
  • Page 143: Digital Inputs Generating Interrupts

    Section 4-6 Interrupts 4-6-2 Digital Inputs Generating Interrupts Enabling / Disabling The 2 Digital Inputs can all be configured to generate interrupts to the CJ-series Interrupts CPU Unit. If a Digital Input is configured to generate interrupts, an interrupt is issued to the CJ-series CPU Unit at a rising- or falling edge of the signal applied to the Digital Input.
  • Page 144 Section 4-6 Interrupts All 2 Digital Inputs are assigned in sequential order to consecutive External Inter- rupt Tasks starting from Digital Input 0. By defining an Offset you determine the External Interrupt Task number of the (first) External Interrupt Task that is assigned to Digital Input 0.
  • Page 146: Error Processing, Maintenance And Inspection

    6(&7,21  (UURU 3URFHVVLQJ 0DLQWHQDQFH DQG ,QVSHFWLRQ 7KLV VHFWLRQ SURYLGHV GHWDLOV RI WKH &-:&7 +LJKVSHHG &RXQWHU 8QLW¶V HUURU LQGLFDWRUV DQG HUURU FRGHV DQG JXLGHOLQHV IRU PDLQWHQDQFH DQG LQVSHFWLRQ RI WKH 8QLW Error Indicators ..........5-1-1 Errors during initial processing .
  • Page 147: Error Indicators

    Section 5-1 Error Indicators Error Indicators CT021 The RUN-, ERC-, and ERH-LEDs, at the front panel of the High-speed Counter Unit, display the following errors. 5-1-1 Errors during initial processing Error Probable cause Remedy Setup error Incorrect Unit number Set correct Unit number and turn Cyclic initial error ON the power again DM-configuration...
  • Page 148: Error Codes

    Section 5-2 Error codes Error codes Reporting errors The errors that can occur at the Unit are divided in 6 categories: DM-configuration errors, IOWR-instruction errors, overflow/underflow errors, Preset error, Interrupt- FIFO full error and System errors. Every error is assigned a unique error code. The error code consists of two words (error code 1 and error code 2).
  • Page 149: Dm-Configuration Errors

    Section 5-2 Error codes 5-2-1 DM-configuration errors DM-configuration errors are detected during initialisation after the Unit has been powered up or restarted. DM-configuration errors can also be detected after the IOWR-instruction “(Re) Configure Unit” has been issued (refer to 4-5-3-4 “(Re) Configure Unit”).
  • Page 150: Iowr/Iord-Instruction Errors

    Section 5-2 Error codes Clearing DM-configuration DM-configuration errors can be cleared by correcting the faulty settings in Data errors Memory and consecutively transferring the new configuration data again to the Unit. To transfer the configuration data you can choose from one out of two possi- bilities: œ...
  • Page 151: Overflow/Underflow Errors

    Section 5-2 Error codes Error Code 1 Error Code 2 Error Description 0420 Counter Range Invalid Upper Range Limit < Lower Range Limit. Range Limits Counter No. indicates the Linear Counter number and Range No. indicates the Range number. 0430 Counter Range Invalid...
  • Page 152: Preset Error

    Section 5-2 Error codes Note At overflow- and underflow errors it is possible to configure Output State Control (refer to 3-5-4 "Output Control Configuration"). 5-2-4 Preset error A Preset error is generated if a Circular or Linear Counter is preset with an invalid Preset Value (refer to 3-4 "Digital Input Functions"...
  • Page 153: Maintenance And Inspection

    Section 5-3 Maintenance and Inspection œ Mask one or more interrupts of the Unit, which caused the error. œ Mask one or more interrupts of other Units in the system, which are generating interrupts as well. œ Reduce the execution time of the assigned External Interrupt Tasks. œ...
  • Page 154: Routine Inspections

    Section 5-3 Maintenance and Inspection œ A smudge may retain on the Unit from gum, vinyl, or tape that was left on for a long time. Remove the smudge when cleaning. !Caution Never use volatile solvents such as paint thinner or benzene or chemical wipes. These substances could damage the surface of the Unit.
  • Page 156: Application Examples

    6(&7,21  $SSOLFDWLRQ ([DPSOHV 7KLV VHFWLRQ JLYHV LQIRUPDWLRQ DERXW WKH FRQILJXUDWLRQ RI WKH &-:&7 +LJKVSHHG &RXQWHU 8QLW DQG SURJUDP VDPSOHV ZKLFK FDQ EH XVHG WR RSHUDWH WKH 8QLW DFFRUGLQJ WR ILYH FRPPRQ DSSOLFDWLRQ H[DPSOHV $W WKH EHJLQQLQJ RI HDFK VHFWLRQ WKDW GHVFULEHV DQ DSSOLFDWLRQ H[DPSOH DOO FRQILJXUDWLRQ LWHPV WKDW DUH FRYHUHG LQ WKDW VHFWLRQ DUH PHQWLRQHG Flow Control .
  • Page 157: Flow Control

    Section 6-1 Flow Control Flow Control Covered configuration items in this example: œ Simple Counter (for a Simple Counter no DM-configurations have to be made). Application Description In the following example a tank has to be filled with a fixed amount of liquid. Press- ing the push button resets the Simple Counter, opens the Gate of the Simple Counter and opens the valve.
  • Page 158 Section 6-1 Flow Control 15 14 13 12 11 10 9 CIO 2002 (= n+2) Open Gate Simple Counter 1 0→1 = Open Gate Close Gate Simple Counter 1 0→1 = Close Gate Reset Simple Counter 1 0→1 = Reset Counter 15 14 13 12 11 10 9 CIO 2016 (= n+16) Status Digital Input 0:...
  • Page 159 Section 6-1 Flow Control Ladder Program A20011 Set Simple C ounter 1 t o 200015 Manual Output Control First Cycle F lag 200015 Manual Output Control 201600 Reset Simple Counter 1 200203 to zero Push Button Open Gate Counter 1 200200 Open Valve 200000...
  • Page 160: Length Measurement

    Section 6-2 Length Measurement Length Measurement Covered configuration items in this example: œ Circular Counter œ Range Mode, setting Range Data œ Programmable Output Pulses (Output Pulse Duration) œ Digital Input Function (Functions 5 and 11) œ Capturing and reading Captured Values œ...
  • Page 161 Section 6-2 Length Measurement To measure the length of objects the pulses of encoder E1 are counted by Linear/ Circular Counter 1 (corresponding DIP switch on the front of the Unit is in the ON- position). Photo-electric sensor D1 is connected to Digital Input I0. Digital Input I0 controls Counter 1 and is assigned Digital Input Function 11 (Reset, Stop, Capture and Continue).
  • Page 162 Section 6-2 Length Measurement Removing objects Timing the correct moment to remove an object for the pusher is done by the com- bination of encoder 2 and photo-electric sensor D2. Objects are removed by the pusher which is located at conveyor belt 2. Photo-electric sensor D2 is connected to Digital Input I1.
  • Page 163 Section 6-2 Length Measurement is also stored in DM starting from D600. To configure the Unit the following DM- settings must be made 15 14 13 12 11 10 9 :DM-word (The hyphen “-“ indicates that the contents of the corresponding digit is irrelevant and the value does not care) General DM-Settings: D 20000 (= m)
  • Page 164 Section 6-2 Length Measurement Ladder Program A short ladder program for the PLC is written to read and store the measured length of improper sized objects in EM starting from EM100 of the CJ-series CPU Unit. A2001 1 MO VR (560) Write physical memory address of First Cycle Flag EM 100...
  • Page 165: Positioning

    Section 6-3 Positioning Positioning Covered configuration items in this example: œ Linear Counter œ Comparison Mode, setting Comparison Data œ Digital Input Function (Function 05) œ Using IOWR-instruction to change Comparison Data Application Description In this example a hole is drilled into an object. The drill bit is spun by a single speed, single direction motor (motor 2) which can only be turned ON or OFF.
  • Page 166 Section 6-3 Positioning the feed-motor is switched to move slowly until it reaches the limit switch and is switched OFF (via the ladder program). At this moment a new object is placed in position again. At this moment the feed-motor stays switched OFF for as long as the proximity switch has detected a new object, initiating the whole cycle again.
  • Page 167 Section 6-3 Positioning CV 1 setti ngs of Counter 1 (in EM): EM 01510 Comparison Value 1 is 35000 (=000088B8 EM 01511 EM 01512 +Set Pattern: Set Soft Output 2 (i.e. startdrill-motor) in the positive (=+) EM 01513 counting direction EM 01514 +Reset Pattern: no outputs are reset at the crossing of CV0 in the positive counting direction...
  • Page 168 Section 6-3 Positioning Ladder Program A short ladder program for the PLC is written to start and stop the feed-motor. The feed-motor is connected to the Digital Output Unit and mapped on CIO 000000. The proximity switch is mapped on CIO 000200.
  • Page 169 Section 6-3 Positioning 201600 000200 Turn ON feed-motor M1 if object is present AND if the drill-motor is in the home position (after the object Limit switch at Proximity switch 000000 is treated it is removed automatically Digital Input l0 by other machinery) 201600 Turn OFF feed-motor M1 if the drill-motor...
  • Page 170: Cam-Positioning

    Section 6-4 CAM-positioning CAM-positioning Covered configuration items in this example: œ Circular Counter œ Range Mode, setting Range Data œ Interrupts (Outputs generating interrupts) œ Hysteresis œ Input Signal Type, Phase Differential, multiplication x4 œ Resetting a Counter with the Z-input combined with the Software Reset Enable Application Description In this example 15 outputs of a machine are controlled according to the position angle of the “electronic CAM-shaft”...
  • Page 171 Section 6-4 CAM-positioning The encoder is connected to Circular Counter 1. The 15 outputs are controlled by 5 Ranges (Range 0 to 4). An Hysteresis of 20 counts is defined and will be applied to the Range Limits. The outputs are assigned to the Interrupt Tasks 10 to 39 respectively in the PLC ladder program (i.e.
  • Page 172 Section 6-4 CAM-positioning Range Data Counter 1 Range Data Counter 1 Range 0 settings of Counter 1 (in EM): EM 00100 Lower Range Limit is 500 (=000001F4 EM 00101 EM 00102 Upper Range Limit is 800 (=00000320 EM 00103 EM 00104 Output Pattern: 0, 1, 5 and 12 are ON (=00001023 EM 00105 Range 1 settings of...
  • Page 173 Section 6-4 CAM-positioning Ladder Program A short ladder program (consisting of 30 External Interrupt Tasks) for the PLC is written to control the outputs via the additional output module. All outputs are con- figured to generate interrupts. The Digital Output Unit is mapped in CIO starting from CIO 000000.
  • Page 174 Section 6-4 CAM-positioning Interrupt Task 24: Output 7 000007 Always ON flag Interrupt Task 25: Output 7 000007 Always OFF flag Interrupt Task 26: Output 8 000008 Always ON flag Interrupt Task 27: Output 8 000008 Always OFF flag Interrupt Task 28: Output 9 000009 Always ON flag...
  • Page 175: Speed Control

    Section 6-5 Speed Control Speed Control Covered configuration items in this example: œ Circular Counter œ Rate Ranges, setting Rate Range Data Application Description In this example logs are fed into a saw blade. A conveyor that has two speeds (fast/slow) transports the logs.
  • Page 176 Section 6-5 Speed Control CJ1W-OD231/ID231). The speed of the conveyor motor is controlled by Digital Output O0 and the slow speed indicator is controlled by Digital Output O1 of the High-speed Counter Unit. Speed Saw Blade [ Hz] Conveyor Speed: Conveyor Speed: High frequencies are Fast...
  • Page 177 Section 6-5 Speed Control DM-configuration The Machine Number of the High-speed Counter Unit is 0. The High-speed Coun- ter is allocated 40 CIO-words starting from CIO 2000 (n = CIO 2000 + 0 x 10) and 400 DM-words starting from D 20000 (m = D 20000 + 0 x 100). To configure the Unit the following DM-settings must be made.
  • Page 178: Using Terminal Block Units With Screw-Terminals

    Appendix A Using Terminal Block Units with Screw-terminals Appendix A Using Terminal Block Units with Screw-terminals The following table shows the numbering of the Screw-terminals when you use Terminal Block Units (XW2B-40G4 or XW2B-40G5) to connect the external signals (Power Supply, Digital I/O and Counter Input Signals) to the CJ1W-CT021 High-speed Counter Unit.
  • Page 179 Appendix A Using Terminal Block Units with Screw-terminals sponds to the pins numbered B1 to B20 of the associated connector (CN1) on the Unit.
  • Page 180: Assigning External Interrupt Tasks To Outputs

    Appendix B Assigning External Interrupt Tasks to Outputs The following table shows which External Interrupt Task Numbers are assigned to rising- and falling edges of the corresponding Output bits in the Unit Output Pattern. Two External Interrupt Tasks are assigned to every Output if that Output has been enabled to generate interrupts.
  • Page 181 Appendix B Assigning External Interrupt Tasks to Outputs Output Assigned External Interrupt executed at rising/falling edge* Interrupt Task Number Offset + 32 Rising Offset + 33 Falling Offset + 34 Rising Offset + 35 Falling Offset + 36 Rising Offset + 37 Falling Offset + 38 Rising...
  • Page 182: Description Of The Response Time

    Appendix C Description of the Response Time The Response Time of the CJ1W-CT021 High-speed Counter Unit is the time between the Unit receiving a count pulse (on one of the Counter inputs A or B) and the switching (ON or OFF) of a corresponding Digital Output. CJ1W-CT021 Input Output...
  • Page 184: Index

    Index Counter Types Circular Counter A-indicator Linear Counter Simple Counter Allocating Memory Digital Input Functionality Application Areas Hysteresis Application Examples Inintial Counter Value CAM-positioning Input Signal Types Flow Control Phase Differential Signals (x1, x2, x4) Length Measurement Pulse & Direction Signals Positioning Up &...
  • Page 185 Index Data Exchange, between CPU and CS1W-CT021/CT041 Enable Reset   ERC-indicator   Delay, turning ON an Output ERH-indicator Digital Input Functionality Error Categories Capture and Reset Funtion DM-configuration errors Capture Funtion Interrupt FIFO full error Disable Reset Function IOWR/IORD-instruction errors Enable Reset Function Overflow/Underflow errors...
  • Page 186 Index Frequency Measurement Error Clear Command Range- and Comparison data Functional Specifications Rate History Log File data IOWR-Instruction    Gating General specifications LED-indicators Length Measurement Example   Linear Counter Example Hysteresis   Logically AND/OR Counter Output Patterns Example Machine Number Switch Indicators...
  • Page 187 Index Output Drivers Range-Data   Allocation Changing at run-time, using IORD/IOWR Configuration Output Pattern      Examples Logically AND/OR Counter Output Patterns   Predefined Output Pattern Rate History Log File   Unit Output Pattern Rate Measurement Output Pulse Duration Rate Ranges...
  • Page 188 Index   Terminal Block Unit Time Window Troubleshooting Underflow Underflow Error-Code Generation Unit Output Pattern Up & Down Signals Wiring Connector Pin-layout Connector Wiring Methods External connector Terminal Block Unit Counter Input Circuitry Example 5/12/24 VDC NPN Open Collector Example 5/12/24 VDC PNP Open Collector Line Driver (RS422) Digital Input Circuitry...
  • Page 190: Revision History

    Revision History A manual revision code appears as a suffix to the catalog number on the front cover of the manual. Cat. No. W401-E1-01 Revision code The following table outlines the changes made to the manual during each revision. Page numbers refer to the previous version.
  • Page 191 Scarborough, Ontario M 416.286.6465 OMRON ON-LINE Global - http://www.omron.com USA - http://www.omron.com/oei Canada - http://www.omron.com/oci 800.55.OMRON or 847.843.7900 Sao Paulo 55.11.5564.6488 Buenos Aires 54.114.787.1129 Florida 954.227.2121 W401-E1-1 01/02 Printed in U.S.A. ©2002 OMRON ELECTRONICS LLC Specifications subject to change without notice.

Table of Contents