Modicon X80: BMXEHC0200 Counting Module User Manual
Modicon X80: BMXEHC0200 Counting Module User Manual
35013355 10/2019
              Modicon X80
              BMXEHC0200 Counting Module
              User Manual
              Original instructions
              10/2019
35013355.14
              www.schneider-electric.com
    The information provided in this documentation contains general descriptions and/or technical
    characteristics of the performance of the products contained herein. This documentation is not
    intended as a substitute for and is not to be used for determining suitability or reliability of these
    products for specific user applications. It is the duty of any such user or integrator to perform the
    appropriate and complete risk analysis, evaluation and testing of the products with respect to the
    relevant specific application or use thereof. Neither Schneider Electric nor any of its affiliates or
    subsidiaries shall be responsible or liable for misuse of the information contained herein. If you
    have any suggestions for improvements or amendments or have found errors in this publication,
    please notify us.
    You agree not to reproduce, other than for your own personal, noncommercial use, all or part of
    this document on any medium whatsoever without permission of Schneider Electric, given in
    writing. You also agree not to establish any hypertext links to this document or its content.
    Schneider Electric does not grant any right or license for the personal and noncommercial use of
    the document or its content, except for a non-exclusive license to consult it on an "as is" basis, at
    your own risk. All other rights are reserved.
    All pertinent state, regional, and local safety regulations must be observed when installing and
    using this product. For reasons of safety and to help ensure compliance with documented system
    data, only the manufacturer should perform repairs to components.
    When devices are used for applications with technical safety requirements, the relevant
    instructions must be followed.
    Failure to use Schneider Electric software or approved software with our hardware products may
    result in injury, harm, or improper operating results.
    Failure to observe this information can result in injury or equipment damage.
    © 2019 Schneider Electric. All rights reserved.
2                                                                                           35013355 10/2019
         Table of Contents
                              Safety Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                              7
                              About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                            11
                    Part I Introduction to the Counting Function . . . . . . . . . . . .                                                15
            Chapter 1 General Information on the Counting Function. . . . . . . .                                                       17
                              General Information on Counting Functions . . . . . . . . . . . . . . . . . . . .                         17
            Chapter 2 Presentation of Counting Module . . . . . . . . . . . . . . . . . .                                               19
                              General Information about Counting Module. . . . . . . . . . . . . . . . . . . .                          20
                              General Information about the Counting Module Operation . . . . . . . .                                   21
                              Presentation of the BMX EHC 0200 Counting Module . . . . . . . . . . . .                                  22
            Chapter 3 Presentation of the Counting Module Operation. . . . . . .                                                        23
                              Overview of BMX EHC 0200 Module Functionalities . . . . . . . . . . . . .                                 23
                   Part II Counting Module BMX EHC 0200 Hardware
                           Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                     25
            Chapter 4 General Rules for Installing Counting Module
                      BMX EHC 0200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                        27
                              Physical Description of the Counting Module . . . . . . . . . . . . . . . . . . .                         28
                              Fitting of Counting Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              30
                              Fitting 10-Pin and 16-Pin Terminal Blocks to a BMX EHC 0200
                              Counting Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         32
                              How to Connect BMX EHC 0200 Module: Connecting 16-Pin and 10-
                              Pin Terminal Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         33
            Chapter 5 BMX EHC 0200 Counting Module Hardware
                      Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                    35
                              Standards and Certifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              36
                              Characteristics for the BMX EHC 0200 Module and its Inputs and
                              Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   37
                              Display and Diagnostics of the BMX EHC 0200 Counting Module . . .                                         40
                              BMX EHC 0200 Module Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                    42
                              Shielding Connection Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            50
                   Part III Counting Module BMX EHC 0200 Functionalities . .                                                            53
            Chapter 6 BMX EHC 0200 Counting Module Functionalities . . . . .                                                            55
                       6.1 BMX EHC 0200 Module Configuration . . . . . . . . . . . . . . . . . . . . . . . .                            56
                           Input Interface Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             57
                           Programmable Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .               58
                           Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         59
35013355 10/2019                                                                                                                         3
                 Output Block Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                  62
                 Diagnostics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          67
                 Synchronization, Homing, Enable, Reset to 0 and Capture Functions                                               69
                 Modulo Flag and Synchronization Flag . . . . . . . . . . . . . . . . . . . . . . . .                            77
                 Sending Counting Events to the Application . . . . . . . . . . . . . . . . . . . .                              79
             6.2 BMX EHC 0200 Module Operation Modes . . . . . . . . . . . . . . . . . . . . .                                   82
                 BMX EHC 0200 Module Operation in Frequency Mode . . . . . . . . . . .                                           83
                 BMX EHC 0200 Module Operation in Event Counting Mode. . . . . . . .                                             84
                 BMX EHC 0200 Module Operation in Period Measuring Mode . . . . . .                                              86
                 BMX EHC 0200 Module Operation in Ratio Mode . . . . . . . . . . . . . . . .                                     89
                 BMX EHC 0200 Module Operation in One Shot Counter Mode . . . . .                                                92
                 BMX EHC 0200 Module Operation in Modulo Loop Counter Mode. . .                                                  95
                 BMX EHC 0200 Module Operation in Free Large Counter Mode . . . .                                                99
                 BMX EHC 0200 Module Operation in Pulse Width Modulation Mode .                                                 107
       Part IV Counting Module BMX EHC 0200 Software
               Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                          109
    Chapter 7 Software Implementation Methodology for
              BMX EHC xxxx Counting Modules . . . . . . . . . . . . . . . . . .                                                 111
                    Installation Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              111
    Chapter 8 Accessing the Functional Screens of the BMX EHC xxxx
              Counting Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                      113
                    Accessing the Functional Screens of the BMX EHC 0200 Counting
                    Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     114
                    Description of the Counting Module Screens. . . . . . . . . . . . . . . . . . . .                           116
    Chapter 9 Configuration of the BMX EHC 0200 Counting Modules .                                                              119
             9.1 Configuration Screen for BMX EHC xxxx Counting Modules. . . . . . . .                                          120
                 Configuration Screen for BMX EHC 0200 Counting Modules in a
                 Modicon M340 Local Rack. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                     120
             9.2 Configuration of Modes for the BMX EHC 0200 Module . . . . . . . . . . .                                       123
                 Frequency Mode Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                       124
                 Event Counting Mode Configuration . . . . . . . . . . . . . . . . . . . . . . . . . .                          126
                 Period Measuring Mode Configuration. . . . . . . . . . . . . . . . . . . . . . . . .                           128
                 Ratio Mode Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   130
                 One Shot Counter Mode Configuration . . . . . . . . . . . . . . . . . . . . . . . .                            132
                 Modulo Loop Counter Mode Configuration . . . . . . . . . . . . . . . . . . . . .                               134
                 Free Large Counter Mode Configuration . . . . . . . . . . . . . . . . . . . . . . .                            137
                 Pulse Width Modulation Mode Configuration . . . . . . . . . . . . . . . . . . . .                              140
4                                                                                                                       35013355 10/2019
          Chapter 10 BMX EHC xxxx Counting Module Settings . . . . . . . . . . .                                                      143
                            Adjust Screen for BMX EHC 0200 Counting Modules . . . . . . . . . . . .                                   144
                            Setting the Preset Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            146
                            Setting the Calibration Factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              147
                            Modulo Adjust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       148
                            Setting the Hysteresis Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              149
          Chapter 11 Debugging the BMX EHC 0200 Counting Modules . . . .                                                              151
                   11.1 Debug Screen for BMX EHC xxxx Counting Modules . . . . . . . . . . . .                                        152
                        Debug Screen for BMX EHC xxxx Counting Modules . . . . . . . . . . . .                                        152
                   11.2 BMX EHC 0200 Module Debugging . . . . . . . . . . . . . . . . . . . . . . . . . .                             155
                        Frequency Mode Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                      156
                        Event Counting Mode Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . .                         157
                        Period Measuring Mode Debugging . . . . . . . . . . . . . . . . . . . . . . . . . .                           158
                        Ratio Mode Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                  159
                        One Shot Counter Mode Debugging . . . . . . . . . . . . . . . . . . . . . . . . . .                           160
                        Modulo Loop Counter Mode Debugging . . . . . . . . . . . . . . . . . . . . . . .                              161
                        Free Large Counter Mode Debugging. . . . . . . . . . . . . . . . . . . . . . . . .                            163
                        Pulse Width Modulation Mode Debugging . . . . . . . . . . . . . . . . . . . . .                               165
          Chapter 12 Display of BMX EHC xxxx Counting Module Error . . . . .                                                          167
                            Fault Display Screen for BMX EHC 0200 Counting Modules . . . . . .                                        168
                            Faults Diagnostics Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              170
                            List of Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   171
          Chapter 13 The Language Objects of the Counting Function . . . . . .                                                        173
                   13.1 The Language Objects and IODDT of the Counting Function . . . . . . .                                         174
                        Introducing Language Objects for Application-Specific Counting . . . .                                        175
                        Implicit Exchange Language Objects Associated with the Application-
                        Specific Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           176
                        Explicit Exchange Language Objects Associated with the Application-
                        Specific Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           177
                        Management of Exchanges and Reports with Explicit Objects . . . . . .                                         179
                   13.2 Language Objects and IODDT Associated with the Counting Function
                        of the BMX EHC xxxx Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        184
                        Details of Implicit Exchange Objects for the T_Unsigned_CPT_BMX
                        and T_Signed_CPT_BMX-types IODDTs . . . . . . . . . . . . . . . . . . . . . .                                 185
                        Details of the Explicit Exchange Objects for the T_CPT_BMX-type
                        IODDT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       190
                   13.3 The IODDT Type T_GEN_MOD Applicable to All Modules . . . . . . . . .                                          192
                        Details of the Language Objects of the IODDT of Type T_GEN_MOD                                                192
35013355 10/2019                                                                                                                        5
             13.4 Device DDTs Associated with the Counting Function of the
                  BMX EHC xxxx Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            194
                  Counter Device DDT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         195
                  MOD_FLT Byte Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             203
         Part V Quick Start: Example of Counting Module
                Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                  205
    Chapter 14 Description of the Application . . . . . . . . . . . . . . . . . . . . . .                                207
                      Overview of the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      207
    Chapter 15 Installing the Application Using Control Expert. . . . . . . . .                                          209
             15.1 Presentation of the Solution Used . . . . . . . . . . . . . . . . . . . . . . . . . . . .              210
                  Technological Choices Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             211
                  Process Using Control Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             212
             15.2 Developing the Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          213
                  Creating the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     214
                  Configuration of the Counting Module . . . . . . . . . . . . . . . . . . . . . . . . .                 215
                  Declaration of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       218
                  Creating the Program for Managing the Counter Module . . . . . . . . . .                               220
                  Creating the Labelling Program in ST . . . . . . . . . . . . . . . . . . . . . . . . .                 222
                  Creating the I/O Event Section in ST . . . . . . . . . . . . . . . . . . . . . . . . . .               224
                  Creating a Program in LD for Application Execution . . . . . . . . . . . . . .                         225
                  Creating an Animation Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            228
                  Creating the Operator Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             229
    Chapter 16 Starting the Application . . . . . . . . . . . . . . . . . . . . . . . . . .                              231
                      Execution of Application in Standard Mode . . . . . . . . . . . . . . . . . . . . .                231
          Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        235
6                                                                                                                35013355 10/2019
         Safety Information
Important Information
NOTICE
         Read these instructions carefully, and look at the equipment to become familiar with the device
         before trying to install, operate, service, or maintain it. The following special messages may appear
         throughout this documentation or on the equipment to warn of potential hazards or to call attention
         to information that clarifies or simplifies a procedure.
35013355 10/2019                                                                                            7
PLEASE NOTE
     Electrical equipment should be installed, operated, serviced, and maintained only by qualified
     personnel. No responsibility is assumed by Schneider Electric for any consequences arising out of
     the use of this material.
     A qualified person is one who has skills and knowledge related to the construction and operation
     of electrical equipment and its installation, and has received safety training to recognize and avoid
     the hazards involved.
                                                WARNING
      UNGUARDED EQUIPMENT
         Do not use this software and related automation equipment on equipment which does not have
          point-of-operation protection.
         Do not reach into machinery during operation.
      Failure to follow these instructions can result in death, serious injury, or equipment damage.
     This automation equipment and related software is used to control a variety of industrial processes.
     The type or model of automation equipment suitable for each application will vary depending on
     factors such as the control function required, degree of protection required, production methods,
     unusual conditions, government regulations, etc. In some applications, more than one processor
     may be required, as when backup redundancy is needed.
     Only you, the user, machine builder or system integrator can be aware of all the conditions and
     factors present during setup, operation, and maintenance of the machine and, therefore, can
     determine the automation equipment and the related safeties and interlocks which can be properly
     used. When selecting automation and control equipment and related software for a particular
     application, you should refer to the applicable local and national standards and regulations. The
     National Safety Council's Accident Prevention Manual (nationally recognized in the United States
     of America) also provides much useful information.
     In some applications, such as packaging machinery, additional operator protection such as point-
     of-operation guarding must be provided. This is necessary if the operator's hands and other parts
     of the body are free to enter the pinch points or other hazardous areas and serious injury can occur.
     Software products alone cannot protect an operator from injury. For this reason the software
     cannot be substituted for or take the place of point-of-operation protection.
