HSC ct-021 W401-E1-04
HSC ct-021 W401-E1-04
HSC ct-021 W401-E1-04
W401-E1-04
CJ1W-CT021
High-speed Counter Units
OPERATION MANUAL
CJ1W-CT021
High-speed Counter Units
Operation Manual
Revised April 2011
iii
iv
Notice:
OMRON products are manufactured for use according to proper procedures by a qualified operator and
only for the purposes described in this manual.
The following conventions are used to indicate and classify precautions in this manual. Always pay atten-
tion to the information provided with them. Failure to comply with the precautions can result in injury to peo-
ple or damage to the product.
Visual Aids
The following headings appear in the left column of the manual to help you locate different types of infor-
mation.
Note Indicates information of particular interest for efficient and convenient operation of
the product.
OMRON, 2001
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any
form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written
permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because
OMRON is constantly striving to improve its high-quality products, the information contained in this manual is
subject to change without notice. Every precaution has been taken in the preparation of this manual. Nevertheless,
OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting
from the use of the information contained in this publication.
v
Read and Understand this Manual
Please read and understand this manual before using the product. Please consult your OMRON
representative if you have any questions or comments.
LIMITATIONS OF LIABILITY
OMRON SHALL NOT BE RESPONSIBLE FOR SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES,
LOSS OF PROFITS OR COMMERCIAL LOSS IN ANY WAY CONNECTED WITH THE PRODUCTS,
WHETHER SUCH CLAIM IS BASED ON CONTRACT, WARRANTY, NEGLIGENCE, OR STRICT
LIABILITY.
In no event shall the responsibility of OMRON for any act exceed the individual price of the product on which
liability is asserted.
vi
Application Considerations
SUITABILITY FOR USE
OMRON shall not be responsible for conformity with any standards, codes, or regulations that apply to the
combination of products in the customer's application or use of the products.
At the customer's request, OMRON will provide applicable third party certification documents identifying
ratings and limitations of use that apply to the products. This information by itself is not sufficient for a
complete determination of the suitability of the products in combination with the end product, machine,
system, or other application or use.
The following are some examples of applications for which particular attention must be given. This is not
intended to be an exhaustive list of all possible uses of the products, nor is it intended to imply that the uses
listed may be suitable for the products:
Outdoor use, uses involving potential chemical contamination or electrical interference, or conditions or
uses not described in this manual.
Nuclear energy control systems, combustion systems, railroad systems, aviation systems, medical
equipment, amusement machines, vehicles, safety equipment, and installations subject to separate
industry or government regulations.
Systems, machines, and equipment that could present a risk to life or property.
Please know and observe all prohibitions of use applicable to the products.
NEVER USE THE PRODUCTS FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO
ADDRESS THE RISKS, AND THAT THE OMRON PRODUCTS ARE PROPERLY RATED AND INSTALLED
FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.
PROGRAMMABLE PRODUCTS
OMRON shall not be responsible for the user's programming of a programmable product, or any
consequence thereof.
vii
Disclaimers
CHANGE IN SPECIFICATIONS
Product specifications and accessories may be changed at any time based on improvements and other
reasons.
It is our practice to change model numbers when published ratings or features are changed, or when
significant construction changes are made. However, some specifications of the products may be changed
without any notice. When in doubt, special model numbers may be assigned to fix or establish key
specifications for your application on your request. Please consult with your OMRON representative at any
time to confirm actual specifications of purchased products.
PERFORMANCE DATA
Performance data given in this manual is provided as a guide for the user in determining suitability and does
not constitute a warranty. It may represent the result of OMRON's test conditions, and the users must
correlate it to actual application requirements. Actual performance is subject to the OMRON Warranty and
Limitations of Liability.
viii
TABLE OF CONTENTS
PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
1 Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
2 General Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
3 Safety Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
4 Operating Environment Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
5 Application Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
6 EC Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
SECTION 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1-1 Features and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1-2 Basic Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1-3 Specifications and Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1-4 Quick Start Up Reference Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1-5 Operating Procedure Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1-6 Application Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
SECTION 2
Components, Installation and Wiring . . . . . . . . . . . . . . . . . 25
2-1 Components and Switch Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2-2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2-3 Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
SECTION 3
Operation and Configuration . . . . . . . . . . . . . . . . . . . . . . . . 45
3-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3-2 Counter Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3-3 Input Signal Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3-4 Digital Input Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3-5 Output Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3-6 Reset Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3-7 Extra Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
SECTION 4
Exchanging Data with CPU . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4-2 Memory Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
4-3 IOWR-Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
4-4 IORD-Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4-5 Supported IOWR/IORD-Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4-6 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
ix
TABLE OF CONTENTS
SECTION 5
Error Processing, Maintenance and Inspection . . . . . . . . . 133
5-1 Error Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
5-2 Error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5-3 Maintenance and Inspection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
SECTION 6
Application Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
6-1 Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
6-2 Length Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
6-3 Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6-4 CAM-positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
6-5 Speed Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Appendices
A Using Terminal Block Units with Screw-terminals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
B Assigning External Interrupt Tasks to Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
C Description of the Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
D Application Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
E IORF and IOWR/IORD-instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
x
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.
Section 1 introduces the CJ1W-CT021 High-speed Counter Unit and describes the features, functions,
and specifications. It gives short instructions on how to operate the Units.
Section 2 provides information about components, wiring and installing the CJ1W-CT021 High-speed
Counter Unit.
Section 3 provides information about the configuration and operation of the CJ1W-CT021 High-speed
Counter Unit.
Section 4 provides information on the data-exchange and the communication interface between the
CJ1W-CT021 High-speed Counter Unit and the CPU.
Section 5 provides details of the CJ1W-CT021 High-speed Counter Units errors, error -codes and indica-
tors and guidelines for troubleshooting.
Section 6 provides sample programs, according to practical applications, that can be used with the
CJ1W-CT021 High-speed Counter Unit.
The Appendices describe a comparison with C200H-CT021 High-speed Counter Unit, the numbering of
Terminal Block Units, the numbering of External Interrupt Tasks to Outputs and a description of the
Response Time.
All through this manual where a double word is defined as for instance n+2, n+3 this must be interpreted
as follows:
6 5 4 3 2 1 0
sign x10 x10 x10 x10 x10 x10 x10 :BCD Double Word
0 = + (positive)
F = - (negative)
7 6 5 4 3 2 1 0
x16 x16 x16 x16 x16 x16 x16 x16 :Hexadecimal Double Word
xi
!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.
xii
PRECAUTIONS
This section provides general precautions for using the Programmable Controller (PLC) and the High-speed Counter Unit.
The information contained in this section is important for the safe and reliable application of the High-speed Counter
Unit. You must read this section and understand the information contained before attempting to set up or operate a
High-speed Counter Unit and PLC system.
xiii
Intended Audience 1
1 Intended Audience
This manual is intended for the following personnel, who must also have knowl-
edge of electrical systems (an electrical engineer or the equivalent).
Personnel in charge of installing FA systems.
Personnel in charge of designing FA systems.
Personnel in charge of managing FA systems and facilities.
2 General Precautions
The user must operate the product according to the performance specifications
described in the operation manuals.
Before using the product under conditions which are not described in the manual
or applying the product to nuclear control systems, railroad systems, aviation sys-
tems, vehicles, combustion systems, medical equipment, amusement machines,
safety equipment, and other systems, machines, and equipment that may have a
serious influence on lives and property if used improperly, consult your OMRON
representative.
Make sure that the ratings and performance characteristics of the product are suf-
ficient for the systems, machines, and equipment, and be sure to provide the sys-
tems, machines, and equipment with double safety mechanisms.
This manual provides information for installing and operating OMRON High-
speed Counter Units. Be sure to read this manual before operation and keep this
manual close at hand for reference during operation.
!WARNING 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.
3 Safety Precautions
!WARNING Never attempt to disassemble any Units while power is being supplied.
Doing so may result in serious electronic shock.
!WARNING Never touch any of the terminals while power is being supplied.
Doing so may result in serious electronic shock.
!WARNING Provide safety measures in external circuits (i.e., not in the Programmable Con-
troller), including the following items, to ensure safety in the system if an abnor-
mality occurs due to malfunction of the PLC unit. Not providing sufficient safety
measures may result in serious accidents.
Emergency stop circuits, interlock circuits, limit circuits, and similar safety
measures must be provided in external control circuits.
The PLC will turn OFF all outputs when its self-diagnosis function detects any
error or when a severe failure alarm (FALS) instruction is executed. Unexpected
operation, however, may still occur for errors in the I/O control section, errors in
I/O memory, and other errors that cannot be detected by the self-diagnosis
function. As a countermeasure for all such errors, external safety measures
must be provided to ensure safety in the system.
xiv
Safety Precautions 3
The PLC outputs may remain ON or OFF due to deposits on or burning of the
output relays, or destruction of the output transistors. As a countermeasure for
such problems, external safety measures must be provided to ensure safety in
the system.
When the 24-VDC output (service power supply to the PLC) is overloaded or
short-circuited, the voltage may drop result in the outputs being turned OFF. As
a countermeasure for such problems, external safety measures must be pro-
vided to ensure safety in the system.
!WARNING The CPU Unit refreshes I/O even when the program is stopped (i.e., even in
PROGRAM mode). Confirm safety thoroughly in advance before changing the
status of any part of memory allocated to I/O Units, Special I/O Units, or CPU
Bus Units. Any changes to the data allocated to any Unit may result in unex-
pected operation of the loads connected to the Unit. Any of the following opera-
tion may result in changes to memory status.
Transferring I/O memory data from a Programming Device to the CPU Unit.
Changing present values in memory with a Programming Device.
Force-setting/-resetting bits with a Programming Device.
Transferring I/O memory files from a Memory Card or EM file memory to the
CPU Unit.
Transferring I/O memory from a host computer or from another PLC on a net-
work.
!WARNING Do not attempt to take any Unit apart while the power is being supplied. Doing so
may result in electric shock.
!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.
!Caution Execute online edit only after confirming that no adverse effects will be caused
by extending the cycle time. Otherwise, the Input signals may not be readable.
!Caution Confirm safety at the destination node before transferring a program to another
node or changing contents of the I/O memory area. Doing either of these without
confirming safety may result in injury.
!Caution Tighten the screws on the terminal block of the AC Power Supply Unit to the
torque specified in the operation manual. Loose screws may result in burning or
malfunction.
xv
Operating Environment 4
!Caution Take appropriate and sufficient countermeasures when installing systems in the
following locations:
Locations subject to static electricity or other forms of noise.
Locations subject to strong electromagnetic fields.
Locations subject to possible exposure to radioactivity.
Locations close to power supplies.
!Caution The operating environment of the PLC System can have a large effect on the lon-
gevity and reliability of the system. Improper operating environments can lead to
malfunction, failure, and other unforeseeable problems with the PLC System. Be
sure that the operating environment is within the specified conditions at installa-
tion and remains within the specified conditions during the life of the system.
xvi
Application Precautions 5
5 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 or less when installing the system, to pro-
tect against electrical shock.
Always turn OFF the power supply to the PLC before attempting any of the fol-
lowing. Performing any of the following with the power supply turned ON may
lead to electrical shock:
Mounting or removing any Units (e.g., I/O Units, CPU Unit, etc.) or memory
cassettes.
Assembling any devices or racks.
Connecting or disconnecting any connectors, cables or wiring.
Setting DIP switch or rotary switches.
!Caution Failure to comply with the following precautions could lead to faulty operation of
the PLC or the system, or could damage the PLC or PLC Units. Always follow
these precautions.
Fail-safe measures must be taken by the customer to ensure safety in the event
of incorrect, missing, or abnormal signals caused by broken signal lines,
momentary power interruptions, or other causes.
Interlock circuits, limit circuits, and similar safety measures in external circuits
(i.e., not in the Programmable Controller) must be provided by the customer.
If the IOM Hold Bit is turned ON, the outputs from the PLC will not be turned
OFF and will maintain their previous status when the PLC is switched from RUN
or MONITOR mode to PROGRAM mode. Make sure that the external loads will
not produce dangerous conditions when this occurs. (When operation stops for
a fatal error, including those produced with the FALS instruction, all outputs
from Output Unit will be turned OFF and only the internal output status will be
maintained.)
Use the Units only with the power supplies and voltages specified in the oper-
ation manuals. Other power supplies and voltages may damage the Units.
Take appropriate measures to ensure that the specified power with the rated
voltage and frequency is supplied. Be particularly careful in places where the
power supply is unstable. An incorrect power supply may result in malfunction.
Install external breakers and take other safety measures against short-
circuiting in external wiring. Insufficient safety measures against short-
circuiting may result in burning.
Do not apply voltages to Input sections in excess of the rated Input voltage.
Excess voltages may result in burning.
Do not apply voltages or connect loads in excess of the maximum switching
capacity to output sections. Excess voltage or loads may result in burning.
xvii
Application Precautions 5
!Caution Install the Units properly as specified in the operation manuals. Improper
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.
Leave the label attached to the Unit when wiring. Removing the label may result
in malfunction if foreign matter enters the Unit.
Remove the label after the completion of wiring to ensure proper heat dissipa-
tion. Leaving the label attached may result in malfunction.
Use crimp terminals for wiring. Do not connect bare stranded wires directly to
terminals. Connection of bare stranded wires may result in burning.
Double-check all the wiring and the connectors before turning ON the power
supply. Incorrect wiring or bad connections may result in burning or malfunc-
tion.
Be sure that the terminal blocks, Memory Units, expansion cables, and other
items with locking devices are properly locked into place. Improper locking may
result in malfunction.
Check switch settings, the contents of the DM Area, and other preparations
before starting operation. Starting operation without the proper settings or data
may result in an unexpected operation.
Check the user program for proper execution before actually running it on the
Unit. Not checking the program may result in an unexpected operation.
Confirm that no adverse effect will occur in the system before attempting any of
the following. Not doing so may result in an unexpected operation.
Changing the operating mode of the PLC.
Force-setting/force-resetting any bit in memory.
Changing the present value of any word or any set value in memory.
Do not pull on the cables or bend the cables beyond their natural limit. Doing
either of these may break the cables.
Do not place objects on top of the cables or other wiring lines. Doing so may
break the cables.
When replacing parts, be sure to confirm that the rating of a new part is correct.
Not doing so may result in malfunction or burning.
Before touching a Unit, be sure to first touch a grounded metallic object in order
to discharge any static built-up. Not doing so may result in malfunction or dam-
age.
Do not touch circuit boards or the components mounted to them with your bare
hands. There are sharp leads and other parts on the boards that may cause
injury if handled improperly.
Provide proper shielding when installing in the following locations:
Locations subject to static electricity or other sources of noise.
Locations subject to strong electromagnetic fields.
Locations subject to possible exposure to radiation.
Locations near power supply lines.
Do not attempt to take any Units apart, to repair any Units, or to modify any
Units in any way.
After connecting Power Supply Units, CPU Units, I/O Units, Special I/O Units,
or CPU Bus Units together, secure the Units by sliding the sliders at the top and
bottom of the Units until they click into place. Correct operation may not be pos-
sible if the Units are not securely properly. Be sure to attach the end cover pro-
vided with the CPU Unit to the rightmost Unit. CJ-series PLCs will not operate
properly if the end cover is not attached.
xviii
EC Directives Section
6 EC Directives
6-1 Applicable Directives
EMC Directives
Low Voltage Directive
6-2 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). Whether the products conform to the standards in
the system used by the customer, however, must be checked by the customer.
EMC-related performance of the OMRON devices that comply with EC Directives
will vary depending on the configuration, wiring, and other conditions of the equip-
ment or control panel on which the OMRON devices are installed. The customer
must, therefore, perform the final check to confirm that devices and the overall
machine conform to EMC standards.
xix
SECTION 1
Introduction
This section gives specifications of the CJ1W-CT021 and a brief description of the functions and features of the Unit and the
areas of application.
1
Features and Functions Section 1-1
CT021
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
20 20
23
456
01
789
23
456
01
789
CN1
MODE
1 1
B A
Freely Configurable The CJ1W-CT021, a Special I/O Unit for CJ-series PLC-systems, is a freely con-
figurable High-speed Counter Unit. Depending on the requirements of your appli-
cation, the specific behaviour of the Unit can be adjusted by changing the
configuration settings.
Counter Type Configuring the Unit starts with choosing one out of 3 Counter Types:
Simple Counter (refer to 3-2-1 "Simple Counter")
Circular Counter (refer to 3-2-2 "Circular Counter")
Linear Counter (refer to 3-2-3 "Linear Counter")
By default all Counters are set to Simple Counter for which no configuration set-
tings have to be made, enabling every Counter to count pulses directly after the
Unit has been powered up. For all Counter Types the full counting range is avail-
able. Circular and Linear Counters can be fully (DM-) configured according to the
application that is to be controlled.
Input Signal Type Depending on the type of input signal that your application requires, for every
Counter a choice can be made out of three input signal types:
Phase Differential Inputs (multiplication by either 1, 2 or 4)
(refer to 3-3-1 "Phase Differential")
Up/Down Pulse Inputs (refer to 3-3-2 "Up & Down")
Pulse & Direction Inputs (refer to 3-3-3 "Pulse & Direction")
2
Features and Functions Section 1-1
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). Refer to 3-4 "Digital Input Functions".
Digital Output Control To control the Outputs the Unit can be configured in one of the two following Out-
put Control Modes:
Range Mode (refer to 3-5-1 "Range Mode")
Comparison Mode (refer to 3-5-2 "Comparison Mode")
In Range Mode, a configurable number of up to 32 Ranges can be applied to indi-
vidual Counters. Every Range can control up to a maximum of 32 Outputs. An
Output is turned ON when the Counter is in the corresponding Range. In Compar-
ison Mode a configurable number of up to 32 Comparison Values can be applied
to individual Counters. Depending on the direction of counting, an Output can be
set or reset (configurable) on reaching the Comparison Value. Every Comparison
Value can control up to maximum 32 Outputs.
Resetting Counter Value Resetting of the Counter Value can be freely configured depending on the appli-
cation needs. The following sources can trigger a reset:
Software bit in the PLC
Z-Input
Digital Input (that is configured as a Reset Input)
To enable resetting a Counter Value, an external Digital Input can be configured as
Enable Reset Input and/or the Software Enable Reset bit can be used (refer to
3-6 "Reset Signals").
Programmable Output The timing characteristics of the Digital Outputs can be modified, depending on
Pulses the requirements of the application as follows (refer to 3-7-1 "Programmable Out-
put Pulses"):
Output Turn ON Delay [1 ms to 9999 ms], to delay turning ON an Output
Output Pulse Duration [1 ms to 9999 ms], to generate an Output pulse of the
specified duration
Rate Measurement The ability, for every Counter, to measure the Rate of the incoming pulses within
a predefined time-window [1ms to 9999 ms] enables measuring speeds and fre-
quencies. Rate Measurement is executed as background calculation and can be
enabled or disabled. For every Counter up to a maximum of 64 most recent Rate
Values are available as a Rate History Log File (refer to 3-7-2 "Rate Measure-
ment").
Hysteresis For Counters in Range Mode a hysteresis can be configured [1 to 255 counts], to
prevent Outputs from toggling due to unwanted oscillating of encoding equipment
(e.g. rotary incremental encoder). Refer to 3-7-3 "Hysteresis".
3
Features and Functions Section 1-1
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. The cut-off frequencies for the signal lines A and B can be set to:
10 kHz
50 kHz (default)
500 kHz
For the Digital Inputs 10 kHz and 50 kHz (default) noise filters can be configured.
Refer to 3-7-4 "Noise Filtering".
Run-time Configurable Configuration settings of the Unit can be changed at Run-time by using the IOWR-
instruction to be able to quickly adjust to changing application needs without the
need of restarting the Unit or stopping the Counters. Care, however, must be taken
when changing configuration settings. Refer to 3-5 "Output Control" for informa-
tion.
Interrupt Support All Outputs and Digital Inputs can be configured to generate interrupts to the PLC
in order to have a minimal response time enabling fast control of applications.
Generating interrupts is only possible when the High-speed Counter Unit is
mounted on a CPU-backplane.
Support Software The Unit can be configured by using CX-Programmer Support Software or a Pro-
gramming Console.
Quick Start Up Reference For a quick overview of all the features and functions that the High-speed Counter
Guide Unit offers to you, refer to 1-4 "Quick Start Up Reference Guide". This section also
contains references to the particular section(s) in the Manual where you can read
more detailed information about specific features and functions of the High-speed
Counter Unit.
4
Basic Configuration Section 1-2
20 20
23
456
01
789
23
456
01
789
CN1
2
1
O
N
MODE
1 1
B A
Typical applicable Sensors for Digital Inputs: Typical applicable Actuators for Digital Outputs:
Photo Electric
Relais
Sensor
ON/OFF M
High/Low Speed
Proximity Switch Forward/Reverse
Brake ON/OFF
Incremental
Encoder
Proximity Sensor
Other P ulse
Generators
Mounting Restrictions The CJ1W-CT021 High-speed Counter Unit is a Special I/O Unit belonging to the
CJ Series.
A CJ1W-CT021 High-speed Counter Unit can be mounted to either a CJ CPU
Rack or CJ Expansion Rack.
Note If you want the CJ1W-CT021 High-speed Counter Unit to generate interrupts to
activate external interrupt tasks in a CJ1-H CPU Unit, the Counter Unit must be in
one of the five positions immediately to the right of the CJ1-H CPU Unit on the
CPU Rack. If you want the High-speed Counter Unit to generate interrupts to acti-
vate external interrupt tasks in a CJ1M CPU Unit, the Counter Unit must be in one
of the three positions immediately to the right of the CJ1M CPU Unit on the CPU
5
Basic Configuration Section 1-2
Rack.
No external interrupt tasks can be activated in CJ1-H or CJ1M CPU Units if the
CJ1W-CT021 High-speed Counter Unit is in any other position (i.e., 6th Unit posi-
tion or further away from the CJ1-H CPU Unit, or 4th Unit position or further away
from the CJ1M CPU Unit), or if it is on a CJ-series Expansion Rack.
I/O Connection Methods To connect the In- and Output signal wires to the Unit two methods are available:
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).
6
Specifications and Characteristics Section 1-3
Note 1. The Unit must be in one of the five positions immediately to the right of the CJ1-
H CPU Unit or in one of the three positions immediately to the right of the CJ1M
CPU Unit to activate external interrupt tasks. No external interrupt tasks can be
activated if the Unit is in any other position (i.e., 6th Unit position or further away
from the CJ1-H CPU Unit, or 4th Unit position or further away from the CJ1M
CPU Unit), or if it is on a CJ-series Expansion Rack.
2. The maximum number of Units per Rack is also depending on the maximum
supply current of the Power Supply Unit and the current consumption of other
Units on the Rack.
3. The CJ1W-CT021 Special I/O Unit is allocated words for 40 words in the Spe-
cial I/O Unit (CIO) Area (refer to 4-2-3 "CIO-Memory Mapping").
4. The CJ1W-CT021 Special I/O Unit is allocated words for 4 Units in the Special
I/O Unit DM Area. From the 400 DM words that are allocated, the first 113
words are used to make the DM-settings and the remaining 287 words can be
used as work-words (refer to 4-2-4 "DM-Memory Mapping").
7
Specifications and Characteristics Section 1-3
8
Specifications and Characteristics Section 1-3
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
Freeze Output States*1
Predefine Output States*1
Refer to 3-5-4 "Output Control Configuration".
Output Driver Configuration The Output Driver of every Digital Output can be configured as:
NPN
PNP*1
Refer to 3-5-4 "Output Control Configuration".
Reset Signals Every Counter can be reset to zero by (a combination of) the following sources:
Software Counter Reset Bit
Digital Input*1
Z-Input*1
Refer to 3-6 "Reset Signals".
Extra Functions Programmable Output Pulse*1:
To every Digital Output an ON-delay and/or a Pulse Duration [1, 9999 ms]
can be applied (refer to 3-7-1 "Programmable Output Pulses")
Rate Measurement*: For every Counter the Pulse Rate can be measured by
defining a Time-Window [1, 9999 ms]. Up to a maximum of 64 Rate Values
are stored in the Rate History Log File. Rate Values from the Rate History
Log File can be read using the IORD-instruction. Additionally for every
Counter two Rate Ranges can be defined that control the Outputs according
to the measured Rate Value. Refer to 3-7-2 "Rate Measurement".
Hysteresis*1: To prevent Outputs from being switched On and Off by very
small fluctuations in the Counter Value around Range Limits, for every
Counter an Hysteresis-value [1, 255] can be defined (the Unit must in Range
Mode). Refer to 3-7-3 "Hysteresis".
Noise Filtering Counter Inputs To suppress noise on the signal lines of the Counter Inputs (A and B) and the
and Digital Inputs Digital Inputs (I0 and I1) a Noise Filter can be configured:
10 kHz*1
50 kHz (default)
500 kHz*1
For the Digital Inputs the 500 kHz filter can not be selected. The Z-Input
Signals of every Counter are filtered with a fixed Noise Filter of 1 kHz. Refer to
3-7-4 "Noise Filtering".
Initial Counter Value The Initial Counter Value*1 is transferred to the Unit when the Unit is
Powered Up or Restarted. The Initial Counter Value is very useful to
overcome problems in case of power failure. Refer to 3-7-5 "Initial Counter
Value".
9
Specifications and Characteristics Section 1-3
Item CJ1W-CT021
IORD- and IOWR-instructions Run-time*3 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*1 (refer to 4-5-1 "DM-data")
Range- and Comparison Data*1 (refer to 4-5-2 "Range- and Comparison
data")
Captured Counter Value (refer to 4-5-3-1 "Captured Counter Value")
Rate History Log File Data*1 (refer to 4-5-3-2 "Rate History Log File data")
Counter Value (refer to 4-5-3-3 "Counter Value")
(Re) Configure High-speed Counter Unit*1 (refer to 4-5-3-4 "(Re) Configure
Unit")
Error Clear (refer to 4-5-3-5 "Error Clear Command")
Interrupts of Outputs The Digital Outputs and the Soft Outputs of the Unit Output Pattern can all
be configured to generate interrupts to the CJ1-H/CJ1M CPU Unit*1. Refer
to 4-6-1 "Outputs Generating Interrupts".*2
Interrupts of Digital Inputs The Digital Inputs can all be configured to generate interrupts to the CJ1-H/
CJ1M CPU Unit*1. Refer to 4-6-2 "Digital Inputs Generating Interrupts".*2
Error History Log Function Stores up to 30 error log records (refer to 5-2 Error codes)
*1
This specification item is only supported for Circular and Linear Counters (not
for Simple Counters). For a complete overview of the differences between Sim-
ple and Circular/Linear Counters refer to 1-4 "Quick Start Up Reference Guide".
*2 To activate external interrupt tasks, a CJ1-H or CJ1M CPU Unit must be used.
CJ1 CPU Units do not support external interrupt tasks. To activate external
interrupt tasks in a CJ1-H CPU Unit, the CJ1W-CT021 High-speed Counter
Unit must be in one of the five positions immediately to the right of the CJ1-H
CPU Unit. For CJ1M CPU Units, the CJ1W-CT021 High-speed Counter Unit
must be in one of the three positions immediately to the right of the CJ1M CPU
Unit. No external interrupt tasks can be activated if the Unit is in any other posi-
tion (i.e., 6th Unit position or further away from the CJ1-H CPU Unit, or 4th Unit
position or further away from the CJ1M CPU Unit), or if it is on a CJ-series
Expansion Rack.
Power Supply Unit
CJ1-H or CJ1M CPU Unit
1st Unit
2ndUnit
3rd Unit
4th Unit
5th Unit
6thUnit
10th Unit
10
Specifications and Characteristics Section 1-3
*3
If an IOWR- or IORD-instruction is used during operation, comparison will stop
during instruction execution. Care must be taken, therefore, with the timing of
executing instructions. (Refer to 3-5 "Output Control" for details.)
Note 1. The Counter Inputs (A, B, Z) are insulated from each other and from the Digital
Inputs. The Digital Inputs are also insulated from each other. All Counter Inputs
and Digital Inputs are reverse polarity protected and insulated from the I/O-bus.
2. A noise filter can be configured (10 kHz or 50 kHz (default)) for the Digital
Inputs. Every Z-Input has a defined noise filter of 1 kHz.
3. If the 50-kHz noise filter is configured for External Control Inputs, signals of
10 s or longer can be read.
11
Specifications and Characteristics Section 1-3
B B
B B G G
GG
On On
On On
50% 0V
50% 0V
Off Off
Off Off
A A
A A
Relationship between A and B phases with phase Relationship between A and B phases with phase
differential
Relationship between A and inputs
B phases w ith phase differential
Relationship between A and Binputs
phases w ith phase
differential inputs differential
H inputs
Phase A
H
On A
Phase
On
On
50% On
50%
0V
Off 0V
Off Off
Off
Phase A
Phase A
On
On
0V
0V
Phase B Off
Phase B Off
Phase B
D D D D Phase B
DD D D I I I I
Counter Input Z * / Digital Inputs (24V) II Counter Input
I ZI *
Counter Input Z * Counter Input Z *
On On
On On
50% 0V
50% 0V
Off Off
Off Off
Z
Z Z
E J
Z E
J
* Maximum allowed frequency of Z-pulses is 1 kHz * Maximum allowed frequency of Z-pulses is 1 kHz
* M aximum a llowed f requency of Z-pulses is 1 k Hz * Maximum allowed frequency of Z-pulses is 1 k Hz
Note As a general guideline it can be stated that if you want the timing requirements for
the Counter Inputs to satisfy the above mentioned specifications, you must pay
attention to the type of output driver of the encoder being used, the length of the
encoder cable and the frequency of the count pulses generated. For example, if
12
Specifications and Characteristics Section 1-3
Note 1. Every Digital Output has 2 Output drivers available: NPN and PNP (available
as separate pins on the front connectors). Every Output can be separately (DM-)
configured for NPN or PNP. By default the Outputs are configured as NPN-output
(refer to 3-5-4 "Output Control Configuration").
2. The Digital Outputs are insulated from the I/O-bus but not from each other.
They are not short circuit protected.
3. The Output current must not exceed 200 mA per common (i.e. per 2 Digital Out-
puts) otherwise the unit will be damaged.
4. The Outputs can be automatically or manually controlled (DM-setting) by using
Force ON/OFF bits in CIO (refer to 3-5 "Output Control").
5. The state control of the Outputs, in case the operating mode of the PLC-CPU
is changed from RUN/MONITOR PROGRAM, an I/O Bus error or an Over-
flow/Underflow error occurs, can be configured (refer to 3-5-4 "Output Control
Configuration").
13
Specifications and Characteristics Section 1-3
Maximum Switching The maximum switching current depends upon the power supply voltage, as
Capacity shown below.
46
14
Quick Start Up Reference Guide Section 1-4
Counters configured as Circular/Linear Counter can use all the functions and fea-
tures that the Unit offers to you, while Counters configured as Simple Counter only
offer you a limited subset instead. The diagram below shows you all the functional
blocks that the Unit has available to you to operate and configure the Unit (refer to
SECTION 3 "Operation and Configuration"). The numbers in grey refer to the table
on page 16 to indicate which functions are supported for Simple Counters and
which functions for Circular/Linear Counters.
Capture Preset
2, 3 Register 2, 3 Register
Programmable
8
Output Pulse
Counter Inputs
1 Output State
(A, B, Z) 5
Control
Simple
I0 Circular
Digital Inputs I1 Linear NPN/PNP
Automatic
3 (I0, I1) 4 6 Digital Outputs
Output Control
Counter* (O0, O1)
1, 2
Manual
Noise 4 Output Control
11
Filter
10 Hysteresis
Counter Counter
2, 3 Start/Stop 2, 3, 7 Reset
15
Quick Start Up Reference Guide Section 1-4
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").
CJ 1W-CT021
CJ-series CPU Unit
13 IOWR
13 IORD
O1
O0
15 Interrupts
16
Quick Start Up Reference Guide Section 1-4
17
Quick Start Up Reference Guide Section 1-4
*1 The 500 kHz filter can only be configured for the Counter Inputs (not for the Dig-
ital Inputs).
*2 If in a mixed configuration of Simple/Circular/Linear Counters one or more of
the Digital Outputs have been configured to have Interrupt functionality, then
this functionality is applied to the Outputs, both if they are controlled manually
as well as automatically.
*3 If in a mixed configuration of Simple/Circular/Linear Counters one or more of
the Digital Inputs have been configured to have Interrupt functionality, then this
functionality is applied to the Inputs on a rising or falling edge depending on the
Digital Input Function for which the Digital Inputs have been configured.
18
Quick Start Up Reference Guide Section 1-4
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. You can choose to
use Simple Counters if you intend to use the Counter only with basic counting
functionality (refer to 3-2-1 "Simple Counter" for details and to 1-5 Operating Pro-
cedure Guidelines for a quick start up procedure)
Circular/Linear Counter If you want to use the full available functionality for a Counter, you must configure
it for Circular or Linear Counter (refer to 3-2-2 "Circular Counter" and 3-2-3 "Linear
Counter" for details and to 1-5 "Operating Procedure Guidelines" for a quick start
up procedure).
Next the Input Signal Type (Phase Differential, Up/Down, or Pulse & Direction) for
every Counter has to be defined. Depending on the requirements of the application
one or more (maximum 2) Digital Inputs can be assigned to a Counter. To configure
the Digital Input(s) a choice can be made out of 17 available modes (e.g. Gate,
Enable Reset or Combination Modes, see 3-4 "Digital Input Functions"). During
operation of the Counter, the Counter can be Started, Stopped, Reset, Captured
or Preset by using the Digital Input(s) or the corresponding bits in CIO.
Controlling the Outputs is done by choosing the Output Control Mode (Range or
Comparison Mode). Furthermore 4 additional control mechanisms are available to
control the Outputs (Programmable Output Pulse, Output State Control, Manual
Control and Hysteresis). Refer to 3-5 "Output Control".
In case the Counter Input Signals (A, B, Z) and the Digital Input Signals (I0 to I1)
are exposed to electromagnetic noise, a noise filter can be configured (10 kHz,
50 kHz (=default) or 500 kHz) to suppress this noise. The 500 kHz noise filter is
only available for the Counter Input Signals and not for the Digital Input Signals.
Refer to 3-7-4 "Noise Filtering".
Indirect Addressing for The CJ1W-CT021 High-speed Counter Unit is allocated 400 DM-words in the
Circular and Linear Special I/O Unit DM-Area and a block of 40 CIO-words in the Special I/O Unit Area
Counters of the PLC. The configuration of the Unit is done by making the appropriate DM-
settings in the Special I/O Unit DM-Area that is allocated to the Unit.
The Special I/O Unit DM-Area is divided in an area of 30 words to make the Gen-
eral Unit Settings and 2 blocks of 45 DM-words each to make the Counter Specific
Settings, which are unique for every Counter. The remaining 287 words of the 400
DM-words can be used as work-words in the PLC Ladder Program.
19
Quick Start Up Reference Guide Section 1-4
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. If you only intend to use a limited number of
Ranges or Comparison Values then it is also possible to use the work-words of the
Special I/O Unit DM-Area to store the Range or Comparison Data (287 work-
words for the CT021 are available). Therefore, at the end of every block with Coun-
ter Specific Settings, you can specify an Indirect Address. This Indirect Address
points to the actual memory location where the Range- or Comparison Settings of
that specific Counter are stored.
For a detailed description about the CIO- and DM-Memory Allocation refer to 4-2
"Memory Allocation".
Note During operation of the Unit, for Circular and Linear Counters run-time configura-
tion is possible by using the IOWR-instruction from the PLC Ladder Program (refer
to 4-5 "Supported IOWR/IORD-Instructions"). Additionally, the Digital Inputs and
Outputs can be configured to generate interrupts to the PLC by setting the appro-
priate Interrupt Masks in DM. (refer to 4-6 "Interrupts")
20
Operating Procedure Guidelines Section 1-5
Next you must execute step 2, 3, 4, and 5. Once the I/O table is created in step 5,
the Unit must be configured if you have chosen for Configuration 2 or 3. If you have
chosen for Configuration 1 the Unit is ready to operate. Consequently guidelines
to be followed after step 5 will depend on the Configuration made in step 1.
CT021
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
789
23
456
01
789
O
N
CN1
ON OFF
2. Set the Machine Number. Refer to 2-1-4 "Machine Number Switch" for further
details.
CT021
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
9 01
456
No.
789
78 No.
101
101
23
456
01
23
789
100
9 01
456
78
CN1
100
Set between 00 - 92
MODE
1 1
B A
21
Operating Procedure Guidelines Section 1-5
3. Install and wire the Unit. Refer to 2-2 "Installation" and 2-3 "Wiring" for further
details.
CT021
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
20 20
23
01
456
789
23
01
456
789
CN1
MODE
1 1
B A
CT021
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
20 20
23
01
456
789
23
01
456
789
CN1
Power ON
MODE
1 1
B A
5. Create the I/O table. The I/O table can be created by using CX-Programmer
Support Software or a Programming Console.
CX-Programmer
CT021
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
20 20
23
01
456
789
23
01
456
789
CN1
MODE
1
Programming Console
1
B A
Unit Configuration After the I/O table is created in step 5, you have to configure the Unit if you have
chosen for Configuration 2 or 3 in step 1. Configuration is done by making the
appropriate DM-settings. The Unit can be configured by using CX-Programmer
Support Software or a Programming Console. Two Programming Consoles can be
used with the CJ-series CPU Units: the C200H-PRO27-E and the CQM1-PRO01-
E. CS1W-KS001 Key Sheet must be used for both.
Depending on the Configuration (1, 2 or 3) that you specified in step 1, you should
continue with the corresponding step of the configuration-process:
22
Operating Procedure Guidelines Section 1-5
Refer to 3-2-1 "Simple Counter" for more details about the Simple Counter.
Refer to 3-2-2 "Circular Counter" and 3-2-3 "Linear Counter" for more details
about both Counter Types. Refer to 4-1-2 "Special I/O Units Restart bits" for more
information about restarting the Unit.
Refer to 3-2-1 "Simple Counter", 3-2-2 "Circular Counter" and 3-2-3 "Linear Coun-
ter" for more details about the Counter Types. Refer to 4-1-2 "Special I/O Units
Restart bits" for more information about restarting the Unit.
Note For using Simple Counters you do not have to clear the corresponding DM-set-
tings to zero (=0000), since the Unit does not use this information and always uses
the default (=0000) settings.
23
Application Areas Section 1-6
Section 6-2 "Length Measurement", for example, describes the following applica-
tion:
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
20 20
23
456
01
789
23
456
01
789
CN1
2
1
O
N
MODE
1 1
B A
Photo-electric Photo-electric
sensor (D2) sensor (D1)
Pusher
24
SECTION 2
Components, Installation and Wiring
This section provides details of the components, switch settings and other information required to install and operate
CJ1W-CT021 High-speed Counter Units.
25
Components and Switch Settings Section 2-1
66.5
2.7 31 65
CT021
RUN ERC ERH
CH1 A B Z I0 O0 Indicators
CH2 A B Z I1 O1
20 20
23
9 01
456
Machine
78
23 Number Switch
9 01
456
90
78
CN1
Counter Mode
2
Switch
1
O
N
MODE
1 1
B A
2.7
Connecting Cable
26
Components and Switch Settings Section 2-1
2-1-2 Indicators
CT021
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
The indicators on the LED-display show the operating status of the Unit. The fol-
lowing table shows the meaning of the indicators.
27
Components and Switch Settings Section 2-1
1 2
1 2
O
N
O
N
ON OFF ON OFF
1 2
O
N
After having set the DIP switch of the Counter to ON, further selection between
Circular and Linear Counter, is done by DM-setting. Counters that are configured
for Circular/Linear Counter can make use of all the features that the High-speed
Counter Unit offers. More information on Circular and Linear Counters can be
found in 3-2-2 "Circular Counter" and 3-2-3 "Linear Counter" respectively.
The Simple Counter is an extra feature of the High-speed Counter Unit, that ena-
bles an easy and fast set-up of the Unit since no (DM-) configuration settings have
to be made (all default (=0000) DM-settings are used). Consequently for Simple
Counters only a reduced subset of all the features that the Unit offers are availa-
ble. For further details about the Simple Counter and the features supported, see
3-2-1 "Simple Counter".
!Caution Since the Counter Type Switch is located at the back of the Unit, always turn OFF
the power to the PLC before installing or removing the Unit.
28
Components and Switch Settings Section 2-1
X100
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.
The allocation of these words is done according to the Machine Number set. The
Machine Number is set by using the two Machine Number rotary switches on the
front panel of the Unit.
Always turn OFF the power before setting the Machine Number. Use a flat-blade
screwdriver, being careful not to damage the switch. Be sure not to leave the
switch midway between settings.
Note The Machine Number determines which words in the CPU Units Special I/O Unit
Area (CIO 2000 to CIO 2959 and DM 20000 to DM 29599) are allocated to the
High-speed Counter Unit. Since the Unit is allocated 400 DM-words and 40 CIO-
words, the Machine Number can only be set between 00 and 92. The Machine
Numbers 93, 94 and 95 can not be set.
29
Installation Section 2-2
Note 1. If two or more Special I/O Units are assigned the same Machine Number, a fatal
error Unit No. Duplication Error (in the PLC-CPU) will be generated (A40113
will turn ON) and the PLC will not operate.
2. The High-speed Counter Unit is allocated the words for 4 Units. If you use Spe-
cial I/O Units that are allocated more than 100 DM-words and 10 CIO-words,
like the CJ1W-CT021 High-speed Counter Unit, you should make sure that no
memory overlapping occurs. If the Machine Number for the High-speed Coun-
ter Unit is set to n the Machine Number of the Special I/O Unit should be set
to n+4, in order to avoid memory overlapping. In case two or more Special I/O
Units have set Machine Numbers that cause an overlapping of allocated mem-
ory a fatal error Unit No. Duplication Error (in the PLC-CPU) will be generated
(A40113 will turn ON) and the PLC will not operate.
3. Besides the memory that is allocated to the High-speed Counter Unit in the
Special I/O Unit DM Area, for every Counter additional memory can be allo-
cated in DM/EM. This extra allocated amount of memory is used to make the
Counter Specific Settings related to Range or Comparison Mode. Memory is
allocated by specifying an Indirect Address for every Counter in the Special I/
O Unit DM Area. For details about Indirect Addressing refer to 4-2-2 "Indirect
Addressing".
2-2 Installation
2-2-1 System Configuration Precautions
Up to 24 Units can be connected for each PLC (CPU Unit), including up to 10 on
each Rack (CPU Rack and Expansion Racks).
Note The Unit must be mounted to one of the five positions immediately to the right of
the CJ1-H CPU Unit (when facing the PLC) to generate interrupts to the CPU
Unit to execute external interrupt tasks. Interrupts are not supported from any
other location on the CPU Rack and are not supported at all from Expansion
Rack. They are also not supported by CJ1 CPU Units.
!Caution Be sure to turn OFF the power supply to the PLC before installing or removing
Units or connecting or disconnecting connectors.
30
Installation Section 2-2
PA205R
MCPWR
L1 BUSY
20 20
AC100-240V 23
INPUT
01
456
789
L2/N
23
456
01
789
PERIPHERAL
CN1
RUN
OUTPUT
AC240V
DC24V
MODE
1 1
PORT B A
2. Slide the yellow sliders on the top and bottom of the Units until they click into
place, firmly locking the Units together.
Slide the sliders toward the back
until they click into place.
Slider
PA205R
POWER SYSMAC
CJ1G-CPU44
RUN
ERR/ALM
INH
CT021
RUN ERC ERH Lock
PROGRAMMABLE CH1 A
PRPHL B Z I0 O0
CONTROLLER CH2 A
COMM B Z I1 O1
OPEN
Release
MCPWR 20 20
L1 BUSY
23
AC100-240V
01
456
INPUT 789
L2/N
23
456
01
789
PERIPHERAL CN1
RUN
OUTPUT
AC240V
DC24V
MODE
1 1
B A
PORT
3. Attach an End Plate to the Unit on the right end of the Rack.
Note The Units may not function properly if the sliders are not locked into place.
Always connect the End Plate to the rightmost Unit. The CJ-series PLC will not
function properly without the End Plate connected. The End Plate is provided with
the CPU Unit.
31
Wiring Section 2-3
2-3 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. The following table lists the allo-
cation of the external signals to the respective pins.
Power Supply External power has to be applied to the Power Supply pins in order to feed the Dig-
ital Outputs. Depending on what your application requires you can apply an exter-
nal voltage between 12 to 24 VDC. In case the Digital Outputs are not used in your
application, no external power has to be supplied.
32
Wiring Section 2-3
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). After you have configured the Digital Outputs for NPN or PNP you should
make sure to use the corresponding physical NPN or PNP output pin.
Digital Inputs The Digital Inputs should be supplied with 24 VDC signals. Every Digital Input (I0
and I1) is equipped with a separate Ground Signal (0V) and has its own electronic
input circuitry. This gives you the opportunity to connect sensors either with a
NPN- or PNP-output driver. By making the appropriate DM-setting it is possible to
assign multiple Digital Inputs to single Counters (refer to 3-4 "Digital Input Func-
tions" for more details).
Counter Inputs To the Counter Inputs of the High-speed Counter Unit signals can be applied orig-
inating from one of the following driver types:
RS-422 Line Driver
5, 12 and 24 VDC signals from NPN- or PNP Drivers
The Unit allows you to connect Line Driver signals and 24 VDC signals to any
Counter. The following table gives an overview of which driver signals can be
applied to which Counters:
Counter 1
Counter 2
!Caution Be sure that all the connectors are wired correctly and properly connected to the
High-speed Counter Unit, to prevent the Unit from malfunctioning.
To wire the CJ1W-CT021 in order to connect the external signals (Power Supply,
the Digital I/O and the Counter Inputs) two methods are available:
1. Directly connecting the wires and cables to the external connector, which is
standard delivered with the High-speed Counter Unit
2. Indirectly connecting the wires and cables to the screw terminals of a Terminal
Block Unit. The Terminal Block Unit is connected to the Unit with a standard
(flat-) cable. Both parts can be ordered separately.
External Connector The connector has to be assembled from the separate parts that it exists of and
that are supplied together with the Unit. Most important part is the connector jack
(FCN-361J040) that contains 40 soldering terminals to which the wires have to be
soldered.
33
Wiring Section 2-3
A B
1
A1 B1
A2 B2
A3 B3
A4 B4
5
A5 B5
Insulating tube
A6 B6
2
Wire (cross section: 0. 3 m m m ax.) A19 B19
20
A20 B20
Cable separation
Encoder cable
Assembling Connectors
Three, M2 pan-head screws
(8 mm long)
Two, M2.6 long screws
Case
Connector jack
Cable clamp
Case
One, M2.6 nut
Three M2 nuts
Note 1. The cross section of the signal wires that can be connected to each soldering
terminal must be 0.3 mm2
2. Do not short circuit any terminals when soldering. Recommended is to cover
every soldered wire with an insulated tube.
34
Wiring Section 2-3
3. When using multi-conductor cables, separate the input- and output cables.
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. For this pur-
pose you should use a Terminal Block Unit. The following Terminal Block Units are
recommended for using together with the CJ1W-CT021 High-speed Counter Unit:
These Terminal Block Units can be mounted to a DIN-rail or can be mounted using
screws. The connector on front of the Unit should be connected to a Terminal
Block Unit through a standard (40 wire) cable. For this purpose you can use the
standard available cables with product-number XW2Z-xxxB. The length of the
cable is indicated by xxx in centimetres. The following cables are available:
XW2Z-050B (0.5 m)
XW2Z-100B (1 m)
XW2Z-150B (1.5 m)
XW2Z-200B (2 m)
XW2Z-300B (3 m)
XW2Z-500B (5 m)
The next figure shows how to use the Terminal Block Unit in a typical configuration
together with the CJ1W-CT021 High-speed Counter:
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
20 20
23
456
01
789
23
456
01
789
CN1
2
1
O
N
MODE
1 1
B A
35
Wiring Section 2-3
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.
0V A6 (0 V)
A5 (0 V)
36
Wiring Section 2-3
Counter 1: Counter 2:
Phase A
24 V
B9 (24 V) B16 (24 V)
5 V/12 V
A9 (5 V) A16 (12 V)
LD+
B8 (LD+) B15 (LD+)
0 V/LD
A8 (0 V/LD) A15 (0 V/LD)
37
Wiring Section 2-3
Fuse
A1 : 0V COM for Digital Outputs O0 and O1
NPN
Digital Output O0
PNP
NPN
Digital Output O1
PNP
NPN or PNP can be set for each Digital Output.
(Output control setting: m+6.)
38
Wiring Section 2-3
A5
A6
39
Wiring Section 2-3
B2 : O0 (PNP)
Internal Circuitry
A3 : O1 (NPN)
Load
NPN
Digital Output O0 (PNP)
PNP
NPN
Digital Output O1 (NPN)
PNP
Set the software switches for every Digital Output in the appropriate position
40
Wiring Section 2-3
B9 (Phase A 24 V)
Blac k: Phase A A8 (Phase A 0 V)
Encoder
B11 (Phase B 24 V)
White: Phase B A10 (Phase B 0 V)
B13 (Phase Z 24 V)
Orange: Phase Z
A12 (Phase Z 0 V)
0V
+24 V
24 VDC
Power Suppl y
Power Supply 0V
24 VDC Powerr Supply
u
+24 V
High-speed
igh-speed Counter
Shielded
hielde twisted
twiste -pair
- air cable
B9
IA A8
Phase
Ph eA
B11
IB A10
Phase
Ph eB
B13
IZ A12
Phase
Ph eZ
41
Wiring Section 2-3
0V
+24 V
24 VDC
Power Supply
IA A8
Phase A
B11
IB A10
Phase B
B13
IZ A12
Phase Z
42
Wiring Section 2-3
0V
+5 V
5 VDC
Power Supply
Power Supply
High-speed Counter
Shielded twisted- pair cable
A+ B15
A- A15
B+ B17
B- A17
Z+ B19
Z- A19
43
SECTION 3
Operation and Configuration
This section describes how to configure the CJ1W-CT021 High-speed Counter Unit and how to operate the Unit according to
the specific requirements of your application.
3-1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3-2 Counter Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3-2-1 Simple Counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3-2-2 Circular Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3-2-3 Linear Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3-3 Input Signal Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3-3-1 Phase Differential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3-3-2 Up & Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3-3-3 Pulse & Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3-4 Digital Input Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3-5 Output Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3-5-1 Range Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3-5-2 Comparison Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3-5-3 Manual Output Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3-5-4 Output Control Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3-6 Reset Signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3-7 Extra Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3-7-1 Programmable Output Pulses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3-7-2 Rate Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3-7-3 Hysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3-7-4 Noise Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3-7-5 Initial Counter Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
45
Overview Section 3-1
3-1 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. For Simple Counters the default DM-settings are used and no
DM-settings can be made.
In this section you will learn how to configure the CJ1W-CT021 High-speed Coun-
ter Unit in order to adjust the behaviour of the Unit according to the specific
requirements of your application (refer to 1-4 "Quick Start Up Reference Guide" for
an overview of the configuration items for every Counter). Also throughout this
section, the CIO-words that are relevant to operate the Unit from the PLC ladder
program are mentioned (refer to 4-2-3 "CIO-Memory Mapping" for an overview).
For an overview of all the DM-settings that can be made refer to 4-2-4 "DM-Mem-
ory Mapping".
All the features and functions that the High-speed Counter Unit offers are (DM-)
configurable (except the configuration of the Simple Counter which is done by DIP
switch). In the Special I/O Unit DM-area that is allocated to the High-speed Coun-
ter after the Unit has been properly installed (see 1-5 "Operating Procedure
Guidelines"), all the available features and functions of the Unit are represented by
their corresponding DM-words. You are free to choose the sequence in which you
configure the different functions. However, you are recommended to follow the
sequence of configuring the features and functions in the order as described in
this section.
Note 1. Throughout this section for the DM- and CIO- addresses an offset is defined
with respect to the physical address of the first word of the block that is allo-
cated to the High-speed Counter Unit (N = Machine Number):
m = DM20000 + (Nx100), address of the first word of the block of 400 DM-
words that are allocated to the Unit
n = CIO2000 + (Nx10), address of the first word of the block of 40 CIO-
words that are allocated to the Unit
Example: m+2 indicates the DM-word located at DM20000 +(Nx100) + 2.
2. Double words are indicated as for example n+22, n+23 (double word in CIO)
or m+57, m+58 (double word in DM). How to distinguish between the least-
and most significant words (LSW and MSW) within double words, you should
refer to the section called About this Manual at the beginning of this Manual.
46
Counter Types Section 3-2
The configuration starts by setting each Counters DIP switch on the front of the
Unit in the appropriate position. By default this switch is in the OFF position which
selects the Simple Counter. To select a Circular or Linear Counter set the switch
in the ON position. After you have set the DIP switch in the ON position you can
configure every Counter as Circular or Linear Counter by giving the corresponding
word in DM the appropriate setting:
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+30 m+75
Counter Type:
0 = Circular Counter
1 = Linear Counter
For Circular and Linear Counters all the functions and features of the High-speed
Counter Unit are available and configurable. For Simple Counters only the default
functions and features are supported since the Unit ignores the DM-settings for
Simple Counters.
Counter Value For all Counter Types the 32-bit Counter Value is reflected in CIO.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+22 n+27
n+23 n+28
Counter Value
Simple Counter: between 80000000 H and 7FFFFFFF H
Circular Counter: between 00000000H and FFFFFFFFH
Linear Counter: between 80000000 H and 7FFFFFFF H
47
Counter Types Section 3-2
If you want to use all the available features and functions of the High-speed Coun-
ter Unit you must configure a Counter not as Simple Counter but as Circular or Lin-
ear Counter. For detailed information on Circular and Linear Counters refer to 3-
2-2 "Circular Counter" and 3-2-3 "Linear Counter".
Simple Counter The following features and functions are supported for Simple Counters in a
Configuration default configuration:
A Simple Counter can count up and down over the full (32-bits) counting range
(comparable to a Linear Counter, refer to 3-2-3 "Linear Counter").
By using CIO-bits the Counter Value of a Simple Counter can be Preset, Reset
or Captured and the Gate can be Opened or Closed to allow counting pulses
or not.
Only Phase Differential (multiplication x1) Signals can be connected to a Sim-
ple Counter. The Z-signal cannot be used to trigger a Reset, only its status is
reported in CIO (and can be used to trigger a reset indirectly via the PLC lad-
der-program).
The Noise Filters for the Simple Counter and the Digital Inputs are fixed at
50 kHz. This means that the maximum frequency of the count pulses up to
50 kHz is guaranteed.
The Digital Outputs of the High-speed Counter Unit can only be controlled
manually using the corresponding bits in CIO.
The Digital Inputs and Outputs can generate Interrupts if Interrupts have been
enabled (in a mixed configuration with Simple/Circular/Linear Counters).
The two Digital Outputs use an NPN-Output Driver.
48
Counter Types Section 3-2
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".
Three IORD/IOWR-commands are supported: read Captured Counter Value
(refer to 4-5-3-1 Captured Counter Value), read/write Counter Value (refer to
4-5-3-3 "Counter Value") and write Error Clear Command (refer to 4-5-3-5
"Error Clear Command").
Errors are normally reported in CIO (refer to 5-2 "Error codes").
The following features and functions are not supported for Simple Counters:
IORD and IOWR-instructions to change DM-settings cannot be addressed to
Simple Counters and will generate an error (refer to 5-2-2 "IOWR/IORD-
instruction errors"). Only the three above mentioned IORD/IOWR-instructions
are supported for Simple Counters.
Rate Measurement.
Note 1. The CPU exchanges data with the Simple Counter via the I/O Refresh Data
Area (CIO).
2. If a Counter is configured for Simple Counter, it is indicated in CIO.
3. All the DM-words that are allocated to a Simple Counter to make the Counter
Specific Settings, can be used as work-words.
Controlling Simple Simple Counters can be controlled from CIO. For an overview of all control bits
Counters via CIO and words refer to 4-2-3 "CIO-Memory Mapping".
The following gives a detailed description of all the features and functions for Sim-
ple Counters that are available in CIO:
32 Bits Counting Range A Simple Counter has the full counting range (=32 bits) available to count up- or
downwards over the positive and negative counting range between the Lower
Count Limit (2,147,483,648) and the Upper Count Limit (+2,147,483,647).
Lower Count Limit Upper Count Limit
-2,147,483,648 0 +2,147,483,647
(=80000000H ) (=7FFFFFFFH )
Up Counting
Counter Value
Down Counting
Underflow Overflow
Reporting Overflow and If the Counter Value goes above the Upper Count Limit or below the Lower Count
Underflow and indicating Limit an Overflow or Underflow will be generated respectively. These are reported
Simple Counter in CIO for every Counter in the corresponding bits. At Over- and Underflow the
Counter Value will be frozen at the Upper- and Lower Count Limit respectively and
49
Counter Types Section 3-2
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 8 7 6 5 4 3 2 1 0
n+24 n+29
Counter Overflow:
0 = No Overflow
1 = Overflow
Counter Underflow:
0 = No Underflow
1 = Underflow
Simple Counter Indication:
0 = Circular/Linear Counter
1 = Simple Counter
Gating of a Simple Counter The Gate of a Simple Counter can be opened and closed using the Open Gate
Bit and Close Gate Bit in CIO. If the Gate of the Simple Counter is Open the
Counter is ready to count pulses. If the Gate of the Simple Counter is Closed the
Counter will not count pulses. A rising edge of the Open- or Close Gate Bit triggers
the corresponding action in the next I/O Refresh Cycle.
Initially, after the High-speed Counter Unit has been powered up or restarted, the
Gate of the Simple Counter is closed and must be opened first (by setting the
Open Gate bit to 1) to enable counting.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+2 n+5
Open Gate:
01 = Open Gate
Close Gate:
01 = Close Gate
A rising edge of the "Open Gate Bit" opens the Gate regardless of the state of the "Close Gate
Bit". A rising edge of the "Close Gate Bit" closes the Gate regardless of the state of the "Open
Gate Bit". At a simultaneous rising edge of both bits, the state of the Gate is unchanged.
Presetting a Simple The Unit is equipped with a Preset Register that contains the Preset Value for
Counter every (Simple) Counter. To change the Preset Value you can change the Preset
Value in CIO of the corresponding Counter. The Counter Value is overwritten with
the Preset Value at a rising edge of the Preset Counter Bit of the corresponding
50
Counter Types Section 3-2
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 8 7 6 5 4 3 2 1 0
n+2 n+5
Preset Counter:
01 = Preset Counter
CNT1: CNT1: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+3 n+6
n+4 n+7
Preset Value
Set Preset Value for Simple Counter between 80000000H and 7FFFFFFFH.
Resetting a Simple Counter For every Simple Counter the Software Reset Bit can be used to trigger a Reset.
A rising edge of the Software Reset Bit triggers a Reset in the next I/O Refresh
Cycle.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+2 n+5
Software Reset Bit:
01 = Reset Counter
Capturing a Simple Counter Each Simple Counter has a capture register. A rising edge of the Counter Capture
Bit reads the current counter value and stores it in the register. Only the most cur-
rent value is maintained.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+2 n+5
To use the captured counter value in the ladder program, read the value with the
IORD-instruction. Refer to 4-4 "IORD-Instruction" for details.
Status Digital Inputs of The status of the two Digital Inputs is reflected by their corresponding bits in CIO.
Simple Counter You can use these bits as event flags in the Ladder Program.
Bits 0 and 1 correspond to the Physical Digital Inputs I0 and I1.
1 = Input is ON
0 = Input is OFF
Digital Input Status:
n+16 I1 I0
General Setting:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
51
Counter Types Section 3-2
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 8 7 6 5 4 3 2 1 0
n O1 O0
Manual Output Control:
0 = Force Output OFF
1 = Force Output ON
Selection Automatic*/Manual:
0 = Automatic Output Control
1 = Manual Output Control
Status Digital Outputs of The current status of the two Digital Outputs is reported in CIO.
Simple Counter
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+14 O1 O0
Digital Output Status:
0 = Output is OFF
1 = Output is ON
52
Counter Types Section 3-2
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
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.
Rollover
Up
Down
Counting
Counting
Counter Value
Configuring Upper Count The Upper Count Limit can be configured between 1 and 4,294,967,295
Limit (=FFFFFFFFH). By default the Upper Count Limit is equal to the maximum possi-
ble count limit of FFFFFFFFH.
For Circular Counters the Counter automatically rolls over to 0 if the Counter Value
exceeds the Upper Count Value and continues counting. If the Counter Value
goes below 0 the Counter rolls over to the Upper Count Value and continues
counting.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+33 m+78
m+34 m+79
Upper Count Limit
Set Upper Count Limit for Circular Counters between 00000001H and FFFFFFFFH.
Per default (=00000000H) the Upper Count Limit is equal to FFFFFFFFH.
53
Counter Types Section 3-2
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. By default the Minimum and Maximum
Count Limits are set to the maximum counting limits (i.e. 2,147,483,648 and
+2,147,483,647 respectively).
2,147,483,648 Lowercount Limit 1 0 1 Uppercount Limit +2,147,483,647
80000000 H Lowercount Limit FFFFFFFF H 00000001 Uppercount Limit 7FFFFFFFH
Up Counting
Counter Value
Down Counting
Underflow Overflow
If the Counter Value goes above the Upper Count Limit or below the Lower Count
Limit an Overflow- and Underflow flag will be set respectively. These are reported
in CIO for the corresponding Counter.
54
Counter Types Section 3-2
Configuring Upper and The Upper Count Limit must be positive and the Lower Count Limit must be neg-
Lower Count Limits ative (zero is not allowed as Count Limit). To set the Maximum and Minimum
Count Limits refer to the following:
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Upper Count Limit
m+33 m+78
m+34 m+79
m+35 m+80
m+36 m+81
Lower Count Limit
Set Upper Count Limit for Linear Counters between 00000001H and 7FFFFFFFH . By default
(=00000000H) the Upper Count Limit is equal to 7FFFFFFFH . Set Lower Count Limit for Linear
Counters between 80000000H and FFFFFFFFH . By default (=00000000) the Lower Count Limit is
equal to 80000000 H.
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 8 7 6 5 4 3 2 1 0
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
Underflow in CIO.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+24 n+29
Counter Overflow:
0 = No Overflow
1 = Overflow
Counter Underflow:
0 = No Underflow
1 = Underflow
55
Input Signal Types Section 3-3
Input A
A
Input Z
Z
(Reset input)
Phase A
Phase B
1 2 3 2 1 0
Multiplication x1
1 2 3 4 5 6 5 4 3 2 1 0
Multiplication x2
1 2 3 4 5 6 7 8 9 10 11 12 11 10 9 8 7 6 5 4 3 2 1 0
Multiplication x4
Multiplication x1 By default the Counter is configured for Multiplication by 1. If the counter is up-
counting (signal A leads to signal B) pulses are taken into account by the Counter
on the rising edges of signal A. If the Counter is down-counting pulses are taken
into account on the falling edges of input A.
56
Input Signal Types Section 3-3
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. If the Counter is down-counting pulses are also taken into account on the
rising- and falling edges of signal A.
Note For Counter Reset options (Z-input included) refer to 3-6 "Reset Signals".
Incremental encoder
or other pulse Input A
generator Increment pulse
Input B
Incremental encoder
or other pulse Input Z
generator Decrement pulse
1 2 3 1 2
Increment pulse
2 1 0
Decrement pulse
57
Input Signal Types Section 3-3
Incremental encoder
or other pulse Input A
generator Count pulse
Input B
Sensor or
Input Z
switch Direction
control
1 2 3 2 1 2 3
Count pulse
Direction control:
High = Increment
Low = Decrement
58
Digital Input Functions Section 3-4
assigned to
Digital Input 1 Counter 'c'
c = 1 or 2
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".
Digital Input Functions Furthermore, the function of every Digital Input can be selected from one out of 17
available functions. Every function performs its unique action on the Counter to
which it is assigned. The action can be performed on the rising or on the falling
edge of the Digital Input signal. Depending on the requirements of your application
you must select the corresponding Function. By default no function is assigned to
the Digital Inputs and no action is performed on a rising or falling edge of the Dig-
ital Input signal (only the status of the Digital Input is reported in CIO).
I0 I1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+17 m+18
Digital Input Function:
00(BCD) = No Function
01(BCD) = Gate Positive
02(BCD) = Gate Negative
03(BCD) = Preset Rising Edge
04(BCD) = Preset Falling Edge
05(BCD) = Reset Rising Edge
06(BCD) = Reset Falling Edge
07(BCD) = Capture Rising Edge
08(BCD) = Capture Falling Edge
09(BCD) = Stop, Capture and Continue
10(BCD) = Stop, Capture and Continue (inverted)
11(BCD) = Stop, Capture, Reset and Continue
12(BCD) = Stop, Capture, Reset and Continue (inverted
13(BCD) = Capture-Reset Rising Edge
14(BCD) = Capture-Reset Falling Edge
15(BCD) = Enable Reset
16(BCD) = Disable Reset
Counter:
01(BCD) = Counter 1
02(BCD) = Counter 2
59
Digital Input Functions Section 3-4
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. When the Gate is open, the Counter is able to count
pulses. When the Gate is closed, the Counter will not count pulses. The Positive
Gate Function (01) results in an open Gate when the level of the signal applied to
the Digital Input is high and a closed Gate when the level of the signal applied to
the Digital Input is low. For the Negative Gate Function (02) the same functionality
is applied to the Counter for inverted signals.
Function 01: Function 02:
Gate Positive Gate Negative
Gate Closed Gate Op en Gate Closed Gate Closed Gate Op en Gate Closed
The Gate of a Counter can also be opened and closed by using the Open Gate
Bit and Close Gate Bit in CIO.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+2 n+5
Open Gate:
01 = Open Gate
Close Gate:
01 = Close Gate
A rising edge of the "Open Gate Bit" opens the Gate regardless of the state of the "Close Gate
Bit". A rising edge of the "Close Gate Bit" closes the Gate regardless of the state of the "Open
Gate Bit". At a simultaneous rising edge of both bits, the state of the Gate is unchanged.
Note Initially, at power up or restart of the Unit, for all counter types (i.e. Simple-, Circu-
lar-, and Linear Counters) the Gate is closed and counting is disabled. In order to
enable counting you must open the Gate first.
Preset Function A Digital Input configured to have Preset functionality will preset the Counter with
the Preset Value on a rising edge (Preset Rising Edge, Function 03) or falling edge
(Preset Falling Edge, Function 04) of the Digital Input signal. This will cause the
Counter Value to be overwritten with the Preset Value.
Function 03: Function 04:
Preset Rising Edge Preset Falling Edge
The Unit is equipped with a Preset Register for every Counter that contains the
Preset Value. To change the Preset Value you can change the (32-bits) Preset
Value in CIO of the corresponding Counter. The Counter Value is overwritten with
60
Digital Input Functions Section 3-4
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 8 7 6 5 4 3 2 1 0
n+2 n+5
Preset Counter:
01 = Preset Counter
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+3 n+6
n+4 n+7
Preset Value
Set between 00000000H and FFFFFFFFH (Circular Counter)
Set between 80000000H and 7FFFFFFFH (Linear Counter)
Reset Function A Digital Input configured to have Reset functionality will reset the Counter to zero
on a rising edge (Reset Rising Edge, Function 05) or falling edge (Reset Falling
Edge, Function 06) of the Digital Input signal.
Function 05: Function 06:
Reset Rising Edge Reset Falling Edge
To reset a Counter with Function 05 or 06, the Software Enable Reset Bit must
be set to 1. A Counter can also be reset by using the Software Reset Bit in CIO.
Setting this bit to 1 causes a forced reset of the corresponding Counter.
Refer to 3-6 "Reset Signals" for detailed information about resetting Counters.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+2 n+5
Software Reset Bit:
0 1 = Reset Counter
Note Resets from an External Control Input signal will be executed within 300 s.
61
Digital Input Functions Section 3-4
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. The Unit is equipped with a Capture Register for every Counter. Every time
that a Counter Value is captured the contents of the Capture Register are over-
written with the new Captured Value and the old Captured Value is lost.
Function 07: Function 08:
Capture Rising Edge Capture Falling Edge
The Counter Value can also be captured by using the Capture Counter Value Bit
in CIO.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+2 n+5
If you want to use the Captured Value in your Ladder Program, you must use the
IORD-instruction. This instruction reads the Captured Value from the Unit into a
specified location in the memory of the PLC. For more details on using the IORD-
instruction and reading the Captured Value refer to 4-4 "IORD-Instruction".
Stop, Capture and Continue A Digital Input configured to have Stop, Capture and Continue functionality will
Stop the Counter (= close the Gate) and Capture the current Counter Value into
the Capture Register on a rising edge of the signal applied to the Digital Input
(Stop, Capture and Continue, Function 09). On the next falling edge the Counter
will continue counting (= open the Gate). For the Stop, Capture and Continue
(Inverted) Function (10) the same functionality is applied to the Counter for
inverted signals.
Function 09: Function 10:
Stop, Capture and C ontinue Stop, Capture and C ontinue (Inverted)
Gate Op en Gate Op en
Stop counting and Capture Continue Counting Stop counting and Capture Continue Counting
current Counter Value into current Counter Value into
Capture Register Capture Register
Note The Open Gate Bit, Close Gate Bit, Preset Counter Bit, Reset Bit, or the Counter
Capture Bit in CIO may not be executed if turned ON for only one PLC cycle.
Always keep these bits turned ON until the execution status changes for the cor-
responding flags in n+24 or n+29.
62
Digital Input Functions Section 3-4
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). On the next falling edge the Counter
Value will be Reset to zero and continue counting (= open the Gate). For the Stop,
Capture, Reset and Continue (Inverted) Function (12) the same functionality is
applied to the Counter for inverted signals.
Function 11: Function 12:
Stop, Capture, Reset and C ontinue Stop, Capture, Reset and C ontinue (Inverted)
Gate Closed Gate Open Gate Closed Gate Open
Stop counting and Reset Counter Value Stop counting and Reset Counter Value
Capture Counter Value to zero and C ontinue Capture Counter Value to zero and C ontinue
into Capture Register Counting into Capture Register Counting
To reset a Counter with Function 11 or 12, the Software Enable Reset Bit must be
set to 1. Refer to 3-6 "Reset Signals" for detailed information about resetting
Counters.
Capture and Reset A Digital Input configured to have Capture and Reset functionality will capture the
current Counter Value into the Capture Register and Reset the Counter to zero on
a rising edge (Capture-reset Rising Edge, Function 13) or falling edge (Capture-
Reset Falling Edge, Function 14) of the signal applied to the Digital Input.
Function 13: Function 14:
Capture-Reset Rising Edge Capture-Reset Falling Edge
To reset a Counter with Function 13 or 14, the Software Enable Reset Bit must be
set to 1. Refer to 3-6 "Reset Signals" for detailed information about resetting
Counters.
63
Digital Input Functions Section 3-4
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.
Function 15: Function 16:
Enable Reset Disable Reset
External Reset External Reset External Reset External Reset External Reset External Reset
Disabled Enabled Disabled Enabled Disabled Enabled
In order to be able to reset a Counter with Function 5, 6, 11, 12, 13 or 14, resetting
must be Enabled by setting the Software Enable Reset Bit. Refer to 3-6 "Reset
Signals" for detailed information about resetting Counters.
Digital Input Status The status of the two Digital Inputs is reflected by their corresponding bits in CIO.
You can use these bits as event flags in the Ladder Program.
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+16 I1 I0
Digital Input Status:
0 = Input is OFF
1 = Input is ON
The above-mentioned Digital Input Status Word reflects the status of all Digital
Inputs. However, very short pulses on the Digital Inputs (shorter than the PLC-
cycle or shorter than the time the Data Transfer Busy bit is ON for IOWR-instruc-
tion execution), may not be seen in the Digital Status Word.
Action Status The Preset, Reset and Capture actions can be detected via CIO. Each action has
a corresponding bit which is ON for exactly one PLC-cycle-time after the occur-
rence of that action. You can use these bits in the Ladder Program to take the
appropriate action.
Z-Input Status For each counter the Z-input status is reflected in CIO. The bit is ON for ecactly
one PLC-cycle-time after the Z-input has been activated.
64
Output Control Section 3-5
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 8 7 6 5 4 3 2 1 0
n+24 n+29
Gate Open/Closed:
0 = Gate Closed
1 = Gate Open
Counting Direction:
0 = Counter counts down
1 = Counter counts up
Preset Activated:
ON for exactly one PLC-cycle
Reset Activated:
ON for exactly one PLC-cycle
Capture Activated:
ON for exactly one PLC-cycle
Z-signal Activated:
ON for exactly one PLC-cycle
The Reset, Preset, Capture and Z-signal Activated Bits are ON for exactly one PLC-cycle after
the occurrence of a (short) pulse which was detected since the previous I/O Refresh.
Besides automatically, the Digital Outputs can also be controlled manually (refer
to 3-5-3 "Manual Output Control").
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m
Output Control Mode:
0 = Range Mode
1 = Comparison Mode
65
Output Control Section 3-5
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. The two Digital Outputs represent the Physical Outputs O0 and
O1 of the Unit.
31 4 3 2 1 0
Soft Outputs 2 to 31
Digital Outputs 0 and 1 correspond with the Physical Digital Outputs O0 and O1.
Output Status The status of the Digital Outputs is reflected by their corresponding bits in CIO and
can be used as event flags in the Ladder Program. The Soft Outputs for instance
can be used in the Ladder Program to control outputs of an external Digital Output
Unit.
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+14 15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
n+15 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Output Status
0 = Output is OFF
1 = Output is ON
= Digital Output
(corresponding with Digital Outputs O0 and O1)
= Soft Output
(corresponding with Soft Outputs 2-31)
Note Every Soft and Digital Output can be configured to generate an Interrupt to the
CPU. For details refer to 4-6-1 "Outputs Generating Interrupts".
66
Output Control Section 3-5
Counter Value
Range 0 Range 1
Range 2
Range 3
External
Output 0
External Output 1
Internal Output 2
Internal Output 3
In this example four Ranges are specified. The configuration data of the Counter
shows that:
Output 0 must be ON for Counter Values within Range 0.
Output 1 and 3 must be ON for Counter Values within Range 1.
Output 2 must be ON for Counter Values within Range 2.
Both of the Outputs 0 and 3 must be ON for Counter Values within Range 3.
In the above example the Counter Value is within Range 1 and 3 and consequently
the Outputs 0, 1 and 3 are turned ON.
67
Output Control Section 3-5
Range 1
Rollover
Range 0
Range 3
Counter Value
68
Output Control Section 3-5
OR Output Pattern
Range 31
Upper Range Limit
E/D Output Pattern
Lower Range Limit
Range 0 Counter 2
Upper Range Limit
E/D Output Pattern
Lower Range Limit
OR Output Pattern
Range 31
Upper Range Limit
E/D Output Pattern
Lower Range Limit
OR /
Unit Output Pattern
AND
69
Output Control Section 3-5
The Counter Type (Circular or Linear) determines the range in which the Upper
and Lower Limits can be set. For Circular Counters this range is 00000000H-
FFFFFFFFH and for Linear Counters this range is 80000000H-7FFFFFFFH. For
Linear Counters the Upper Range Limit must be greater than the Lower Range
Limit. The Unit will generate an error if the Upper Range Limit Lower Range Limit
(refer to 5-2 "Error codes" for more details). For Circular Counters, the Upper
Range Limit can be set lower than the Lower Range Limit.
To configure a Counter in Range Mode for every Range that you want to use the
Range-Data must be set. Each data-item is specified by two words (=32 bits). For
the exact memory location to set the Range-Data refer to 4-2-1 "Memory Map-
ping".
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
Output Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
In the Output Pattern of the Range every single Output can be configured to turn
ON when that Range is active. To configure an Output to turn ON you must set the
corresponding bit to 1. If multiple Ranges of a Counter are active at the same time,
the Output Patterns of those Ranges are logically ORed to become the Output
Pattern of that Counter.
Note 1. The Counter Range-Data can also be changed during actual operation using
the IOWR-instruction. Refer to 4-3 "IOWR-Instruction" for more details.
2. In Range Mode it is possible to apply Hysteresis to Ranges in order to prevent
Digital Outputs from toggling due to unwanted oscillating of an encoder. Refer
to 3-7-3 "Hysteresis" for detailed information.
3. Precautions When Setting Range Data
Comparison Stoppage during Comparison of Ranges
The comparison operation stops for 1.5 ms from when the High-speed
Counter Value falls within the Upper Range Limit or Lower Range Limit for
70
Output Control Section 3-5
the Range Data. However, the comparison does not stop for other
Counters.
Set the Range Data considering the time when the comparison is stopped.
For example, for the Range table shown in the following diagram, approxi-
mately 4.8 counts occur during 1.5 ms when a 3.2 kHz pulse is input. This
means that comparison does not occur for Counter Values 101, 102, 103,
and 104. During this period, the Output set under the Output Pattern does
not turn ON even if the Counter Value is within the Range Data range.
Comparison starts again after this 1.5 ms has elapsed.
3.2-kHz
pulse
Counter Value
100 101 102 103 104 105
Range Data 0
Upper Range
Limit 104
Lower Range
Limit 100
Range Data 1
Upper Range
Limit 103
Lower Range
Limit 101
Range Data 2
Upper Range
Limit 105
Lower Range
Limit 102
71
Output Control Section 3-5
Reflecting Active / Not A Range becomes active if: Lower Range Limit Counter Value Upper Range
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 8 7 6 5 4 3 2 1 0
n+20 n+25 15 14 13 12 11 10 9 7 7 6 5 4 3 2 1 0
n+21 n+26 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Active Ranges:
= Range 0-31 0 = Range Active
1 = Range not Active
Range Active: Lower Range Limit Counter Value Upper Range Limit
Range not Active: Counter Value < Lower Range Limit
Counter Value > Upper Range Limit
Note Lower Range Limit = Upper Range Limit can be set under the Range conditions.
Enabling and Disabling of Every single Range can be enabled or disabled. If a Range is disabled (by default)
Ranges its Output Pattern will be ignored in the Unit Output Pattern calculation. If a Range
is enabled the Output Pattern of that Range will be applied to the Output Pattern
of the corresponding Counter when that Range becomes active. To Enable/Disa-
ble Ranges of Counters refer to the following:
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+57 m+102 15 14 13 12 11 10 9 7 7 6 5 4 3 2 1 0
m+58 m+103 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Range Enable Data:
= Range 0-31 0 = Range Disabled
1 = Range Enabled
Note Enabling/Disabling of Ranges can also be done on the fly by using IOWR-instruc-
tions. Refer to 4-3 "IOWR-Instruction" for more details.
Logically AND/OR Counter If the Unit is in Range mode, the Output Patterns of the two Counters are (by
Output Patterns default) logically ORd and consecutively applied to the Unit Output Pattern.
Depending on the requirements of your application you can also choose to AND
the Counter Output Patterns before they are applied to the Unit Output Pattern.
If multiple Counters are used together to control an application, you have the
option to logically AND or OR the Counter Output Patterns to become the Unit
Output Pattern. In this way it is possible to turn Outputs ON or OFF depending on
Ranges being active of multiple Counters. For instance, it is possible to turn an
Output ON when both a Range of Counter 1 and a Range of Counter 2 are active.
To configure the Unit to AND the Counter Output Patterns refer to the following.
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m
AND/OR Counter Output Patterns:
0 = Logically OR Counter Output Patterns
1 = Logically AND Counter Output Patterns
72
Output Control Section 3-5
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. If both the Counters are configured to use no Ranges, the
output patterns for both outputs will be all OFF.
Counter Value
Output 0
Output 1
Soft Output 2
Soft Output 3
73
Output Control Section 3-5
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.
CV6 Out0
Soft2 Soft3
Up-counting:
Counter Value positive (+) direction
Soft2
Out0
CV5
CV4
74
Output Control Section 3-5
Counter 1
+Set Pattern CV0
Comparison Value 0 +Reset Pattern CV0
E/D
-Set Pattern CV0
-Reset Pattern CV0 Output Set Pattern
Output Reset Pattern
event
+Reset Pattern CV31 (*2)
Comparison Value 31 E/D
-Set Pattern CV31
-Reset Pattern CV31
(*1)
event Unit Output Pattern
Counter 2
+Set Pattern CV0
Comparison Value 0 +Reset Pattern CV0
E/D
-Set Pattern CV0
-Reset Pattern CV0
75
Output Control Section 3-5
To configure a Counter in Comparison Mode for every Comparison Value that you
want to use the CV-Data must be set. Each data-item is specified by two words
(=32 bits). For the exact memory location of the CV-Data, refer to 4-2-1 "Memory
Mapping".
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Comparison Value
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
+Set Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
Comparison Data +Reset Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
-Set Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
-Reset Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
In the +/- Set and Reset Patterns the Outputs are represented by:
76
Output Control Section 3-5
3.2-kHz
pulse
Counter Value
100 101 102 103 104 105
Note 1. Multiple Comparison Values of a specific Counter may not have the same
value. The Unit will generate an error if multiple CVs have the same value
(refer to 5-2 "Error codes" for more details).
2. CV-Data can also be changed on the fly. Refer to 4-3 "IOWR-Instruction" for
more details.
3. The Digital Outputs are Set/Reset in the chronological order of reaching the
CVs. After reaching a (new) CV the (old) Unit Output Pattern is updated.
77
Output Control Section 3-5
4. In case for a CV both a Set and a Reset in one and the same counting direction
for a specific Output are defined, the Reset has priority.
5. The output can be set to Set, Reset, or No Change when a target value is
reached both for incrementing and decrementing. Each time, the output pattern
for both counters will change in the order targets are reached.
6. Do not change the counting direction quickly near a target value. If the direction
is changed near a CV, the direction in which the target was reached (increment-
ing or decrementing) may be incorrectly detected.
Reflecting Active / Not A Comparison Value becomes active if the Counter Value is greater than or equal
Active Comparison Values to that Comparison Value. Whether or not a CV is active is reflected in CIO for
each Counter.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+20 n+25 15 14 13 12 11 10 9 7 7 6 5 4 3 2 1 0
n+21 n+26 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Active Comparison Values:
= Comparison Value 0-31 0 = Comparison Value Active
1 = Comparison Value not Active
Note Each time a CV is crossed (in positive or negative counting direction) an Output
can be Set, Reset or remain Unchanged. In this way, every Counter is able to
change the Unit Output Pattern. Therefore, the Unit Output Pattern is updated by
all four Counters in the chronological order of crossing the CVs.
Enable / Disable Every single CV can be enabled or disabled. If a CV is disabled (by default) no
Comparison Values action will be taken on reaching that CV. If a CV is enabled, depending on the
direction of counting, the Set/Reset Output Patterns will be applied to the Unit Out-
put Pattern on reaching that CV. To Enable/Disable CVs of Counters refer to the
following:
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+57 m+102 15 14 13 12 11 10 9 7 7 6 5 4 3 2 1 0
m+58 m+103 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Comparison Value Enable Data:
= Comparison Value 0-31 0 = Comparison Value Disabled
1 = Comparison Value Enabled
Note Enabling/Disabling of CVs can also be done on the fly by using IOWR-instruc-
tions. Refer to 4-3 "IOWR-Instruction" for more details.
78
Output Control Section 3-5
Updating Unit Output Besides by crossing CVs 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" and 3-6 "Reset Signals". Every Preset or Reset Action will then update
the Unit Output Pattern according to the predefined Output Set and Output Reset
Patterns. You can define an Output to be Set, Reset or remain Unchanged (similar
as on reaching a Comparison Value).
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+59 m+104 15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
Output Set Pattern
m+60 m+105 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
m+61 m+106 15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
Output Reset Pattern
m+62 m+107 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Note In case for a Preset or Reset action for a specific Output both a Set and a Reset
is defined the Reset has priority.
To control the Physical Outputs (0-1) manually, Manual Output Control must be
selected by setting the Automatic/Manual Output Control Bit to 1. Now it is possi-
ble to force ON and OFF the Physical Digital Outputs by setting and resetting the
corresponding bits respectively. Manual Output Control can be used for test pur-
poses (wiring) when the Unit is being installed.
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n
Manual Output Control:
0 = Force Output OFF
1 = Force Output ON
Selection Automatic/Manual:
0 = Automatic Output Control
1 = Manual Output Control
79
Output Control Section 3-5
Output State Control The state control of the 32 Outputs, in case the operating mode of the PLC-CPU
is changed from RUN/MONITOR PROGRAM, an I/O Bus error or an Overflow/
Underflow error occurs, can be configured. By default (=0) the Unit will continue to
update the state of the Outputs automatically according to the mode in which the
Unit is (Range Mode or Comparison Mode). You can also choose to freeze the
state of the Outputs (=1) in which case the last state of the Outputs, as they were
just before the operating mode is changed or just before an I/O Bus- or Overflow/
Underflow error occurs, is applied to the Outputs. If you choose to predefine the
state of the Outputs (=2), an Output pattern can be (pre-) defined that will be
applied to the Outputs when the operating mode is changed or when an I/O Bus-
or Overflow/Underflow error occurs.
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+21 15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0 Predefined
m+22 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 Output Pattern
After changing the operating mode from RUN/MONITOR PROGRAM and after an I/O Bus- or
Overflow/Underflow error has occurred :
0 = Output is turned OFF
1 = Output is turned ON
80
Reset Signals Section 3-6
Digital Input
Z-Signal Reset
OR
Trigger
OR
Reset Enable sources:
AND
Software Reset Enable Bit
Software Reset Bit as Reset For every Counter the Software Reset Bit can be used to trigger a Reset. The Soft-
Source ware Reset Bit has priority over all other Reset Sources. Setting the Software
Reset Bit triggers a Reset in the next I/O Refresh Cycle.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+2 n+5
Software Reset Bit:
01 = Reset Counter
Digital Input as Reset In order to use a Digital Input as Reset Source you must assign Function 5, 6, 11,
Source 12, 13 or 14 to the corresponding Digital Input. Refer to 3-4 "Digital Input Func-
tions" for more information.
Z-Input Signal as Reset If you want to use the Z-Signal of an incremental encoder as a Reset Source this
Source must first be enabled in DM. Using the Z-Signal can be enabled for every Counter.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+32 m+77
Z-Signal Control:
0 = Z-Signal Reset Disabled
1 = Z-Signal Reset Enabled
81
Reset Signals Section 3-6
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.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+2 n+5
Software Reset Enable Bit:
0 = Resetting by Digital Input or Z-Signal Disabled
1 = Resetting by Digital Input or Z-Signal Enabled
Digital Input as Reset In order to use a Digital Input as Reset Enable Source you must assign Function
Enable Source 15 or 16 (= Enable/Disable Reset) to the corresponding Digital Input. Refer to 3-4
"Digital Input Functions" for more information.
82
Extra Functions Section 3-7
The corresponding action is triggered by a rising edge of the Output (0-1) of the
Unit Output Pattern and consequently applied to the corresponding Digital Output.
31 4 3 2 1 0
Normal Functionality
Reset ON-Delay
Output Pulse ON-Delay
ON-Delay ON-Delay ON-Delay
Normal Functionality A Digital Output that is configured to have Normal Functionality will turn ON imme-
diately after the corresponding bit of the Unit Output Pattern turns ON.
Output Pulse ON-Delay A Digital Output that is configured to have an Output Pulse ON-Delay will turn ON
after the ON-Delay has elapsed.
Output Pulse Duration A Digital Output that is configured to have an Output Pulse Duration turns ON
immediately and will stay ON for the specified Pulse Duration. After the Pulse
Duration has elapsed the Digital Output turns OFF.
83
Extra Functions Section 3-7
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.
O0: O1: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+10 m+12
Output Pulse Duration:
0000(BCD) = Normal Functionality
0001-9999(BCD) = Output Pulse Duration in milliseconds
Note 1. A Digital Output to which an Output ON-Delay or Output Pulse is applied will
turn OFF immediately after the corresponding Output (0-1) of the Output Pat-
tern has turned OFF. An Output Pulse ON-Delay or Output Pulse Duration in
progress will be reset immediately and the Digital Output is turned OFF or stays
OFF.
2. If an Output is switched ON manually (refer to 3-5-3 "Manual Output Control")
and Programmable Output Pulse functionality has been assigned to that Out-
put, then this functionality will not be applied to the Output. Instead, the Output
is switched ON immediately.
3.When applying an Output Pulse to a turn OFF a Digital Output, the output will
appear to be OFF, but internally it will be treated as ON until it is reset when the
range conditions are met or target is matched. If an attempt is made to set the
output, the system will assume that it is already ON and it will remain OFF. Par-
ticularly with target values, configure reset conditions for output carefully.
84
Extra Functions Section 3-7
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.
Count Pulses
T0 T1 T2
Time Base
Current Current
Current
Counter Value (T0) Counter Value (T1)
Counter Value (T2)
Rate Measurement can be done for all Input Signal Types (refer to 3-3 "Input Sig-
nal Types"). Calculating the Rate Value in this way implies that a change of the
counting direction during the Time-Window is reflected in the Rate Value. For illus-
tration refer to the next example:
The Counter Value (T0) at the beginning of the Time-Window is +5. During the
Time-Window 5 up counts and 15 down counts are received. The Counter Value
(T1) at the end of the Time-Window will then be 5. The Rate Value is 10.
Note 1. For Phase Differential Signals (multiplication x2 and x4) pulses are counted on
both edges of A or both edges of A and B respectively. If you want to calculate
the pulse Rate Value for these signals, you must divide the measured Rate Val-
ues by 2 and 4 respectively.
2. The pulse rate after presetting or resetting a counter will be the pulse rate cal-
culated just prior to presetting or resetting.
3. Calculations will be correct when a Ring Counter rolls over (goes from maxi-
mum value to 0 or from 0 to maximum value).
4. The measurement interval normally varies by 125 s and can vary by a maxi-
mum of 1 ms. If this variation becomes a problem, it is recommended that the
pulse rate value be averaged in the ladder program.
85
Extra Functions Section 3-7
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:
The Rate Values can be read into your Ladder Program for further usage, by issu-
ing an IORD-instruction. Like this, one or multiple Rate Values (with a maximum of
64) can be read. If you specify to read only one Rate Value the youngest Rate
Value will be returned. If the Rate History Log File is full a new (youngest) Rate
Value will overwrite the oldest Rate Value. Refer to 4-5-3-2 "Rate History Log File
data" for detailed information.
Frequency Measurement After the Rate Value is read into the Ladder Program this value can be used to cal-
culate the Frequency [Hz] of the applied signals. The Frequency of the incoming
pulses can be calculated by using the following formula:
Rate Value
Frequency [Hz] =
Time-Window [s]
If for example the Time-Window is set to 2 seconds (= 2000 ms) and during the
Time-Window 20,000 up counts are received (i.e. Rate Value = 20,000) the corre-
sponding Frequency is 10,000 Hz.
Rotational Speed After the Rate Value is read into the Ladder Program this value can also be used
Measurement to calculate the Rotational Speed [rpm]. The Rotational Speed can indicate the
speed of a motor in rotations per minute [rpm]. The Rotational Speed can be cal-
culated by using the following formula:
Rate Value 60
Rotational Speed [rpm] =
Encoder Resolution [P/R] Time-Window [s]
If you want to calculate the Rotational Speed you need to know the number of
Pulses per motor or encoder revolution [P/R]. If for example the Time-Window is
set to 1 second (= 1000 ms), the Encoder Resolution is 2,000 P/R and during the
Time-Window 50,000 up counts are received (i.e. Rate Value = 50,000) the corre-
sponding Rotational Speed is 1,500 rpm.
86
Extra Functions Section 3-7
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 8 7 6 5 4 3 2 1 0
m+39 m+84
Time-Window:
0000(BCD) = No Rate Measurement
0001-9999(BCD) = Time-Window in milliseconds
Rate Ranges Besides the capability to measure (positive and negative) Rate Values for every
Counter two Rate Ranges (Rate Range 0 and 1) can be configured. The Rate
Ranges offer you the opportunity to undertake specific action (i.e. control the Unit
Output Pattern) when the measured Rate Values have entered a Rate Range.
Rate Ranges can represent Frequency Ranges or Rotational Speed Ranges,
making it possible to undertake action at (too high or too low Alarm) Frequencies
or Rotational Speeds.
Rate Value
Alarm-Area
Alarm-Area
The Upper Rate Range Limit must be greater than the Lower Rate Range Limit.
The Unit will generate an error if the Upper Rate Range Limit Lower Rate Range
Limit (refer to 5-2 "Error codes" for more details). Every Rate Range can be ena-
bled or disabled. If a Rate Range is disabled (by default) no action will be taken
when the Rate Range becomes active. If a Rate Range is enabled the Set & Reset
87
Extra Functions Section 3-7
Output Pattern of that Rate Range will be applied to the Unit Output Pattern when
that Rate Range becomes active.
Reflecting Active / Not A Rate Range becomes active if: Lower Rate Range Limit Rate Value Upper
Active Rate Ranges Rate Range Limit. Whether or not a Rate Range is active is reflected in CIO for
each Counter.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+24 m+29
Rate Range 0 Active/not Active:
0 = Rate Range 0 not Active
1 = Rate Range 0 Active
Rate Range 1 Active/not Active:
0 = Rate Range 1 not Active
1 = Rate Range 1 Active
Note Rate Ranges may not overlap. If Rate Ranges overlap the Unit will generate an
error (refer to 5-2 "Error codes" for more details).
Set Lower- and Upper Range Rate Limits as a signed hexadecimal number between 80000000H
and 7FFFFFFFH (i.e. - 2,147,483,648 and +2,147,483,647 respectively). Make sure that the
Upper Rate Range Limit > Lower Rate Range Limit.
88
Extra Functions Section 3-7
In the Set and Reset Patterns the Outputs are represented by:
Set/Reset actions as defined in the Output Set & Reset Pattern to control the Outputs, overrule
the Unit Output Pattern for the corresponding Outputs.
Enabling/Disabling Rate After you have configured Rate Ranges, as described above, every Rate Range
Ranges can be enabled or disabled. If a Rate Range is disabled (by default) no action will
be taken when the Rate Range becomes active. If a Rate Range is enabled the
corresponding Output Set & Reset Patterns are applied to the Unit Output Pattern
when that Range becomes active. To Enable/Disable Rate Ranges of Counters
refer to the following.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+56 m+101
Rate Range 0 Enable Data:
0 = Rate Range 0 Disabled
1 = Rate Range 0 Enabled
Rate Range 1 Enable Data:
0 = Rate Range 1 Disabled
1 = Rate Range 1 Enabled
89
Extra Functions Section 3-7
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. To prevent outputs from being switched ON and OFF by very small
fluctuations, the High-speed Counter Unit offers the Hysteresis Function that can
be configured for every Counter separately. You can assign Hysteresis in a range
from 1 to 255 counts (= 0001H 00FFH) from which the Counter treats the fluctu-
ation in the Counter Input Signal as a real change and outputs can be controlled
accordingly.
Lower Upper
Range Limit Range Limit
Down-Counting
Up-Counting
Range Active
Range Inactive
Hysteresis Hysteresis
Configuring Hysteresis
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+63 m+108
Hysteresis:
0000 = No Hysteresis
Set Hysteresis in number of counts between 0001-0255 (= 0001H 00FFH)
Note 1. The Hysteresis can only be applied to Units in Range Mode. If the Unit is in
Comparison Mode you are able to configure Hysteresis yourself using Compar-
ison Values.
2. Do not set the origin (i.e., a present value of 0) within the Hysteresis-Area.
3. If the Counter is Preset, turn OFF the Hysteresis. If the Counter is Preset in the
Hysteresis-Area, the Outputs will not be controlled correctly.
90
Extra Functions Section 3-7
Configuring Noise Filter For the purpose of suppressing noise on the control lines of the Digital Inputs also
Digital Inputs a Noise Filter is available. A Noise Filter can be configured for Digital Input 0 & 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
General Setting: m+8
91
Extra Functions Section 3-7
The Initial Counter Value is very useful in case the Power of the PLC-system fails.
If the Power of the PLC-system fails, the application that is controlled by the High-
speed Counter Unit will come to rest, and the Counter Values will be reset to zero.
After the system has been Powered Up again, the application has to be reset,
since it has lost the position data with the resetting of the Counter Values.
To overcome this trouble, the Power OFF Interrupt Task of the PLC can be used to
detect the failing system Power. You can use this Power OFF Interrupt Task to pro-
gram a transfer of the Counter Values of every Counter (in CIO) to the correspond-
ing Initial Counter Value of that Counter in DM. The data in DM is retained when
the Power is OFF. Therefore, Powering Up the system again, results in a transfer
of the DM-settings from the CPU to the Unit and the Counter Value is overwritten
by the Initial Counter Value, allowing your application to continue from where it
was at the moment of failing Power.
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+37 m+82
m+38 m+83
Initial Count Value:
Set between 00000000H and FFFFFFFFH (Circular Counter)
Set between 80000000H and 7FFFFFFFH (Linear Counter)
By default the Initial Count Value is equal to 0.
Note 1. The Power OFF Interrupt Task that takes care of saving the Counter Values to
the Initial Counter Values can also be used to detect a Power OFF that has
been done on purpose.
2. The Initial Counter Value can also be set, independent of a Power Failure, to
load the Counter Value with an Initial Value instead of zero.
3. The Present Value stored by the interrupt task must be used considering the
possibility of a power interrupt to the Encoder and interrupt processing execu-
tion timing.
92
SECTION 4
Exchanging Data with CPU
This section provides information on exchanging data between CJ1W-CT021 High Speed Counter Units and
CJ-series CPU Units.
4-1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4-1-1 Basic Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4-1-2 Special I/O Units Restart bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
4-2 Memory Allocation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
4-2-1 Memory Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
4-2-2 Indirect Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
4-2-3 CIO-Memory Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
4-2-4 DM-Memory Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
4-2-5 Range Memory Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4-2-6 Comparison Memory Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
4-3 IOWR-Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
4-4 IORD-Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4-5 Supported IOWR/IORD-Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4-5-1 DM-data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4-5-2 Range- and Comparison data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4-5-3 Special data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
4-6 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4-6-1 Outputs Generating Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
4-6-2 Digital Inputs Generating Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . 131
93
Overview Section 4-1
4-1 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 (refer to 4-5-3-4 "(Re) Configure
Unit"). The Unit configuration data consists of the configuration data in the Special
I/O Unit DM Area and the Range/Comparison Data.
CPU Unit: High-speed Counter Unit:
Counter 1
400
Words Counter 2
Unit
D 20000 + (N x 100) + 399 Configuration
Data
Power ON or
DM/EM Area: Unit Restart
Range Mode:
N = Machine Number
* Maximum No. of Ranges or CV's is 32
94
Overview Section 4-1
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. For more information on the exact memory location of the Special I/O
Unit and Special I/O Unit DM Areas and the Machine Numbers that can be set,
refer to 2-1-4 "Machine Number Switch".
Unit Status Data The Special I/O Unit Area contains the status information of the High-speed Coun-
ter Unit in CIO and is divided in an area with output words and an area with input
words. Both areas are divided in three parts: a general part and two Counter spe-
cific parts, and these are updated cyclically every I/O refresh.
Unit Configuration Data The Unit configuration data is located in the Special I/O Unit DM Area, which is
allocated to the High-speed Counter Unit, and the Range/Comparison Data. The
Mode for which the Unit is configured determines if you have to set Range or Com-
parison Data (refer to 3-5-1 "Range Mode" and 3-5-2 "Comparison Mode" for
more information). The location of the Range/Comparison Data is indicated by an
Indirect Address that you have to specify for every Counter (refer to 4-2-2 "Indirect
Addressing" for detailed information).
The Special I/O Unit DM Area contains the configuration settings of the High-
speed Counter Unit. It is divided in three parts: a general part and two Counter
specific parts. The general part contains the settings that are relevant for the
whole Unit and the Counter specific parts contain the settings that are relevant to
the specific Counters.
Note The Unit configuration data can also be transferred during actual operation of
the Unit, by issuing an IOWR-instruction (refer to 4-5-3-4 "(Re) Configure
Unit").
I/O Refresh will not occur while the Data Transfer Busy bit (CIO n+19, bit 02) is
ON. For example, the Counter Value will not be refreshed while the bit is ON.
95
Overview Section 4-1
Bit Function
A50200 Unit No. 0 Restart Bit Restarts the Unit when
turned from OFF to ON.
A50201 Unit No. 1 Restart Bit
~ ~
A50215 Unit No. 15 Restart Bit
A50300 Unit No. 16 Restart Bit
~ ~
A50715 Unit No. 95 Restart Bit
The Unit can also be restarted by turning the Power from OFF to ON.
96
Memory Allocation Section 4-2
n n+14
General
n+1
General
n+2
Counter 1 n+19
n+4 n+20
n+5
Counter 1
Counter 2
n+7 n+24
n+8 n+25
Not used
Counter 2
n+29
n+30
n+13
Not used
n+39
k2
Counter 1
Range / CV Settings
Counter 2 Indirect Address k1 m+74
m+75
Counter 2
m = D 20,000 + (N x 100)
N = Machine Number
k1, k2 = Any available address in DM/EM
(Refer to 4-2-2 for more details about Indirect Addressing)
Note The Range/Comparison Data blocks that are allocated to the Counters do not
necessarily have to be consecutive and can be in any area of DM/EM. In case
they overlap the Unit reports this in CIO as a warning, but does not generate an
error. This makes it possible to define only one block with Range/Comparison
97
Memory Allocation Section 4-2
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 8 7 6 5 4 3 2 1 0
n+19
Range/Comparison Blocks overlap:
0 = No overlapping
1 = One or more blocks overlap
Unit in Range Mode In Range Mode Indirect Addressing can be used to define the Ranges per Counter
that you want to use. The number of Ranges (M) defines the size of the Range
Data block (size = M x 6 words). If you want to use multiple Ranges you are rec-
ommended to use consecutive Ranges starting from Range 0 (i.e. Range 0, 1, 2,
3 M - 1) in order to save memory occupation.
EM/DM:
k(c)
Data Range 0
Special I/O Unit DM-Area:
Data Range 1
Counter c
Data Range M*-1 c = 1 or 2
* Assumed that M 0. By default M=0 which means that no Ranges will be used.
Note If you do not want the Ranges to be consecutive and only intend to use two
Ranges (e.g. Range 0 and Range 15) then you still have to define the number of
Ranges (M) to be 16. In order to prevent configuration errors from happening you
should make sure that the data of Ranges 1 to 14 is also valid, although you do not
intend to use Range 1 to 14.
98
Memory Allocation Section 4-2
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 CVs (M) defines the size
of the CV Data block (size = M x 10 words). If you want to use multiple CVs you
are recommended to use consecutive CVs starting from CV 0 (i.e. CV 0, 1, 2, 3
M - 1) in order to save memory occupation.
EM/DM:
k(c)
Data CV 0
Special I/O Unit DM-Area:
Data CV 1
Data CV 2 # o f CVs M
(0 M 32)
Data CV 3 EM (=0) / DM (=1)
Size of CV Data block:
Area
Number of CVs (= M ) x 10 words
Indirect Address k(c)
(00000 t o 32760)
Counter 'c'
Data CV M *-1 c = 1 or 2
* Assumed that M 0. By default M=0 which means that no CVs will be used.
Note If you do not want the Comparison Values to be consecutive and only intend to use
two CVs (e.g. CV 0 and CV 15) then you still have to define the number of CVs
(M) to be 16. In order to prevent configuration errors from happening you should
make sure that the data of CVs 1 to 14 is also valid, although you do not intend to
use CV 1 to 14.
Configuring Indirect Indirect Addressing with the Unit in Range or Comparison Mode is specified in the
Addressing Special I/O Unit DM Area for every Counter. You must specify the memory area
(EM/DM) and the address (00000 to 32760) of the first word where the Range/CV
data is to be stored. Like this you are able to specify any address that is available
in EM or DM. By specifying the number of Ranges or Comparison Values per
Counter you determine the number of words with Range/CV data that are allo-
cated for every Counter. For every Range 6 words and for every Comparison
Value 10 words are allocated.
99
Memory Allocation Section 4-2
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+65 m+110
Memory Area:
0 = EM (Extended Memory)
1 = DM (Data Memory)
CNT1: CNT2: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+66 m+111 : LSW
m+67 m+112 : MSW
Indirect Address:
Set between 00000(BCD) and 32760(BCD)
The least significant word (LSW) of the Indirect Address contains the four least
significant digits and the most significant word (MSW) contains the most signifi-
cant digit of the Indirect Address (refer to the examples on the following pages).
Example Range Mode Unit is in Range Mode. You want to use 12 Ranges (Range 0 to Range 11) for
Counter 1 and want to allocate them in Data Memory starting from D1850.
CNT1: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+64 1 2 12 Ranges
m+65 1 Memory Area is DM
m+66 1 8 5 0 Indirect Address is 1850
m+67 0
DM:
D1850 Data Range 0:
Data Range 0
D1856
Data Range 1
D1862
Data Range 2 D1850
Lower Range Limit
D1851
D1868
Data Range 3 D1852 Upper Range Limit
12 x 6 words = D1853
72 words D1854
Output Pattern
D1855
D1916
Data Range 11
For an overview all addresses related to Range Data refer to 4-2-5 "Range Mem-
ory Mapping".
100
Memory Allocation Section 4-2
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 8 7 6 5 4 3 2 1 0
m+64 0 5 5 Comparison Values
m+65 0 Memory Area is EM
m+66 0 5 2 0 Indirect Address is 520
m+67 0
DataCV 0 :
EM:
EM520
Data CV 0
EM530
Data CV 1 EM520
Comparison Value
EM521
EM540
5 x 10 words = Data CV 2 EM522 +Set Pattern
50 words EM523
EM550
Data CV 3 EM524
+Reset Pattern
EM525
EM560
Data CV 4 EM526 -Set Pattern
EM527
EM528
-Reset Pattern
EM529
For an overview of all addresses related to Comparison Data refer to 4-2-6 "Com-
parison Memory Mapping".
Note Double words in CIO are indicated as for example n+3, n+4. How to distinguish
between the least- and most significant words (LSW and MSW) within double
words, you should refer to the section called About this Manual at the beginning
of this Manual.
101
Memory Allocation Section 4-2
CIO Output Words The 14 Output Words (n to n+13) are divided in 3 groups: General, Counter 1, and
Counter 2.
Word Bit Item Function
(output)
General
n 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.
02-14 --- Not used
15 Automatic/Manual Automatic (=0) Digital Output Control /
Manual (=1) Digital Output Control
n+1 00 Read Next Error Read next error at the rising edge (from the error
list in the High-speed Counter Unit). The error code
can be read from CIO-words n+17 and n+18.
01 15 --- Not used
Counter 1
n+2 00 Open Gate*, *** Open Gate (01)
01 Close Gate*, *** Close Gate (01)
02 Preset*** Load Preset Value (01)
03 Reset*** Reset Counter (Forced Reset) to zero (01)
04 Capture*** Capture Counter Value (01)
05 Reset Enable** Enable Resetting for Z-signal / Digital Input (=1)
06-15 --- Not used
n+3, n+4 00-15 Preset Value Preset Value
Counter 2
n+5 00 Open Gate*, *** Open Gate (01)
01 Close Gate*, *** Close Gate (01)
02 Preset*** Load Preset Value (01)
03 Reset*** Reset Counter (Forced Reset) to zero (01)
04 Capture*** Capture Counter Value (01)
05 Reset Enable** Enable Resetting for Z-signal / Digital Input (=1)
06-15 --- Not used
n+6, n+7 00-15 Preset Value Preset Value
n+8 to n+13 00-15 --- Not used
* Initially, after power-up or restart of the Unit, the Gate is closed. To enable
counting pulses, first open the Gate by setting the Open Gate bit of the
corresponding counter to 1.
**Bit(s) have no function for Simple Counters.
***These bits may not be executed if they are ON for only one PLC cycle. Always
keep these bits turned ON until the execution status changes in the corre-
sponding flags in n+24 or n+29.
102
Memory Allocation Section 4-2
CIO Input Words The 26 Input Words (n+14 to n+39) are divided in 3 groups: General, Counter 1,
and Counter 2.
Word Bit 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
n+16 00-01 Input Status Current status of Digital Inputs
02-15 --- Not used
n+17, n+18 00-15 Error Code The type of error is represented as follows:
n+17 = error code 1
n+18 = error code 2
Refer to 5-2 "Error codes" for more information
n+19 00 Global Error Indication that one or more errors have occurred and that
their error code(s) are included in the error list of the Unit
01 Interrupts Pending* Interrupts Pending (=1); m 1 interrupt(s) in FIFO-queue
02 Data Transfer Busy Data Transfer Busy (=1), Unit is busy completing the
IORD/IOWR-instruction or is being initialized****
03 Data Transfer Toggled every time Data Transfer is completed
Completed
04 IA Blocks overlap** Indication that IA blocks overlap in PLC memory
05-15 --- Not used
Counter 1
n+20, n+21 00-15 Ranges / Comparison Ranges Active (=1) / Inactive (=0) /
Values active* Comparison Values Active (=1) / Inactive (=0)
n+22, n+23 00-15 Counter Value Counter Value
n+24 00 Counter Overflow Counter Overflow (=1), Upper Count Limit of Linear
Counter is reached
01 Counter Underflow Counter Underflow (=1), Lower Count Limit of Linear
Counter is reached
02 Counter Running / Counter Running/Gate Open (=1),
Gate Open Counter Stopped/Gate Closed (=0)
03 Counting Direction Counting Direction, Down (=0) / Up (=1)
04 Preset Activated ** Preset Activated (=1)
05 Reset Activated ** Reset Activated (=1)
06 Capture Activated **, Capture Activated (=1)
***
07 Z-signal Activated ** Z-signal Activated (=1)
08-09 --- Not used
10 Rate Range 0* Rate Range 0 Active (=1)
11 Rate Range 1* Rate Range 1 Active (=1)
12-14 --- Not used
15 Simple Counter Simple Counter (=1) / Circular/Linear Counter (=0)
103
Memory Allocation Section 4-2
104
Memory Allocation Section 4-2
Note Double words in DM are indicated as for example m+2, m+3. How to distinguish
between the least- and most significant words (LSW and MSW) within double
words, you should refer to the section called About this Manual at the beginning
of this Manual.
* Refer to 4-6 "Interrupts" for information about Outputs and Inputs generating
Interrupts.
105
Memory Allocation Section 4-2
106
Memory Allocation Section 4-2
107
Memory Allocation Section 4-2
108
Memory Allocation Section 4-2
* Set to "0" and turn OFF Hysteresis to use the Preset function.
** Sets the beginning (k1) of the Range Data or Comparison Data.
109
Memory Allocation Section 4-2
110
Memory Allocation Section 4-2
* Set to "0" and turn OFF Hysteresis to use the Preset function.
** Sets the beginning (k2) of the Range Data or Comparison Data.
111
Memory Allocation Section 4-2
112
Memory Allocation Section 4-2
113
Memory Allocation Section 4-2
114
Memory Allocation Section 4-2
115
IOWR-Instruction Section 4-3
4-3 IOWR-Instruction
IOWR(223) @IOWR(223)
C C
S S
D D
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 8 7 6 5 4 3 2 1 0
C:
CC2 (=Control Code 2)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D+1:
Number of words to be
written:
Set between 1-128 (0001H - 0080 H)
116
IOWR-Instruction Section 4-3
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 R1
IOWR(223)
CIO n+ 19 (bit 02) C Set ( C/S/D) data ready
R0 before executing
S
IOWR-instruction
D
R0
=
R1 Transfer successful
R2 Global Error
Data has been
R4
successfully written
CIO n+ 19 (bit 00)
R3
The Data Transfer Busy bit (CIO n+19, bit 02) is ON when the Unit is busy com-
pleting an IOWR/IORD-instruction or being initialised. When this bit is OFF the
Unit is ready to execute the IOWR-instruction. If an error occurs during the execu-
tion of the IOWR-instruction the ER-flag turns ON. The Data Transfer Completion
bit (CIO n+19, bit 03) is toggled every time that data transfer is completed. The
Global Error bit (CIO n+19, bit 00) turns ON when the Unit detects any error that
causes this bit to be set (refer to 5-2 "Error codes").
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 IOWR-instruction while another IOWR/IORD-
instruction is in progress the ER-flag turns ON. Therefore, to guarantee correct
execution of IOWR-instructions, you should always use the ladder diagram struc-
ture as shown above.
The response time for bits allocated to outputs (e.g., Open Gate Bit) will be
delayed while the Data Transfer Busy bit (CIO n+19, bit 02) is ON (e.g., when time
is required to process IOWR or when a Unit is reset). In any case, the bit allocated
to the output will be processed as soon as the Data Transfer Busy bit turns OFF.
Comparison stops while the Data Transfer Busy bit (CIO n+19, bit 02) is ON. Refer
to 3-5-1-2 "Configuration and operation in Range Mode" and 3-5-2-2 "Configura-
tion and operation in Comparison Mode" for details.
117
IORD-Instruction Section 4-4
4-4 IORD-Instruction
IORD(222) @IORD(222)
C C
S S
D D
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 8 7 6 5 4 3 2 1 0
C:
CC2 (=Control Code 2)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
S+1:
Number of words to be read:
Set between 1-128 (0001H - 0080H)
Example ladder program Refer to the following structure for the ladder program if you want to use the IORD-
instruction. For an overview of the supported IORD-instructions and how to set the
C-, S- and D-operands, refer to 4-5 "Supported IOWR/IORD-Instructions".
Start Data Transfer Busy
IORD(222)
CIO n+19 ( bit 02) C Set (C/S/D) data ready
before executing
S
IORD-instruction
D
R1 Transfer successful
The Data Transfer Busy bit (CIO n+19, bit 02) is ON when the Unit is busy com-
pleting an IOWR/IORD-instruction or being initialised. When this bit is OFF the
118
IORD-Instruction Section 4-4
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. Therefore, to guarantee correct
execution of IORD-instructions, you should always use the ladder diagram struc-
ture as shown above.
The response time for bits allocated to outputs (e.g., Open Gate Bit) will be
delayed while the Data Transfer Busy bit (CIO n+19, bit 02) is ON (e.g., when time
is required to process IORD or when a Unit is reset). In any case, the bit allocated
to the output will be processed as soon as the Data Transfer Busy bit turns OFF.
Comparison stops while the Data Transfer Busy bit (CIO n+19, bit 02) is ON. Refer
to 3-5-1-2 "Configuration and operation in Range Mode" and 3-5-2-2 "Configura-
tion and operation in Comparison Mode" for details.
119
Supported IOWR/IORD-Instructions Section 4-5
120
Supported IOWR/IORD-Instructions Section 4-5
c = Counter Number (1 or 2)
*1 M = Number of Ranges, 1 M 21
*2 M = Number of Comparison Values, 1 M 12
*3 R = Pulse Rate value, 1 R 64
121
Supported IOWR/IORD-Instructions Section 4-5
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.
Example:
The High-speed Counter Unit is assigned Machine Number 6. You want to change
the Maximum Count Value of Circular Counter 2. The new Maximum Count Limit
consists of 2 words, is located in Data-Memory at address D0050 and D0051 and
is equal to 2710 H (=10,000 decimal).
IOWR(223)
#2C03 CC1= 2C (= Counter 2), CC2= 03
D0050 S= D0050 (first word with new Maximum Count Value)
#00020006 D= #0006 (Machine Number) and D+1= #0002 (# words)
Example:
The High-speed Counter Unit is in Range Mode and is assigned Machine Number
3. You want to read the Range Enable Data of Counter 2 and write it to D1800 in
the PLC memory.
IORD(222)
#2B03 CC1= 2B (= Counter 2), CC2= 03
#00020003 S= #0003 (Machine Number) and S+1= #0002 (# words)
D1800 D= D1800 (write Range Enable Data to D1800 and D1801)
c = Counter Number (1 or 2)
*1 M = Number of Ranges, 1 M 21
*2 M = Number of Comparison Values, 1 M 12
122
Supported IOWR/IORD-Instructions Section 4-5
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. Refer to 3-5-2-2 "Configuration
and operation in Comparison Mode" and 5-2-2 "IOWR/IORD-instruction errors"
for details.
Range Data If the Unit is in Range Mode for each Counter the Range Data of one or multiple
Ranges can be read from the Unit or written to the Unit. For every Range the
Range Data is contained in 6 words. Every IORD- and IOWR-instruction can
transfer up to a maximum of 128 words. Thus per IORD- or IOWR-instruction you
can read or write Range Data of up to a maximum of 21 Ranges.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
Output Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
In the Control Code, CC1 specifies the Counter number (c = 1 or 2) from which the
Range Data is to be read or written. CC2 specifies the first Range number (00-31).
Depending on the number of Ranges that you want to read the Range Data from
or overwrite with new Range Data, you have to specify the number of words to be
transferred. This number of words is equal to the number of Ranges x 6.
Example: The High-speed Counter Unit, with Machine Number 1, operates in Range Mode
and Counter 2 uses 5 Ranges (Range 00 to Range 04). You want to change the
Range Data of Ranges 03 and 04. The new Range Data, consisting of 12 words
(= 6 words x 2 Ranges), is located in Data-Memory starting from D0100.
IOWR(223)
#2A03 CC1= 2A (= Counter 2), CC2= 03 (= first Range Number)
D0100 S= D0100 (first word with new Range Data)
#000C0001 D= #0001 (Machine Number) and D+1= #000C (# words)
123
Supported IOWR/IORD-Instructions Section 4-5
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. Thus per IORD- or IOWR-instruction
you can read or write CV Data of up to a maximum of 12 Comparison Values.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Comparison Value
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
+Set Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
Comparison Data +Reset Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
-Set Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 7 7 6 5 4 3 2 O1 O0
-Reset Pattern
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
In the +/- Set and Reset Patterns the Outputs are represented by:
In the Control Code, CC1 specifies the Counter number (1 or 2) from which the CV
Data is to be read or written. CC2 specifies the first CV number (00-31). Depend-
ing on the number of CVs that you want to read the CV Data from or overwrite with
new CV Data, you have to specify the number of words to be transferred. This
number of words is equal to the number of CVs x 10.
Example:
The High-speed Counter Unit, with Machine Number 3, operates in Comparison
Mode and Counter 1 uses 4 Comparison Values (CV 00 to CV 03). You want to
change the Comparison Data of CV 00. The new Comparison Data, consisting of
10 words (= 10 words x 1 CV), is located in Data-Memory starting from D0200.
IOWR(223)
#1A00 CC1= 1A (= Counter 1), CC2= 00 (= first CV Number)
D0200 S= D0200 (first word with new CV Data)
#000A0003 D= #0003 (Machine Number) and D+1= #000A (# words)
124
Supported IOWR/IORD-Instructions Section 4-5
c = Counter Number (1 or 2)
Example:
The High-speed Counter Unit is assigned Machine Number 8. You want to read
the Captured Counter Value of Counter 1 and write it to D0300 in the PLC mem-
ory.
IORD(222)
#1C02 CC1= 1C (= Counter 1), CC2= 02
#00020008 S= #0008 (Machine Number) and S+1= #0002 (# words)
D= D0300 (write Captured Counter Value to D0300 and
D0300
D0301)
Note Reading the Captured Counter Value with IORD is also supported for Simple
Counters (refer to 3-2-1 "Simple Counter").
125
Supported IOWR/IORD-Instructions Section 4-5
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. You want to read
the youngest Rate Value from the Rate History Log File of Counter 1 and write it
to D0500 in the PLC memory.
IORD(222)
#1F01 CC1= 1F (= Counter 1), CC2= 01
#00020007 S= #0007 (Machine Number) and S+1= #0002 (# words)
D0500 D= D0500 (write youngest Rate Value to D0500 and D0501)
c = Counter Number (1 or 2)
Example:
The High-speed Counter Unit is assigned Machine Number 5. You want to over-
write the Counter Value of Counter 2 with 500 (= 01F4 (hex)).
IOWR(223)
#2C01 CC1= 2C (= Counter 2), CC2= 01
D0100 S= D0100 (= new Counter Value = #000001F4)
#00020005 D= #0005 (Machine Number) and D+1 = #0002 (# words)
Note Reading/writing the Counter Value with IORD/IOWR is also supported for Simple
Counters (refer to 3-2-1 "Simple Counter").
126
Supported IOWR/IORD-Instructions Section 4-5
Example:
The High-speed Counter Unit is assigned Machine Number 2. You want to (re)
configure the Unit by transferring all the configuration settings to the Unit (the PLC
is in RUN/MONITOR-mode).
IOWR(223)
#0D01 CC1= 0D, CC2= 01
S=Not relevant (fill in valid constant, e.g. D0300 containing
-
#0000)
#00010002 D= #0002 (Machine Number) and D+1= #0001 (# words)
!Caution Before you make your ladder program operational, make sure that the IOWR-
instruction (Re) Configure Unit uses valid configuration data. If the Unit configu-
ration data contains invalid settings the Unit will stop operating and report the
error(s).
127
Interrupts Section 4-6
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)
Note Writing the Error Clear Command with IOWR is also supported for Simple
Counters (refer to 3-2-1 "Simple Counter"). This enables you to clear IORD/IOWR-
instruction errors that occurred after you have issued the IORD-instruction Cap-
tured Counter Value or the IORD/IOWR-instruction Counter Value to a Simple
Counter.
4-6 Interrupts
The status information of the 2 Digital Inputs and the 32 Outputs is exchanged with
the CJ-series CPU Unit every I/O refresh via the Special I/O Unit Area. The I/O
refresh is executed cyclically at the end of the Ladder Program or can be forced by
I/O refresh instruction. In both cases the CJ-series CPU Unit takes the initiative for
a data-exchange. In order for the High-speed Counter Unit to be able to report the
status information of the 2 Digital Inputs and 32 Outputs to the CJ-series CPU
Unit, independent from the I/O Refresh, all Digital Inputs and Outputs can be con-
figured to generate interrupts. Important events, indicated by a status change of
the Digital Inputs and the Outputs, can thus be reported as quickly as possible to
the CJ-series CPU Unit.
Note External interrupts are supported only by CJ1-H and CJ1M CPU Units. They are
not supported by CJ1 CPU Units. If you want the High-speed Counter Unit to gen-
erate interrupts to activate external interrupt tasks in a CJ1-H CPU Unit, the Coun-
ter Unit must be in one of the five positions immediately to the right of the CJ1-H
CPU Unit on the CPU Rack. If you want the High-speed Counter Unit to generate
interrupts to activate external interrupt tasks in a CJ1M CPU Unit, the Unit must be
in one of the three positions immediately to the right of the CJ1M CPU Unit on the
CPU Rack.
No external interrupt tasks can be activated for CJ1-H or CJ1M CPU Units if the
CJ1W-CT021 High-speed Counter Unit is in any other position (i.e., 6th Unit posi-
tion or further away from the CJ1-H CPU Unit, or 4th Unit position or further away
from the CJ1M CPU Unit), or if it is on a CJ-series Expansion Rack. All external
interrupt tasks will be disabled in these cases.
128
Interrupts Section 4-6
0 = Interrupts Disabled
1 = Interrupts Enabled
External Interrupt Task Every Output that is enabled to generate interrupts is assigned two External Inter-
Offset rupt Tasks in the CJ-series CPU Unit. For this purpose all 32 Outputs are assigned
in sequential order to consecutive External Interrupt Tasks starting from Output 0.
By defining an Offset you determine the External Interrupt Task numbers of the
(first two) External Interrupt Tasks that are assigned to Output 0. The remaining 31
Outputs are assigned to the respective External Interrupt Task numbers in
increasing order starting from Offset + 2.
Output Assigned External Interrupt executed at
Interrupt Task Number rising/falling edge*
0 (=O0) Offset Rising
Offset + 1 Falling
1 (=O1) Offset + 2 Rising
Offset + 3 Falling
2 Offset + 4 Rising
Offset + 5 Falling
3 Offset + 6 Rising
Offset + 7 Falling
4 Offset + 8 Rising
Offset + 9 Falling
~ ~ ~
129
Interrupts Section 4-6
For every Output the assigned External Interrupt Task number can be calculated
with the following formula (O = Output):
Since there are 256 External Interrupt Tasks available (numbered 0 to 255) the
Offset can be maximum 192. With an Offset of 192 the last Output (31) will be
assigned the last available External Interrupt Task 255 (=192+2x31+1).
Example 1 If you only want Soft Input 3 to generate interrupts and you only want to execute
an External Interrupt Task on the rising edge of Digital Output 3, than you must
enable Output 3 to generate interrupts (m+2 = 0008H and m+3 = 0000H). If you
decide to use an Offset of 5 (m+1 = 0005(BCD)) than External Interrupt Tasks 11
and 12 will be assigned to Output 3. In External Interrupt Task 11 you should write
an appropriate (ladder) program which is to be executed at a rising edge of the
corresponding bit of Output 3 in the Unit Output Pattern. External Interrupt Task 12
must also be programmed but will remain empty since no action is required on a
falling edge of Output 3.
Example 2 An Offset of 10 (m+1 = 0010(BCD)), with all 32 Outputs enabled to generate inter-
rupts (m+2 and m+3 = FFFFH), means that the rising edge of the corresponding
bit of Output 0 in the Unit Output Pattern is assigned to External Interrupt Task
Number 10 and the falling edge to External Interrupt Task 11. The rising edge of
Output 1 to External Interrupt Task Number 12 and the falling edge to External
Interrupt Task Number 13 and so on. For Output 31 the two External Interrupt
Tasks 72 and 73 are assigned. Now you have External Interrupt Tasks 10 to 73
available. In every Task you should write an appropriate (ladder) program which is
to be executed at the Outputs corresponding rising or falling edge.
The application example in section 6-4 CAM-positioning shows you how to use
outputs generating interrupts.
130
Interrupts Section 4-6
You can (DM-) configure a Digital Input to generate interrupts by setting the corre-
sponding bit in the Interrupt Enable Data of the Digital Inputs. The Interrupt Enable
Data of the Digital Inputs consists of 2 bits representing the 2 Digital Inputs. By
default the Inputs are disabled to generate interrupts.
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+5 I1 I0
Interrupt Enable Data Inputs
0 = Interrupts Disabled
1 = Interrupts Enabled
Bits 0 and 1 correspond with the Physical Digital Inputs I0 and I1.
External Interrupt Task Every Digital Input that is enabled to generate interrupts is assigned to an external
Offset interrupt task in the CJ-series CPU Unit. In the External Interrupt Task you should
write an appropriate (ladder) program that takes the required action on the occur-
rence of an interrupt.
131
Interrupts Section 4-6
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. The remaining Digital Input is assigned to the respec-
tive external interrupt task numbers in increasing order starting from Offset + 1.
Since there are 256 External Interrupt Tasks available (numbered 0 to 255), the
Offset can be maximum 252.
Note 1. Multiple interrupts generated at the same time will be queued in FIFO-order
inside the High-speed Counter Unit. If the FIFO-buffer is full the Unit will gener-
ate an error (refer to 5-2-5 "Interrupt FIFO full error" for more information).
2. If the ranges of external interrupt task numbers that are assigned to the Outputs
and the Digital Inputs overlap, the Unit does not generate an error.
132
SECTION 5
Error Processing, Maintenance and Inspection
This section provides details of the CJ1W-CT021 High-speed Counter Units error indicators and error codes and guidelines
for maintenance and inspection of the Unit.
133
Error Indicators Section 5-1
The RUN-, ERC-, and ERH-LEDs, at the front panel of the High-speed Counter
Unit, display the following errors.
134
Error Indicators Section 5-1
135
Error codes Section 5-2
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+18
Error Code 2
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+19
Global Error bit:
0 = No error exists
1 = Error(s) has/have occurred
Every error category requires its own unique action to clear them (refer to the next
sections for information on clearing errors of different categories).
Error History Log File Up to a maximum of 30 errors can be logged in chronological order inside the
High-speed Counter Unit, constituting the Error History Log File. If multiple errors
are active at the same time every error (-code) can be read sequentially into CIO
(n+17, n+18) by using the Read Next Error bit. Every next error is read from the
Error History Log File at the rising edge of the Read Next Error bit. If you attempt
to read an error after the last error in the list has been read, the value of zero will
be returned. Now you can scroll through the same error list again from the next ris-
ing edge of the Read Next Error bit.
General Setting: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+1
Read Next Error
01 = Read Next Error
136
Error codes Section 5-2
137
Error codes Section 5-2
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:
Turn the power of the CJ-series PLC system ON.
Restart the High-speed Counter Unit (refer to 4-1-2 "Special I/O Units Restart
bits").
138
Error codes Section 5-2
Clearing IOWR-instruction IOWR-instruction errors can be cleared by issuing the IOWR-instruction with the
errors Error Clear (EC) command (refer to 4-5-3-5 "Error Clear Command" for more
information).
Clearing overflow/ Overflow- and underflow errors can be cleared by resetting or presetting the
underflow errors Counter that generated over- or underflow. To reset a Counter refer to 3-6 "Reset
Signals". To preset a Counter refer 3-4 "Digital Input Functions".
139
Error codes Section 5-2
Note At overflow- and underflow errors it is possible to configure Output State Control
(refer to 3-5-4 "Output Control Configuration").
Clearing Preset error A Preset error can be cleared by resetting or by presetting the Counter that gen-
erated a Preset error, with a valid Preset Value. To reset a Counter refer to 3-6
"Reset Signals". To preset a Counter refer to 3-4 "Digital Input Functions".
Multiple interrupts, generated by the Digital Inputs and/or the Outputs, will be
queued in FIFO-order inside the High-speed Counter Unit, for as long as the cur-
rent active interrupt is not executed. The FIFO-buffer stores up to 30 interrupt
requests. If the FIFO-buffer is full the Unit will report an error to the CJ-series CPU
Unit. All interrupts generated by the Unit, after the Interrupt FIFO full error has
occurred will be ignored and will not generate additional errors. Error Code 2 con-
tains the external interrupt task number of the corresponding interrupt that was
excluded from the full FIFO-queue.
Clearing Interrupt FIFO If the speed with which the High-speed Counter Unit generates interrupts is higher
error than the speed with which the CJ-series CPU Unit executes the interrupts, the
FIFO-buffer inside the Unit runs full and the Interrupt FIFO full error is generated.
The error can be cleared by issuing the IOWR-instruction with the Error Clear
(EC) command (refer to 4-5-3-5 "Error Clear Command" for details).
140
Error codes Section 5-2
The error indicates that the load of interrupts on the CJ-series CPU Unit is too
high. Clearing the error as mentioned before most probably needs additional
measures to be taken in order to prevent this error from happening in the future:
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.
External interrupt requests from the High-speed Counter Unit will not reach the
CPU Unit if the CPU Unit is not a CJ1-H or CJ1M CPU Unit (CJ1 CPU Units do not
support external interrupts), or the Unit is mounted at an incorrect position.
Be sure the High-speed Counter Unit is installed in the correct position. It must be
installed in one of the five positions immediately to the right of the CPU Unit (when
facing the PLC) if a CJ1-H CPU Unit is used, or in one of the three positions imme-
diately to the right of the CPU Unit if a CJ1M CPU Unit is used.
Clearing System errors Turn ON the power supply again or restart the system. If the error persists, then
replace the CJ-series CPU Unit.
141
Maintenance and Inspection Section 5-3
5-3-1 Cleaning
Clean the High-speed Counter Unit regularly as described below in order to keep
it in its optimal operating condition.
Wipe the Unit with a dry, soft cloth for regular cleaning.
When a spot cannot be removed with a dry cloth, dampen the cloth with a neu-
tral cleanser, wring out the cloth, and wipe the Unit.
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.
Inspection Equipment Prepare the following equipment before inspecting the system.
Required Equipment:
Have a standard and Phillips-head screwdriver, multimeter, alcohol, and a clean
cloth.
Equipment that could be needed:
Depending on the system conditions, a synchroscope, oscilloscope, thermometer,
gas sensor or hygrometer (to measure humidity) might be needed.
142
Maintenance and Inspection Section 5-3
Inspection Procedure Check the items in the following table and correct any items that are not according
to the criteria.
143
Maintenance and Inspection Section 5-3
144
SECTION 6
Application Examples
This section gives information about the configuration of the CJ1W-CT021 High-speed Counter Unit and program samples,
which can be used to operate the Unit according to five common application examples. At the beginning of each section that
describes an application example, all configuration items that are covered in that section are mentioned.
145
Flow Control Section 6-1
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. The liquid passes through the flow meter into the
tank. The pulse output of the flow meter measures the liquid flow that is propor-
tional to the number of pulses generated (5,000 pulses is equivalent to 1 litre).
After the tank has been filled with exactly 100 litres of liquid the valve and the Gate
of the Simple Counter are closed automatically.
CT021
RUN ERC ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
20 20
23
456
01
789
23
456
9 01
78
CN1
2
1
O
N
MODE
1 1
B A
Liquid
Tank
The push button is connected to Digital Input I0 and the valve is connected to Dig-
ital Output O0 of the High-speed Counter Unit. The pulses of the flow meter are
counted by Counter 1 which is configured as Simple Counter (corresponding DIP
switch at the front of the Unit is in the OFF-position).
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).
A short ladder program for the PLC must be written to control this application. The
ladder program interfaces with the High-speed Counter Unit via the Special I/O
Unit Area in CIO.
Relevant CIO-words The following CIO-words are relevant to control the application and must be used
in the ladder program.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CIO 2000 (= n) O0
Manual Control Digital Output 0:
0 = Close Valve
1 = Open Valve
Selection Automatic/Manual:
1 = Manual Output Control
146
Flow Control Section 6-1
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CIO 2002 (= n+2)
Open Gate Simple Counter 1
01 = Open Gate
Close Gate Simple Counter 1
01 = Close Gate
Reset Simple Counter 1
01 = Reset Counter
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CIO 2016 (= n+16) I0
Status Digital Input 0:
0 = Push-button is not pressed
1 = Push-button is pressed
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CIO 2022 (= n+22)
CIO 2023 (= n+23)
Counter Value Simple Counter 1
147
Flow Control Section 6-1
Ladder Program
A20011
200015 Set Simple C ounter 1 t o
Manual Output Control
First Cycle F lag
200015
201600
200203 Reset Simple Counter 1
to zero
Push Button
SET
Open Valve
200000
202402
CPSL(115)
Check if tank content is
Gate Open Counter 1 2022 greater than or equal to
100 litres (= 000 7A120H)
#0007A120
>=
148
Length Measurement Section 6-2
Application Description In this example the length of objects is measured. Improper sized objects are
removed from the line by activating the pusher for one second. The measured
length of improper sized objects is stored in EM of the PLC as a 32-bits Counter
Value. The High-speed Counter Unit is DM-configured and works stand-alone
except for storing the size of improper sized objects in EM; a short ladder program
is written to read and store the length of improper sized objects into the CJ-series
CPU Unit. The Unit is in Range Mode.
In order to activate the pusher at the right moment (i.e. the object with incorrect
length is in front of the pusher) encoder 2 and photo-electric sensor D2 are used.
When the end of the object leaves the beam of photo-electric sensor D2, Counter
2 is reset and continues counting. The pusher will be activated for one second as
soon as the object is in the predefined range of Counter 2.
CT041 PS204S
Power
RUN ER C ERH
CH1 A B Z I0 O0
CH2 A B Z I1 O1
CH3 A B Z I2 O2
CH4 A B Z I3 O3
MACH
No.
X101 X100
1 1
CN2 CN1
20 20
AB AB
Photo-electric Photo-electric
sensor ( D2) sensor ( D1)
Pusher
Motor 1
Conveyor belt 2 Conveyor belt 1
Motor 2
Encoder ( E2) Encoder ( E1)
149
Length Measurement Section 6-2
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).
At the falling edge of Digital Input I0, when an object enters the beam of the photo-
electric sensor, the Counter Value is reset, the gate is opened and Counter 1
starts counting pulses from zero. At the rising edge of Digital Input I0, when the
object leaves the beam of the photo-electric sensor, the Counter Value of Counter
1 is captured and the gate is closed.
Reading Captured Value By issuing an IORD-instruction from the PLC ladder program the captured Coun-
ter Value is read. The length of improper sized objects is stored in Extended Mem-
ory of the PLC (refer to the ladder program example on the next pages).
Measuring length The length is measured by Counter 1 and should be ideally 5000. The valid range
for the length of an object is 4900 5100. If the length of an object is in Range 0
(4000 4900) or Range 1 (5100 6000) the object is improperly sized and must
be removed. Digital Output O0, in the Output Pattern of Counter 1, is turned ON
when the Counter Value is within Range 0 or 1.
Digital Output O0 ON
150
Length Measurement Section 6-2
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. Digital Input I1 controls Counter 2 and is assigned Digital Input
Function 5 (Reset Rising Edge).
Reset Counter 2 at R ising Edge
(Digital Input Function 5)
Digital Input I1
(= photo-electric sensor D 2)
time
Object p asses D 2
Digital Output O0 ON
Digital Input I1 At the rising edge of Digital Input I1, when an object leaves the beam of the photo-
electric sensor, Counter 2 is reset but continues counting. When the Counter
Value enters Range 0 Digital Output O0 is turned ON.
Logically AND Output The pusher (i.e. Digital Output O0) is controlled by logically AND-ing the output
Patterns Counter 1 and 2 patterns of Counter 1 and 2. This means that the pusher is activated when both
output patterns of Counter 1 and 2 have turned ON bit 0 (= Digital Output O0).
31 4 3 2 1 0
Logical AND
Consequently the pusher is activated for 1 second when Counter 1 has measured
an invalid sized object AND when Counter 2 has determined that the object is in
front of the pusher.
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). The Range Data
of Counter 1 is stored in DM starting from D500 and the Range Data of Counter 2
151
Length Measurement Section 6-2
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 8 7 6 5 4 3 2 1 0
:DM-word
152
Length Measurement Section 6-2
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.
A20011
MO VR (560)
Write physical memory address of
First Cycle Flag EM 100 EM 100 into Index Register IR 0
(data of improperly sized objects
IR0 is stored in EM starting from EM 100)
ON
RSET
Reset flag of improperly
Always ON flag 000100 sized objects
201600 201902
I ORD(222)
CPSL(115)
CPSL(115)
Check if Captured Value
D100
is too big
#000013EC
000100
M OVL(498)
Write measured length of
Rising edge of improperly D100 improperly sized objects to
sized objects EM starting from EM 100
IR0+
153
Positioning Section 6-3
6-3 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. The
feed motor has two speeds (fast/slow) and can travel in two directions (forward/
reverse). The High-speed Counter Unit controls the speed and direction of the
feed-motor and turns ON/OFF the drill-motor. Turning ON and OFF the feed-motor
is done by the PLC ladder program via a Digital Input- and Output Unit (e.g. CJ1W-
ID231/OD231). A proximity switch is also connected to the Digital Input-and Out-
put Unit and reports to the CPU via the ladder program that an object is ready to
be treated. Consequently via the ladder program the feed-motor is turned ON.
0 1 0 1
20 20 1 1 1 1
23
456
9 01
78
23
456
01
789
CN1
DC24V 4.1mA
DC24V 4.1mA
2
1
O
N
MODE
1 1 20 20 20 20
B A A B A B
Limit switch
(Drill)
Encoder (Feed) Motor1
Motor2
Proximity switch
Object
After an object has been detected the feed-motor (M1) is turned ON (slow/for-
ward). When CV0 is passed M1 is switched to move fast. Reaching CV1 causes
the drill-motor (M2) to turn ON. At CV2 the feed-motor is switched to move slow.
Reaching CV3, when the hole has been completed causes the feed-motor to
reverse direction and to move back with fast speed (Counter 1 now counts down).
Other machinery (that is not visible) now automatically removes the object and the
proximity switch becomes inactive. At CV1 the drill-motor turns OFF and at CV0
154
Positioning Section 6-3
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.
The limit switch is connected to Digital Input I0 which is assigned function 05 (i.e.
Reset Rising Edge). Activation of the limit switch when the drill-motor is in the
home position causes Counter 1 to be reset and the feed-motor to be switched to
its initial state (slow/forward). An Output Reset Pattern (m+61, m+62) has been
defined to switch the feed-motor to its initial state.
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). The Comparison
Data of Counter 1 is stored in EM starting from EM 1500. To configure the Unit the
following DM-settings must be made.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
:DM-word
155
Positioning Section 6-3
Transfer the DM-settings to the High-speed Counter Unit by restarting the Unit.
156
Positioning Section 6-3
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.
157
Positioning Section 6-3
201600
RSET Turn OFF feed-motor M1 if the drill-motor
is in home position, detected by a rising
Limit switch at 000000 edge on Digital Input i0
Digital Input l0
000000 201402
000001 If the feed motor is on, the drill motor
Feed motor Soft Output 2 is turned ON after the target position
is reached and Soft Output 2 turns ON.
010000
MOVL(498)
Trigger new CV-data #0000AFC8
for CV03
D1200
MOVL(498)
#00000003
D1202
MOVL(498)
New CV-data for CV03,
#00000000 written to the 10-word
block starting from D1200
D1204
MOVL(498)
#00000000
D1206
MOVL(498)
#00000000
D1208
010001 201902
IOWR (223)
Write new CV03-data
Renew CV03 data Data Transfer Busy #1A03 (i.e. 10 words starting from
D1200) for Counter 1 to the Unit
D1200
#000A0000
Equals Flag
010002 Transfer Successful
201903
DIFU(13)010003 Data Transfer Completed
010003 201900
010005 CV03-data successfully
written
Data Transfer Completed Global error
010004
158
CAM-positioning Section 6-4
6-4 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
bit
Application Description In this example 15 outputs of a machine are controlled according to the position
angle of the electronic CAM-shaft that is driven by a motor. The position angle is
measured by counting the pulses of an incremental encoder that is connected to
the CAM-shaft.
In order to increase the resolution of the encoder the Input Signal Type for Counter
1 is set to multiplication x4. The Z-phase of the encoder is used to reset the
Counter together with the Software Reset Enable bit (make sure that CIO n+2, bit
05 is set).
The 15 outputs are controlled by the PLC ladder program via an additional Output
Unit (e.g. CJ1W-OD231). In order to reduce the On/Off-response time for the out-
puts all 15 outputs are enabled to generate interrupts to the CJ1-H CPU Unit.
CT021 OD231
RUN ERC ERH 0 1 2 3
CH1 A B Z I0 O0 4 5 6 7
8 9 10 11
CH2 A B Z I1 O1 12 13 14 15
0 1
20 20 1 1
23
456
9 01
78
23
456
01
789
CN1
DC24V 4.1mA
2
1
O
N
MODE
1 1 20 20
B A A B
Position Angle
Electric CAM-shaft
Encoder
Motor
159
CAM-positioning Section 6-4
2 2500 6000 5, 7, 9
3 5000 7000 2, 3
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). The Range Data
of Counter 1 is stored in EM starting from EM100. To configure the Unit the follow-
ing DM-settings must be made.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
:DM-word
160
CAM-positioning Section 6-4
Transfer the DM-settings to the High-speed Counter Unit by restarting the Unit.
161
CAM-positioning Section 6-4
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. The Software Reset Enable bit must be set to 1 in CIO (= CIO
200205) to enable resetting Counter 1 by a rising edge of the Z-signal.
Interrupt Task 10:
ON
000000 Output 0
Always ON flag
Interrupt Task 11:
OFF
000000 Output 0
Always ON flag
Interrupt Task 13:
OFF
000001 Output 1
Always ON flag
Interrupt Task 15:
OFF
000002 Output 2
Always ON flag
Interrupt Task 17:
OFF
000003 Output 3
Always ON flag
Interrupt Task 19:
OFF
000004 Output 4
Always ON flag
Interrupt Task 21:
OFF
000005 Output 5
Always ON flag
Interrupt Task 23:
OFF
000006 Output 6
162
CAM-positioning Section 6-4
Always ON flag
Interrupt Task 25:
OFF
000007 Output 7
Always ON flag
Interrupt Task 27:
OFF
000008 Output 8
Always ON flag
Interrupt Task 29:
OFF
000009 Output 9
Always ON flag
Interrupt Task 31:
OFF
000010 Output 10
Always ON flag
Interrupt Task 33:
OFF
000011 Output 11
Always ON flag
Interrupt Task 35:
OFF
000012 Output 12
Always ON flag
Interrupt Task 37:
OFF
000013 Output 13
Always ON flag
Interrupt Task 39:
OFF
000014 Output 14
163
Speed Control Section 6-5
Application Description In this example logs are fed into a saw blade. A conveyor that has two speeds
(fast/slow) transports the logs. Via the control panel the conveyor and the saw
blade can be started and stopped. A speed sensor detects the speed of the saw
blade. The pulses of the speed sensor are counted by Counter 1 and are propor-
tional to the speed of the saw blade.
Logs are fed into the saw blade at fast speed. When the saw blade encounters an
irregularity in the log, the speed of the saw blade slows down. Now the conveyor
is switched from fast to slow speed (slow speed indicator turns ON). Once the saw
blade clears the irregularity and returns to its normal speed, the conveyor is
switched from slow to fast speed again (slow speed indicator turns OFF).
ID231 OD231 CT021
0 1 2 3 0 1 2 3 RUN ERC ERH
4 5 6 7 4 5 6 7
8 9 10 11 8 9 10 11 CH1 A B Z I0 O0
12 13 14 15 12 13 14 15 CH2 A B Z I1 O1
0 1 0 1
1 1 1 1 20 20
23
456
9 01
78
23
456
01
789
CN1
DC24V 4.1mA
DC24V 4.1mA
2
1
O
N
MODE
Control Panel 20
A B
20 20
A B
20 1
B
1
Slow Speed
Indicator
Speed Sensor
Motor
The speed sensor is connected to Circular Counter 1. The two Rate Ranges
(Range 0 and 1) of Counter 1 are used to detect the speed of the saw blade. Turn-
ing the conveyor motor and the saw blade ON/OFF, using the control panel, is con-
trolled via the PLC ladder program and a Digital Input- and Output Unit (e.g.
CJ1W-OD231/ID231). The speed of the conveyor motor is controlled by Digital
164
Speed Control Section 6-5
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:
Fast Slow Slow Fast High frequencies are
detected by Rate Range 0
Slow
(O0 and O1 are ON )
Fast
(O0 and O1 are OFF ) Time
In order to use Counter 1 for Rate Measurement its Time-Window has been set to
1 second (=1000 ms). Rate Range 0 is used to detect frequencies that are above
the critical speed and Rate Range 1 used to detect frequencies that are below the
critical speed:
Rate Range Data Rate Range Lower Rate Range Upper Rate Range Outputs ON
Limit Limit
0 5000 2,147,483,647 0, 1 (OFF)
1 0 4999 0, 1 (ON)
165
Speed Control Section 6-5
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.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
: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) - - - 0 Range Mode (=0)
Counter 1 DM-settings:
D 20030 (= m+30) - - - 0 Circular Counter (=0)
D 20039 (= m+39) 1 0 0 0 Time-Window of Counter 1 is 1000 ms (=1000)
D 20040 (= m+40) 1 3 8 8 Lower Range Rate Limit of Range Rate 0 is 5000 (=00001388H)
D 20041 (= m+41) 0 0 0 0
D 20042 (= m+42) F F F F Upper Range Rate Limit of Range Rate 0 is 2,147,438,647 (=7FFFFFFF H)
D 20043 (= m+43) 7 F F F
D 20044 (= m+44) 0 0 0 0 Output Set Pattern Rate Range 0: All Outputs are turned ON (=00000000H)
D 20045 (= m+45) 0 0 0 0
D 20046 (= m+46) 0 0 0 3 Output Reset Pattern Rate Range 0: Outputs 0 and 1 are turned OFF
D 20047 (= m+47) 0 0 0 0 (=00000003H)
D 20048 (= m+48) 0 0 0 0 Lower Range Rate Limit of Range Rate 1 is 0 (=00000000H)
D 20049 (= m+49) 0 0 0 0
D 20050 (= m+50) 1 3 8 7 Upper Range Rate Limit of Range Rate 1 is 4999 (=00001387H)
D 20051 (= m+51) 0 0 0 0
D 20052 (= m+52) 0 0 0 3
Output Set Pattern Rate Range 1: Outputs 0 and 1 are turned ON (=00000003H )
D 20053 (= m+53) 0 0 0 0
D 20054 (= m+54) 0 0 0 0 Output Reset Pattern Rate Range 1: No Outputs are turned OFF (=00000000H)
D 20055 (= m+55) 0 0 0 0
D 20056 (= m+56) - - - 3 Rate Range 0 and Rate Range 1 are enabled (=0003H)
Transfer the DM-settings to the High-speed Counter Unit by restarting the Unit.
Ladder Program A short ladder program for the PLC is written to control the conveyor motor and the
saw blade via the control panel. The Digital Output Unit is mapped in CIO starting
from CIO 000000. The start-pushbutton is mapped on CIO 000200 and the stop-
pushbutton on CIO 000201. The conveyor motor is mapped on CIO 000000 and
the saw blade motor on CIO 000001.
000200 000201
Start Stop
000000
000001 Saw Blade M otor
Conveyor Motor
000001
166
Using Terminal Block Units with Screw-terminals Appendix A
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.
Connections
CN1
XW2B-40G4
XW2B-40G5
1 3 49
Screw terminal block
terminal arrangement 2 4 50
Note The top row of the Terminal Block Unit (numbered 1 to 39) corresponds to the pins
numbered A1 to A20 of the associated connector (CN1) on the High-speed Coun-
ter Unit. The bottom row of the Terminal Block Unit (numbered 2 to 40) corre-
167
Using Terminal Block Units with Screw-terminals Appendix A
sponds to the pins numbered B1 to B20 of the associated connector (CN1) on the
Unit.
168
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. An output can be enabled to generate interrupts by setting
the corresponding bit in the Output Interrupt Enable Data (refer to 4-6-1 "Outputs Generating Interrupts").
* The assigned External Interrupt Task number is executed at a rising/falling edge of the corresponding Output bit
in the Unit Output Pattern.
169
Assigning External Interrupt Tasks to Outputs Appendix B
* The assigned External Interrupt Task number is executed at a rising/falling edge of the corresponding Output bit
in the Unit Output Pattern.
170
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
circuitry circuitry
processing
MPU Digital Output
B
The Response Time can vary between 0.1 and 0.5 milliseconds, but is guaranteed to be less than 0.5
milliseconds. The following factors cause the Response Time to fluctuate:
The maximum Response Time of 0.5 milliseconds can no longer be guaranteed and will temporarily become
longer than 0.5 milliseconds in case you make use of:
IOWR/IORD-instructions
IORF-instructions
Programmable Output Pulses
Rate Measurement for one or more Counters
Digital Inputs or Z-inputs
Outputs- and or Digital Inputs generating Interrupts to the CJ1-H PLC
Note
When using one of the above functions, the approximate response time will be as follows:
Response time = 0.5 ms + function execution time.
Refer to Appendix E "IORF and IOWR/IORD-instruction Execution Times" for information on execution times for
IORF and IOWR/IORD-instructions.
External Control Inputs and Z-signal Inputs require approximately 300 s, and external interrupt tasks require
10 s per interrupt.
171
Appendix D
Application Restrictions
The following restrictions apply when using CJ1W-CT021 High-speed Counter Units.
Restriction Reference
When a 50-kHz noise filter is configured, External Control Inputs cannot read signals 1-3-3 "Input Specifications"
shorter than 10 s.
The time from signal input to resetting for External Control Inputs is 300 s max. 3-4 "Digital Input Functions"
The Open Gate Bit, Close Gate Bit, Preset Counter Bit, Reset Bit, or the Counter 3-4 "Digital Input Functions"
Capture Bit in CIO may not be executed if turned ON for only one PLC-cycle. Always 4-2 "Memory Allocation"
keep these bits turned ON until the execution status changes in the corresponding
flag in n+24 or n+29.
External Control Inputs may not be reflected in the status of External Inputs (n+2, 3-4 "Digital Input Functions"
n+5) if the pulse width is extremely short.
The following are the main reasons for this:
The signal is shorter than the CPU Unit cycle time.
The signal is shorter than the time the Data Transfer Busy bit is ON (e.g.,
during execution of an IOWR-instruction.)
The comparison operation stops for 1.5 ms from when the High-speed Counter Value 3-5-1-2 "Configuration and operation
falls within the Upper Range Limit or Lower Range Limit for the Range Data. in Range Mode"
However, the comparison does not stop for other counters.
Consider the time that the comparison is stopped when making settings for Range
Data.
When the High-speed Counter Value reaches the target value for Comparison Data, 3-5-2-2 "Configuration and operation
comparison stops for 1.5 ms. However, comparison for other counters does not stop. in Comparison Mode"
Consider the time the comparison stops when setting Comparison Data.
Comparison is stopped during the execution of IOWR/IORD-instructions and remains 3-5-1-2 "Configuration and operation
stopped until the processing of the instruction has been completed. The Data in Range Mode"
Transfer Busy bit is ON during this time. 3-5-2-2 "Configuration and operation
This stopping of comparison during the execution of IOWR/IORD-instructions affects in Comparison Mode"
counter comparisons for all counters.
Set Range Data and Comparison Data considering that comparisons are stopped by
execution of IOWR/IORD-instructions.
The measurement interval for the Pulse Rate Measurement Function normally varies 3-7-2 "Rate Measurement"
by 125 s and can vary by a maximum of 1 ms. If the pulse rate value is averaged in
the ladder program, a value with a low (averaged) variation can be obtained.
The I/O Refresh will not occur while the Data Transfer Busy bit (CIO n+19, bit 02) is 4-1-1 "Basic Setup"
ON, and the Counter Value will not be refreshed while this bit is ON.
The Unit's Data Transfer Busy bit (n+19, bit 02) will turn ON for approximately 120 ms 4-2-3 "CIO-Memory Mapping"
at restart and when the power is turned ON.
When using the IOWR-instruction to write Comparison Data to the Unit, check that 4-5 "Supported IOWR/IORD-
the target value being written will not be duplicated in the same Counter. If a target Instructions"
value already set to the Unit is transferred, set the Comparison Data so that the same
value will be overwritten for the existing target value.
A CJ1-H or CJ1M CPU Unit is required to use external interrupt tasks. CJ1 CPU Units 4-6 "Interrupts"
do not support external interrupt tasks.
There are also restrictions on the position of the Unit on the Rack. Refer to the
section given in the right column for information on the restrictions.
173
Application Restrictions Section D
Restriction Reference
The External Interrupt Task buffer stores up to 30 requests. 5-2-5 "Interrupt FIFO full error"
For functions that cannot guarantee a response time of 0.5 ms or shorter, the Appendix C "Description of the
approximate response time will be as follows: Response Time"
Response time = 0.5 ms + function execution time.
External Control Inputs and Z-signal Inputs take approximately 300 s, and external
interrupt tasks take 10 s per interrupt.
Refer to Appendix E "IORF and IOWR/IORD-instruction Execution Times" for
information on execution times for IORF and IOWR/IORD-instructions.
174
Appendix E
IORF and IOWR/IORD-instruction Execution Times
Instruction Control data Execution conditions Execution time
IORF --- --- 0.5 ms
IOWR 0D01 --- 10 s
0B01 --- 0.8 ms
1A00 (See note.) Range comparison conditions are not set in the Unit and the following command
is executed.
Rewriting 21 ranges 5 ms
1A00 (See note.) Comparison conditions for 32 ranges are set in the Unit and the following
command is executed.
Rewriting 1 range 50 ms
Rewriting 21 ranges 55 ms
1A00 (See note.) Comparison conditions for 16 ranges are set in the Unit and the following
command is executed.
Rewriting 1 range 29 ms
Rewriting 21 ranges 33 ms
1A00 (See note.) Comparisons for 32 target conditions are set in the Unit and the following
command is executed.
Rewriting 1 comparison value 10 ms
Rewriting 12 comparison values 13 ms
1A00 (See note.) Comparisons for 16 target conditions are set in the Unit and the following
command is executed.
Rewriting 1 comparison value 8 ms
Rewriting 12 comparison values 10 ms
1B03 When Range Mode is used
Disabling all comparison ranges 5 ms
Enabling 16 comparison ranges 29 ms
Enabling all comparison ranges 50 ms
1B03 When Comparison Mode is used
Disabling all comparison values 5 ms
Enabling 16 comparison values 8 ms
Enabling all comparison values 11 ms
IORD 0B01 --- 0.3 ms
0B02 --- 0.3 ms
1E01 --- 0.3 ms
1C03 --- 0.3 ms
1C04 --- 0.3 ms
1F02 --- 0.3 ms
1B03 --- 0.3 ms
1B04 --- 0.3 ms
1A00 --- 0.8 ms
1C02 --- 0.3 ms
1F01 --- 0.7 ms
1C01 --- 0.3 ms
Note The time required to rewrite a Comparison Table depends more on the number of values already set in the
table in the Unit than on the amount of transfer data.
175
Index
Counter Types 47
A Circular Counter 53
A-indicator 27 Linear Counter 54
Allocating Memory 97 Simple Counter 48
Application Areas 24 Digital Input Functionality 59
Hysteresis 90
Application Examples
Inintial Counter Value 92
CAM-positioning 159
Input Signal Types 56
Flow Control 146
Phase Differential Signals (x1, x2, x4) 56
Length Measurement 149
Pulse & Direction Signals 58
Positioning 154
Up & Down Signals 57
Speed Control 164
Noise Filtering 91
Assembling Connectors 34
Output Control 65
Automatic Output Control 65, 79 Comparison Mode 73
Manual Output Control 79
Output Driver Type 80
B Output State Control 80
Basic Configuration 5 Range Mode 67
Programmable Output Pulses 83
B-indicator 27
Rate Measurement 84
Resetting 81
C Connector 32
Pin-layout 32
CAM-positioning Example 159 Wiring Methods 33
Captured Counter Value, reading with IORD 125, 150 External Connector 33
Capturing 62 Terminal Block Unit 35
CIO-Memory Mapping, Input Words 103 Counter Input Circuitry 37
Counter 1 103 Example Line Driver (RS-422) 43
Counter 2 104 Counter Inputs 41
General 103 Configuring Driver Type 33
CIO-Memory Mapping, Output Words 102 12VDC Open Collector 33
Counter 1 102 24VDC Open Collector 33
Counter 2 102 5VDC Open Collector 33
General 102 Example 5/12/24VDC NPN Open Collector 41
Circular Counter 17, 19, 53 Example 5/12/24VDC PNP Open Collector 42
Examples 149, 159 Example Line Driver (RS-422) 43
Specifications 11
Comparison Memory Mapping 114
Counter Type Switch 28
Comparison Mode 73
Configuration and operation 76 Counter Types 47
Example with Circular Counter 74 Circular Counter 53
Example with Linear Counter 73 Linear Counter 54
Overview 75 Simple Counter 48
177
Index
D E
Data Exchange, between CPU and CS1W-CT021/CT041 94 Enable Reset 81
Delay, turning ON an Output 83 ERC-indicator 27, 134
Digital Input Functionality 59 ERH-indicator 27, 134
Capture and Reset Funtion 63 Error Categories
Capture Funtion 62 DM-configuration errors 137
Disable Reset Function 64 Interrupt FIFO full error 140
Enable Reset Function 64 IOWR/IORD-instruction errors 138
Examples 149, 154 Overflow/Underflow errors 139
Multiple Digital Inputs controlling one Counter 59 Preset errors 140
Preset Function 60 Error Clear Command 127
Reset Function 61
Error codes 136
Stop, Capture and Continue Function 62
Error History Log File 136
Stop, Capture, Reset and Continue Function 63
Error Indicators
Digital Inputs
During Initial processing 134
Functionality 59
During Normal processing 134
Internal Circuitry 36
Specifications 11 Error Processing 137
Status Information 64 Errors, clearing
Wiring 33, 36 DM-configuration errors 137
Example 24 VDC NPN Sensor 39 Interrupt FIFO full error 140
Example 24 VDC PNP Sensor 39 IOWR/IORD-instruction errors 138
Digital Inputs Generating Interrupts 131 Overflow/Underflow errors 139
178
Index
I M
Indicators 27 Machine Number Switch 29
A, B, Z 27 Maintenance 142
ERC 27 Manual Output Control 79
ERH 27 Memory Allocation 97
LED 27 CIO-Memory Mapping 101
RUN 27, 134 Comparison Memory Mapping 114
Indirect Addressing 98 DM-Memory Mapping 105
Initial Counter Value 92 Indirect Addressing 98
Input Drivers 33 Memory Mapping 97
Range Memory Mapping 112
Input Signal Types 56
Phase Differential Signals (x1, x2, x4) 56 Memory Mapping 97
Pulse & Direction Signals 58 Mounting the Unit 31
Up & Down Signals 57 Multiple Digital Inputs controlling one Counter 59
Input specifications 11
Inspection 142
Installing High-speed Counter Unit
N
Components 26 Noise Filtering 91
Indicators 27 Counter Inputs 91
Installation 30 Digital Inputs 91
Switch settings 29 NPN-Output Driver 80
Counter Type Switch 28
Machine Number Switch 29
Interrupt Task 129, 131, 162 O
Interrupts
Offset 129, 131
Inputs Generating Interrupts 131
Outputs Generating Interrupts 129 Operating High-speed Counter Unit 15, 21
Example 159 Operating Mode, change of 80
IORD-Instruction 118 Output Control 65
IOWR/IORD-Instructions 120 Comparison Mode 73
(Re) Configure Unit 127 Manual Output Control 79
Captured Counter Value 125 Output Driver Type 80
Counter Value 126 Output State Control 80
DM-data 120 Range Mode 67
Rate Ranges 87
179
Index
180
Index
T
Terminal Block Unit 35, 167
Time Window 85
Troubleshooting 136
U
Underflow 55
Underflow Error-Code Generation 55
Unit Output Pattern 66
Up & Down Signals 57
W
Wiring 32
Connector Pin-layout 32
Connector Wiring Methods 33
External connector 33
Terminal Block Unit 35
Counter Input Circuitry
Example 5/12/24 VDC NPN Open Collector 41
Example 5/12/24 VDC PNP Open Collector 42
Line Driver (RS-422) 43
Digital Input Circuitry 36
Example 24 VDC NPN Sensor 39
Example 24 VDC PNP Sensor 39
Digital Output Circuitry 38
Example NPN/PNP Digital Output 40
Important Wiring Considerations 36
Z
Z-indicator 27
Z-signal, resetting by 81, 159
181
Revision History
A manual revision code appears as a suffix to the catalog number on the front cover of the manual.
Revision code
The following table outlines the changes made to the manual during each revision. Page numbers refer to the
previous version.
183
184
OMRON Corporation Industrial Automation Company Authorized Distributor:
Tokyo, JAPAN
Contact: www.ia.omron.com
Regional Headquarters
OMRON EUROPE B.V. OMRON ELECTRONICS LLC
Wegalaan 67-69-2132 JD Hoofddorp One Commerce Drive Schaumburg,
The Netherlands IL 60173-5302 U.S.A.
Tel: (31)2356-81-300/Fax: (31)2356-81-388 Tel: (1) 847-843-7900/Fax: (1) 847-843-7787
OMRON ASIA PACIFIC PTE. LTD. OMRON (CHINA) CO., LTD. OMRON Corporation 2001 All Rights Reserved.
No. 438A Alexandra Road # 05-05/08 (Lobby 2), Room 2211, Bank of China Tower, In the interest of product improvement,
Alexandra Technopark, 200 Yin Cheng Zhong Road, specifications are subject to change without notice.
Singapore 119967 PuDong New Area, Shanghai, 200120, China Printed in Japan
Tel: (65) 6835-3011/Fax: (65) 6835-2711 Tel: (86) 21-5037-2222/Fax: (86) 21-5037-2200 Cat. No. W401-E1-04 0411