8                                                                                           35013355 10/2019
         Ensure that appropriate safeties and mechanical/electrical interlocks related to point-of-operation
         protection have been installed and are operational before placing the equipment into service. All
         interlocks and safeties related to point-of-operation protection must be coordinated with the related
         automation equipment and software programming.
         NOTE: Coordination of safeties and mechanical/electrical interlocks for point-of-operation
         protection is outside the scope of the Function Block Library, System User Guide, or other
         implementation referenced in this documentation.
                                                    WARNING
          EQUIPMENT OPERATION HAZARD
             Verify that all installation and set up procedures have been completed.
             Before operational tests are performed, remove all blocks or other temporary holding means
              used for shipment from all component devices.
             Remove tools, meters, and debris from equipment.
          Failure to follow these instructions can result in death, serious injury, or equipment damage.
         Follow all start-up tests recommended in the equipment documentation. Store all equipment
         documentation for future references.
         Software testing must be done in both simulated and real environments.
         Verify that the completed system is free from all short circuits and temporary grounds that are not
         installed according to local regulations (according to the National Electrical Code in the U.S.A, for
         instance). If high-potential voltage testing is necessary, follow recommendations in equipment
         documentation to prevent accidental equipment damage.
         Before energizing equipment:
          Remove tools, meters, and debris from equipment.
          Close the equipment enclosure door.
          Remove all temporary grounds from incoming power lines.
          Perform all start-up tests recommended by the manufacturer.
35013355 10/2019                                                                                            9
OPERATION AND ADJUSTMENTS
     The following precautions are from the NEMA Standards Publication ICS 7.1-1995 (English
     version prevails):
      Regardless of the care exercised in the design and manufacture of equipment or in the selection
        and ratings of components, there are hazards that can be encountered if such equipment is
        improperly operated.
      It is sometimes possible to misadjust the equipment and thus produce unsatisfactory or unsafe
        operation. Always use the manufacturer’s instructions as a guide for functional adjustments.
        Personnel who have access to these adjustments should be familiar with the equipment
        manufacturer’s instructions and the machinery used with the electrical equipment.
      Only those operational adjustments actually required by the operator should be accessible to
        the operator. Access to other controls should be restricted to prevent unauthorized changes in
        operating characteristics.
10                                                                                       35013355 10/2019
         About the Book
At a Glance
Document Scope
         This manual describes the hardware and software implementation of the Modicon X80 counting
         module BMXEHC0200.
Validity Note
         This documentation is valid for EcoStruxure™ Control Expert 14.1 or later.
         The technical characteristics of the devices described in the present document also appear online.
         To access the information online:
          Step      Action
              1     Go to the Schneider Electric home page www.schneider-electric.com.
              2     In the Search box type the reference of a product or the name of a product range.
                     Do not include blank spaces in the reference or product range.
                     To get information on grouping similar modules, use asterisks (*).
              3     If you entered a reference, go to the Product Datasheets search results and click on the
                    reference that interests you.
                    If you entered the name of a product range, go to the Product Ranges search results and click
                    on the product range that interests you.
              4     If more than one reference appears in the Products search results, click on the reference that
                    interests you.
              5     Depending on the size of your screen, you may need to scroll down to see the datasheet.
              6     To save or print a datasheet as a .pdf file, click Download XXX product datasheet.
         The characteristics that are presented in the present document should be the same as those
         characteristics that appear online. In line with our policy of constant improvement, we may revise
         content over time to improve clarity and accuracy. If you see a difference between the document
         and online information, use the online information as your reference.
35013355 10/2019                                                                                                 11
Related Documents
      You can download these technical publications and other technical information from our website
      at www.schneider-electric.com/en/download.
12                                                                                           35013355 10/2019
Product Related Information
                                                   WARNING
          UNINTENDED EQUIPMENT OPERATION
          The application of this product requires expertise in the design and programming of control
          systems. Only persons with such expertise should be allowed to program, install, alter, and apply
          this product.
          Follow all local and national safety codes and standards.
          Failure to follow these instructions can result in death, serious injury, or equipment damage.
35013355 10/2019                                                                                           13
14   35013355 10/2019
         Modicon X80
         Overview
         35013355 10/2019
         Part I
         Introduction to the Counting Function
35013355 10/2019                                                                                           15
Overview
16         35013355 10/2019
         Modicon X80
         Counting Functions
         35013355 10/2019
         Chapter 1
         General Information on the Counting Function
At a Glance
         The counting function enables fast counting using couplers, Control Expert screens and
         specialized language objects. The general operation of expert modules also known as couplers is
         described in the section Presentation of the Counting Module Operation BMX EHC 0200.
         In order to implement the counting, it is necessary to define the physical context in which it is to be
         executed (rack, supply, processor, modules etc.) and to ensure the software implementation
         (see page 109).
         This second aspect is performed from the different Control Expert editors:
                    in offline mode
                    in online mode
35013355 10/2019                                                                                             17
Counting Functions
18                   35013355 10/2019
         Modicon X80
         Counting Module
         35013355 10/2019
         Chapter 2
         Presentation of Counting Module
35013355 10/2019                                                                        19
Counting Module
Introduction
         Counting module is standard format module that enable pulses from a sensor to be counted at a
         maximum frequency of 60 KHz (BMX EHC 0200).
         The BMX EHC 0200 module has 2 channels.
Sensors Used
         The sensors used on each channel may be:
              24 VDC two-wire proximity sensors
              Incremental signal encoders with 10/30 VDC output and push-pull outputs.
Illustration
                                                       3
                        1
         1     Incremental encoder
         2     Proximity sensors
         3     Counting module BMX EHC 0200
20                                                                                        35013355 10/2019
                                                                                             Counting Module
Introduction
         The BMX EHC 0200 module have:
            Counting-related functions (comparison, capture, homing, reset to 0)
            Event generation functions designed for the application program
            Outputs for actuator use (contacts, alarms, relays)
Characteristics
         The main characteristics of BMX EHC 0200 module are as follows.
35013355 10/2019                                                                                         21
Counting Module
At a Glance
       The BMX EHC 0200 counting module enables the counting or downcounting of pulses to be
       performed. It has the following functions:
          Enable
          Capture
          Comparison
          Homing or reset to 0
          2 physical outputs
                     A              COUNTER
                     B
                                                                      2 Thresholds
                                                                                          2
                                                                      Comparator
                                       32 bits                                        Reflex
              Sync                                                    Counter/TH1     Output
                         home                             2           Counter/TH2
                                                       capture
              Ref                                                      record/TH1
                                                       register
                                                                       record/TH2
              En
Capt
22                                                                                    35013355 10/2019
         Modicon X80
         Counting Module
         35013355 10/2019
         Chapter 3
         Presentation of the Counting Module Operation
At a Glance
         This part presents the different types of user applications for the BMX EHC 0200 module.
Measurement
         The following table presents the measurement functionality for the BMX EHC 0200 module:
Counting
         The following table presents the counting functionality for the BMX EHC 0200 module:
         NOTE: In case of a user application such as level 1 packaging/labeling, the machine makes
         constant spacing between parts. In case of a user application such as level 2 packaging/labeling,
         the counting module learns the incoming edge of each part.
Frequency Generator
         The following table presents the frequency generator functionality for the BMX EHC 0200 module:
35013355 10/2019                                                                                       23
Counting Module
Interface
        The BMX EHC 0200 module may be interfaced with the following components:
           mechanical switch
           24 VDC two-wire proximity sensor
           24 VDC three-wire proximity sensor
           10/30 VDC encoder with push-pull outputs
24                                                                                 35013355 10/2019
         Modicon X80
         Counting Module BMX EHC 0200 Hardware Implementation
         35013355 10/2019
         Part II
         Counting Module BMX EHC 0200 Hardware Implementation
35013355 10/2019                                                                                                                   25
Counting Module BMX EHC 0200 Hardware Implementation
26                                                     35013355 10/2019
         Modicon X80
         Counting Module BMX EHC 0200: General Rules for Installation
         35013355 10/2019
         Chapter 4
         General Rules for Installing Counting Module BMX EHC 0200
35013355 10/2019                                                                                       27
Counting Module BMX EHC 0200: General Rules for Installation
Illustration
         The figure below present the counting module BMX EHC 0200 :
         Number        Description
         1             Module state LEDs:
                        State LEDs at module level
                        State LEDs at channel level
28                                                                                    35013355 10/2019
                                               Counting Module BMX EHC 0200: General Rules for Installation
Accessories
         The BMX EHC 0200 module requires the use of the following accessories:
            Two 16-pin terminal blocks
            One 10-pin terminal block
            One BMXXSP•••• shielding connection kit (see page 50)
         NOTE: The two 16-pin connectors and the 10-pin connector are available under the reference
         BMX XTS HSC 20.
35013355 10/2019                                                                                        29
Counting Module BMX EHC 0200: General Rules for Installation
At a Glance
        The counting modules are powered by the rack bus. The modules may be handled without turning
        off power supply to the rack, without damage or disturbance to the PLC.
        Fitting operations (installation, assembly, and disassembly) are described below.
Installation Precautions
        The counting modules may be installed in any of the positions in the rack except for the first two
        (marked PS and 00) which are reserved for the rack power supply module (BMX CPS ••••) and the
        processor (BMX P34 ••••) respectively. Power is supplied by the bus at the bottom of the rack
        (3.3 V and 24 V).
        Before installing a module, you must take off the protective cap from the module connector located
        on the rack.
                                                        DANGER
         HAZARD OF ELECTRIC SHOCK
              Turn off all power to sensor and pre-actuator devices before connection of disconnection of
               the terminal block.
              Remove the terminal block before plugging / unplugging the module on the rack.
         Failure to follow these instructions will result in death or serious injury.
Installation
        The diagram below shows counting module BMX EHC 0200 mounted on the rack:
30                                                                                             35013355 10/2019
                                                          Counting Module BMX EHC 0200: General Rules for Installation
The following table describes the different elements which make up the assembly below:
          Number        Description
          1             BMX EHC 0200 counting module
          2             Standard rack
35013355 10/2019                                                                                                   31
Counting Module BMX EHC 0200: General Rules for Installation
Fitting 10-Pin and 16-Pin Terminal Blocks to a BMX EHC 0200 Counting Module
At a Glance
        BMX EHC 0200 counting modules with 10-pin and 16-pin terminal block connections require
        terminal blocks to be connected to the module. The fitting operations (assembly and disassembly)
        are described below.
                                                           DANGER
         HAZARD OF ELECTRIC SHOCK
         Turn off all power to sensor and pre-actuator devices before connection or disconnection of the
         terminal block.
         Failure to follow these instructions will result in death or serious injury.
        If two 16-pin terminal blocks are used, each can be plugged into the middle or the top connector
        of the module. Therefore, despite the indicators on the terminal blocks and module, it is possible
        to invert the two terminal blocks and thus create incorrect wiring.
                                                        CAUTION
         UNEXPECTED BEHAVIOR OF APPLICATION
         Do careful tests on the wiring before any connection of material (sensors, actuators) and before
         any application tests.
         Failure to follow these instructions can result in injury or equipment damage.
        The following table shows the procedure for assembling the 10-pin and 16-pin terminal blocks onto
        a BMX EHC 0200 counting module:
         Step        Action
         1           Plug the 10-pin terminal block into the bottom connector of the module.
         2           Plug the 16-pin terminal block into the middle connector of the module if it is
                     used.
         3           Plug the 16-pin terminal block into the top connector of the module if it is used.
        NOTE: The three module connectors have indicators which show the proper direction to use for
        terminal block installation.
32                                                                                                        35013355 10/2019
                                                   Counting Module BMX EHC 0200: General Rules for Installation
How to Connect BMX EHC 0200 Module: Connecting 16-Pin and 10-Pin Terminal
Blocks
At a Glance
         The BMX EHC 0200 counting module uses the following terminal blocks:
          Two 16-pin terminal blocks for the inputs
          One 10-pin terminal block for supplies outputs
          Characteristic                     Available
          Type of terminal block             Spring terminal blocks
          Number of wires accommodated       1
          Wire gauge           Minimum       AWG 20 (0.5 mm2)
          accommodated
                               Maximum       AWG 18 (1 mm2)
          Wiring constraints                 To insert and remove wires from the connectors, use a flat-tipped
                                             screwdriver with a 2.5 mm wide and 0.4 mm thick blade. With the
                                             screwdriver, push the flexible plate down on the outside (the side
                                             closest to the corresponding receptacle) to open the round receptacle.
                                             A screwing (rotating) or bending motion is not required.
                                                         DANGER
          HAZARD OF ELECTRIC SHOCK
          Turn off all power to sensor and pre-actuator devices before connection or disconnection of the
          terminal block.
          Failure to follow these instructions will result in death or serious injury.
35013355 10/2019                                                                                                33
Counting Module BMX EHC 0200: General Rules for Installation
34                                                             35013355 10/2019
         Modicon X80
         BMX EHC 0200
         35013355 10/2019
         Chapter 5
         BMX EHC 0200 Counting Module Hardware Implementation
35013355 10/2019                                                                                   35
BMX EHC 0200
Download
      Click the link that corresponds to your preferred language to download standards and certifications
      (PDF format) that apply to the modules in this product line:
       Title                                     Languages
       Modicon M580, M340, and X80 I/O Platforms,  English: EIO0000002726
       Standards and Certifications                French: EIO0000002727
                                                   German: EIO0000002728
                                                   Italian: EIO0000002730
                                                   Spanish: EIO0000002729
                                                   Chinese: EIO0000002731
36                                                                                         35013355 10/2019
                                                                                                    BMX EHC 0200
Characteristics for the BMX EHC 0200 Module and its Inputs and Outputs
Ruggedized Version
         The BMX EHC 0200H (hardened) equipment is the ruggedized version of the BMX EHC 0200
         (standard) equipment. It can be used at extended temperatures and in harsh chemical
         environments.
         For more information, refer to chapter Installation in More Severe Environments (see Modicon
         M580, M340, and X80 I/O Platforms, Standards and Certifications).
General Characteristics
         This table presents the general characteristics for the BMX EHC 0200 and BMX EHC 0200H
         modules:
35013355 10/2019                                                                                                    37
BMX EHC 0200
                                                       WARNING
        OVERHEATING MODULE
        Do not operate the BMX EHC 0200H at 70°C (158°F) if the sensor power supply is greater than
        26.4 V or less than 21.1 V.
        Failure to follow these instructions can result in death, serious injury, or equipment damage.
Input Characteristics
       This table presents the general characteristics of the input channels for the module:
38                                                                                                  35013355 10/2019
                                                                                               BMX EHC 0200
Characteristics of Outputs
         This table presents the general characteristics of the output channels for the module:
35013355 10/2019                                                                                               39
BMX EHC 0200
At a Glance
         The BMX EHC 0200 counting module has LEDs that enable the status of the module to be viewed:
              Module state LEDs: RUN, ERR, I/O
              State LEDs for inputs/outputs of each channel: IA, IB, IS, IE, IP, IC, Q0 and Q1.
Illustration
         The following drawing shows the display screen of the BMX EHC 0200 module:
Fault Diagnostics
         The following table presents the various module states according to the LED states:
40                                                                                                 35013355 10/2019
                                                                                 BMX EHC 0200
Legend
      LED on
      LED off
35013355 10/2019                                                                           41
BMX EHC 0200
At a Glance
       The BMX EHC 0200 counting module uses the following:
        Two 16-pin connectors for the inputs
        One 10-pin connector for the outputs
                                                       DANGER
        HAZARD OF ELECTRIC SHOCK
           Turn off all power to sensor and pre-actuator devices before connection or disconnection of
            the terminal block.
           Remove the terminal block before plugging / unplugging the module on the rack.
        Failure to follow these instructions will result in death or serious injury.
       NOTE: The two 16-pin connectors and the 10-pin connector are sold separately and are available
       in the BMX XTS HSC 20 connection kit.
Field Sensors
       The module has type 3 of IEC 61131 inputs that support signals from mechanical switching
       equipment such as:
        Contact relays
        Push-buttons
        Limit switch sensors
        Switches with 2 or 3 wires
       The module complies with most encoders that have a supply of 10...30 V and push-pull outputs.
       NOTE: The module 24 V supply for sensors has thermal and short-circuit protection.
42                                                                                         35013355 10/2019
                                                                                          BMX EHC 0200
The symbol and description of each pin are described in the following table:
35013355 10/2019                                                                                     43
BMX EHC 0200
Sensor Connections
      The example below shows sensors with applied to inputs IN_A and IN_B and equipment with
      applied to inputs IN_EN and IN_SYNC:
      1   IN_A input
      2   IN_B input
      3   IN_SYNC input (synchronization input)
      4   IN_EN input (enable input)
44                                                                                  35013355 10/2019
                                                                                        BMX EHC 0200
Encoder Connection
         The example below shows an incremental encoder used for axis control and the three auxiliary
         inputs used especially for the 32-bit counter mode:
35013355 10/2019                                                                                    45
BMX EHC 0200
Field Actuators
       The Q0 and Q1 outputs are limited by a maximum current of 0.5 A.
       NOTE: The Q0 and Q1 outputs have a thermal protection as well as short-circuit protection.
46                                                                                       35013355 10/2019
                                                                                          BMX EHC 0200
The symbol and description of each pin are described in the table below:
35013355 10/2019                                                                                     47
BMX EHC 0200
Safety Instructions
        Electromagnetic perturbations may cause the application to operate in an unexpected manner.
        Follow all local and national safety codes and standards.
                                                       DANGER
        HAZARD OF ELECTRIC SHOCK
        If you cannot prove that the end of a shielded cable is connected to the local ground, the cable
        must be considered as dangerous and personal protective equipment (PPE) must be worn.
        Failure to follow these instructions will result in death or serious injury.
                                                   WARNING
        UNEXPECTED EQUIPMENT OPERATION
        Follow these instructions to reduce electromagnetic perturbations:
         Adapt the programmable filtering to the frequency applied at the inputs.
         Use a shielded cable (connected to the functional ground) connected to pins 15 and 16 of the
          connector when using an encoder or a fast detector.
        In a highly disturbed environment:
         Use the BMXXSP•••• shielding connection kit (see page 50) to connect the shielding without
           programmable filtering and
         Use a specific 24 VDC supply for inputs and a shielded cable for connecting the supply to the
           module.
        Failure to follow these instructions can result in death, serious injury, or equipment damage.
48                                                                                          35013355 10/2019
                                                                                          BMX EHC 0200
         The figure below shows the recommended circuit for high-noise environment using the shielding
         connection kit:
                                                  NOTICE
          MODULE DAMAGE
          Use fast acting fuses to protect the electronic components of the module from overcurrent and
          reverse polarity of the input/output supplies.
          Failure to follow these instructions can result in equipment damage.
35013355 10/2019                                                                                      49
BMX EHC 0200
Introduction
       The BMXXSP•••• shielding connection kit allows to connect the cable shielding directly to the
       ground and not to the module shielding to help protect the system from electromagnetic
       perturbations.
       Connect the shielding on the cordsets for connecting:
        Analog module,
        Counter module,
        Encoder interface module,
        Motion control module,
        An XBT console to the processor (via shielded USB cable).
Kit References
       Each shielding connection kit includes the following components:
        A metal bar
        Two sub-bases
The reference is dependent on the number of slots on the Modicon X80 rack:
Clamping Rings
       Use clamping rings to connect the shielding on cordsets to the metal bar of the kit.
       NOTE: The clamping rings are not included in the shielding connection kit.
       Depending on the cable diameter, the clamping rings are available under the following references:
                                                                           2
        STBXSP3010: small rings for cables with cross-section 1.5...6 mm (AWG16...10).
          STBXSP3020: large rings for cables with cross-section 5...11 mm2 (AWG10...7).
50                                                                                            35013355 10/2019
                                                                                              BMX EHC 0200
Kit Installation
         Installation of the shielding connection kit to the rack can be done with module already installed on
         the rack except for the BMXXBE0100 rack extender module.
         Fasten the sub-bases of the kit at each end of the rack to provide a connection between the cable
         and the ground screw of the rack:
         1    rack
         2    sub-base
         3    metallic bar
         4    clamping ring
         NOTE: A shielding connection kit does not modify the volume required when installing and
         uninstalling modules.
35013355 10/2019                                                                                           51
BMX EHC 0200
Kit Dimensions
       The following figure gives the dimensions (height and depth) of a Modicon X80 rack with its
       shielding connection kit:
NOTE: The overall width equals to the width of the Modicon X80 rack.
52                                                                                        35013355 10/2019
         Modicon X80
         Counting Module BMX EHC 0200 Functionalities
         35013355 10/2019
         Part III
         Counting Module BMX EHC 0200 Functionalities
35013355 10/2019                                        53
Counting Module BMX EHC 0200 Functionalities
54                                             35013355 10/2019
         Modicon X80
         BMX EHC 0200 Functionalities
         35013355 10/2019
         Chapter 6
         BMX EHC 0200 Counting Module Functionalities
35013355 10/2019                                                                                      55
BMX EHC 0200 Functionalities
        Section 6.1
        BMX EHC 0200 Module Configuration
56                                                                              35013355 10/2019
                                                                                         BMX EHC 0200 Functionalities
Description
         The BMX EHC 0200 counting module has six inputs:
            3 fast inputs
            3 classic inputs
Fast Inputs
         The table below presents the module’s fast inputs.
Classic Inputs
         The table below presents the module’s classic inputs:
          Input                  Use
          IN_EN input            Used to authorize counter operation
          IN_REF input           Used for homing in advanced mode
          IN_CAP input           Used for register capture
35013355 10/2019                                                                                                  57
BMX EHC 0200 Functionalities
Programmable Filtering
At a Glance
        The BMX EHC 0200 counting module’s six inputs are compatible with the use of mechanical
        switches.
        A programmable debounce filter with 3 levels (low, medium and high) is available at every input.
In this mode, the system delays all transitions until the signal is stable for 450 μs.
58                                                                                               35013355 10/2019
                                                                                 BMX EHC 0200 Functionalities
Comparison
At a Glance
         The comparison block operates automatically. This block is available in certain counting modes:
              Frequency
              Period measuring
              Ratio
              One shot counter
              Modulo loop counter
              Free large counter
Comparison Thresholds
         The comparison block has two thresholds:
              The upper threshold: upper_th_value double word (%QDr.m.c.4)
              The lower threshold: lower_th_value double word (%QDr.m.c.2)
         The upper threshold value must be greater than the lower threshold value.
         If the upper threshold is less than or equal to the lower threshold, the lower threshold does not
         change but it is ignored.
         This rule takes into account the format of the counter value.
Status             15 14 13 12    11 10    9    8         7       6   5      4         3     2      1      0
register bit
Compared                                              Capture 1           Capture 0              Counter
element
Comparison                                     High    Window Low High Window         Low   High Window Low
result
35013355 10/2019                                                                                             59
BMX EHC 0200 Functionalities
Update
         When the compare_enable bit (%QWr.m.c.0.5) is set to 0, the comparison status register is
         deleted.
         The comparison with capture 0 and capture 1 registers values is performed every time the registers
         are loaded.
         The comparison with the counter current value is performed as follows:
60                                                                                           35013355 10/2019
                                                                                BMX EHC 0200 Functionalities
35013355 10/2019                                                                                          61
BMX EHC 0200 Functionalities
       The output_block_0(1)_enable bit enables the operation of the function block 0(1) to be
       authorized when it is set to 1. When the bit is set to 0, Bit output_block_0(1) is maintained at 0.
       The output_0(1) bit is applied at the logic output Q0(1) and must be set to 0 when the function
       block is used. When the bit is set to 1, the output is forced to 1.
       In the operational modes where the block generates a pulse, the pulse width can be configured
       thanks to the configuration screen.
62                                                                                            35013355 10/2019
                                                                                      BMX EHC 0200 Functionalities
Output Programming
         The table below shows the configurable functions:
          Function    Programming
          code
          0           Disabled = no direct action (Default value)
          1           Low counter.
                      The output is high if the counter value is less than the low threshold.
          2           Counter in a window
                      The output is high if the counter value is between the upper and lower thresholds or equal
                      to one of the two thresholds.
          3           High counter.
                      The output is high if the counter value is greater than the upper threshold.
          4           Pulse less than the lower threshold.
                      The output pulse starts when the counter value decreases and crosses the lower threshold
                      value -1.
          5           Pulse greater than the lower threshold.
                      The output pulse starts when the counter value increases and crosses the lower threshold
                      value +1.
          6           Pulse less than the upper threshold.
                      The output pulse starts when the counter value decreases and crosses the upper threshold
                      value -1.
          7           Pulse greater than the upper threshold.
                      The output pulse starts when the counter value increases and crosses the upper threshold
                      value +1.
          8           Counter stopped (only in one shot counter mode).
                      The output changes to high if the counter is stopped.
          9           Counter running (only in one shot counter mode).
                      The output changes to high if the counter is running.
          10          Capture 0 low value.
                      The output is high if the capture 0 value is less than the lower threshold.
          11          Capture 0 value in a window.
                      The output is high if the capture 0 value is between the upper and lower thresholds or equal
                      to one of the two thresholds.
          12          Capture 0 high value.
                      The output is high if the capture 0 value is greater than the upper threshold.
          13          Capture1 low value.
                      The output is high if the capture1 value is less than the lower threshold.
35013355 10/2019                                                                                                     63
BMX EHC 0200 Functionalities
        Function      Programming
        code
        14            Capture1 value in a window.
                      The output is high if the capture1 value is between the upper and lower thresholds or equal
                      to one of the two thresholds.
        15            Capture1 high value.
                      The output is high if the capture1 value is greater than the upper threshold.
       NOTE: The output 0 function block is inactive when using the counter in pulse width modulation
       mode.
Output Performances
       In general, these reflex actions act with a delay less than 0.6 ms. The repeatability is about +/-
       0.3 ms.
       Special boost functions:
        "Counter Low" (function code 1) applied to Output Block 0
        "Counter High" (function code 3) applied to Output Block 1 speed up timing.
Output Properties
       The counting module BMX EHC 0200 enables output signals to be exchanged with two 24VCC
       field actuators.
       It is possible to configure the following parameters for each output:
          The module response for fault recovery
        The output polarity for each counting channel (positive or negative polarity)
        The fallback mode and state for every module channel
64                                                                                                    35013355 10/2019
                                                                                  BMX EHC 0200 Functionalities
         In case of the fault recovery parameter is configured to auto recovery, an output channel
         that has been turned off because of error detection starts operating again as soon as the error is
         corrected. No user intervention is required to reset the channels.
         NOTE: A minimum delay of 10 s occurs before the error is cleared in both latched off and auto
         recovery modes.
35013355 10/2019                                                                                           65
BMX EHC 0200 Functionalities
66                                                                                          35013355 10/2019
                                                                               BMX EHC 0200 Functionalities
Diagnostics
35013355 10/2019                                                                                         67
BMX EHC 0200 Functionalities
IO Data
          All input/output statuses are provided in the channel data bits.
          The table below shows the channel data bits:
68                                                                                         35013355 10/2019
                                                                                   BMX EHC 0200 Functionalities
Introduction
         This section presents the functions used by the various counting modes of the BMX EHC 0200
         module:
            Synchronization function
            Homing function
            Enable function
            Reset to 0 function
            Capture functions
         Each function uses at least one of the following two bits:
            valid_(function) bit: Setting this bit to 1 allows you to take into account the occurrence of
             an external event which activates the function. If this bit is set to 0, the event is not taken into
             account and does not activate the function. The functions_enabling word (%QWr.m.c.0)
             contains all the valid_(function) bits.
            force_(function) bit: Setting this bit to 1 allows you to activate the function irrespective of
             the status of the external event. All the force_(function) bits are %Qr.m.c.4...%Qr.m.c.8
             language objects.
Synchronization Function
         The synchronization function is used to synchronize the counter operation upon a transition
         applied to the IN_SYNC (%I r.m.c.6) physical input or the force_sync bit set to 1.
         This function is usable in the following counting modes:
            Pulse width modulation: to restart the output signal at the beginning (phase at 1)
            Modulo loop counter: to reset and start the counter
            One shot counter: to preset and start the counter
            Event counting: to restart the internal time base at the beginning
         The user may configure the synchro edge parameter in the configuration screen by choosing
         from the following two possibilities to configure the sensitive edge that carries out the
         synchronization:
            Rising edge of the IN_SYNC input
            Falling edge of the IN_SYNC input
35013355 10/2019                                                                                              69
BMX EHC 0200 Functionalities
       The following table presents the force_sync bit in bold which is an element of the %Qr.m.c.d
       output command word:
       The following table presents the valid_sync bit in bold which is an element of the %QWr.m.c.0
       function enabling word:
70                                                                                            35013355 10/2019
                                                                                BMX EHC 0200 Functionalities
Homing Function
         This homing function loads the value predefined in the adjust screen preset value
         (%MDr.m.c.6) into the counter when the preset condition (defined by the preset mode
         parameter) occurs. This preset condition takes into account the IN_SYNC and IN_REF physical
         inputs to define the reference point of the process.
         This function is only used in the free large counter mode.
         The user may change the Preset Mode parameter in the configuration screen by choosing from
         the following five possibilities to configure the preset condition:
            Rising edge of the IN_SYNC input
            Rising edge of the IN_REF input
            Rising edge of the IN_SYNC input and high level of the IN_REF input
            First rising edge of the IN_SYNC input and high level of the IN_REF input
            First rising edge of the IN_SYNC input and low level of the IN_REF input
35013355 10/2019                                                                                         71
BMX EHC 0200 Functionalities
       The following table presents the force_ref bit in bold which is an element of the %Qr.m.c.d
       output command word:
       The following table presents the valid_ref bit in bold which is an element of the %QWr.m.c.0
       function enabling word:
72                                                                                            35013355 10/2019
                                                                                         BMX EHC 0200 Functionalities
         When the preset occurs consequently to the preset condition, the application can react using:
            either the SYNC_REF_FLAG input (%IWr.m.c.0.2) (see page 77)
            or the EVT_SYNC_PRESET input (%IWr.m.c.10.2) (see page 79).
Enable Function
         This function is used to authorize changes to the current counter value depending on the status of
         the IN_EN physical input.
         This function is used in the following counting modes:
            Pulse width modulation
            Modulo loop counter
            One shot counter
            Free large counter
         The following table presents the force_enable bit in bold which is an element of the %Qr.m.c.d
         output command word:
35013355 10/2019                                                                                                  73
BMX EHC 0200 Functionalities
       The following table presents the valid_enable bit in bold which is an element of the
       %QWr.m.c.0 function enabling word:
74                                                                                                      35013355 10/2019
                                                                                    BMX EHC 0200 Functionalities
Reset to 0 Function
         This function is used to load the value 0 into the counter via software command.
         This function is used in the following counting modes:
            Free large counter
            Modulo loop counter
            One shot counter
         The following table presents the force_reset bit in bold which is an element of the %Qr.m.c.d
         output command word:
         The function is only activated by the rising edge of the force_reset bit (%Qr.m.c.7). There is
         no valid_reset bit because the function is not activated by any physical input.
35013355 10/2019                                                                                             75
BMX EHC 0200 Functionalities
Capture Function
       This function allows to store the current counter value into a capture register upon an external
       condition.
       Each BMX EHC 0200 module channel has 2 capture registers:
          capture0
          capture1.
       The capture function is used in the following counting modes:
          Modulo loop counter
          Free large counter.
       In the modulo loop counter mode, only the capture0 function is available.
       The function enables to record the current counter value according to the synchronisation
       condition.
       If the IN_SYNC input receives the sensitive edge of synchronization (see page 69), the current
       counter value is stored into the capt_0_val register (%IDr.m.c.14). The valid_capt_0 bit
       (%QWr.m.c.0.3) must be set to 1 to operate.
       When the synchronization is requiered at the same time (with the valid_sync bit set to 1) the
       storage into the capt_0_val register occurs just before reseting the current counter value.
       In the free large counter mode, both capture0 and capture1 registers are available.
       The capture1 function always stores the current counter value into the capt_1_val register
       (%IDr.m.c.16) as soon as the IN_CAP input receives a rising edge. The valid_capt_1 bit
       (%QWr.m.c.0.4) must be set to 1 to operate.
       The capture0 function can be configured as one of the following 2 conditions:
          Preset condition
          Falling edge of the IN_CAP input.
       The valid_capt_0 bit (%QWr.m.c.0.3) must be set to 1 to operate.
       If the capture0 function is configured as the preset condition, the function stores the current
       counter value into the capt_0_val register (%IDr.m.c4) when the defined preset condition
       (see page 71) occurs.
       When the preset is requiered at the same time (with the valid_ref bit set to 1) the storage into
       the capt_0_val register occurs just before loading the current counter value at the preset value.
       In all cases, the current counter value must be valid before the capture event (the validity bit
       (%IWr.m.c.0.3) set to 1)
76                                                                                          35013355 10/2019
                                                                                    BMX EHC 0200 Functionalities
At a Glance
         This section presents the operation of the bits relating to the following events:
            Synchronization or counter homing event, depending on the counting mode.
            Counter rollovers the modulo or its limits in forward or reverse.
         The table below presents the counting modes that may activate synchronization, homing and
         modulo events:
35013355 10/2019                                                                                                  77
BMX EHC 0200 Functionalities
78                                                                                                35013355 10/2019
                                                                               BMX EHC 0200 Functionalities
At a Glance
         The event task number must be declared in the module’s configuration screen to enable the events
         sending.
         The BMX EHC 0200 module has eight event sources contained in the events_source word at
         the address %IWr.m.c.10:
35013355 10/2019                                                                                         79
BMX EHC 0200 Functionalities
        All the events sent by the module, whatever their source, call the same single event task in the
        PLC.
        There is normally only one type of event indicated per call.
        The evt_sources word (%IWr.m.c.10) is updated at the start of the event task processing.
Enabling Events
        In order for a source to produce an event, the validation bit corresponding to the event must be set
        to 1:
Address               Description
%QWr.m.c.1.0          Start of counting event validation bit.
%QWr.m.c.1.1           Counter rollovering modulo, 0 or its limits event validation bit.
%QWr.m.c.1.2          Synchronization or counter homing event validation bit.
%QWr.m.c.1.3          Counter less than lower threshold event validation bit.
%QWr.m.c.1.4          Counter between the upper and lower thresholds event validation bit.
%QWr.m.c.1.5          Counter greater than upper threshold event validation bit.
%QWr.m.c.1.6          Capture 0 event validation bit.
%QWr.m.c.1.7          Capture 1 event validation bit.
Input Interface
        The event only has one input interface. This interface is only updated at the start of the event task
        processing. The interface consists of:
           The evt_sources word (%IWr.m.c.10)
           The current value of the counter during the event (or an approximate value) contained in the
            counter_value word (%IDr.m.c.12)
           The capt_0_val register (%IDr.m.c.14) updated if the event is the capture 0
           The capt_1_val register (%IDr.m.c.16) updated if the event is the capture 1
80                                                                                                   35013355 10/2019
                                                                              BMX EHC 0200 Functionalities
Operating Limits
         Each counter channel can produce a maximum of one event per millisecond, but this flow may be
         slowed down by simultaneously sending events to several modules on the PLC bus.
         Each counter channel has a four slot transmission buffer which can be used to store several events
         while waiting to be sent.
         If the channel is unable to send all of the internally produced events, the overrun_evt bit
         (%IWr.m.c.10.8) of the evt_sources word is set to 1.
35013355 10/2019                                                                                        81
BMX EHC 0200 Functionalities
        Section 6.2
        BMX EHC 0200 Module Operation Modes
82                                                                                         35013355 10/2019
                                                                                    BMX EHC 0200 Functionalities
At a Glance
         Using the frequency mode allows you to measure an event frequency, speed, rate and flow.
Basic Principle
         In this mode, the module monitors the pulses applied only to the IN_A input and calculates the
         number of pulses in time intervals of 1 s. The current frequency is then shown in number of events
         per second (hertz). The counting register is updated at the end of each 10 ms interval.
Operating Limits
         The maximum frequency that the module can measure on the IN_A input is 60 kHz. Beyond
         60 kHz, the counting register value may decrease until it reaches 0. Beyond 60 kHz and up to the
         real cut-off frequency of 100 kHz, the module may indicate that it has exceeded the frequency limit.
         When there is a variation in frequency, the value restoration time is 1 s with a value precision of
         1 Hz. When there is a very significant variation in frequency, an accelerator enables you to restore
         the frequency value with a precision of 10 Hz in 0.1 s.
         The maximum duty cycle at 60 KHz is 60%.
         NOTE: You have to check the validity bit (%IWr.m.c.0.3) before taking into account the
         numerical values such as the counter and the capture registers. Only the validity bit at the high
         level (set to 1) guarantees that the mode will operate correctly within the limits.
35013355 10/2019                                                                                             83
BMX EHC 0200 Functionalities
At a Glance
       Using the event counting mode allows you to determine the number of events received in a
       scattered manner.
Basic Principle
       In this mode, the counter assesses the number of pulses applied at the IN_A input, at time intervals
       defined by the user. The counting register is updated at the end of each interval with the number
       of events received.
       It is possible to use the IN_SYNC input over a time interval, provided that the validation bit is set
       to 1. This restarts the event counting for a new predefined time interval. Depending on the selection
       made by the user, the time interval starts at the rising edge or at the falling edge on the IN_SYNC
       input.
Operation
       The trend diagram below illustrates the counting process in event counting mode:
84                                                                                            35013355 10/2019
                                                                                     BMX EHC 0200 Functionalities
Operating Limits
         The module counts the pulses applied at the IN_A input every time the pulse duration is greater
         than 5 μs (without debounce filter).
         The synchronization of the counter must not be done more than one time per 5 ms.
         NOTE: You have to check the validity bit (%IWr.m.c.0.3) before taking into account the
         numerical values such as the counter and the capture registers. Only the validity bit at the high
         level (set to 1) guarantees that the mode will operate correctly within the limits.
35013355 10/2019                                                                                              85
BMX EHC 0200 Functionalities
At a Glance
       Using the period measuring mode allows to:
          determine the duration of an event.
          determine the time between two events.
          set and measure the execution time for a process.
Basic Principle
       This counting mode consists of two sub-modes:
          Rising edge to falling edge mode (edge to opposite): allows you to measure the duration of an
           event.
          Rising edge to rising edge mode (edge to edge): allows you to measure the length of time
           between two events.
       The user may also use the IN_SYNC input to enable or stop a measurement. It is also possible to
       specify a time out value in the configuration screen. This function allows to stop a measurement
       that exceeds this time out. In this case, the counting register is not valid until the next complete
       measurement.
       The units used to measure the length of time of an event or between two events are defined by the
       user (1 μs, 100 μs or 1 ms).
86                                                                                           35013355 10/2019
                                                                                     BMX EHC 0200 Functionalities
         NOTE: The valid_sync bit (%QWr.m.c.0.0) must be set to 1 to enable the IN_SYNC input. If
         the IN_SYNC input is not wired, the application must force the setting of the force_sync bit
         (%Qr.m.c.4) to 1 to authorize the measurements.
35013355 10/2019                                                                                              87
BMX EHC 0200 Functionalities
Operating Limits
       The module can perform a maximum of 1 measurement every 5 ms.
       The shortest pulse that can be measured is 100 μs, even if the unit defined by the user is 1 μs.
       The maximum duration that can be measured is 1,073,741,823 units of time (unit defined by the
       user).
       NOTE: You have to check the validity bit (%IWr.m.c.0.3) before taking into account the
       numerical values such as the counter and the capture registers. Only the validity bit at the high
       level (set to 1) guarantees that the mode will operate correctly within the limits.
88                                                                                                     35013355 10/2019
                                                                                BMX EHC 0200 Functionalities
At a Glance
         The ratio mode only uses the IN_A and IN_B inputs. This counting mode consists of two sub-
         modes:
            Ratio 1: is used to divide two frequencies (Frequency IN_A / Frequency IN_B) and is useful, for
             example, in applications such as flowmeters and mixers.
            Ratio 2: is used to subtract two frequencies (Frequency IN_A - Frequency IN_B) and is used in
             the same applications but which require more precise adjustment (closer frequencies).
         NOTE: A positive value indicates that the frequency measured on the IN_A input is greater than
         the frequency measured on the IN_B input.
         A negative value indicates that the frequency measured on the IN_A input is less than the
         frequency measured on the IN_B input.
Ratio 1 Mode
         The figure below shows BMX EHC 0200 module operation in Ratio 1 mode.
              A
              B
                        10 ms                10 ms
                     (f(A)/f(B))x1000     (f(A)/f(B))x1000
         In this mode, the counter evaluates the ratio between the number of rising edges of the IN_A input
         and the number of rising edges of the IN_B input over a period of 1 s. The register value is updated
         every 10 ms.
         An absolute limit value is declared on the configuration screen. If this limit value is exceeded, the
         counter_value register (%IDr.m.c.12) is disabled by setting the validity bit
         (%IWr.m.c.0.3) to 0.
         If no frequency is applied to the IN_A or IN_B inputs, the counter_value register
         (%IDr.m.c.12) is disabled by setting the validity bit (%IWr.m.c.0.3) to 0.
         NOTE: The ratio 1 mode presents the results in thousandths in order to have greater level of
         precision (where 2,000 is displayed, this corresponds to a value of 2).
35013355 10/2019                                                                                           89
BMX EHC 0200 Functionalities
Ratio 2 Mode
       The figure below shows BMX EHC 0200 module operation in Ratio 2 mode.
              A
              B
                      10 ms                10 ms
                      f(A) – f(B)           f(A) – f(B)
       In this mode, the counter evaluates the difference between the number of rising edges of the IN_A
       input and the number of rising edges of the IN_B input over a period of 1 s. The counter_value
       register (%IDr.m.c.12) is updated at the end of each 10 ms interval.
       An absolute limit value is declared on the configuration screen. If this limit value is exceeded, the
       counter_value register (%IDr.m.c.12) is disabled and the validity bit (%IWr.m.c.0.3)
       to 0.
90                                                                                                  35013355 10/2019
                                                                              BMX EHC 0200 Functionalities
Operating Limits
         The maximum frequency that the module can measure on the IN_A and IN_B inputs is 60 kHz.
         The measured values are between -60,000,000,000 and +60,000,000,000.
         NOTE: You have to check the validity bit (%IWr.m.c.0.3) before taking into account the
         numerical values such as the counter and the capture registers. Only the validity bit at the high
         level (set to 1) guarantees that the mode will operate correctly within the limits.
35013355 10/2019                                                                                       91
BMX EHC 0200 Functionalities
At a Glance
       Using the one shot counter mode allows you to quantify a group of parts.
Basic Principle
       In this mode, activating the synchronization function starts the counter which, starting from a value
       defined by the user in the adjust screen (preset value), decreases with every pulse applied to
       the IN_A input until it reaches the value 0. Downcounting is made possible when the enable
       function is activated. The counting register is thus updated every 1 ms.
       One basic use of this mode is, using an output, to indicate the end of a group of operations (when
       the counter reaches 0).
Operation
       The trend diagram below illustrates the counting process in one shot counter mode:
92                                                                                            35013355 10/2019
                                                                                     BMX EHC 0200 Functionalities
         In the trend diagram above, we can see that the counter is set to the preset value at the IN_SYNC
         input’s rising edge. Then, the counter decrements the counting register with every pulse applied to
         the IN_A input. When the register is set to 0, the counter awaits a new signal from the IN_SYNC
         input. The IN_A input pulses have no effect on the register value as long as the counter is set to 0.
         The enable function must be activated during the counting by:
            setting to 1 the force_enable bit
            setting to 1 the valid_enable bit and when the IN_EN input is at the high level
         When the enable function is deactivated, the last value reported in the counting register is
         maintained and the counter ignores the pulses applied to the IN_A input. However, it does not
         ignore the IN_SYNC input status.
         Each time the counter starts a downcounting operation, the run bit switches to the high level. It
         switches to the low level when the register value reaches 0.
         NOTE: The pulses applied to IN_SYNC and IN_EN inputs are only taken into account when the
         inputs are enabled (see page 73).
         The value defined by the user (preset value) is contained in the word %MDr.m.c.6. The user may
         change this value by specifying the value of this word by configuring the parameter in the adjust
         screen or by using the WRITE_PARAM(IODDT_VAR1) Function. IODDT_VAR1 is of the type
         T_UNSIGNED_CPT_BMX. This value change is only taken into account by the module after one of
         the following conditions has been established:
          At the next synchronization if the counter is stopped (run bit set to 0)
          At the second synchronization if the counter is activated (run bit set to 1).
35013355 10/2019                                                                                                   93
BMX EHC 0200 Functionalities
Operating Limits
       The maximum frequency that can be applied to the IN_SYNC input is 1 pulse every 5 ms.
       The maximum value defined by the user (preset value) is 4,294,967,295.
       NOTE: You have to check the validity bit (%IWr.m.c.0.3) before taking into account the
       numerical values such as the counter and the capture registers. Only the validity bit at the high
       level (set to 1) guarantees that the mode will operate correctly within the limits.
94                                                                                         35013355 10/2019
                                                                                  BMX EHC 0200 Functionalities
At a Glance
         The use of the modulo loop counter mode is recommended for packaging and labeling applications
         for which actions are repeated for series of moving objects.
Basic Principle
         In the upcounting direction, the counter increases until it reaches the modulo value -1, the modulo
         value being defined by the user. At the following pulse in the counting direction, the counter is reset
         to 0 and the counting resumes.
         In the downcounting direction, the counter decreases until it reaches 0. At the next pulse in the
         counting direction, the counter is reset to the the modulo value -1, the modulo value being defined
         by the user. The downcounting may then be resumed.
         The enable function must be activated during the counting by:
            Setting to 1 the force_enable bit (%Qr.m.c.6)
            Setting to 1 the valid_enable bit (%QWr.m.c.0.2) when the IN_EN input is at the high level
         When the enable function is deactivated, the last value reported in the counting register is
         maintained and the counter ignores the pulses applied to the IN_A input. However, it does not
         ignore the preset condition.
         In the modulo loop counter mode, the counter must be synchronized at least one time to operate.
         The current counter value is cleared each time the synchronization occurs.
         The current counter value can be recorded into the capture0 register (see page 76) when the
         condition of synchronization occurs (see page 69).
         The modulo value defined by the user is contained in the modulo_value word %MDr.m.c.4. The
         user may change this value by specifying the value of this word:
            In the ajust screen
            In the application, using the WRITE_PARAM(IODDT_VAR1) Function. IODDT_VAR1 is of the
             type T_UNSIGNED_CPT_BMX.
         The new modulo value is acknowledged if one of the two following conditions is met:
            The synchronization is activated
            The counter rollovers the value 0 in the downcounting direction or the modulo value -1 (this
             value is the modulo value recorded before editing the new modulo value) in the upcounting
             direction.
35013355 10/2019                                                                                             95
BMX EHC 0200 Functionalities
Counting Interface
       In this mode, the user may select one of the following counting configurations:
          A = Up, B = Down (default configuration)
          A = Impulse, B = Direction
          Normal Quadrature X1
          Normal Quadrature X2
          Normal Quadrature X4
          Reverse Quadrature X1
          Reverse Quadrature X2
          Reverse Quadrature X4.
       The following table shows the upcounting and downcounting principle according to the selected
       configuration:
96                                                                                                    35013355 10/2019
                                                                                    BMX EHC 0200 Functionalities
Operation
         The trend dithe modulo counting process in the configuration by default (IN_A = counting, In_B =
         downcounting):
35013355 10/2019                                                                                                 97
BMX EHC 0200 Functionalities
Operating Limits
       The maximum frequency that can be applied to the IN_SYNC input is 1 pulse every 5 ms.
       The maximum frequency for the modulo event is once every 5 ms.
       The maximum value for the defined modulo value and the counter is 4,294,967,295.
       NOTE: You have to check the validity bit (%IWr.m.c.0.3) before taking into account the
       numerical values such as the counter and the capture registers. Only the validity bit at the high
       level (set to 1) guarantees that the mode will operate correctly within the limits.
98                                                                                                 35013355 10/2019
                                                                                BMX EHC 0200 Functionalities
At a Glance
         The use of the free large counter mode is especially recommended for axis monitoring or labeling
         where the incoming position of each part has to be learned.
Basic Principle
         The upcounting (or downcounting) starts as soon as the homing function is completed.
         The enable function must be activated during the counting by:
            Setting to 1 the force_enable bit (%Qr.m.c.6)
            Setting to 1 the valid_enable bit (%QWr.m.c.0.2) when the IN_EN input is at the high level.
         When the enable function is deactivated, the last value reported in the counting register is
         maintained and the counter ignores the pulses applied to the IN_A input. However, it does not
         ignore the preset condition.
         In the free large counter mode, the counter must be preset at least one time to operate. The current
         counter value is load with the preset_value each time the preset condition occurs.
         The current counter can be recorded into the capture0 register when the preset condition occurs
         or using the IN_CAP input.
         The current counter value can be stored into the capture1 register using the IN_CAP input.
         For further information, you may see the synchronization function (see page 69) and the capture
         function (see page 76).
         In the free large counter mode, the counting register is updated at 1 ms intervals.
35013355 10/2019                                                                                          99
BMX EHC 0200 Functionalities
Counting Configurations
       In this mode, the user may select one of the following counting configurations:
          A = Up, B = Down (default configuration)
          A = Impulse, B = Direction
          Normal Quadrature X1
          Normal Quadrature X2
          Normal Quadrature X4
          Reverse Quadrature X1
          Reverse Quadrature X2
          Reverse Quadrature X4
       The following table shows the upcounting and downcounting principle according to the selected
       configuration:
Homing Function
         This function allows to record the current_counter_value register in the capt_0_val
         register and/or to set the current_counter_value register to the user-predefined parameter
         preset_value.
         The value defined by the user as preset_value is contained in the %MDr.m.c.4 word.
         The user may change this value by specifying the value of this word:
            In the ajust screen
            In the application, by using the WRITE_PARAM(IODDT_VAR1) Function. IODDT_VAR1 is of the
             type T_SIGNED_CPT_BMX.
         For further information, you may see the homing function (see page 71) and the capture function
         (see page 76).
         The module configuration enables you to select the following homing conditions:
            Rising edge of the IN_SYNC input (default)
            Rising edge of the IN_REF input
            Rising edge of the IN_SYNC input at the IN_REF input’s high level:
 First rising edge of the IN_SYNC input and high level at the IN_REF input
 First rising edge of the IN_SYNC input and low level at the IN_REF input
Operation
         The trend diagram below illustrates the counting process for a free large counter in the
         configuration by default:
       NOTE: Overflow or underflow is indicated by two bits LOW_LIMIT and HIGH_LIMIT until the
       application reloads the counting value predefined by the user (force_ref bit set to 1 or preset
       condition true). The upcounting or downcounting may therefore resume.
       In the rollover configuration, the counting register switches to the opposite limit value when one of
       the two limits is exceeded:
Slack Delete
         In the free large counter mode, the counter may apply a hysteresis if the rotation is inverted. The
         hysteresis parameter configured with the adjust screen defines the number of points that are
         not acknowledged by the counter during the rotation inversion. This aims to take into account the
         slack between the encoder/motor axis and the mechanical axis (e.g. an encoder measuring the
         position of a mat).
         This behavior is described in the following figure:
         The value defined by the user as the Hysteresis (slack) value is contained in the
         %MWr.m.c.9 word. The user may change this value by specifying the value of this word (this value
         is from 0 to 255):
            In the adjust screen
            In the application by using the WRITE_PARAM(IODDT_VAR1) Function. IODDT_VAR1 is of the
             type T_SIGNED_CPT_BMX.
Operating Limits
       The shortest pulse applied to the IN_SYNC input is 100 μs.
       The maximum homing event frequency is once every 5 ms.
       The counter value is between -2,147,483,648 and +2,147,483,647.
       NOTE: You have to check the validity bit (%IWr.m.c.0.3) before taking into account the
       numerical values such as the counter and the capture registers. Only the validity bit at the high
       level (set to 1) guarantees that the mode will operate correctly within the limits.
At a Glance
         In this operating mode, the module uses an internal clock generator to supply a periodic signal at
         the module’s Q0 output. Only the Q0 output is concerned by this mode as the Q1 output is
         independent of this mode.
Basic Principle
         The output_block_0_enable command bit (%Qr.m.c.2) must be set to 1 in order to enable a
         modulation at the Q0 output.
         The active validation function enables the operation of the internal clock generator that produces
         the output signal to be validated.
         The active synchronization function enables the output signal to be synchronized by resetting to 0
         the internal clock generator.
         The wave form of the output signal depends on:
            The pwm_frequency value (%QDr.m.c.6): it defines the frequency from 0.1 Hz (value is
             equal to 1) to 4 KHz (value is equal to 40,000), in increments of 0.1 Hz
            The pwm_duty value (%QWr.m.c.8): it defines the duty cycle from 5 % (value is equal to 1) to
             95 % (value is equal to 19) in increments of 5 %.
         The following figure shows the operation of the module in the pulse width modulation mode:
Operating Limits
       The maximum output frequency is 4 kHz.
       The maximum frequency that can be applied to the IN_SYNC input is 1 pulse every 5 ms.
       The Q0 driver is "source type", therefore a load resistance is required to switch the output signal
       Q0 to 0 V using the correct frequency. We recommend a load resistance of 250 Ω.
       The allowed duty cycle varies according to the frequency of the Q0 output.
       The table below shows duty cycle values according to the selected frequency. These values must
       be observed for normal operation:
        Frequency                            Duty cycle
        0.1... 250 Hz                        95% - 5%
        251... 500 Hz                        90% - 10%
        501... 1 000 Hz                      80% - 20%
        1001... 1 500 Hz                     70% - 30%
        1501... 2 000 Hz                     60% - 40%
        2 001... 2 500 Hz                    50%
        2 5001... 4 000 Hz                   50% (See following note )
       NOTE: If the frequency and the duty cycle do not respect this table, the output and the validity
       bit (%IWr.m.c.0.3) remains in the low state.
       NOTE: You have to check the validity bit (%IWr.m.c.0.3) before taking into account the
       numerical values such as the counter and the capture registers. Only the validity bit at the high
       level (set to 1) guarantees that the mode will operate correctly within the limits.
       NOTE: From 2501 Hz to 4000 Hz, the 50% ratio is not guaranteed on output.
         Part IV
         Counting Module BMX EHC 0200 Software Implementation
         Chapter 7
         Software Implementation Methodology for BMX EHC xxxx Counting Modules
Installation Methodology
At a Glance
         The software installation of the BMX EHC **** counting modules is carried out from the various
         Control Expert editors:
                   in offline mode,
                   in online mode.
         The following order of installation phases is recommended but it is possible to change the order of
         certain phases (for example, starting with the configuration phase).
Installation Phases
         The following table shows the different installation phases:
        Key:
        (1)              These various phases can also be performed in online mode
         Chapter 8
         Accessing the Functional Screens of the BMX EHC xxxx Counting Modules
Accessing the Functional Screens of the BMX EHC 0200 Counting Modules
At a Glance
          This section describes how to access the functional screens of the BMX EHC 0200 counting
          modules.
Procedure
          To access the screens, execute the following actions:
Step       Action
      1    Expand the Configuration directory in the project browser.
           Result: the following screen appears:
Step        Action
     3      Double-click on the counting module.
            Result: the module screen appears:
Introduction
          The various available screens for the BMX EHC 0200 counting modules are:
             Configuration screen
             Adjust screen
             Debug screen (can only be accessed in online mode)
             Faults screen (can only be accessed in online mode)
2              Heading area         Provides an abbreviation as a reminder of the module and module status in online
                                    mode (LEDs).
3              Module area          Is used:
                                     By clicking on the reference number, to display the tabs:
                                        Description which gives the characteristics of the device.
                                        I/O Objects or Device DDT depending on the I/O data type selected at
                                           module insertion in the Control Expert project.
               Channel area         Is used:
                                     By clicking on the channel (Counter) number, to display the tabs:
                                        Configuration which gives the characteristics of the channel. By default in
                                         topological I/O data model, no function is configured. By default in device
                                         DDT data model, all channels are Frequency Mode configured and a
                                         channel can not be set to None.
                                        Adjust: consists of various sections to be completed (parameter values),
                                         displayed according to the choice of counting function.
                                        Debug: displays the status of the inputs and outputs, as well as the various
                                         parameters of the current counting function (in online mode).
                                        Fault which shows the device errors (in online mode).
4              General parameters Allows you to select the counting function and the task associated with the channel:
               area                Function: counting function among those available for the modules involved.
                                      Depending on this choice, the headings of the configuration area may differ.
                                   Task: defines the task through which the channel's implicit exchange objects
                                      will be exchanged.
                                    These choices are only possible in offline mode.
5              Parameters in        This area has various functionalities which depend upon the current mode:
               progress area         Configuration: is used to configure the channel parameters.
                                     Adjust: consists of various sections to be completed (parameter values),
                                       displayed according to the choice of counting function.
                                     Debug: displays the status of the inputs and outputs, as well as the various
                                       parameters of the current counting function.
                                     Fault: displays the errors that have occurred on the counting channels.
         Chapter 9
         Configuration of the BMX EHC 0200 Counting Modules
        Section 9.1
        Configuration Screen for BMX EHC xxxx Counting Modules
Configuration Screen for BMX EHC 0200 Counting Modules in a Modicon M340 Local
Rack
At a Glance
        This section presents the configuration screen for BMX EHC 0200 counting modules.
Illustration
         The figure below presents the configuration screen for the BMX EHC 0200 module in modulo loop
         counter mode:
NOTE: When adding a BMX EHC 0200 in a local rack the defaut function is Frequency mode
         Section 9.2
         Configuration of Modes for the BMX EHC 0200 Module
At a Glance
        The configuration of a counting module is stored in the configuration constants (%KW).
        The parameters r,m and c shown in the following tables represent the topologic addressing of the
        module. Each parameter had the following signification:
           r: represents the rack number,
           m:represents the position of the module on the rack,
           c: represents the channel number.
Configuration Objects
        The table below presents the frequency mode configurable elements.
At a Glance
        The configuration of a counting module is stored in the configuration constants (%KW).
        The parameters r,m and c shown in the following tables represent the topologic addressing of the
        module. Each parameter had the following signification:
           r: represents the rack number,
           m:represents the position of the module on the rack,
           c: represents the channel number.
Configuration Objects
        The table below presents the event counting mode configurable elements
         IN_SYNC input filter   %KWr.m.c.4                  The least significant byte can take the following values:
                                (least significant byte)     0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
          Output block 1        %KWr.m.c.19                 This word can take the following values:
                                                             0: off,
                                                             1: low counter,
                                                             2: counter in a window,
                                                             3: High counter,
                                                             4: pulse = less than the lower threshold (LT),
                                                             5: pulse = greater than the lower threshold (LT),
                                                             6: pulse = less than the upper threshold (UT),
                                                             7: pulse = greater than the upper threshold (UT).
At a Glance
        The configuration of a counting module is stored in the configuration constants (%KW).
        The parameters r,m and c shown in the following tables represent the topologic addressing of the
        module. Each parameter had the following signification:
           r: represents the rack number,
           m:represents the position of the module on the rack,
           c: represents the channel number.
Configuration Objects
        The table below presents the period measuring mode configurable elements.
         IN_SYNC input filter   %KWr.m.c.4                 The least significant byte can take the following values:
                                (least significant byte)    0: none,
                                                            1: low,
                                                            2: medium,
                                                            3: high.
         Mode                   %KWr.m.c.8                 The least significant byte can take the following values:
                                (least significant byte)    0: From one edge to the same edge at input IN_A,
                                                            1: From one edge to the opposite edge at input IN_A.
          Output block 1        %KWr.m.c.19      This word can take the following values:
                                                  0: off,
                                                  1: low counter,
                                                  2: counter in a window,
                                                  3: High counter,
                                                  4: pulse = less than the lower threshold (LT),
                                                  5: pulse = greater than the lower threshold (LT),
                                                  6: pulse = less than the upper threshold (UT),
                                                  7: pulse = greater than the upper threshold (UT).
At a Glance
        The configuration of a counting module is stored in the configuration constants (%KW).
        The parameters r,m and c shown in the following tables represent the topologic addressing of the
        module. Each parameter had the following signification:
           r: represents the rack number,
           m:represents the position of the module on the rack,
           c: represents the channel number.
Configuration Objects
        The table below presents ratio mode configurable elements.
         IN_A input filter       %KWr.m.c.3                 The least significant byte can take the following
                                 (least significant byte)   values:
                                                             0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
         IN_B input filter       %KWr.m.c.3                 The most significant byte can take the following
                                 (most significant byte)    values:
                                                             0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
         Input power supply fault %KWr.m.c.2.8              General input/output fault (bit set to 0)
                                                            Local (bit set to 1)
         Scale factor            %KWr.m.c.6                 Edit (value in the range 1...255)
                                 (least significant byte)
         Absolute limit          %KDr.m.c.12                Edit
          Output block 1        %KWr.m.c.19      This word can take the following values:
                                                  0: off,
                                                  1: low counter,
                                                  2: counter in a window,
                                                  3: High counter,
                                                  4: pulse = less than the lower threshold (LT),
                                                  5: pulse = greater than the lower threshold (LT),
                                                  6: pulse = less than the upper threshold (UT),
                                                  7: pulse = greater than the upper threshold (UT).
At a Glance
        The configuration of a counting module is stored in the configuration constants (%KW).
        The parameters r,m and c shown in the following tables represent the topologic addressing of the
        module. Each parameter had the following signification:
           r: represents the rack number,
           m:represents the position of the module on the rack,
           c: represents the channel number.
Configuration Objects
        The table below presents the one shot counter mode configurable elements
         IN_SYNC input filter   %KWr.m.c.4                 The least significant byte can take the following values:
                                (least significant byte)    0: none,
                                                            1: low,
                                                            2: medium,
                                                            3: high.
         IN_EN input filter     %KWr.m.c.4                 The most significant byte can take the following values:
                                (most significant byte)     0: none,
                                                            1: low,
                                                            2: medium,
                                                            3: high.
          Output block 1        %KWr.m.c.19      This word can take the following values:
                                                  0: off,
                                                  1: low counter,
                                                  2: counter in a window,
                                                  3: High counter,
                                                  4: pulse = less than the lower threshold (LT),
                                                  5: pulse = greater than the lower threshold (LT),
                                                  6: pulse = less than the upper threshold (UT),
                                                  7: pulse = greater than the upper threshold (UT).
At a Glance
        The configuration of a counting module is stored in the configuration constants (%KW).
        The parameters r,m and c shown in the following tables represent the topologic addressing of the
        module. Each parameter had the following signification:
           r: represents the rack number,
           m:represents the position of the module on the rack,
           c: represents the channel number.
Configuration Objects
        The table below presents modulo loop counter mode configurable elements.
         IN_A input filter       %KWr.m.c.3                 The most significant byte can take the following values:
                                 (most significant byte)     0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
         IN_SYNC input filter    %KWr.m.c.4                 The least significant byte can take the following values:
                                 (least significant byte)    0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
         IN_EN input filter      %KWr.m.c.4                 The most significant byte can take the following values:
                                 (most significant byte)     0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
          Output block 1         %KWr.m.c.19                This word can take the following values:
                                                             0: off,
                                                             1: low counter,
                                                             2: counter in a window,
                                                             3: High counter,
                                                             4: pulse = less than the lower threshold (LT),
                                                             5: pulse = greater than the lower threshold (LT),
                                                             6: pulse = less than the upper threshold (UT),
                                                             7: pulse = greater than the upper threshold (UT).
At a Glance
         The configuration of a counting module is stored in the configuration constants (%KW).
         The parameters r,m and c shown in the following tables represent the topologic addressing of the
         module. Each parameter had the following signification:
            r: represents the rack number,
            m:represents the position of the module on the rack,
            c: represents the channel number.
Configuration Objects
         The table below presents the free large counter mode configurable elements.
          IN_B input filter      %KWr.m.c.3                 The most significant byte can take the following values:
                                 (most significant byte)     0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
          IN_SYNC input filter   %KWr.m.c.4                 The least significant byte can take the following values:
                                 (least significant byte)    0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
          IN_EN input filter     %KWr.m.c.4                 The most significant byte can take the following values:
                                 (most significant byte)     0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
          IN_REF input filter    %KWr.m.c.5                 The least significant byte can take the following values:
                                 (least significant byte)    0: none,
                                                             1: low,
                                                             2: medium,
                                                             3: high.
At a Glance
        The configuration of a counting module is stored in the configuration constants (%KW).
        The parameters r,m and c shown in the following tables represent the topologic addressing of the
        module. Each parameter had the following signification:
           r: represents the rack number,
           m:represents the position of the module on the rack,
           c: represents the channel number.
Configuration Objects
        The table below presents the pulse width modulation mode configurable elements.
         Chapter 10
         BMX EHC xxxx Counting Module Settings
At a Glance
         This section presents the adjust screen for BMX EHC 0200 counting modules.
Illustration
         The figure below presents the adjust screen for the BMX EHC 0200 module in modulo loop counter
         mode:
6              Unit field            This field contains the unit of each variable that may be configured. This field may
                                     not be modified and can be accessed in both offline and online modes.
Introduction
        The preset value concerns the following counting modes:
           for the BMX EHC 0200 module:
             one shot counter mode
             free large counter mode
Description
        The following table shows the preset value setting:
Introduction
         The calibration factor concerns the frequency and ratio modes for the BMX EHC 0200 .
Description
         The following table shows the calibration factor setting:
Modulo Adjust
Introduction
        The modulo concerns the modulo loop counter modes for the counting modules BMX EHC ****.
Description
        The following table shows the modulo adjust:
Introduction
         The hysteresis value concerns free large counter mode for module BMX EHC 0200.
Description
         The following table shows the setting for the hysteresis value:
         Chapter 11
         Debugging the BMX EHC 0200 Counting Modules
       Section 11.1
       Debug Screen for BMX EHC xxxx Counting Modules
At a Glance
       This section presents the debug screen for BMX EHC •••• counting modules. A module’s debug
       screen can only be accessed in online mode.
Illustration
         The figure below presents the debug screen for the BMX EHC 0200 module in modulo loop
         counter mode:
         Section 11.2
         BMX EHC 0200 Module Debugging
At a Glance
       The table below presents the frequency mode debugging elements:
At a Glance
         The table below presents the event counting mode debugging elements:
At a Glance
       The table below presents the period measuring mode debugging elements:
At a Glance
         The table below presents the ratio mode debugging elements:
For a description of each language object refer to T_SIGNED_CPT_BMX IODDT (see page 185).
At a Glance
       The table below presents the one shot counter mode debugging elements:
At a Glance
         The table below presents the modulo loop counter mode debugging elements:
At a Glance
         The table below presents the free large counter mode debugging elements:
For a description of each language object refer to T_SIGNED_CPT_BMX IODDT (see page 185).
At a Glance
         The table below presents the pulse width modulation mode debugging elements:
         Chapter 12
         Display of BMX EHC xxxx Counting Module Error
At a Glance
         This section presents the fault display screen for BMX EHC 0200 counting modules. A module’s
         fault display screen may only be accessed in online mode.
Illustration
         The figure below presents the fault display screen for the BMX EHC 0200 module in modulo loop
         counter mode.
At a Glance
        The diagnostic screens (see page 113) on the module or channel are only accessible in connected
        mode. When an un-masked fault appears, it is reported:
           in the configuration screen of the rack, with the presence of a red square in the position of the
            faulty counting module,
           in all screens at module level (Description and Fault tabs),
             in the module field with the LED
           in all channel level screens (Configuration, Adjustment, Debug and Fault tabs),
             in the module zone with the LED
             in the channel zone with the fault LED
           in the fault screen that is accessed by the Fault where the fault diagnostics are described.
        The fault is also signaled:
           On the module, on the central display,
           by dedicated language objects: CH_ERROR (%Ir.m.c.ERR) and MOD_ERROR
            (%Ir.m.MOD.ERR), %MWr.m.MOD.2, etc. and status words.
        NOTE: Even if the fault is masked, it is reported by the flashing of the I/O LED and in the fault
        screen.
List of Error
At a Glance
         The messages displayed on the diagnostics screens are used to assist with debugging. These
         messages must be concise and are sometimes ambiguous (as different faults may have the same
         consequences).
         These diagnostics are on two levels: module and channel, the latter being the most explicit.
         The lists below show the message headings with suggestions for identifying issues.
         Different hardware and software                 Module fault has gone down to channel level.
         configurations                                  Refer to module level diagnostics.
         Invalid software configuration:                 Check and modify the configuration constants.
          incorrect constant
          bit combination not associated with any
            configuration
         Communication error                             Check the connections between the racks.
         Application fault: refusal to configure or      Diagnose the fault more precisely.
         adjust
35013355 10/2019
         Chapter 13
         The Language Objects of the Counting Function
General
         The counting modules have only two associated IODDTs. These IODDTs are predefined by the
         manufacturer and contains language objects for inputs/outputs belonging to the channel of an
         application-specific module.
         The IODDT associated with the counting modules are of T_ Unsigned_CPT_BMX and
         T_Signed_CPT_BMX types.
         NOTE: IODDT variables can be created in two different ways:
          Using the I/O objects (see EcoStruxure™ Control Expert, Operating Modes) tab.
          Using the Data Editor (see EcoStruxure™ Control Expert, Operating Modes).
At a Glance
         An integrated application-specific interface or the addition of a module automatically enhances the
         language objects application used to program this interface or module.
         These objects correspond to the input/output images and software data of the module or integrated
         application-specific interface.
Reminders
         The module inputs (%I and %IW) are updated in the PLC memory at the start of the task, the PLC
         being in RUN or STOP mode.
         The outputs (%Q and %QW) are updated at the end of the task, only when the PLC is in RUN mode.
         NOTE: When the task occurs in STOP mode, either of the following are possible, depending on
         the configuration selected:
          outputs are set to fallback position (fallback mode)
          outputs are maintained at their last value (maintain mode)
Figure
         The following diagram shows the operating cycle of a PLC task (cyclical execution).
Introduction
         Explicit exchanges are performed at the user program's request using these instructions:
          READ_STS (read status words)
          WRITE_CMD (write command words)
          WRITE_PARAM (write adjustment parameters)
          READ_PARAM (read adjustment parameters)
          SAVE_PARAM (save adjustment parameters)
          RESTORE_PARAM (restore adjustment parameters)
         For more details about instructions, refer to EcoStruxure™ Control Expert, I/O Management, Block
         Library.
         These exchanges apply to a set of %MW objects of the same type (status, commands or
         parameters) that belong to a channel.
         These objects can:
          provide information about the module (for example, type of error detected in a channel)
          have command control of the module (for example, switch command)
          define the module’s operating modes (save and restore adjustment parameters in the process
           of application)
         NOTE: To avoid several simultaneous explicit exchanges for the same channel, it is necessary to
         test the value of the word EXCH_STS (%MWr.m.c.0) of the IODDT associated to the channel
         before calling any EF addressing this channel.
         NOTE: Explicit exchanges are not supported when X80 analog and digital I/O modules are
         configured through an eX80 adapter module (BMECRA31210) in a Quantum EIO configuration.
         You cannot set up a module's parameters from the PLC application during operation.
Managing Exchanges
        During an explicit exchange, check performance to see that the data is only taken into account
        when the exchange has been correctly executed.
        To do this, two types of information is available:
         information concerning the exchange in progress (see page 182)
         the exchange report (see page 182)
        NOTE: In order to avoid several simultaneous explicit exchanges for the same channel, it is
        necessary to test the value of the word EXCH_STS (%MWr.m.c.0) of the IODDT associated to the
        channel before calling any EF addressing this channel.
At a Glance
         When data is exchanged between the PLC memory and the module, the module may require
         several task cycles to acknowledge this information. IODDTs use two words to manage
         exchanges:
          EXCH_STS (%MWr.m.c.0): exchange in progress
          EXCH_RPT (%MWr.m.c.1): report
         NOTE:
         Depending on the localization of the module, the management of the explicit exchanges
         (%MW0.0.MOD.0.0 for example) will not be detected by the application:
          For in-rack modules, explicit exchanges are done immediately on the local PLC Bus and are
            finished before the end of the execution task. So, the READ_STS, for example, is finished when
            the %MW0.0.mod.0.0 bit is checked by the application.
          For remote bus (Fipio for example), explicit exchanges are not synchronous with the execution
            task, so the detection is possible by the application.
Illustration
         The illustration below shows the different significant bits for managing exchanges:
        NOTE: r represents the rack number, m the position of the module in the rack, while c represents
        the channel number in the module.
        NOTE: Exchange and report words also exist at module level EXCH_STS (%MWr.m.MOD) and
        EXCH_RPT (%MWr.m.MOD.1) as per IODDT type T_GEN_MOD.
         When the instruction is scanned by the PLC, the Exchange in progress bit is set to 1 in %MWr.m.c.
         Phase 2: Analysis of the data by the I/O module and report.
         When the data is exchanged between the PLC memory and the module, acknowledgement by the
         module is managed by the ADJ_ERR bit (%MWr.m.c.1.2).
         This bit makes the following reports:
          0: correct exchange
          1: incorrect exchange)
       NOTE: If the module is not present or is disconnected, explicit exchange objects (READ_STS for
       example) are not sent to the module (STS_IN_PROG (%MWr.m.c.0.0) = 0), but the words are
       refreshed.
          Step      Action
          1         Power on.
          2         The system sends the configuration parameters.
          3         The system sends the adjust parameters by WRITE_PARAM method.
                    Note: When the operation is finished, the bit %MWr.m.c.0.2 switches to 0.
         If, in the begining of your application, you use a WRITE_PARAM command, wait until the bit
         %MWr.m.c.0.2 switches to 0.
At a Glance
         The tables below present the T_Unsigned_CPT_BMX and T_Signed_CPT_BMX-types IODDTs
         implicit exchange objects which are applicable to all BMX EHC •••• counting modules.
%Ir.m.c.d Word
         The table below presents the meanings of the %Ir.m.c.d words:
At a Glance
       This section presents the explicit exchange objects for the T_Unsigned_CPT_BMX and
       T_Signed_CPT_BMX- types IODDTs which are applicable to all BMX EHC •••• counting modules.
       They includes word type objects whose bits have a specific meaning. These objects are described
       in detail below.
       Sample variable declaration: T_Unsigned_CPT_BMX and T_Signed_CPT_BMX-types
       IODDT_VAR1.
       NOTE:
        in general, the meaning of the bits is given for bit status 1.
        not all bits are used.
Introduction
        The Modicon X80 modules have an associated IODDT of type T_GEN_MOD.
Observations
        In general, the meaning of the bits is given for bit status 1. In specific cases an explanation is given
        for each status of the bit.
        Some bits are not used.
List of Objects
        The table below presents the objects of the IODDT.
Introduction
         This topic describes the device DDT for the Modicon X80 counter module, the instance default
         naming is described in Device DDT Instance Naming Rule (see EcoStruxure™ Control Expert,
         Program Languages and Structure, Reference Manual).
         Regarding the device DDT, its name contains the following information:
          platform with:
            M for Modicon X80 module
            max channel (2 or 8)
         Example: For a Modicon X80 counter module with 2 standard inputs: T_M_CPT_STD_IN_2
         Modifying the adjustment parameters of a channel from Control Expert during a CCOTF operation
         causes the channel to be re-initialized.
         The concerned parameters are:
          PRESET_VALUE
            Preset value
          CALIBRATION_FACTOR
            Calibration Factor
          MODULO_VALUE
            Modulo value
          SLACK_VAL (Hysteresis)
            Offset value
       Here below is all the signed ASF that must be used with a counter BMX EHC 0200:
        Free Large counter Mode
        Ratio 1
        Ratio 2
       Here below is all the unsigned ASF that must be used with a counter BMX EHC 0200:
        Event Counting Mode
        Frequency Mode
        Modulo Loop Counter Mode
        One Shot Counter Mode
        Period Measuring Mode
        Pulse Width Modulation Mode
       Here below is all the signed ASF that must be used with a counter BMX EHC 0800:
        Up Down Counting Mode
       Here below is all the unsigned ASF that must be used with a counter BMX EHC 0800:
        Event Counting Mode
        Frequency Mode
        Modulo Loop Counter Mode
        One Shot Counter Mode
          DDT                                  Description
          T_M_CPT_STD_CH_STS                   Structure to read the channel Depending on the module location, the
                                               status of a counting module. DDT can be connected to the STS
                                                                             output parameter of the EFB:
                                                                              READ_STS_QX when the module
                                                                                is located in Quantum EIO.
                                                                              READ_STS_MX when the module
                                                                                is located in a M580 local rack or in
                                                                                M580 RIO drops.
          T_M_SIGN_CPT_STD_CH_PRM              Structure for adjustment       The DDT can be connected to the
                                               parameters of a channel of a   PARAM output parameter of the EFB:
                                               counting module (signed         READ_PARAM_MX to read
                                               application specific function)   module parameters.
                                               in a M580 local rack.           WRITE_PARAM_MX to write
          T_M_UNSIGN_CPT_STD_CH_PRM            Structure for adjustment         module parameters.
                                               parameters of a channel of a  SAVE_PARAM_MX to save
                                               counting module (unsigned        module parameters.
                                               application specific function)  RESTORE_PARAM_MX to restore
                                               in a M580 local rack.            the new parameters of the module.
          NOTE: Targeted channel address (ADDR) can be managed with ADDMX (see EcoStruxure™ Control Expert,
          Communication, Block Library) EF (connect the output parameter OUT to the input parameter ADDR of the
          communication functions).
                              NOTE: This bit is managed only by modules located in a remote rack with a
                              BME CRA 312 10 adapter module. Modules located in the local rack do not manage
                              this bit that remains at 0.
          7        –          Not used.
         Part V
         Quick Start: Example of Counting Module Implementation
         Chapter 14
         Description of the Application
At a Glance
         The application described in this document is used for sticking labels on boxes.
         The boxes are carried on a conveyor. A label is stuck onto the box when the latter passes by the
         two dedicated points.
         A sensor placed below the conveyor detects any new incoming box. The boxes should arrive at
         constant intervals.
         The conveyor motor is fitted with an encoder connected to a counting input module. Any process
         deflection is monitored and displayed.
         The application's control resources are based on an operator screen displaying all box positions,
         the number of labeled boxes and the deflection monitoring.
Illustration
         This is the application’s final operator screen:
Operating Mode
         The operating mode is as follows:
            A Start button is used to start the labelling process.
            A Stop button interrupts the labelling process.
            When the box arrives at the right time, the Box on time indicator lights on.
            In case of process deflection, the box delay time is displayed. If this time has been too long, a
             Process deflection indicator lights on.
         Chapter 15
         Installing the Application Using Control Expert
        Section 15.1
        Presentation of the Solution Used
At a Glance
         There are several ways of writing a counter application using Control Expert. The one proposed,
         uses the Modulo Loop Counter Mode available in the BMX EHC 0200 counting input module.
Technological Choices
         The following table shows the technological choices used for the application.
At a Glance
        The following logic diagram shows the different steps to follow to create the application. A
        chronological order must be respected in order to correctly define all of the application elements.
Description
        Description of the different types:
         Section 15.2
         Developing the Application
At a Glance
        Developing an application using Control Expert involves creating a project associated with a PLC.
         Step      Action
         1         Launch the Control Expert software.
         2         Click on File then New to select a PLC.
         3         To see all PLC versions, click on the box Show all versions.
         4         Select the processor you wish to use from those proposed.
         5         To create a project with specific values of project settings, check the box Settings File and use the
                   browser button to localize the .XSO file (Project Settings file). It is also possible to create a new one.
                   If the Settings File box is not checked , default values of project settings are used.
         6         Terminate your configuration, insert a BMX EHC 0200 input module.
         7         Confirm with OK.
At a Glance
         Developing a counting application involves choosing the right module and appropriate
         configuration.
Module Selection
         The table below shows the procedure for selecting the counting input module.
          Step     Action
          1        In the Project browser double-click on Configuration then on 0:Bus X and on
                   0:BMX XBP ••• (Where 0 is the rack number)
          2        In the Bus X window, select a slot (for example slot 1) and double-click
          3        Choose the BMX HEC 0200 counting input module
         Step      Action
         1         In the Bus X window, double-click on the BMX EHC 0200 counting input module
         2         Select a channel (for example Counter 0) and click
         3         Select the module function Modulo Loop Counter Mode
         4         In the Config tab, configure the OutputBlock 0 reflex output with a pulse when the counting is
                   greater than the Lower Threshold (Pulse = greater than LT) and the OutputBlock 1 reflex
                   output with a pulse when the counting is greater than the Upper Threshold (Pulse = greater
                   than UT). Then click on the Event value and select Enable.
5 Click on the Adjust tab and enter the modulo value (for example 50).
          Step     Action
          1        In the BMX EHC 0200 window, click on the BMX EHC 0200 and then on the I/O objects tab
          2        Click on the I/O object prefix address %CH then on the Update grid button, the channel
                   address appears in the I/O object grid
          3        Click on the line %CH0.1.0 and then enter a channel name in the Prefix for name zone
          4        Now click on different Implicit I/O object prefix addresses then Update grid button to see the
                   names and addresses of the implicit I/O objects.
Declaration of Variables
At a Glance
        All of the variables used in the different sections of the program must be declared.
        Undeclared variables cannot be used in the program.
        NOTE: For more information, refer to chapter Data Editor (see EcoStruxure™ Control Expert,
        Operating Modes).
         Step         Action
         1            In Project browser / Variables & FB instances, double-click on
                      Elementary variables
         2            In the Data editor window, select the box in the Name column and enter a
                      name for your first variable.
         3            Now select a Type for this variable.
         4            When all your variables are declared, you can close the window.
The following screen shows the application variables created using the data editor :
NOTE: Click on in front of the derived variable Encoder to expand the I/O objects list.
At a Glance
        Two sections are declared in the MAST task:
           The Labelling_Program section (See Creating the Labelling Program in ST, page 222),
            written in ST, initiates and uses the Modulo Loop Counter Mode functions and I/O objects,
           The Application section (See Creating a Program in LD for Application Execution,
            page 225), written in LD, executes the counting start-up and the operator screen animation.
Process Chart
        The following screen shows the process chart.
          Step                    Description
          Functions enabling      Enables the Modulo Mode functions used in the application.
          Threshold definitions   The values of the thresholds, on which depend the reflex outputs,
                                  are defined in this step.
          Process deflection      Test if the capture value is greater than the deflection parameter
          Deflection Alarm ON     If the result of the process deflection test is true, the alarm is ON.
          Deflection Alarm OFF    If the result of the process deflection test is false, the alarm is OFF.
At a Glance
        This section initiates and uses the Modulo Loop Counter Mode functions and objects.
         END IF
         (*Definition of the lower and upper threshold values*)
         Encoder.LOWER_TH_VALUE:=First_Labelling_Point;
         Encoder.UPPER_TH_VALUE:=Second_Labelling_Point;
         (*Process Deflection Watching*)
         IF Encoder.CAPT_0_VALUE>deflection_parameter=true
              THEN last_box_late:=1; (*Default light set ON*)
              ELSE last_box_late:=0; (*Default light set OFF*)
         END IF
         (*If the next part arrives just in the right time, the green indicator
         lights on*)
         IF Encoder.CAPT_0_VALUE = 0
           THEN Last_Box_On_Target :=1 (*Green light set ON*)
           ELSE Last_Box_On_Target :=0 (*Green light set OFF*)
         END IF
          Step      Action
          1         In Project Browser\Program\Tasks, double-click on MAST,
          2         Right-click on Section then select New section. Give your section a name and select ST
                    language.
          3         The name of your section appears and can now be edited by double-clicking on it.
          4
                    To use the I/O object, right-click in the editor then click on Data selection and on       .
                    Click on     on the front of the I/O derived variable Encoder and the list of the I/O objects
                    appears.
                    Click on the one you need and confirm with OK.
         NOTE: In the Data selection windows, the IODDT checkbox must be checked to have access to
         the I/O derived variable Encoder.
At a Glance
        This section is called when the modulo value is reached.
         Step         Action
              1       In Project Browser\Program\, double-click on Events
              2       Right click on I/O Events then select New Event section. Give your section
                      a number, for this example select 0, and then select ST language
              3       Confirm with OK and the edition window appears.
At a Glance
         This section executes the counting start up and the operator screen animation.
          Step         Action
          1            In Project Browser\Program\Tasks, double-click on MAST.
          2            Right click on Section then select New section. Name this section Application, then select
                       the language type LD.
                       The Edit window opens.
          3
                       To create the contact Encoder.Sync_Ref_Flag, click on         then place it in the editor. Double-
                       click on this contact then on    . The Instance Selection window opens. Validate the
                       Inside structure checkbox and click on           in front of the Encoder variable and select
                       Sync_Ref_Flag in the list. Confirm with OK.
          4            To use the RS block you must instantiate it. Right click in the editor then click on Select data
                       and on      . Click on the Function and Function Block Types tab. Click on Libset and
                       select the RS block in the list then confirm with OK and position your block. To link the
                       Encoder.Sync_Ref_Flag contact to the S Rnput of the RS block, align the contact and the input
horizontally, click on and position the link between the contact and the input.
At a glance
        An animation table is used to monitor the values of variables, and modify and/or force these values.
        Only those variables declared in Variables & FB instances can be added to the animation
        table
        NOTE: Note: For more information, refer to chapter Animation Tables (see EcoStruxure™ Control
        Expert, Operating Modes).
         Step         Action
         1            In the Project browser, right click on Animation tables.
                      The edit window opens.
         2
                      Click on first cell in the Name column, then on the   button, and add the
                      variables you require.
NOTE: The animation table is dynamic only in online mode (display of variable values)
At a Glance
         The operator screen is used to animate graphic objects that symbolize the application. These
         objects can belong to the Control Expert library, or can be created using the graphic editor.
         NOTE: For more information, refer to chapter Operator screens (see EcoStruxure™ Control
         Expert, Operating Modes).
         NOTE: To animate objects in online mode, you must click on          . By clicking on this button, you
         can validate what is written.
         Step         Action
         1            In the Project browser, right click on Operator screens and click on New screen.
                      The operator screen editor appears.
         2            Click on the      and position the new button on the operator screen. Double click on the
                      button and in the Control tab, select the Run variable by clicking the button     and confirm
                      with OK. Then, enter the button name in the text zone.
The table below shows the procedure for inserting and animating the conveyor.
         Step         Action
         1            In the Tools menu, select Operator screens Library. Double click on Machine then
                      Conveyor. Select the dynamic conveyor from the runtime screen and Copy (Ctrl+C) then
                      Paste (Ctrl+V) it into the drawing in the operator screen editor.
         2            The conveyor is now in your operator screen. You now need a variable to animate the
                      wheels. Select your conveyor then click on    . A line on the wheel is selected.
                      Press enter and the object properties window opens. Select the Animation tab and enter
                      the concerned variable, by clicking on      (in the place of %MW0).
                      In our application, this will be Encoder.INPUT_A, the physical input A state. Confirm with
                      Apply and OK.
         3
                      Click on       to select the other lines one by one and apply the same procedure.
        NOTE: In the Instance Selection, tick the IODDT checkbox and click on                         to access the I/O
        objects list.
        The table below shows the procedure for inserting and animating a display.
         Step         Action
         1            Click on  and position it on the operator screen. Double click on the text and select the
                      Animation tab.
         2            Tick the Animated Object checkbox, select the concernd variable by cliking on         and
                      confirm with OK.
         Chapter 16
         Starting the Application
At a Glance
         Standard mode working requires the use of a PLC and a BMX EHC 0200 with an encoder and a
         sensor linked to its inputs.
Outputs wiring
         The actuators are connected as follow:
Pin description:
Inputs Wiring
         The encoder and the sensor are connected as follows:
Description:
Application Execution
         The table below shows the procedure for launching the application in standard mode:
         Step           Action
         1              In the PLC menu, click on Standard Mode,
         2              In the Build menu, click on Rebuild All Project. Your project is generated and is ready
                        to be transferred to the PLC. When you generate the project, you will see a results window. If
                        there is an error in the program, Control Expert indicates its location if you click on the highlighted
                        sequence.
         3              In the PLC menu, click on Connection. You are now connected to the PLC.
         4              In the PLC menu, click on Transfer project to PLC. The Transfer project to PLC
                        window opens. Click on Transfer. The application is transferred to the PLC.
         5              In the PLC, click on Execute. The Execute window opens. Click on OK. The application is now
                        being executed (in RUN mode) on the PLC.
Index
B                                             G
BMXEHC0200, 22                                grounding accessories, 50
BMXXSP0400, 50                                   BMXXSP0400, 50
BMXXSP0600, 50                                   BMXXSP0600, 50
BMXXSP0800, 50                                   BMXXSP0800, 50
BMXXSP1200, 50                                   BMXXSP1200, 50
                                                 STBXSP3010, 50
                                                 STBXSP3020, 50
C
certifications, 36
channel data structure for all modules        I
    T_GEN_MOD, 192, 192                       input interface blocks, 57
channel data structure for counting modules   installing, 27, 109
    T_SIGNED_CPT_BMX, 185, 190
    T_UNSIGNED_CPT_BMX, 185, 190
configuring, 119                              M
Counting Events, 79                           MOD_FLT, 203
                                              modulo loop counter, 95
D
debugging, 151                                O
diagnosing, 67                                one shot counter, 92
E                                             P
event counting, 84                            parameter settings, 173
                                              period measuring, 86
                                              pulse width modulation, 107
F
filtering, 58
free large counter, 99                        Q
frequency mode, 83                            quick start, 205
functions, 56
                                              R
                                              ratio, 89
                                              S
                                              settings, 143
standards, 36
STBXSP3010, 50
STBXSP3020, 50
T
T_GEN_MOD, 192, 192
T_M_CPT_STD_IN_2, 195
T_M_CPT_STD_IN_8, 195
T_SIGNED_BMX, 185
T_SIGNED_CPT_BMX, 190
T_UNSIGNED_CPT_BMX, 185, 190
terminal blocks
   connecting, 27
   installing, 27
W
wiring accessories, 27