M251 PLC Guides
M251 PLC Guides
EIO0000001462 11/2015
                   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.
    No part of this document may be reproduced in any form or by any means, electronic or
    mechanical, including photocopying, without express written permission of Schneider Electric.
    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.
    © 2015 Schneider Electric. All rights reserved.
2                                                                                       EIO0000001462 11/2015
         Table of Contents
                     Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                           7
                     About the Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                          9
           Chapter 1 About the Modicon M251 Logic Controller . . . . . . . . .                                                             15
                               M251 Logic Controller Description . . . . . . . . . . . . . . . . . . . . . . . . . . .                     15
           Chapter 2 How to Configure the Controller . . . . . . . . . . . . . . . . . .                                                   17
                               How to Configure the Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   17
           Chapter 3 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                   19
                               Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   19
           Chapter 4 Supported Standard Data Types. . . . . . . . . . . . . . . . . .                                                      21
                               Supported Standard Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                     21
           Chapter 5 Memory Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                            23
                               Controller Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                    24
                               RAM Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   26
                               Flash Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   28
                               Relocation Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          32
           Chapter 6 Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                 35
                               Maximum Number of Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                    36
                               Task Configuration Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                 37
                               Task Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        39
                               System and Task Watchdogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                     42
                               Task Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       43
                               Default Task Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                44
           Chapter 7 Controller States and Behaviors. . . . . . . . . . . . . . . . . .                                                    45
                        7.1 Controller State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                 46
                            Controller State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                 47
                        7.2 Controller States Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   51
                            Controller States Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   51
                        7.3 State Transitions and System Events . . . . . . . . . . . . . . . . . . . . . . . . .                          55
                            Controller States and Output Behavior . . . . . . . . . . . . . . . . . . . . . . . .                          56
                            Commanding State Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                       59
                            Error Detection, Types, and Management. . . . . . . . . . . . . . . . . . . . . .                              65
                            Remanent Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                 66
EIO0000001462 11/2015                                                                                                                       3
     Chapter 8 Controller Device Editor . . . . . . . . . . . . . . . . . . . . . . . .                                             69
                      Controller Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .               70
                      Controller Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            72
                      PLC Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          73
                      Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      75
     Chapter 9 Expansion Modules Configuration . . . . . . . . . . . . . . . .                                                      77
                      I/O Configuration General Practices . . . . . . . . . . . . . . . . . . . . . . . . . .                       78
                      I/O Bus Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              79
                      TM4 Expansion Module Configuration . . . . . . . . . . . . . . . . . . . . . . . . .                          80
                      TM3/TM2 Expansion Module Configuration. . . . . . . . . . . . . . . . . . . . .                               81
                      Optional I/O Expansion Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                      82
    Chapter 10 Ethernet Configuration . . . . . . . . . . . . . . . . . . . . . . . . .                                             85
             10.1 Ethernet Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                86
                  Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            87
                  IP Address Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                    89
                  Modbus TCP Client/Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        94
                  Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              96
                  FTP Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            109
                  SNMP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          111
                  TM251MESC Logic Controller as Target Device On EtherNet/IP . . . .                                               112
                  TM251MESE Logic Controller as Target Device On EtherNet/IP . . . .                                               134
                  M251 Logic Controller as an IOScanner Slave Device on Modbus TCP                                                 154
             10.2 Firewall Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                 159
                  Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           160
                  Dynamic Changes Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                          162
                  Firewall Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              163
                  Script File Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             165
    Chapter 11 Industrial Ethernet Manager . . . . . . . . . . . . . . . . . . . . .                                               169
                      Industrial Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          170
                      DHCP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          174
                      Fast Device Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                  175
    Chapter 12 Serial Line Configuration . . . . . . . . . . . . . . . . . . . . . . .                                             177
                      Serial Line Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              178
                      SoMachine Network Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                      180
                      Modbus Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             181
4                                                                                                                    EIO0000001462 11/2015
                           ASCII Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   185
                           Modbus IOScanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      187
                           Adding a Device on the Modbus IOScanner . . . . . . . . . . . . . . . . . . . .                     189
                           Adding a Modem to a Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             196
         Chapter 13 CANopen Configuration. . . . . . . . . . . . . . . . . . . . . . . . .                                     197
                           CANopen Interface Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . .             197
         Chapter 14 Post Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                               201
                           Post Configuration Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           202
                           Post Configuration File Management . . . . . . . . . . . . . . . . . . . . . . . . .                204
                           Post Configuration Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          206
         Chapter 15 Connecting a Modicon M251 Logic Controller to a PC                                                         211
                           Connecting the Controller to a PC . . . . . . . . . . . . . . . . . . . . . . . . . . . .           211
         Chapter 16 SD Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        215
                           Updating Modicon M251 Logic Controller Firmware . . . . . . . . . . . . . .                         216
                           File Transfer with SD Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        219
     Appendices             .........................................                                                          225
        Appendix A Functions to Get/Set Serial Line Configuration in User
                   Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                          227
                           GetSerialConf: Get the Serial Line Configuration . . . . . . . . . . . . . . . .                    228
                           SetSerialConf: Change the Serial Line Configuration . . . . . . . . . . . . .                       229
                           SERIAL_CONF: Structure of the Serial Line Configuration Data Type                                   232
        Appendix B Controller Performance . . . . . . . . . . . . . . . . . . . . . . . . .                                    235
                           Processing Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        235
           Glossary         .........................................                                                          237
              Index         .........................................                                                          247
EIO0000001462 11/2015                                                                                                            5
6   EIO0000001462 11/2015
         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.
EIO0000001462 11/2015                                                                                       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.
8                                                                                       EIO0000001462 11/2015
         About the Book
At a Glance
Document Scope
         The purpose of this document is to help you to program and operate your Modicon M251 Logic
         Controller with the SoMachine software.
         NOTE: Read and understand this document and all related documents before installing, operating,
         or maintaining your Modicon M251 Logic Controller.
         The Modicon M251 Logic Controller users should read through the entire document to understand
         all features.
Validity Note
         This document has been updated for the release of SoMachine V4.1 SP2.
Related Documents
EIO0000001462 11/2015                                                                                 9
     Title of Documentation                                         Reference Number
     Modicon TM4 Expansion Modules Programming Guide                EIO0000001802 (ENG);
                                                                    EIO0000001803 (FRE);
                                                                    EIO0000001804 (GER);
                                                                    EIO0000001805 (SPA);
                                                                    EIO0000001806 (ITA);
                                                                    EIO0000001807 (CHS)
     Modicon TM3 Modules Configuration Programming Guide            EIO0000001402 (ENG);
                                                                    EIO0000001403 (FRE);
                                                                    EIO0000001404 (GER);
                                                                    EIO0000001405 (SPA);
                                                                    EIO0000001406 (ITA);
                                                                    EIO0000001407 (CHS)
     Modicon TM2 Modules Configuration Programming Guide            EIO0000000396 (ENG);
                                                                    EIO0000000397 (FRE);
                                                                    EIO0000000398 (GER);
                                                                    EIO0000000399 (SPA);
                                                                    EIO0000000400 (ITA);
                                                                    EIO0000000401 (CHS)
     Modicon M251 Logic Controller System Functions and Variables   EIO0000001468 (ENG);
     PLCSystem Library Guide                                        EIO0000001469 (FRE);
                                                                    EIO0000001470 (GER);
                                                                    EIO0000001471 (SPA);
                                                                    EIO0000001472 (ITA);
                                                                    EIO0000001473 (CHS)
     SoMachine Controller Assistant User Guide                      EIO0000001671 (ENG);
                                                                    EIO0000001672 (FRE);
                                                                    EIO0000001673 (GER);
                                                                    EIO0000001675 (SPA);
                                                                    EIO0000001674 (ITA);
                                                                    EIO0000001676 (CHS)
     You can download these technical publications and other technical information from our website
     at http://download.schneider-electric.com
10                                                                                 EIO0000001462 11/2015
Product Related Information
                                                    WARNING
          LOSS OF CONTROL
             The designer of any control scheme must consider the potential failure modes of control paths
              and, for certain critical control functions, provide a means to achieve a safe state during and
              after a path failure. Examples of critical control functions are emergency stop and overtravel
              stop, power outage and restart.
             Separate or redundant control paths must be provided for critical control functions.
             System control paths may include communication links. Consideration must be given to the
              implications of unanticipated transmission delays or failures of the link.
             Observe all accident prevention regulations and local safety guidelines.1
             Each implementation of this equipment must be individually and thoroughly tested for proper
              operation before being placed into service.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
         1For additional information, refer to NEMA ICS 1.1 (latest edition), "Safety Guidelines for the
         Application, Installation, and Maintenance of Solid State Control" and to NEMA ICS 7.1 (latest
         edition), "Safety Standards for Construction and Guide for Selection, Installation and Operation of
         Adjustable-Speed Drive Systems" or their equivalent governing your particular location.
                                                    WARNING
          UNINTENDED EQUIPMENT OPERATION
             Only use software approved by Schneider Electric for use with this equipment.
             Update your application program every time you change the physical hardware configuration.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
EIO0000001462 11/2015                                                                                      11
Terminology Derived from Standards
      The technical terms, terminology, symbols and the corresponding descriptions in this manual, or
      that appear in or on the products themselves, are generally derived from the terms or definitions
      of international standards.
      In the area of functional safety systems, drives and general automation, this may include, but is not
      limited to, terms such as safety, safety function, safe state, fault, fault reset, malfunction, failure,
      error, error message, dangerous, etc.
      Among others, these standards include:
       Standard                   Description
       EN 61131-2:2007            Programmable controllers, part 2: Equipment requirements and tests.
       ISO 13849-1:2008           Safety of machinery: Safety related parts of control systems.
                                  General principles for design.
       EN 61496-1:2013            Safety of machinery: Electro-sensitive protective equipment.
                                  Part 1: General requirements and tests.
       ISO 12100:2010             Safety of machinery - General principles for design - Risk assessment and risk
                                  reduction
       EN 60204-1:2006            Safety of machinery - Electrical equipment of machines - Part 1: General
                                  requirements
       EN 1088:2008               Safety of machinery - Interlocking devices associated with guards - Principles
       ISO 14119:2013             for design and selection
       ISO 13850:2006             Safety of machinery - Emergency stop - Principles for design
       EN/IEC 62061:2005          Safety of machinery - Functional safety of safety-related electrical, electronic,
                                  and electronic programmable control systems
       IEC 61508-1:2010           Functional safety of electrical/electronic/programmable electronic
                                  safety-related systems: General requirements.
       IEC 61508-2:2010           Functional safety of electrical/electronic/programmable electronic
                                  safety-related systems: Requirements for electrical/electronic/programmable
                                  electronic safety-related systems.
       IEC 61508-3:2010           Functional safety of electrical/electronic/programmable electronic
                                  safety-related systems: Software requirements.
       IEC 61784-3:2008           Digital data communication for measurement and control: Functional
                                  safety field buses.
       2006/42/EC                 Machinery Directive
       2004/108/EC                Electromagnetic Compatibility Directive
       2006/95/EC                 Low Voltage Directive
12                                                                                              EIO0000001462 11/2015
         In addition, terms used in the present document may tangentially be used as they are derived from
         other standards such as:
          Standard                 Description
          IEC 60034 series         Rotating electrical machines
          IEC 61800 series         Adjustable speed electrical power drive systems
          IEC 61158 series         Digital data communications for measurement and control – Fieldbus for use in
                                   industrial control systems
         Finally, the term zone of operation may be used in conjunction with the description of specific
         hazards, and is defined as it is for a hazard zone or danger zone in the EC Machinery Directive
         (EC/2006/42) and ISO 12100:2010.
         NOTE: The aforementioned standards may or may not apply to the specific products cited in the
         present documentation. For more information concerning the individual standards applicable to the
         products described herein, see the characteristics tables for those product references.
EIO0000001462 11/2015                                                                                        13
14   EIO0000001462 11/2015
         Modicon M251 Logic Controller
         About the Modicon M251 Logic Controller
         EIO0000001462 11/2015
         Chapter 1
         About the Modicon M251 Logic Controller
Overview
         The M251 Logic Controller has various powerful features and can service a wide range of
         applications.
         Software configuration, programming, and commissioning are achieved with the SoMachine
         software described in the SoMachine Programming Guide and in the M251 Logic Controller
         Programming Guide.
Programming Languages
         The M251 Logic Controller is configured and programmed with the SoMachine software, which
         supports the following IEC 61131-3 programming languages:
          IL: Instruction list
          ST: Structured text
          FBD: Function block diagram
          SFC: Sequential function chart
          LD: Ladder diagram
         SoMachine software can also be used to program this controller using CFC (continuous function
         chart) language.
Power Supply
         The power supply of the M251 Logic Controller is 24 Vdc.
Run/Stop
         The M251 Logic Controller can be operated externally by the following:
          a hardware Run/Stop switch
          a SoMachine software command
EIO0000001462 11/2015                                                                               15
About the Modicon M251 Logic Controller
Memory
        This table describes the different types of memory:
Removable Storage
        M251 Logic Controllers include an embedded SD card slot (see Modicon M251 Logic Controller,
        Hardware Guide).
        The main uses of the SD card are:
         Initializing the controller with a new application
         Updating the controller firmware
         Applying post configuration files to the controller
         Applying recipes
         Receiving data logging files
16                                                                                                EIO0000001462 11/2015
         Modicon M251 Logic Controller
         How to Configure the Controller
         EIO0000001462 11/2015
         Chapter 2
         How to Configure the Controller
Introduction
         First, create a new project or open an existing project in the SoMachine software.
         Refer to the SoMachine Programming Guide for information on how to:
          add a controller to your project
          add expansion modules to your controller
          replace an existing controller
          convert a controller to a different but compatible device
Devices Tree
         The Devices tree presents a structured view of the current hardware configuration. When you add
         a controller to your project, a number of nodes are added to the Devices tree, depending on the
         functions the controller provides.
EIO0000001462 11/2015                                                                                17
How to Configure the Controller
Applications Tree
        The Applications tree allows you to manage project-specific applications as well as global
        applications, POUs, and tasks.
Tools Tree
        The Tools tree allows you to configure the HMI part of your project and to manage libraries.
18                                                                                        EIO0000001462 11/2015
         Modicon M251 Logic Controller
         Libraries
         EIO0000001462 11/2015
         Chapter 3
         Libraries
Libraries
Libraries
Introduction
         Libraries provide functions, function blocks, data types, and global variables that can be used to
         develop your project.
         The Library Manager of SoMachine provides information about the libraries included in your
         project and allows you to install new ones. For more information on the Library Manager, refer to
         the SoMachine Programming Guide.
EIO0000001462 11/2015                                                                                              19
Libraries
20                                                                                                EIO0000001462 11/2015
         Modicon M251 Logic Controller
         Supported Standard Data Types
         EIO0000001462 11/2015
         Chapter 4
         Supported Standard Data Types
         For more information on ARRAY, LTIME, DATE, TIME, DATE_AND_TIME, and TIME_OF_DAY, refer
         to the SoMachine Programming Guide.
EIO0000001462 11/2015                                                                                               21
Supported Standard Data Types
22                              EIO0000001462 11/2015
         Modicon M251 Logic Controller
         Memory Mapping
         EIO0000001462 11/2015
         Chapter 5
         Memory Mapping
Memory Mapping
Introduction
         This chapter describes the memory maps and sizes of the different memory areas in the Modicon
         M251 Logic Controller. These memory areas are used to store user program logic, data and the
         programming libraries.
EIO0000001462 11/2015                                                                                23
Memory Mapping
Introduction
        The controller memory is composed of 2 types of physical memory:
         The Flash memory (see page 28) contains files (application, configuration files, and so on).
         The RAM (Random Access Memory) (see page 26) is used for application execution.
(1) If the controller is in the INVALID_OS state, the only accessible Flash memory is the SD card and only for firmware
    upgrades.
24                                                                                                  EIO0000001462 11/2015
                                                                                                     Memory Mapping
         NOTE: All files in Flash memory can be read, written, or erased, no matter the controller state. The
         modification of files in Flash memory does not affect a running application. Any changes to files in
         Flash memory are taken into account at the next reboot.
EIO0000001462 11/2015                                                                                                25
Memory Mapping
Introduction
       This section describes the RAM (Random Access Memory) size for different areas of the Modicon
       M251 Logic Controller.
Memory Mapping
       The RAM size is 64 Mbytes.
       The RAM is composed of 2 areas:
        dedicated application memory
        OS memory
26                                                                                          EIO0000001462 11/2015
                                                                                                Memory Mapping
          Variables                    Description
          PLC_R                        Structure of controller read-only system variables.
          PLC_W                        Structure of controller read/write system variables.
          ETH_R                        Structure of Ethernet read-only system variables.
          ETH_W                        Structure of Ethernet read/write system variables.
          PROFIBUS_R                   Structure of PROFIBUS DP read-only system variables.
          SERIAL_R                     Structure of Serial Lines read-only system variables.
          SERIAL_W                     Structure of Serial Lines read/write system variables.
          TM3_MODULE_R                 Structure of TM3 modules read-only system variables.
For more information on system and diagnostic variables, refer to M251 PLCSystem Library Guide.
Memory Addressing
         This table describes the memory addressing for the address sizes Double Word (%MD), Word
         (%MW), Byte (%MB), and Bit (%MX):
EIO0000001462 11/2015                                                                                       27
Memory Mapping
Introduction
       The Flash memory contains the file system used by the controller.
File Type
       The Modicon M251 Logic Controller manages the following file types:
       Type                      Description
       Boot application          This file resides in Flash memory and contains the compiled binary code of the
                                 executable application. Each time the controller is rebooted, the executable
                                 application is extracted from the boot application and copied into the controller
                                 RAM (1).
       Application source        Source file that can be uploaded from Flash memory to the PC if the source file is
                                 not available on the PC (2).
       Post configuration        File that contains Ethernet, serial line, and firewall parameters.
                                 The parameters specified in the file override the parameters in the Executable
                                 application at each reboot.
       Data logging              Files in which the controller logs events as specified by the user application.
       HTML page                 HTML pages displayed by the web server for the website embedded in the
                                 controller.
       Operating System (OS)     Controller firmware that can be written to Flash memory. The firmware file is
                                 applied at next reboot of the controller.
       Retain variable           Remanent variables
       Retain-persistent
       variable
       (1) The creation of a boot application is optional in SoMachine, according to application properties. Default
           option is to create the boot application on download. When you download an application from SoMachine
           to the controller, you are transferring only the binary executable application directly to RAM.
       (2) SoMachine does not support uploading of either the executable application or the boot application to a PC
           for modification. Program modifications must be made to the application source. When you download your
           application, you have the option to store the source file to Flash memory.
28                                                                                               EIO0000001462 11/2015
                                                                                                    Memory Mapping
File Organization
            This table shows the file organization of the flash memory:
Cfg Machine.cfg (2) Post configuration file (see page 201) Configuration
EIO0000001462 11/2015                                                                                           29
Memory Mapping
           Fdr/FDRS (3)    Device1.prm                 Parameter files stored by the FDR client FDR
           only for                                    device1                                  (see page 175)
           TM251MESE       Device2.prm                 Parameter files stored by the FDR client
                                                       device2
                           ...                         –
/data      –               –                           Retained and persistent data               –
/sd0       –               –                           SD card. Removable                         –
           –               User files                  –                                          –
(1)
     : v_XX.YY represents the version
(2):   if any
(3)
     : the Fdr/FDRS directory is hidden
            NOTE: Use the sysFile, sysDir and CAAFile libraries to access /sd0, and /usr. For more information
            on the function blocks of these libraries, refer to the CoDeSys Libraries topic in the SoMachine
            online help.
30                                                                                                EIO0000001462 11/2015
                                                                                               Memory Mapping
                                                    NOTICE
          LOSS OF DATA
          Back up your *.log files to an SD card on a regular schedule that avoids saturating the available
          free space in your controller file system.
          Failure to follow these instructions can result in equipment damage.
EIO0000001462 11/2015                                                                                        31
Memory Mapping
Relocation Table
Introduction
       The Relocation Table allows you to organize data to optimize communication between the
       controller and other equipment by regrouping non-contiguous data into a contiguous table of
       located registers, accessible through Modbus.
       NOTE: A relocation table is considered as an object. Only one relocation table object can be added
       to a controller.
       Register                   Description
       60200...61999              Dynamic Memory Area: Read Relocation Table
       62200...63999              Dynamic Memory Area: Write Relocation Table
       Step        Action
           1       Select the Application node in the Applications tree tab.
           2
                   Click      .
           3       Click Add other objects → Relocation Table....
                   Result: The Add Relocation Table window is displayed.
           4       Click Add.
                   Result: The new relocation table is created and initialized.
                   NOTE: As a Relocation Table is unique for a controller, its name is Relocation Table and
                   cannot be changed.
32                                                                                          EIO0000001462 11/2015
                                                                                            Memory Mapping
EIO0000001462 11/2015                                                                                   33
Memory Mapping
Erase Empty Item Removes all the elements of the list for which the "Variable" column is empty.
       NOTE: If a variable is undefined after program modifications, the content of the cell is displayed in
       red, the related Validity cell is False, and Address is set to -1.
34                                                                                                EIO0000001462 11/2015
         Modicon M251 Logic Controller
         Tasks
         EIO0000001462 11/2015
         Chapter 6
         Tasks
Tasks
Introduction
         The Task Configuration node in the Applications tree allows you to define one or more tasks to
         control the execution of your application program.
         The task types available are:
          Cyclic
          Freewheeling
          Event
          External event
         This chapter begins with an explanation of these task types and provides information regarding the
         maximum number of tasks, the default task configuration, and task prioritization. In addition, this
         chapter introduces the system and task watchdog functions and explains its relationship to task
         execution.
EIO0000001462 11/2015                                                                                     35
Tasks
36                                                                                       EIO0000001462 11/2015
                                                                                                     Tasks
Screen Description
         This screen allows you to configure the tasks. Double-click the task that you want to configure in
         the Applications tree to access this screen.
         Each configuration task has its own parameters that are independent of the other tasks.
         The Configuration window is composed of 4 parts:
EIO0000001462 11/2015                                                                                   37
Tasks
                        NOTE: Do not assign tasks with the same priority. If there are yet other tasks that attempt
                        to pre-empt tasks with the same priority, the result could be indeterminate and unpredicable.
                        For important safety information, refer to Task Priorities (see page 43).
        Type            These task types are available:
                         Cyclic (see page 39)
                         Event (see page 41)
                         External (see page 41)
                         Freewheeling (see page 40)
        Watchdog        To configure the watchdog (see page 42), define these 2 parameters:
                         Time: enter the timeout before watchdog execution.
                         Sensitivity: defines the number of expirations of the watchdog timer before the
                           controller stops program execution and enters a HALT state.
        POUs            The list of POUs (see SoMachine, Programming Guide) (Programming Organization Units)
                        controlled by the task is defined in the task configuration window:
                         To add a POU linked to the task, use the command Add Call and select the POU in the
                           Input Assistant editor.
                         To remove a POU from the list, use the command Remove Call.
                         To replace the currently selected POU of the list by another one, use the command
                           Change Call.
                         POUs are executed in the order shown in the list. To move the POUs in the list,
                           select a POU and use the command Move Up or Move Down.
                        NOTE: You can create as many POUs as you want. An application with several small
                        POUs, as opposed to one large POU, can improve the refresh time of the variables in online
                        mode.
38                                                                                                EIO0000001462 11/2015
                                                                                                          Tasks
Task Types
Introduction
         The following section describes the various task types available for your program, along with a
         description of the task type characteristics.
Cyclic Task
         A Cyclic task is assigned a fixed cycle time using the Interval setting in the Type section of
         Configuration subtab for that task. Each Cyclic task type executes as follows:
         1. Read Inputs: The physical input states are written to the %I input memory variables and other
            system operations are executed.
         2. Task Processing: The user code (POU, and so on) defined in the task is processed. The %Q
            output memory variables are updated according to your application program instructions but not
            yet written to the physical outputs during this operation.
         3. Write Outputs: The %Q output memory variables are modified with any output forcing that has
            been defined; however, the writing of the physical outputs depends upon the type of output and
            instructions used.
            For more information on defining the bus cycle task, refer to the SoMachine Programming Guide
            and Modicon M251 Logic Controller Settings (see page 73).
         4. Remaining Interval time: The controller firmware carries out system processing and any other
            lower priority tasks.
         NOTE: If you define too short a period for a cyclic task, it will repeat immediately after the write of
         the outputs and without executing other lower priority tasks or any system processing. This will
         affect the execution of all tasks and cause the controller to exceed the system watchdog limits,
         generating a system watchdog exception.
         NOTE: When the task cycle time is set to a value less than 3 ms, the actual task duration should
         first be monitored through the Task Monitoring screen during commissioning to ensure that it is
         consistently lower than the configured task cycle time. If greater, the task cycle may not be
         respected without causing a task cycle watchdog time-out and the controller transitioning to a
         HALT state. To avoid this condition to a certain degree, when the task cycle time is set to a value
         of less than 3 ms, real limits of +1 ms are imposed if, on any given cycle, the calculated cycle time
         slightly exceeds the configured cycle time.
         NOTE: Get and set the interval of a Cyclic Task by application using the GetCurrentTaskCycle
         and SetCurrentTaskCycle function. (Refer to Toolbox Advance Library Guide for further details.)
EIO0000001462 11/2015                                                                                        39
Tasks
Freewheeling Task
        A Freewheeling task does not have a fixed duration. In Freewheeling mode, each task scan begins
        when the previous scan has been completed and after a short period of system processing. Each
        Freewheeling task type executes as follows:
        1. Read Inputs: The physical input states are written to the %I input memory variables and other
           system operations are executed.
        2. Task Processing: The user code (POU, and so on) defined in the task is processed. The %Q
           output memory variables are updated according to your application program instructions but not
           yet written to the physical outputs during this operation.
        3. Write Outputs: The %Q output memory variables are modified with any output forcing that has
           been defined; however, the writing of the physical outputs depends upon the type of output and
           instructions used.
           For more information on defining the bus cycle task, refer to the SoMachine Programming Guide
           and Modicon M251 Logic Controller Settings (see page 73).
        4. System Processing: The controller firmware carries out system processing and any other
           lower priority tasks (for example: HTTP management, Ethernet management, parameters
           management).
40                                                                                     EIO0000001462 11/2015
                                                                                                                Tasks
Event Task
         This type of task is event-driven and is initiated by a program variable. It starts at the rising edge
         of the boolean variable associated to the trigger event unless pre-empted by a higher priority task.
         In that case, the Event task will start as dictated by the task priority assignments.
         For example, if you have defined a variable called my_Var and would like to assign it to an Event,
         proceed as follows:
          Step      Action
               1    Double-click the TASK in the Applications tree.
               2    Select Event from the Type list in the Configuration tab.
               3
                    Click the Input Assistant button      to the right of the Event field.
                    Result: The Input Assistant window appears.
               4    Navigate in the tree of the Input Assistant dialog box to find and assign the my_Var variable.
         NOTE: When the event task is triggered at a too high frequency, the controller will go to the HALT
         state (Exception). The maximum acceptable rate of events is 5 events per millisecond. In this
         situation, the message 'ISR Count Exceeded' is logged in the application log page.
EIO0000001462 11/2015                                                                                                41
Tasks
Introduction
        Two types of watchdog functionality are implemented for the Modicon M251 Logic Controller:
           System Watchdogs: These watchdogs are defined in and managed by the controller firmware.
            These are not configurable by the user.
           Task Watchdogs: These watchdogs are optional watchdogs that you can define for each task.
            These are managed by your application program and are configurable in SoMachine.
System Watchdogs
        Three system watchdogs are defined for the Modicon M251 Logic Controller. They are managed
        by the controller firmware and are therefore sometimes referred to as hardware watchdogs in the
        SoMachine online help. When one of the system watchdogs exceeds its threshold conditions, an
        error is detected.
        The threshold conditions for the 3 system watchdogs are defined as follows:
         If all of the tasks require more than 85% of the processor resources for more than 3 seconds, a
          system error is detected. The controller enters the HALT state.
         If the total execution time of the tasks with priorities between 0 and 24 reaches 100% of
          processor resources for more than 1 second, an application error is detected. The controller
          responds with an automatic reboot into the EMPTY state.
         If the lowest priority task of the system is not executed during an interval of 10 seconds, a
          system error is detected. The controller responds with an automatic reboot into the EMPTY
          state.
        NOTE: System watchdogs are not configurable by the user.
Task Watchdogs
        SoMachine allows you to configure an optional task watchdog for every task defined in your
        application program. (Task watchdogs are sometimes also referred to as software watchdogs or
        control timers in the SoMachine online help). When one of your defined task watchdogs reaches
        its threshold condition, an application error is detected and the controller enters the HALT state.
        When defining a task watchdog, the following options are available:
         Time: This defines the allowable maximum execution time for a task. When a task takes longer
          than this, the controller will report a task watchdog exception.
         Sensitivity: The sensitivity field defines the number of task watchdog exceptions that must
          occur before the controller detects an application error.
        To access the configuration of a task watchdog, double-click the Task in the Applications tree.
        NOTE: For more information on watchdogs, refer to SoMachine Programming Guide.
42                                                                                       EIO0000001462 11/2015
                                                                                                         Tasks
Task Priorities
                                                     WARNING
          UNINTENDED EQUIPMENT OPERATION
          Do not assign the same priority to different tasks.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
         Inputs are read from the I/O image table at the beginning of the task cycle. Outputs are written to
         the I/O image table at the end of the task.
         NOTE: Event tasks cannot drive the TM3/TM2 bus cycle.
EIO0000001462 11/2015                                                                                        43
Tasks
44                                                                                          EIO0000001462 11/2015
         Modicon M251 Logic Controller
         Controller States and Behaviors
         EIO0000001462 11/2015
         Chapter 7
         Controller States and Behaviors
Introduction
         This chapter provides you with information on controller states, state transitions, and behaviors in
         response to system events. It begins with a detailed controller state diagram and a description of
         each state. It then defines the relationship of output states to controller states before explaining the
         commands and events that result in state transitions. It concludes with information about
         Remanent variables and the effect of SoMachine task programming options on the behavior of
         your system.
EIO0000001462 11/2015                                                                                          45
Controller States and Behaviors
        Section 7.1
        Controller State Diagram
46                                 EIO0000001462 11/2015
                                                                 Controller States and Behaviors
EIO0000001462 11/2015                                                                        47
Controller States and Behaviors
         Legend:
          Controller states are indicated in ALL-CAPS BOLD
          User and application commands are indicated in Bold
          System events are indicated in Italics
          Decisions, decision results, and general information are indicated in normal text
         (1)
               For details on STOPPED to RUNNING state transition, refer to Run Command (see page 59).
         (2)   For details on RUNNING to STOPPED state transition, refer to Stop Command (see page 59).
Note 1
         The Power Cycle (Power Interruption followed by a Power ON) deletes all output forcing settings.
         Refer to Controller State and Output Behavior (see page 56) for further details.
Note 2
         The outputs will assume their initialization states.
Note 3
         In some cases, when a system error is detected, it will cause the controller to reboot automatically
         into the EMPTY state as if no Boot application were present in the Flash memory. However, the
         Boot application is not deleted from the Flash memory. In this case, the ERR LED (Red) flashes
         regularly.
Note 4
         After verification of a valid Boot application the following events occur:
          The application is loaded into RAM.
          The Post Configuration (see page 201) file settings (if any) are applied.
         During the load of the boot application, a Check context test occurs to assure that the Remanent
         variables are valid. If the Check context test is invalid, the boot application will load but the
         controller will assume STOPPED state (see page 62).
Note 5a
         The Starting Mode is set in the PLC settings tab of the Controller Device Editor (see page 73).
Note 5b
         Not applicable
Note 6
         During a successful application download the following events occur:
          The application is loaded directly into RAM.
          By default, the Boot application is created and saved into the Flash memory.
48                                                                                         EIO0000001462 11/2015
                                                                                 Controller States and Behaviors
Note 7
         The default behavior after downloading an application program is for the controller to enter the
         STOPPED state irrespective of the switch position or the last controller state before the download.
         However, there are 2 considerations in this regard:
         Online Change: An online change (partial download) initiated while the controller is in the
           RUNNING state returns the controller to the RUNNING state if successful and provided the
           Run/Stop switch is set to Run. Before using the Login with online change option, test the
           changes to your application program in a virtual or non-production environment and confirm that
           the controller and attached equipment assume their expected conditions in the RUNNING state.
                                                       WARNING
              UNINTENDED EQUIPMENT OPERATION
              Always verify that online changes to a RUNNING application program operate as expected
              before downloading them to controllers.
              Failure to follow these instructions can result in death, serious injury, or equipment
              damage.
             NOTE: Online changes to your program are not automatically written to the Boot application,
             and will be overwritten by the existing Boot application at the next reboot. If you wish your
             changes to persist through a reboot, manually update the Boot application by selecting Create
             boot application in the online menu (the controller must be in the STOPPED state to achieve
             this operation).
         Multiple Download: SoMachine has a feature that allows you to perform a full application
           download to multiple targets on your network or fieldbus. One of the default options when you
           select the Multiple Download... command is the Start all applications after download or
           online change option, which restarts all download targets in the RUNNING state, irrespective
           of their last controller state before the multiple download was initiated. Deselect this option if you
           do not want all targeted controllers to restart in the RUNNING state. In addition, before using
           the Multiple Download option, test the changes to your application program in a virtual or non-
           production environment and confirm that the targeted controllers and attached equipment
           assume their expected conditions in the RUNNING state.
                                                       WARNING
              UNINTENDED EQUIPMENT OPERATION
              Always verify that your application program will operate as expected for all targeted controllers
              and equipment before issuing the "Multiple Download..." command with the "Start all
              applications after download or online change" option selected.
              Failure to follow these instructions can result in death, serious injury, or equipment
              damage.
EIO0000001462 11/2015                                                                                        49
Controller States and Behaviors
           NOTE: During a multiple download, unlike a normal download, SoMachine does not offer the
           option to create a Boot application. You can manually create a Boot application at any time by
           selecting Create boot application in the Online menu on all targeted controllers (the controller
           must be in the STOPPED state for this operation).
Note 8
         The SoMachine software platform allows many powerful options for managing task execution and
         output conditions while the controller is in the STOPPED or HALT states. Refer to Controller States
         Description (see page 51) for further details.
Note 9
         To exit the HALT state it is necessary to issue one of the Reset commands (Reset Warm, Reset
         Cold, Reset Origin), download an application or cycle power.
         In case of non-recoverable event (hardware watchdog or internal error), a cycle power is
         mandatory.
Note 10
         The RUNNING state has 2 exception conditions:
          RUNNING with External Error: this exception condition is indicated by the I/O LED, which
           displays solid Red. You may exit this state by clearing the external error (probably changing the
           application configuration). No controller commands are required.
          RUNNING with Breakpoint: this exception condition is indicated by the RUN LED, which
           displays a single flash. Refer to Controller States Description (see page 51) for further details.
Note 11
         The boot application can be different from the application loaded. It can happen when the boot
         application was downloaded through SD card, FTP, or file transfer or when an online change was
         performed without creating the boot application.
50                                                                                         EIO0000001462 11/2015
                                                                                             Controller States and Behaviors
         Section 7.2
         Controller States Description
Introduction
         This section provides a detailed description of the controller states.
                                                                WARNING
            UNINTENDED EQUIPMENT OPERATION
                        Never assume that your controller is in a certain controller state before commanding a change
                         of state, configuring your controller options, uploading a program, or modifying the physical
                         configuration of the controller and its connected equipment.
                        Before performing any of these operations, consider the effect on all connected equipment.
                        Before acting on a controller, always positively confirm the controller state by viewing its LEDs,
                         verifying the presence of output forcing, and reviewing the controller status information via
                         SoMachine.(1)
            Failure to follow these instructions can result in death, serious injury, or equipment
            damage.
         (1)
                     The controller states can be read in the PLC_R.i_wStatus system variable of the M251
                     PLCSystem library (see Modicon M251 Logic Controller, System Functions and Variables,
                     PLCSystem Library Guide)
EIO0000001462 11/2015                                                                                                    51
Controller States and Behaviors
52                                                                                               EIO0000001462 11/2015
                                                                                     Controller States and Behaviors
This figure shows the difference between the regular flash and single flash:
EIO0000001462 11/2015                                                                                             53
Controller States and Behaviors
54                                                                                       EIO0000001462 11/2015
                                                                             Controller States and Behaviors
         Section 7.3
         State Transitions and System Events
Overview
         This section begins with an explanation of the output states possible for the controller. It then
         presents the system commands used to transition between controller states and the system events
         that can also affect these states. It concludes with an explanation of the Remanent variables, and
         the circumstances under which different variables and data types are retained through state
         transitions.
EIO0000001462 11/2015                                                                                     55
Controller States and Behaviors
Introduction
        The Modicon M251 Logic Controller defines output behavior in response to commands and system
        events in a way that allows for greater flexibility. An understanding of this behavior is necessary
        before discussing the commands and events that affect controller states. For example, typical
        controllers define only 2 options for output behavior in stop: fallback to default value or keep current
        value.
        The possible output behaviors and the controller states to which they apply are:
         managed by Application Program
         keep Current Values
         set All Outputs to Default
         hardware Initialization Values
         software Initialization Values
         Output Forcing
56                                                                                           EIO0000001462 11/2015
                                                                                Controller States and Behaviors
Output Forcing
         The controller allows you to force the state of selected outputs to a defined value for the purposes
         of system testing, commissioning, and maintenance.
         You are only able to force the value of an output while your controller is connected to SoMachine.
         To do so, use the Force values command in the Debug menu.
         Output forcing overrides all other commands to an output irrespective of the task programming that
         is being executed.
         When you logout of SoMachine when output forcing has been defined, you are presented with the
         option to retain output forcing settings. If you select this option, the output forcing continues to
         control the state of the selected outputs until you download an application or use one of the Reset
         commands.
         When the option Update I/O while in stop, if supported by your controller, is checked (default
         state), the forced outputs keep the forcing value even when the logic controller is in STOP.
EIO0000001462 11/2015                                                                                       57
Controller States and Behaviors
                                                    WARNING
         UNINTENDED EQUIPMENT OPERATION
            You must have a thorough understanding of how forcing will affect the outputs relative to the
             tasks being executed.
            Do not attempt to force I/O that is contained in tasks that you are not certain will be executed
             in a timely manner, unless your intent is for the forcing to take affect at the next execution of
             the task whenever that may be.
            If you force an output and there is no apparent affect on the physical output, do not exit
             SoMachine without removing the forcing.
         Failure to follow these instructions can result in death, serious injury, or equipment
         damage.
58                                                                                          EIO0000001462 11/2015
                                                                            Controller States and Behaviors
Run Command
         Effect: Commands a transition to the RUNNING controller state.
         Starting Conditions: BOOTING or STOPPED state.
         Methods for Issuing a Run Command:
          Run/Stop switch goes from stop to run.
          SoMachine Online Menu: Select the Start command.
          RUN command from Web Server
          By an external call via Modbus request using the PLC_W.q_wPLCControl and
           PLC_W.q_uiOpenPLCControl system variables of the M251 PLCSystem library.
          Login with online change option: An online change (partial download) initiated while the
           controller is in the RUNNING state returns the controller to the RUNNING state if successful.
          Multiple Download Command: sets the controllers into the RUNNING state if the Start all
           applications after download or online change option is selected, irrespective of whether the
           targeted controllers were initially in the RUNNING, STOPPED, HALT, or EMPTY state.
          The controller is restarted into the RUNNING state automatically under certain conditions.
Stop Command
         Effect: Commands a transition to the STOPPED controller state.
         Starting Conditions: BOOTING, EMPTY, or RUNNING state.
         Methods for Issuing a Stop Command:
          Run/Stop switch goes from run to stop.
          SoMachine Online Menu: Select the Stop command.
          STOP command from WebServer
          By an internal call by the application or an external call via Modbus request using the PLC_W.
           q_wPLCControl and PLC_W. q_uiOpenPLCControl system variables of the M251 PLCSystem
           library.
          Login with online change option: An online change (partial download) initiated while the
           controller is in the STOPPED state returns the controller to the STOPPED state if successful.
          Download Command: implicitly sets the controller into the STOPPED state.
          Multiple Download Command: sets the controllers into the STOPPED state if the Start all
           applications after download or online change option is not selected, irrespective of whether
           the targeted controllers were initially in the RUNNING, STOPPED, HALT, or EMPTY state.
          REBOOT by Script: The file transfer script on an SD card can issue a REBOOT as its final
           command. The controller will be rebooted into the STOPPED state provided the other conditions
           of the boot sequence allow this to occur. Refer to Reboot (see page 62) for further details.
          The controller is restarted into the STOPPED state automatically under certain conditions.
EIO0000001462 11/2015                                                                                   59
Controller States and Behaviors
Reset Warm
        Effect: Resets all variables, except for the remanent variables, to their default values. Places the
        controller into the STOPPED state.
        Starting Conditions: RUNNING, STOPPED, or HALT states.
        Methods for Issuing a Reset Warm Command:
         SoMachine Online Menu: Select the Reset warm command.
         By an internal call by the application or an external call via Modbus request using the PLC_W.
          q_wPLCControl and PLC_W. q_uiOpenPLCControl system variables of the M251 PLCSystem
          library.
        Effects of the Reset Warm Command:
        1. The application stops.
        2. Forcing is erased.
        3. Diagnostic indications for errors are reset.
        4. The values of the retain variables are maintained.
        5. The values of the retain-persistent variables are maintained.
        6. All non-located and non-remanent variables are reset to their initialization values.
        7. The values of the first 1000 %MW registers are maintained.
        8. The values of %MW1000 to %MW59999 registers are reset to 0.
        9. All fieldbus communications are stopped and then restarted after the reset is complete.
        10.All I/O are briefly reset to their initialization values and then to their user-configured default
           values.
        11.The Post Configuration (see page 201) file is read.
        For details on variables, refer to Remanent Variables (see page 66).
Reset Cold
        Effect: Resets all variables, except for the retain-persistent type of remanent variables, to their
        initialization values. Places the controller into the STOPPED state.
        Starting Conditions: RUNNING, STOPPED, or HALT states.
        Methods for Issuing a Reset Cold Command:
         SoMachine Online Menu: Select the Reset cold command.
         By an internal call by the application or an external call via Modbus request using the PLC_W.
          q_wPLCControl and PLC_W. q_uiOpenPLCControl system variables of the M251 PLCSystem
          library.
        Effects of the Reset Cold Command:
        1. The application stops.
        2. Forcing is erased.
        3. Diagnostic indications for errors are reset.
        4. The values of the retain variables are reset to their initialization value.
        5. The values of the retain-persistent variables are maintained.
        6. All non-located and non-remanent variables are reset to their initialization values.
        7. The values of the first 1000 %MW registers are maintained.
        8. The values of %MW1000 to %MW59999 registers are reset to 0.
60                                                                                            EIO0000001462 11/2015
                                                                                  Controller States and Behaviors
         9. All fieldbus communications are stopped and then restarted after the reset is complete.
         10.All I/O are briefly reset to their initialization values and then to their user-configured default
            values.
         11.The Post Configuration file is read (see page 201).
         For details on variables, refer to Remanent Variables (see page 66).
Reset Origin
         Effect: Resets all variables, including the remanent variables, to their initialization values. Erases
         all user files on the controller. Places the controller into the EMPTY state.
         Starting Conditions: RUNNING, STOPPED, or HALT states.
         Methods for Issuing a Reset Origin Command:
          SoMachine Online Menu: Select the Reset origin command.
         Effects of the Reset Origin Command:
         1. The application stops.
         2. Forcing is erased.
         3. All user files (Boot application, data logging, Post Configuration) are erased.
         4. Diagnostic indications for errors are reset.
         5. The values of the retain variables are reset.
         6. The values of the retain-persistent variables are reset.
         7. All non-located and non-remanent variables are reset.
         8. The values of the first 1000 %MW registers are reset to 0.
         9. The values of %MW1000 to %MW59999 registers are reset to 0.
         10.All fieldbus communications are stopped.
         11.All I/O are reset to their initialization values.
         For details on variables, refer to Remanent Variables (see page 66).
EIO0000001462 11/2015                                                                                            61
Controller States and Behaviors
Reboot
         Effect: Commands a reboot of the controller.
         Starting Conditions: Any state.
         Methods for Issuing the Reboot Command:
          Power cycle
          REBOOT by Script
62                                                                                            EIO0000001462 11/2015
                                                                                  Controller States and Behaviors
         9. All fieldbus communications are stopped and restarted after the boot application is loaded
            successfully.
         10.All I/O are reset to their initialization values and then to their user-configured default values if
            the controller assumes a STOPPED state after the reboot.
         11.The Post Configuration file is read (see page 201).
         For details on variables, refer to Remanent Variables (see page 66).
         NOTE: The Check context test concludes that the context is valid when the application and the
         remanent variables are the same as defined in the Boot application.
         NOTE: If you make an online change to your application program while your controller is in the
         RUNNING or STOPPED state but do not manually update your Boot application, the controller will
         detect a difference in context at the next reboot, the remanent variables will be reset as per a Reset
         cold command, and the controller will enter the STOPPED state.
Download Application
         Effect: Loads your application executable into the RAM memory. Optionally, creates a Boot
         application in the Flash memory.
         Starting Conditions: RUNNING, STOPPED, HALT, and EMPTY states.
         Methods for Issuing the Download Application Command:
          SoMachine:
           2 options exist for downloading a full application:
            Download command.
            Multiple Download command.
             For important information on the application download commands, refer to Controller State
             Diagram.
            FTP: Load Boot application file to the Flash memory using FTP. The updated file is applied at
             the next reboot.
            SD card: Load Boot application file using an SD card in the controller SD card slot. The updated
             file is applied at the next reboot. Refer to File Transfer with SD Card for further details.
         Effects of the SoMachine Download Command:
         1. The existing application stops and then is erased.
         2. If valid, the new application is loaded and the controller assumes a STOPPED state.
         3. Forcing is erased.
         4. Diagnostic indications for errors are reset.
         5. The values of the retain variables are reset to their initialization values.
         6. The values of any existing retain-persistent variables are maintained.
         7. All non-located and non-remanent variables are reset to their initialization values.
         8. The values of the first 1000 %MW registers are maintained.
         9. The values of %MW1000 to %MW59999 registers are reset to 0.
         10.All fieldbus communications are stopped and then any configured fieldbus of the new
            application is started after the download is complete.
EIO0000001462 11/2015                                                                                         63
Controller States and Behaviors
        11.All I/O are reset to their initialization values and then set to the new user-configured default
           values after the download is complete.
        12.The Post Configuration file is read (see page 201).
        For details on variables, refer to Remanent Variables (see page 66).
        Effects of the FTP or SD Card Download Command:
        There are no effects until the next reboot. At the next reboot, the effects are the same as a reboot
        with an invalid context. Refer to Reboot (see page 62).
64                                                                                         EIO0000001462 11/2015
                                                                                        Controller States and Behaviors
Error Management
         The controller detects and manages three types of errors:
          external errors
          application errors
          system errors
NOTE: Refer to the M251 PLCSystem library Guide for more detailed information on diagnostics.
EIO0000001462 11/2015                                                                                                 65
Controller States and Behaviors
Remanent Variables
Overview
        Remanent variables retain their values in the event of power outages, reboots, resets, and
        application program downloads. There are multiple types of remanent variables, declared
        individually as "retain" or "persistent", or in combination as "retain-persistent".
        NOTE: For this controller, variables declared as persistent have the same behavior as variables
        declared as retain-persistent.
        This table describes the behavior of remanent variables in each case:
        NOTE: The first 1000 %MW are automatically retained and persistent if no variable is associated to
        them. Their values are kept after a reboot / Reset warm / Reset cold. The other %MW are managed
        as VAR.
        For example, if you have in your program:
        VAR myVariable AT %MW0 : WORD; END_VAR
        %MW0 will behave like myVariable (not retained and not persistent).
66                                                                                      EIO0000001462 11/2015
                                                                                Controller States and Behaviors
          Step          Action
               1        Select the Application node in the Applications tree.
               2
                        Click    .
               3        Choose Add other objects → Persistent variables
               4        Click Add.
                        Result: The PersistentVars window is displayed.
EIO0000001462 11/2015                                                                                       67
Controller States and Behaviors
68                                EIO0000001462 11/2015
         Modicon M251 Logic Controller
         Controller Device Editor
         EIO0000001462 11/2015
         Chapter 8
         Controller Device Editor
Introduction
         This chapter describes how to configure the controller.
EIO0000001462 11/2015                                                     69
Controller Device Editor
Controller Parameters
Controller Parameters
        To open the device editor, double-click MyController in the Devices tree:
Tabs Description
70                                                                                                  EIO0000001462 11/2015
                                                                                        Controller Device Editor
          Services           Lets you configure the online services of the controller            Online mode
          (see page 75)      (RTC, device identification).                                       only
          I/O Mapping        Mapping of the input and output channels of an I/O device on project –
                             (application) variables.
          Task deployment    Displays a list of I/Os and their assignments to tasks.             After
                                                                                                 compilation
                                                                                                 only
          Users and Groups   The Users and Groups tab is provided for devices supporting online –
                             user management. It allows setting up users and access-rights
                             groups and assigning them access rights to control the access on
                             SoMachine projects and devices in online mode.
                             For more details, refer to the SoMachine Programming Guide.
          Status             No information delivered.                                           –
          Information        Displays general information about the device (name, description,   –
                             provider, version, image).
EIO0000001462 11/2015                                                                                          71
Controller Device Editor
Controller Selection
Introduction
        This tab allows you to manage the connection from the PC to the controller:
         Helping you find a controller in a network.
         Presenting the list of controllers, so you can connect to the selected controller and manage the
          application inside the controller.
         Helping you physically identify the controller from the device editor.
         Helping you change the communication settings of the controller.
72                                                                                        EIO0000001462 11/2015
                                                                                              Controller Device Editor
PLC Settings
Overview
         The figure below presents the PLC Settings tab:
Element                              Description
Application for I/O handling         By default, set to Application because there is only one application in the
                                     controller.
PLC settings Update IO while in      If this option is activated (default), the values of the input and output channels
             stop                    get also updated when the controller is stopped.
                  Behavior for       From the selection list, choose one of the following options to configure how the
                  outputs in Stop    values at the output channels should be handled in case of controller stop:
                                      Keep current values
                                      Set all outputs to default
                  Update all         If this option is activated, then for all devices of the current controller
                  variables in all   configuration all I/O variables will get updated in each cycle of the bus cycle
                  devices            task. This corresponds to the option Always update variables, which can be
                                     set separately for each device in the I/O Mapping dialog.
Bus cycle         Bus cycle task     This configuration setting is the parent for all Bus cycle task parameters used
options                              in the application device tree.
                                     Some devices with cyclic calls, such as a CANopen manager, can be attached
                                     to a specific task. In the device, when this setting is set to Use parent bus
                                     cycle setting, the setting set for the controller is used.
                                     The selection list offers all tasks currently defined in the active application.
                                     The default setting is the MAST task.
                                     NOTE: <unspecified> means that the task is in "slowest cyclic task" mode.
EIO0000001462 11/2015                                                                                                73
Controller Device Editor
Element                             Description
Additional       Generate force     Not used.
settings         variables for IO
                 mapping
                 Enable Diagnosis   Not used.
                 for devices
Starting         Starting mode      This option defines the starting mode on a power-on. For further information,
mode                                refer to State behavior diagram (see page 47).
Options                             Select with this option one of these starting modes:
                                     Start as previous state
                                     Start in stop
                                     Start in run
74                                                                                             EIO0000001462 11/2015
                                                                                           Controller Device Editor
Services
Services Tab
         The Services tab is divided in 3 parts:
          RTC Configuration
          Device Identification
          Post Configuration
          Element                              Description
          RTC             PLC time             Displays the date/time read from the controller. This read-only field
          Configuration                        is initially empty. To read and display the date/time saved on the
                                               controller, click the Read button.
                          Local time           Lets you define a date and a time that are sent to the controller by
                                               clicking the Write button. A message box informs you on the
                                               success of the command. Local time fields are initialized with the
                                               current PC settings.
                          Synchronize with     Lets you directly send the current PC settings. A message box
                          local date/time      informs you on the success of the command.
EIO0000001462 11/2015                                                                                             75
Controller Device Editor
         Element                 Description
         Device Identification   Displays the Firmware version, the Boot Version, and the
                                 Coprocessor Version of the selected controller, if connected.
         Post Configuration      Displays the application parameters overwritten by the Post
                                 configuration (see page 201).
76                                                                              EIO0000001462 11/2015
         Modicon M251 Logic Controller
         Expansion Modules Configuration
         EIO0000001462 11/2015
         Chapter 9
         Expansion Modules Configuration
Overview
         This chapter describes how to configure the TM4, TM3, and TM2 expansion modules for the
         Modicon M251 Logic Controller.
EIO0000001462 11/2015                                                                              77
Expansion Modules Configuration
                                                    WARNING
        UNINTENDED EQUIPMENT OPERATION
        Update the configuration of your program each time you add or delete any type of I/O expansions
        on your I/O bus, or you add or delete any devices on your field bus.
        Failure to follow these instructions can result in death, serious injury, or equipment
        damage.
78                                                                                           EIO0000001462 11/2015
                                                                                    Expansion Modules Configuration
Overview
         I/O bus configuration provides you the ability to select the task that drives TM3 and CANopen
         physical exchanges. It can also override the configuration defined in the PLC settings
         (see page 73).
          Step      Description
               1    Double-click IO_Bus in the Devices tree.
                    Result: The IO_Bus editor tab appears:
               2    Set the Bus cycle task from the list to either of the following:
                     Use parent bus cycle setting (default)
                       Sets the task for bus exchange as defined in the PLC settings.
                     MAST
                       Sets the Master task for bus exchange irrespective of the task defined in the PLC settings.
EIO0000001462 11/2015                                                                                                79
Expansion Modules Configuration
Introduction
        The Modicon M251 Logic Controller supports the TM4 communication expansion modules.
        For further information about the TM4 expansion modules configuration, refer to the TM4
        Expansion Modules Configuration Programming Guide.
                                                WARNING
        UNINTENDED EQUIPMENT OPERATION
           Only use software approved by Schneider Electric for use with this equipment.
           Update your application program every time you change the physical hardware configuration.
        Failure to follow these instructions can result in death, serious injury, or equipment
        damage.
80                                                                                   EIO0000001462 11/2015
                                                                          Expansion Modules Configuration
Introduction
         The Modicon M251 Logic Controller supports the following expansion modules:
          TM3 expansion modules
            Digital I/O modules
            Analog I/O modules
            Expert I/O modules
            Safety modules
            Transmitter and receiver modules
         For further information about the TM3 and TM2 expansion modules configuration, refer to the TM3
         Expansion Modules Configuration Programming Guide and TM2 Expansion Modules
         Configuration Programming Guide respectively.
                                                  WARNING
          UNINTENDED EQUIPMENT OPERATION
             Only use software approved by Schneider Electric for use with this equipment.
             Update your application program every time you change the physical hardware configuration.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
EIO0000001462 11/2015                                                                                 81
Expansion Modules Configuration
Presentation
        I/O expansion modules can be marked as optional in the configuration. The Optional module
        feature provides a more flexible configuration by the acceptance of the definition of modules that
        are not physically attached to the logic controller. Therefore, a single application can support
        multiple physical configurations of I/O expansion modules, allowing a greater degree of scalability
        without the necessity of maintaining multiple application files for the same application.
        Without the Optional module feature, when the logic controller starts up the I/O expansion bus
        (following a power cycle, application download or initialization command), it compares the
        configuration defined in the application with the physical I/O modules attached to the I/O bus.
        Among other diagnostics made, if the logic controller determines that there are I/O modules
        defined in the configuration that are not physically present on the I/O bus, an error is detected and
        the I/O bus does not start.
        With the Optional module feature, the logic controller ignores the absent I/O expansion modules
        that you have marked as optional, which then allows the logic controller to start the I/O expansion
        bus.
        The logic controller starts the I/O expansion bus at configuration time (following a power cycle,
        application download, or initialization command) even if optional expansion modules are not
        physically connected to the logic controller.
        The following module types can be marked as optional:
         TM3 I/O expansion modules
         TM2 I/O expansion modules
        NOTE: TM3 Transmitter/Receiver modules (TM3XTRA1 and the TM3XREC1) and TMC4
        cartridges cannot be marked as optional.
        You must be fully aware of the implications and impacts of marking I/O modules as optional in your
        application, both when those modules are physically absent and present when running your
        machine or process. Be sure to include this feature in your risk analysis.
                                                   WARNING
        UNINTENDED EQUIPMENT OPERATION
        Include in your risk analysis each of the variations of I/O configurations that can be realized
        marking I/O expansion modules as optional, and in particular the establishment of TM3 Safety
        modules (TM3S…) as optional I/O modules, and make a determination whether it is acceptable
        as it relates to your application.
        Failure to follow these instructions can result in death, serious injury, or equipment
        damage.
82                                                                                         EIO0000001462 11/2015
                                                                                   Expansion Modules Configuration
          Step          Action
               1        Add the expansion module to your controller.
               2        Double-click the expansion module in the Devices tree.
               3        Select the I/O Configuration tab
               4        In the Optional module line, select Yes in the Value column:
EIO0000001462 11/2015                                                                                          83
Expansion Modules Configuration
84                                                  EIO0000001462 11/2015
         Modicon M251 Logic Controller
         Ethernet Configuration
         EIO0000001462 11/2015
         Chapter 10
         Ethernet Configuration
Ethernet Configuration
Introduction
         This chapter describes how to configure the Ethernet network interface of the Modicon M251 Logic
         Controller.
EIO0000001462 11/2015                                                                                   85
Ethernet Configuration
        Section 10.1
        Ethernet Services
Ethernet Services
86                                                                            EIO0000001462 11/2015
                                                                                   Ethernet Configuration
Presentation
Ethernet Services
         The controller supports the following services:
          Modbus TCP Server (see page 94)
          Modbus TCP Client (see page 94)
          Web Server (see page 96)
          FTP Server (see page 109)
          SNMP (see page 111)
          M251 Logic Controller As Target Device On EtherNet/IP (see page 112)
          M251 Logic Controller As Slave Device On Modbus TCP (see page 154)
          IEC VAR ACCESS (see page 88)
Ethernet Protocols
         The controller supports the following protocols:
          IP (Internet Protocol)
          UDP (User Datagram Protocol)
          TCP (Transmission Control Protocol)
          ARP (Address Resolution Protocol)
          ICMP (Internet Control Messaging Protocol)
          IGMP (Internet Group Management Protocol)
EIO0000001462 11/2015                                                                                 87
Ethernet Configuration
Connections
        This table shows the maximum number of connections:
        NOTE: When at least one EtherNet/IP target is configured, the total number of connections
        (EtherNet/IP plus Modbus TCP) is limited to 16. Only if the Modbus TCP IOScanner is exclusively
        used may the total number of slave devices can be up to 64. These maximums are controlled for
        at build time.
        Each connection based on TCP manages its own set of connections as follows:
        1. When a client tries to open a connection that exceeds the poll size, the controller closes the
           oldest connection.
        2. If all connections are busy (exchange in progress) when a client tries to open a new one, the
           new connection is denied.
        3. All server connections stay open as long as the controller stays in operational states (RUNNING,
           STOPPED, HALT).
        4. All server connections are closed when leaving or entering operational states (RUNNING,
           STOPPED, HALT), except in case of power outage (because the controller does not have time to
           close the connections).
        Connections can be closed when the originator of the connection requests to close the connection
        it had previously opened.
Services Available
        With an Ethernet communication, the IEC VAR ACCESS service is supported by the controller.
        With the IEC VAR ACCESS service, data can be exchanged between the controller and an HMI.
        The NetWork variables service is also supported by the controller. With the NetWork variables
        service, data can be exchanged between controllers.
        NOTE: For more information, refer to the SoMachine Programming Guide.
88                                                                                       EIO0000001462 11/2015
                                                                                        Ethernet Configuration
IP Address Configuration
Introduction
         There are different ways to assign the IP address of the controller:
          address assignment by DHCP server
          address assignment by BOOTP server
          fixed IP address
          post configuration file (see page 201). If a post configuration file exists, this assignment method
           has priority over the others.
         The IP address can be changed dynamically:
          via the Controller Selection (see SoMachine, Programming Guide) tab in SoMachine.
         NOTE: If the attempted addressing method is unsuccessful, the controller will start using a default
         IP address (see page 92) derived from the MAC address.
         Carefully manage the IP addresses because each device on the network requires a unique
         address. Having multiple devices with the same IP address can cause unpredictable operation of
         your network and associated equipment.
                                                    WARNING
          UNINTENDED EQUIPMENT OPERATION
             Verify that there is only one master controller configured on the network or remote link.
             Verify that all devices have unique addresses.
             Obtain your IP address from your system administrator.
             Confirm that the IP address of the device is unique before placing the system into service.
             Do not assign the same IP address to any other equipment on the network.
             Update the IP address after cloning any application that includes Ethernet communications to
              a unique address.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
         NOTE: Verify that your system administrator maintains a record of all assigned IP addresses on
         the network and subnetwork, and inform the system administrator of all configuration changes
         performed.
EIO0000001462 11/2015                                                                                      89
Ethernet Configuration
Address Management
        The different types of address systems for the controller are shown in this diagram:
        NOTE: If a device programmed to use the DHCP or BOOTP addressing methods is unable to
        contact its respective server, the controller uses the default IP address. It will, however, constantly
        repeat its request.
        The IP process restarts in the following cases:
         Controller reboot
         Ethernet cable reconnection
         Application download (if IP parameters change)
         DHCP or BOOTP server detected after a prior addressing attempt was unsuccessful.
90                                                                                          EIO0000001462 11/2015
                                                                                        Ethernet Configuration
Ethernet Configuration
         In the Devices tree, double-click Ethernet_x:
EIO0000001462 11/2015                                                                                      91
Ethernet Configuration
Default IP Address
        The default IP addresses are:
         11.11.x.x. for Ethernet 1
         10.10.x.x. for Ethernet 2 (only available on TM251MESE)
Address Classes
        The IP address is linked:
         to a device (the host)
         to the network to which the device is connected
92                                                                                                EIO0000001462 11/2015
                                                                                                Ethernet Configuration
Subnet Mask
         The subnet mask is used to address several physical networks with a single network address. The
         mask is used to separate the subnetwork and the device address in the host ID.
         The subnet address is obtained by retaining the bits of the IP address that correspond to the
         positions of the mask containing 1, and replacing the others with 0.
         Conversely, the subnet address of the host device is obtained by retaining the bits of the IP
         address that correspond to the positions of the mask containing 0, and replacing the others with 1.
         Example of a subnet address:
NOTE: The device does not communicate on its subnetwork when there is no gateway.
Gateway Address
         The gateway allows a message to be routed to a device that is not on the current network.
         If there is no gateway, the gateway address is 0.0.0.0.
Security Parameters
EIO0000001462 11/2015                                                                                                93
Ethernet Configuration
Introduction
        Unlike Modbus serial link, Modbus TCP is not based on a hierarchical structure, but on a
        client/server model.
        The Modicon M251 Logic Controller implements both client and server services so that it can
        initiate communications to other controllers and I/O devices, and to respond to requests from other
        controllers, SCADA, HMIs, and other devices.
        Without any configuration, the embedded Ethernet port of the controller supports Modbus server.
        The Modbus client/server is included in the firmware and does not require any programming action
        from the user. Due to this feature, it is accessible in RUNNING, STOPPED and EMPTY states.
        For further information, refer to the Function Block Descriptions (see SoMachine, Modbus and
        ASCII Read/Write Functions, PLCCommunication Library Guide).
94                                                                                       EIO0000001462 11/2015
                                                                              Ethernet Configuration
Diagnostic Request
         This table contains the data selection code list:
EIO0000001462 11/2015                                                                            95
Ethernet Configuration
Web Server
Introduction
        The controller provides as a standard equipment an embedded Web server with a predefined
        factory built-in website. You can use the pages of the website for module setup and control as well
        as application diagnostics and monitoring. These pages are ready to use with a Web browser. No
        configuration or programming is required.
        The Web server can be accessed by the web browsers listed below:
         Google Chrome (version 30.0 or higher)
         Mozilla Firefox (version 1.5 or higher)
                                                    WARNING
         UNINTENDED EQUIPMENT OPERATION
            Define a secure password for the Web Server, and do not allow unauthorized or otherwise
             unqualified personnel to use this feature.
            Ensure that there is a local, competent, and qualified observer present when operating on the
             controller from a remote location.
            You must have a complete understanding of the application and the machine/process it is
             controlling before attempting to adjust data, stopping an application that is operating, or
             starting the controller remotely.
            Take the precautions necessary to assure that you are operating on the intended controller by
             having clear, identifying documentation within the controller application and its remote
             connection.
         Failure to follow these instructions can result in death, serious injury, or equipment
         damage.
96                                                                                           EIO0000001462 11/2015
                                                                                        Ethernet Configuration
         NOTE: The Web server must only be used by authorized and qualified personnel. A qualified
         person is one who has the skills and knowledge related to the construction and operation of the
         machine and the process controlled by the application and its installation, and has received safety
         training to recognize and avoid the hazards involved. No responsibility is assumed by Schneider
         Electric for any consequences arising out of the use of this feature.
                                                    WARNING
          UNAUTHORIZED DATA ACCESS
             Secure access to the FTP/Web server using User Rights.
             If you do not enable User Rights, disable the FTP/Web server to prevent any unwanted or
              unauthorized access to data in your application.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
         In order to change the password, go to Users and Groups tab of the device editor. For more
         information, refer to the SoMachine Programming Guide (see SoMachine, Programming Guide).
         NOTE: The only way to gain access to a controller that has user access-rights enabled and for
         which you do not have the password(s) is by performing an Update Firmware operation. This
         clearing of User Rights can only be accomplished by using a SD card or USB key (depending on
         the support of your particular controller) to update the controller firmware. In addition, you may
         clear the User Rights in the controller by running a script (for more information, refer to SoMachine
         Programming Guide (see SoMachine, Programming Guide)). This effectively removes the existing
         application from the controller memory, but restores the ability to access the controller.
EIO0000001462 11/2015                                                                                      97
Ethernet Configuration
This figure shows the home page of the Web Server site once you have logged in:
98                                                                                     EIO0000001462 11/2015
                                                                                       Ethernet Configuration
         NOTE: Schneider Electric follows, and recommends to its customers, industry best practices in the
         development and implementation of control systems. This recommendation includes a "Defense-
         in-Depth" approach to secure an Industrial Control System. This approach places the controllers
         behind one or more firewalls to restrict access to authorized personnel and protocols only.
                                                    WARNING
          UNAUTHENTICATED ACCESS AND SUBSEQUENT UNAUTHORIZED MACHINE
          OPERATION
             Evaluate whether your environment or your machines are connected to your critical
              infrastructure and, if so, take appropriate steps in terms of prevention, based on Defense-in-
              Depth, before connecting the automation system to any network.
             Limit the number of devices connected to a network to the minimum necessary.
             Isolate your industrial network from other networks inside your company.
             Protect any network against unintended access by using firewalls, VPN, or other, proven
              security measures.
             Monitor activities within your systems.
             Prevent subject devices from direct access or direct link by unauthorized parties or unauthen-
              ticated actions.
             Prepare a recovery plan including backup of your system and process information.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
EIO0000001462 11/2015                                                                                     99
Ethernet Configuration
         Element         Description
         Refresh         Enables I/O refreshing:
                          gray button: refreshing disabled
                          orange button: refreshing enabled
          Element        Description
          Reset          Erases the memorization
          Refresh        Starts/stops refreshing
          Load           Loads parameter configuration of Item0 and Item1
          Save           Saves parameter configuration of Item0 and Item1 in the controller
          Item0          Variable to be displayed
          Item1          Variable to be displayed
          Min            Minimum value of the variable axis
          Max            Maximum value of the variable axis
          Period(s)      Page refresh period in seconds
         Step    Action
         1       Right click the Application node in the Applications tree tab.
         2       Click Add Object → Web Data Configuration....
                 Result: The Add Web Data Configuration window is displayed.
         3       Click Add.
                 Result: The Web Data Configuration object is created and the Web Data Configuration editor is
                 open.
                 NOTE: As a Web Data Configuration object is unique for a controller, its name cannot be
                 changed.
         Element          Description
         Load             Loads saved lists from the controller internal Flash to the web server page
         Save             Saves the selected list description in the controller (/usr/web directory)
         Add              Adds a list description or a variable
         Del              Deletes a list description or a variable
         Refresh period Refreshing period of the variables contained in the list description (in ms)
         Refresh          Enables I/O refreshing:
                           gray button: refreshing disabled
                           orange button: refreshing enabled
        NOTE: IEC objects (%IW, %M,...) are not directly accessible. To access IEC objects you must first
        group their contents in located registers (refer to Relocation Table (see page 32)).
Maintenance Tab
        The Maintenance page provides access to the /usr and /sys folders of the controller flash
        memory (see page 28):
        Index of /usr:
Index of /sys:
          Step          Action
               1        Click Load.
               2        Modify the parameters (see page 205).
               3        Click Save.
                        NOTE: The new parameters will be considered at next Post Configuration file reading
                        (see page 203).
         File                                        Description
         My Machine Controller.gz                    GZIP file
         My Machine Controller.ico                   Icon file
         My Machine Controller.eds                   Electronic Data Sheet file
FTP Server
Introduction
         Any FTP client installed on a computer that is connected to the controller (Ethernet port), without
         SoMachine installed, can be used to transfer files to and from the data storage area of the
         controller.
         NOTE: Schneider Electric follows, and recommends to its customers, industry best practices in the
         development and implementation of control systems. This recommendation includes a "Defense-
         in-Depth" approach to secure an Industrial Control System. This approach places the controllers
         behind one or more firewalls to restrict access to authorized personnel and protocols only.
                                                    WARNING
          UNAUTHENTICATED ACCESS AND SUBSEQUENT UNAUTHORIZED MACHINE
          OPERATION
             Evaluate whether your environment or your machines are connected to your critical
              infrastructure and, if so, take appropriate steps in terms of prevention, based on Defense-in-
              Depth, before connecting the automation system to any network.
             Limit the number of devices connected to a network to the minimum necessary.
             Isolate your industrial network from other networks inside your company.
             Protect any network against unintended access by using firewalls, VPN, or other, proven
              security measures.
             Monitor activities within your systems.
             Prevent subject devices from direct access or direct link by unauthorized parties or unauthen-
              ticated actions.
             Prepare a recovery plan including backup of your system and process information.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
         NOTE: Make use of the security-related commands (see SoMachine, Menu Commands, Online
         Help) which provide a way to add, edit, and remove a user in the online user management of the
         target device where you are currently logged in.
         The FTP server is available even if the controller is empty (no user application and no User Rights
         are enabled).
FTP Access
        Access to the FTP server is controlled by User Rights when they are enabled in the controller. For
        more information, refer to Users and Groups Tab Description (see page 70).
        If User Rights are not enabled in the controller, you are prompted for a user name and password
        unique to the FTP/Web server. The default user name is USER and the default password is also
        USER.
        NOTE: You cannot modify the default user name and password. To secure the FTP/Web server
        functions, you must do so with Users and Groups.
                                                   WARNING
         UNAUTHORIZED DATA ACCESS
            Secure access to the FTP/Web server using User Rights.
            If you do not enable User Rights, disable the FTP/Web server to prevent any unwanted or
             unauthorized access to data in your application.
         Failure to follow these instructions can result in death, serious injury, or equipment
         damage.
        In order to change the password, go to Users and Groups tab of the device editor. For more
        information, refer to the SoMachine Programming Guide.
        NOTE: The only way to gain access to a controller that has user access-rights enabled and for
        which you do not have the password(s) is by performing an Update Firmware operation. This
        clearing of User Rights can only be accomplished by using a SD card or USB key (depending on
        the support of your particular controller) to update the controller firmware. In addition, you may
        clear the User Rights in the controller by running a script (for more information, refer to SoMachine
        Programming Guide). This effectively removes the existing application from the controller memory,
        but restores the ability to access the controller.
Files Access
        See File Organization (see page 28).
SNMP
Introduction
         The SNMP protocol (Simple Network Management Protocol) is used to provide the data and
         services required for managing a network.
         The data is stored in an MIB (Management Information Base). The SNMP protocol is used to read
         or write MIB data. Implementation of the Ethernet SNMP services is minimal, as only the
         compulsory objects are handled.
         M251 controllers support the standard MIB-2 objects.
         The values written are saved to the controller via SNMP client tool software. The Schneider Electric
         software for this is ConneXview. ConneXview is not supplied with the controller. For more details,
         refer to www.schneider-electric.com.
         The size of these character strings is limited to 50 characters.
Introduction
        This section describes the configuration of the TM251MESC as an EtherNet/IP target device.
        For further information about EtherNet/IP, refer to the www.odva.org website.
         Step            Action
             1           In the Devices Tree, select Ethernet_1 (Ethernet Network) and click the green plus button of
                         the node or right-click Ethernet_1 (Ethernet Network) and execute the Add Device...
                         command from the context menu.
                         Result: The Add Device dialog box opens.
             2           In the Add Device dialog box, select EthernetIP.
             3           Click the Add Device button.
             4           Click the Close button.
EtherNet/IP Configuration
        To configure the EtherNet/IP parameters, double-click Ethernet_1 (Ethernet Network) →
        EthernetIP in the Devices tree.
        The following dialog box is displayed:
The table below describes the EthernetIP Slave I/O Mapping configuration:
         The number of word depends on the size parameter configured in EtherNet/IP Configuration.
         Output means OUTPUT from Originator controller (= %IW for the controller).
         Input means INPUT from Originator controller (= %QW for the controller).
Connections on EtherNet/IP
         To access a target device, open a connection which can include several sessions that send
         requests.
         One explicit connection uses one session (a session is a TCP or UDP connection).
         One I/O connection uses 2 sessions.
         The following table shows the EtherNet/IP connections limitations:
          Characteristic                                     Maximum
          Explicit connections                               8 (Class 3)
          I/O connections                                    1 (Class 1)
          Connections                                        8
          Sessions                                           16
          Simultaneous requests                              32
Profile
          The controller supports the following objects:
         The Reset common service has one specific parameter, Type of Reset (USINT), with the following
         values:
        (1)
              Mapped in a WORD:
             MSB: minor revision (second USINT)
             LSB: major revision (first USINT)
        Example: 0205h means revision V5.2.
        Status Description (Attribute 5):
        Instances Supported
        Output means OUTPUT from Originator controller (= %IW for the controller).
        Input means INPUT from Originator controller (= %QW for the controller).
        The controller supports 2 Assemblies:
        NOTE: The Assembly object binds together the attributes of multiple objects so that information to
        or from each object can be communicated over a single connection. Assembly objects are static.
        The Assemblies in use can be modified through the parameter access of the network configuration
        tool (RSNetWorx). The controller needs to recycle power to register a new Assembly assignment.
        The following table describes the Instance attributes:
EPATH is:
         Instance Code
         The following table describes the Instance Services:
         2           Get     Instance Name STRING       -        Unique Name assigned to the File Object
                                                                 Instance. For the C8 hex instance, it is "EDS
                                                                 and Icon Files". For the C9 hex instance, it is
                                                                 "Related EDS and Icon Files".
         3           Get     Instance        UINT       -        Revision number assigned for this instance by
                             Format                              the application, to differentiate between
                             Revision                            different file formats.
         4           Get     File Name       STRING     -        Unique name for File Storage
         5           Get     File Revision   USINT      Major    File Revision is updated every time file content
                                                        Minor    is changed.
         6           Get     File Size       UDINT      -        File Size in bytes
         7           Get     File Checksum UINT         -        Two’s complement of the 16 bit sum of all
                                                                 bytes
         8           Get     Invocation      USINT      -        Defines what should happen after the file is
                             Method                              downloaded. Possible options include:
                                                                  0: No Action
                                                                  2: Power Cycle, etc.
         Instance Codes
         Only instance 1 is supported.
         The following table describes the Instance Services:
        NOTE: The Read Register service requires 4 bytes of data: the first word contains the starting
        register address and the second word contains the number of registers to read. The Write service
        request requires the same 4 bytes, followed by the actual data.
        The Modbus Pass-through service indicates a specific Modbus function. The translation function
        will not perform any Indian conversion on the request or response data. Both request and response
        contain 1 byte of the Modbus Function code followed by the Modbus message data, including a
        sub-function code if present.
         Instance Codes
         Only instance 1 is supported.
         The following table describes the Instance Services:
         Instance Codes
         Only instance 1 is supported.
         The following table describes the Instance Services:
Introduction
        This section describes the configuration of the TM251MESE as an EtherNet/IP target device.
        For further information about EtherNet/IP, refer to the www.odva.org website.
         Step            Action
             1           In the Devices Tree, select Ethernet_1 (Ethernet Network) and click the green plus button of
                         the node or right-click Ethernet_1 (Ethernet Network) and execute the Add Device...
                         command from the context menu.
                         Result: The Add Device dialog box opens.
             2           In the Add Device dialog box, select EthernetIP.
             3           Click the Add Device button.
             4           Click the Close button.
EtherNet/IP Configuration
         To configure the EtherNet/IP parameters, double-click Ethernet_1 (Ethernet Network) →
         EthernetIP in the Devices tree.
         This dialog box is displayed:
The table below describes the EthernetIP Slave I/O Mapping configuration:
         The number of words depends on the size parameter configured in EtherNet/IP Configuration.
         Output means OUTPUT from Originator controller (= %IW for the controller).
         Input means INPUT from Originator controller (= %QW for the controller).
Connections on EtherNet/IP
         To access a target device, open a connection which can include several sessions that send
         requests.
         One explicit connection uses one session (a session is a TCP or UDP connection).
         One I/O connection uses 2 sessions.
         The following table shows the EtherNet/IP connections limitations:
          Characteristic                                     Maximum
          Explicit connections                               8 (Class 3)
          I/O connections                                    1 (Class 1)
          Connections                                        8
          Sessions                                           16
          Simultaneous requests                              32
Profile
          The controller supports the following objects:
        The Reset common service has one specific parameter, Type of Reset (USINT), with the following
        values:
        (1)
              Mapped in a WORD:
             MSB: minor revision (second USINT)
             LSB: major revision (first USINT)
        Example: 0205h means revision V5.2.
         Instances Supported
         Output means OUTPUT from Originator controller (= %IW for the controller).
         Input means INPUT from Originator controller (= %QW for the controller).
         The controller supports 2 Assemblies:
         NOTE: The Assembly object binds together the attributes of multiple objects so that information to
         or from each object can be communicated over a single connection. Assembly objects are static.
         The Assemblies in use can be modified through the parameter access of the network configuration
         tool (RSNetWorx). The controller needs to recycle power to register a new Assembly assignment.
         The following table describes the Instance attributes:
         Instance Codes
         Only instance 1 is supported.
         The following table describes the Instance Services:
         Instance Codes
         Only instance 1 is supported.
         The following table describes the Instance Services:
NOTE: There is one IO Connection Diagnostic object instance for both O->T and T->O paths.
Overview
        This section describes the configuration of the Modicon M251 Logic Controller as a Modbus TCP
        server device.
        The Modbus TCP server device creates a specific I/O area in the controller, accessible through the
        Modbus TCP protocol. It is used when an external I/O scanner (master) needs to access the %IW
        and %QW objects of the controller as an I/O scanner slave. The main advantage of using a
        Modbus TCP IOScanner is that the controller objects are gathered, and can be accessed through
        a single Modbus request.
        The Modbus TCP slave device adds another Modbus server function to the controller. This server
        is accessible by the Modbus client application by using the configured Unit ID (not 255). The
        regular Modbus server of the slave controller needs no configuration, and is addressed through the
        Unit ID = 255.
        Inputs/outputs are seen from the slave controller: inputs are written by the master, and outputs are
        read by the master.
        The Modbus TCP slave device also has the capability to define a privileged Modbus client
        application, whose connection is never forcefully closed (regular Modbus connections may be
        closed when more than 8 connections are needed).
        The timeout duration associated to the privileged connection allows you to verify whether the
        controller is being polled by the privileged master. If no Modbus request is received within the
        timeout duration, the diagnostic information i_byMasterIpLost is set to 1 (TRUE). For more
        information, refer to the Ethernet Port Read-Only System Variables (see Modicon M251 Logic
        Controller, System Functions and Variables, PLCSystem Library Guide).
        For further information about Modbus TCP, refer to the www.modbus.org website.
          Element                   Description
          IP Master Address         IP address of the Modbus master
                                    The connections are not closed on this address.
          TimeOut                   Timeout in 500 ms increments
                                    NOTE: The timeout applies to the IP master Address unless the
                                    address is 0.0.0.0.
          Slave Port                Modbus communication port (502)
          Unit ID                   Sends the requests to the Modbus TCP slave device (1...247), instead of
                                    sending requests to the regular Modbus server (255).
          Holding Registers (%IW)   Number of registers in the input registers (2...40) (each register is 2 bytes)
          Input Registers (%QW)     Number of registers in the output registers (2...40) (each register is 2 bytes)
        NOTE: Modbus requests that attempt to access registers above n+m-1 are answered by the 02 -
        ILLEGAL DATA ADDRESS exception code.
To link I/O to variables, select the Modbus TCP Slave Device I/O Mapping tab:
        The number of words depends on the Holding Registers (%IW) and Input Registers (%QW)
        parameters of the ModbusTCP tab.
        NOTE: Output means OUTPUT from Originator controller (= %IW for the controller).
        Input means INPUT from Originator controller (= %QW for the controller).
         Section 10.2
         Firewall Configuration
Firewall Configuration
Introduction
         This section describes how to configure the firewall of the Modicon M251 Logic Controller.
Introduction
Firewall Presentation
        In general, firewalls help protect network security zone perimeters by blocking unauthorized
        access and permitting authorized access. A firewall is a device or set of devices configured to
        permit, deny, encrypt, decrypt, or proxy traffic between different security zones based upon a set
        of rules and other criteria.
        Process control devices and high-speed manufacturing machines require fast data throughput and
        often cannot tolerate the latency introduced by an aggressive security strategy inside the control
        network. Firewalls, therefore, play a significant role in a security strategy by providing levels of
        protection at the perimeters of the network. Firewalls are important part of an overall, system level
        strategy.
        NOTE: Schneider Electric follows, and recommends to its customers, industry best practices in the
        development and implementation of control systems. This recommendation includes a "Defense-
        in-Depth" approach to secure an Industrial Control System. This approach places the controllers
        behind one or more firewalls to restrict access to authorized personnel and protocols only.
                                                   WARNING
         UNAUTHENTICATED ACCESS AND SUBSEQUENT UNAUTHORIZED MACHINE
         OPERATION
            Evaluate whether your environment or your machines are connected to your critical
             infrastructure and, if so, take appropriate steps in terms of prevention, based on Defense-in-
             Depth, before connecting the automation system to any network.
            Limit the number of devices connected to a network to the minimum necessary.
            Isolate your industrial network from other networks inside your company.
            Protect any network against unintended access by using firewalls, VPN, or other, proven
             security measures.
            Monitor activities within your systems.
            Prevent subject devices from direct access or direct link by unauthorized parties or unauthen-
             ticated actions.
            Prepare a recovery plan including backup of your system and process information.
         Failure to follow these instructions can result in death, serious injury, or equipment
         damage.
Firewall Configuration
        There are 3 ways to manage the controller firewall configuration:
         Static configuration,
         Dynamic changes,
         Application settings.
Script files are used in the static configuration and for dynamic changes.
Static Configuration
         The static configuration is loaded at the controller boot.
         The controller firewall can be statically configured by managing a default script file located in the
         controller. The path to this file is /Usr/Cfg/FirewallDefault.cmd.
Dynamic Changes
         After the controller boot, the controller firewall configuration can be changed by the use of script
         files.
         There are 2 ways to load these dynamic changes:
          Using a physical SD card (see page 162),
          Using a function block (see page 162) in the application.
Application Settings
         Refer to Ethernet Configuration (see page 91).
Using an SD Card
        This table describes the procedure to execute a script file from an SD card:
         Step        Action
             1       Create a valid script file (see page 165).
                     For instance, name the script file FirewallMaintenance.cmd.
             2       Load the script file on the SD card.
                     For instance, load the script file in the Usr/cfg folder.
             3       In the file Sys/Cmd/Script.cmd, add a code line with the command Firewall_install
                     ”pathname/FileName”
                     For instance, the code line is Firewall_install
                     ”/sd0/Usr/cfg/FirewallMaintenace.cmd”
             4       Insert the SD card on the controller.
         Step        Action
             1       Create a valid script file (see page 165).
                     For instance, name the script file FirewallMaintenance.cmd.
             2       Load the script file in the controller memory.
                     For instance, load the script file in the Usr/Syslog folder with FTP.
             3       Use an ExecuteScript (see Modicon M251 Logic Controller, System Functions and Variables,
                     PLCSystem Library Guide) function block.
                     For instance, the [SCmd] input is ‘Firewall_install
                     “/usr/Syslog/FirewallMaintenace.cmd”’
Firewall Behavior
Introduction
         The firewall configuration depends on the action done on the controller and the initial configuration
         state. There are 5 possible initial states:
          There is no default script file in the controller.
          A correct script file is present.
          An incorrect script file is present.
          There is no default script file and the application has configured the firewall.
          A dynamic script file configuration has been already executed.
Overview
         This section describes how script files (default script file or dynamic script file) are written so that
         they can be executed correctly during the booting of the controller or during a specific command
         triggered by the user.
          Command                                       Description
          FireWall enable                               Blocks all frames from the Ethernet interfaces. If no IP
                                                        address is further authorized, it is not possible to
                                                        communicate on the Ethernet interfaces.
                                                        NOTE: By default, when the Firewall is enabled, all frames
                                                        are rejected.
          FireWall Disable                              All IP addresses are allowed to access to the controller on all
                                                        Ethernet interfaces.
          FireWall Eth1 Default Enable                   All frames are accepted by the controller.
          FireWall Eth1 Default Reject                  All frames are rejected by the controller.
                                                        NOTE: By default, if this line is not present, it corresponds
                                                        to the command FireWall Eth1 Default Reject.
          NOTE: The number of lines written in a script file must not exceed 50.
         Chapter 11
         Industrial Ethernet Manager
Introduction
         This chapter describes how to add and configure the Industrial Ethernet.
Industrial Ethernet
Overview
        Industrial Ethernet is the term used to represent the industrial protocols that use the standard
        Ethernet physical layer and standard Ethernet protocols.
        NOTE: The following information only applies to the TM251MESE controller.
        On an Industrial Ethernet network, you can connect:
         industrial devices.(industrial protocols)
         non-industrial devices (other Ethernet protocols)
        For more information, refer to Industrial Ethernet User Guide (see SoMachine Industrial Ethernet,
        User Guide).
        A Control network
        B Device network
        1 Logic controller (see SoMachine Industrial Ethernet, User Guide)
        2 Daisy-chained slaves
        3 Ethernet switch
        4 I/O island (Modbus TCP)
        5 Vision sensor (EtherNet/IP)
        6 PC and HMI (TCP/UDP)
        2, 4, and 5 Industrial Ethernet slave devices (EtherNet/IP / Modbus TCP)
        This architecture is configurable with SoMachine.
          Features                     Description
          TM251MESE logic controller
          Topology                     Daisy chain and Star via switches
          Bandwidth                    10/100 Mbit/s
          EtherNet/IP Scanner
          Performance                  Up to 16 EtherNet/IP target devices managed by the logic
                                       controller, monitored within a timeslot of 10 ms
          Number of connections        0...16
          Number of input words        0...2048
          Number of output words       0...2048
          I/O communications           EtherNet/IP Scanner service
                                       Function block for configuration and data transfer
                                       Originator/Target
          Modbus TCP IOScanner
          Performance                  Up to 64 Modbus TCP slave devices managed by the logic
                                       controller, monitored within a timeslot of 64 ms.
          Number of connections        0...64
          Number of input words        0...2048
          Number of output words       0...2048
          I/O communications           Modbus TCP IOScanner service
                                       Function block for data transfer
                                       Master/Slave
         Features                                Description
         Other services                          FDT/DTM/EDS management
                                                 FDR (Fast Device Replacement)
                                                 DHCP server
                                                 Security management (refer to Security Parameters
                                                 (see page 93) and Firewall Configuration (see page 159)
                                                 Modbus TCP server
                                                 Modbus TCP client
                                                 EtherNet/IP adapter (controller as a target on EtherNet/IP)
                                                 EtherNet/IP Originator
                                                 Modbus TCP server (controller as a slave on Modbus TCP)
                                                 Web server
                                                 FTP server
                                                 SNMP
                                                 IEC VAR ACCESS
         Additional features                     Possible to mix up to 16 EtherNet/IP and Modbus TCP slave
                                                 devices.
                                                 Devices can be directly accessed for configuration, monitoring,
                                                 and management purposes.
                                                 Network transparency between control network and device
                                                 network (logic controller can be used as a gateway).
                                                 NOTE: Using the logic controller as a gateway can impact the
                                                 performance of the logic controller.
EtherNet/IP Overview
        EtherNet/IP is the implementation of the CIP protocol over standard Ethernet.
        The EtherNet/IP protocol uses an Originator/Target architecture for data exchange.
        Originators are devices that initiate data exchanges with Target devices on the network. This
        applies to both I/O communications and service messaging. This is the equivalent of the role of a
        client in a Modbus network.
        Targets are devices that respond to data requests generated by Originators. This applies to both
        I/O communications and service messaging. This is the equivalent of the role of a server in a
        Modbus network.
        EtherNet/IP adapter is an end-device in an EtherNet/IP network. I/O blocks and drives can be
        EtherNet/IP adapter devices.
        The communication between an EtherNet/IP Originator and Target is accomplished using an
        EtherNet/IP connection.
          Step          Action
               1        In the Devices Tree, select Ethernet_2 (Device Network) and click the green plus button of
                        the node or right-click Ethernet_2 (Device Network) and execute the Add Device... command
                        from the context menu.
                        Result: The Add Device dialog box opens.
               2        In the Add Device dialog box, select Protocol Managers → Industrial Ethernet manager.
               3        Click the Add Device button.
               4        Click the Close button.
DHCP Server
Overview
        It is possible to configure a DHCP server on the Ethernet 2 network of the TM251MESE.
        The DHCP server offers addresses to the devices connected on the Ethernet 2 network. The
        DHCP server only delivers static addresses. A unique identified slave gets a unique address.
        DHCP slave devices are identified either by their MAC address or their DHCP device name. The
        DHCP server configuration table defines the relation between addresses and identified slave
        devices.
        The DHCP server addresses are given with an infinite lease time. There is no need for the slave
        devices to refresh the leased IP address.
        For more information, refer to DHCP Server (see SoMachine Industrial Ethernet, User Guide).
Overview
         The Fast Device Replacement (FDR) helps facilitate replacing and reconfiguring a network device.
         This function is available on the Ethernet 2 port of the TM251MESE.
         For more information, refer to Slave Device Replacement with FDR (see SoMachine Industrial
         Ethernet, User Guide).
         Chapter 12
         Serial Line Configuration
Introduction
         This chapter describes how to configure the serial line communication of the Modicon M251 Logic
         Controller.
Introduction
        The Serial Line configuration window allows you to configure the physical parameters of a serial
        line (baud rate, parity, and so on).
The following parameters must be identical for each serial device connected to the port.
         Element            Description
         Baud rate          Transmission speed in bits/s
         Parity             Used for error detection
         Data bits          Number of bits for transmitting data
         Stop bits          Number of stop bits
         Physical Medium    Specify the medium to use:
                             RS485 (using polarisation resistor or not)
                             RS232
         Polarization       Polarization resistors are integrated in the controller. They are switched on or off by this
         Resistor           parameter.
         The SoMachine protocol is incompatible with other protocols such as Modbus Serial Line.
         Connecting a new controller or updating the firmware of a controller connected to an active Modbus
         configured serial line can cause the other devices on the serial line to stop communicating. Ensure
         that the controller is not connected to an active Modbus serial line network before downloading a
         valid application having the concerned port or ports properly configured for the intended protocol.
                                                  NOTICE
          INTERRUPTION OF SERIAL LINE COMMUNICATIONS
          Be sure that your application has the serial line ports properly configured for Modbus before
          physically connecting the controller to an operational Modbus Serial Line network.
          Failure to follow these instructions can result in equipment damage.
This table indicates the maximum baud rate value of the managers:
Introduction
        Use the SoMachine Network Manager to exchange variables with a XBTGT/XBTGK Advanced
        Panel with SoMachine software protocol, or when the Serial Line is used for SoMachine
        programming.
Adding a Modem
        To add a modem to the SoMachine Network Manager, refer to Adding a Modem to a Manager
        (see page 196).
Modbus Manager
Introduction
         The Modbus Manager is used for Modbus RTU or ASCII protocol in master or slave mode.
          Element           Description
          Transmission      Specify the transmission mode to use:
          Mode               RTU: uses binary coding and CRC error-checking (8 data bits)
                             ASCII: messages are in ASCII format, LRC error-checking (7 data bits)
                            Set this parameter identical for each Modbus device on the link.
          Addressing        Specify the device type:
                             Master
                             Slave
         Element            Description
         Address            Modbus address of the device, when slave is selected.
         Time between       Time to avoid bus-collision.
         Frames (ms)        Set this parameter identical for each Modbus device on the link.
         Serial Line        Parameters specified in the Serial Line configuration window.
         Settings
Modbus Master
        When the controller is configured as a Modbus Master, the following function blocks are supported
        from the PLCCommunication Library:
         ADDM
         READ_VAR
         SEND_RECV_MSG
         SINGLE_WRITE
         WRITE_READ_VAR
         WRITE_VAR
        For further information, see Function Block Descriptions (see SoMachine, Modbus and ASCII
        Read/Write Functions, PLCCommunication Library Guide) of the PLCCommunication Library.
Modbus Slave
        When the controller is configured as Modbus Slave, the following Modbus requests are supported:
This table contains the sub-function codes supported by the diagnostic Modbus request 08:
         This table lists the objects that can be read with a read device identification request (basic identifi-
         cation level):
         The following section describes the differences between the Modbus memory mapping of the
         controller and HMI Modbus mapping. If you do not program your application to recognize these
         differences in mapping, your controller and HMI will not communicate correctly. Thus it will be
         possible for incorrect values to be written to memory areas responsible for output operations.
                                                           WARNING
          UNINTENDED EQUIPMENT OPERATION
          Program your application to translate between the Modbus memory mapping used by the
          controller and that used by any attached HMI devices.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
         When the controller and the Magelis HMI are connected via Modbus (HMI is master of Modbus
         requests), the data exchange uses simple word requests.
        There is an overlap on simple words of the HMI memory while using double words but not for the
        controller memory (see following diagram). In order to have a match between the HMI memory
        area and the controller memory area, the ratio between double words of HMI memory and the
        double words of controller memory has to be 2.
        The following gives examples of memory match for the double words:
         %MD2 memory area of the HMI corresponds to %MD1 memory area of the controller because
          the same simple words are used by the Modbus request.
         %MD20 memory area of the HMI corresponds to %MD10 memory area of the controller
          because the same simple words are used by the Modbus request.
        The following gives examples of memory match for the bits:
         %MW0:X9 memory area of the HMI corresponds to %MX1.1 memory area of the controller
          because the simple words are split in 2 distinct bytes in the controller memory.
Adding a Modem
        To add a Modem to the Modbus Manager, refer to Adding a Modem to a Manager (see page 196).
ASCII Manager
Introduction
         The ASCII manager is used to transmit and/or receive data with a simple device.
         Parameter          Description
         Start              If 0, no start character is used in the frame. Otherwise, in Receiving Mode, the
         Character          corresponding character in ASCII is used to detect the beginning of a frame.
                            In Sending Mode, this character is added at the beginning of the frame.
         First End          If 0, no first end character is used in the frame. Otherwise, in Receiving Mode, the
         Character          corresponding character in ASCII is used to detect the end of a frame. In Sending Mode,
                            this character is added at the end of the frame.
         Second End         If 0, no second end character is used in the frame. Otherwise, in Receiving Mode, the
         Character          corresponding character in ASCII is used to detect the end of a frame. In Sending Mode,
                            this character is added at the end of the frame.
         Frame Length If 0, this parameter is not used. This parameter allows the system to conclude an end of
         Received     frame at reception when the controller received the specified number of characters.
                      Note: This parameter cannot be used simultaneously with Frame Received Timeout (ms).
         Frame              If 0, this parameter is not used. This parameter allows the system to conclude the end of
         Received           frame at reception after a silence of the specified number of ms.
         Timeout (ms)
         Serial Line        Parameters specified in the Serial Line configuration window (see page 178).
         Settings
        NOTE: In the case of using several frame termination conditions, the first condition to be TRUE will
        terminate the exchange.
Adding a Modem
        To add a Modem to the ASCII manager, refer to Adding a Modem to a Manager (see page 196).
Modbus IOScanner
Introduction
         The Modbus IOScanner is used to simplify exchanges with Modbus slave devices.
          Element           Description
          Transmission      Specifies the transmission mode to use:
          Mode               RTU: uses binary coding and CRC error-checking (8 data bits)
                             ASCII: messages are in ASCII format, LRC error-checking (7 data bits)
                            Set this parameter identical for each Modbus device on the network.
          Response          Timeout used in the exchanges.
          Timeout (ms)
          Time between      Delay to reduce data collision on the bus.
          Frames (ms)       Set this parameter identical for each Modbus device on the network.
        NOTE:
         If a configured Modbus slave does not answer correctly to 5 consecutive requests, this slave is
          set in an error state in SoMachine. No more request is sent to it until the next warm or cold reset.
         Do not use function blocks of the PLCCommunication library on a serial line with a Modbus
          IOScanner configured. This disrupts the Modbus IOScanner exchange.
Introduction
         This section describes how to add a device on the Modbus IOScanner.
          Step          Action
          1             In the Devices tree, double-click Generic Modbus Slave.
                        Result: The configuration window is displayed.
          2             Enter a Slave Address value for your device (choose a value from 1 to 247).
          3             Choose a value for the Response Timeout (in ms).
         Step           Action
         1              Click the Modbus Slave Channel tab:
          Step          Action
          2             Click the Add Channel button:
         Step           Action
         3              Configure an exchange:
                        In the field Channel, you can add the following values:
                         Channel: Enter a name for your channel.
                         Access Type: Choose the exchange type: Read or Write or Read/Write multiple registers
                            (i.e. %MW) (see page 195).
                         Trigger: Choose the trigger of the exchange. It can be either CYCLIC with the period
                            defined in Cycle Time (ms) field or started by a RISING EDGE on a boolean variable
                            (this boolean variable is then created in the Modbus Master I/O Mapping tab).
                         Comment: Add a comment about this channel.
                        In the field READ Register (if your channel is Read or Read/Write one), you can configure the
                        %MW to be read on the Modbus slave. Those will be mapped on %IW (see Modbus Master I/O
                        Mapping tab):
                         Offset: Offset of the %MW to read. 0 means that the first object that will be read will be %MW0.
                         Length: Number of %MW to be read. For example, if 'Offset' = 2 and 'Length' = 3, the channel
                            will read %MW2, %MW3 and %MW4.
                         Error Handling: choose the behavior of the related %IW in case of loss of communication.
                        In the fieldWRITE Register (if your channel is Write or Read/Write one), you can configure the
                        %MW to be written to the Modbus slave. Those will be mapped on %QW (see Modbus Master I/O
                        Mapping tab):
                         Offset: Offset of the %MW to write. 0 means that the first object that will be written will be
                            %MW0.
                         Length: Number of %MW to be written. For example, if 'Offset' = 2 and 'Length' = 3,
                            the channel will write %MW2, %MW3 and %MW4.
         4              Click the Delete button to remove a channel.
                        Click the Edit button to change the parameters of a channel.
         5              Click OK to validate the configuration of this channel.
          Step          Action
          1             Click the Modbus Slave Init tab:
         Step           Action
         2              Click New to create a new initialization value:
          Step            Action
          1               Click the Modbus Master I/O Mapping tab:
Access Types
         This table describes the different access types available:
Introduction
        A modem can be added to the following managers:
         ASCII Manager
         Modbus Manager
         SoMachine Network Manager
        NOTE: Use Modem TDW-33 (which implements AT & A1 commands) if you need a modem
        connexion with SoMachine Network Manager.
         Chapter 13
         CANopen Configuration
CANopen Configuration
            Step                         Action
                            1            In the Devices tree, double-click CAN_1.
                            2            Configure the baudrate (by default: 250000 bits/s):
                                         NOTE: The Online Bus Access option allows you to block SDO, DTM, and NMT sending
                                         through the status screen.
         When connecting a DTM to a device using CANopen, the DTM communicates in parallel with the
         running application. The overall performance of the system is impacted and can cause overload
         on the fieldbus.
                                                                          WARNING
            UNINTENDED EQUIPMENT OPERATION
            You must consider the impact of DTM connections on the CANopen fieldbus load.
            Failure to follow these instructions can result in death, serious injury, or equipment
            damage.
        Step    Action
            1   Select CANopen Performance in the Hardware Catalog, drag it to the Devices tree, and drop it
                on one of the highlighted nodes.
                For more information on adding a device to your project, refer to:
                 Using the Drag-and-Drop Method (see SoMachine, Programming Guide)
                 Using the Contextual Menu or Plus button (see SoMachine, Programming Guide)
            2   Double-click CANopen_Performance.
                Result: The CANopen Manager configuration window appears:
       NOTE: If Enable Sync Producing is checked, the CAN_x_Sync task is added to the Application
       → Task Configuration node in the Applications tree tab.
         Do not delete or change the Type or External event attributes of CAN_x_Sync tasks. If you do
         so, SoMachine will detect an error when you attempt to build the application, and you will not be
         able to download it to the controller.
         If you uncheck the Enable Sync Producing option on the CANopen Manager sub-tab of the
         CANopen_Performance tab, the CAN0_Sync task is automatically deleted from your program.
                                                  WARNING
          UNINTENDED EQUIPMENT OPERATION
             Do not connect more than 63 CANopen slave devices to the controller.
             Program your application to use 252 or fewer Transmit PDO (TPDO).
             Program your application to use 252 or fewer Receive PDO (RPDO).
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
         Chapter 14
         Post Configuration
Post Configuration
Introduction
         This chapter describes how to generate and configure the post configuration file of the Modicon
         M251 Logic Controller.
Introduction
        Post configuration is an option that allows you to modify some parameters of the application
        without changing the application. Post configuration parameters are defined in a file called
        Machine.cfg, which is stored in the controller.
        By default, all parameters are set in the application.The parameters defined in the Post
        Configuration file are used instead of the corresponding parameters defined in the application. Not
        all parameters have to be specified in the Post Configuration file (for example: one parameter can
        change the IP address without changing the Gateway Address).
Parameters
        The Post Configuration file allows you to change network parameters.
        Ethernet parameters:
          IP Address
         Subnet Mask
         Gateway Address
         Transfer Rate
         IP Config Mode
         Device Name
         IPMaster Address (see page 154)
        Serial Line parameters, for each serial line in the application (embedded port or PCI module):
         Baud rate
         Parity
         Data bits
         Stop bit
        NOTE: Parameter updates with a Post Configuration file that impacts parameters used by other
        devices via a communication port are not updated in the other device.
        For example, if the IP address used by an HMI is updated in the configuration with a Post
        Configuration file, the HMI will still use the previous address. You must update the address used
        by the HMI independently.
Operating Mode
         The Post Configuration file is read:
          after a Reset Warm command (see page 60)
          after a Reset Cold command (see page 60)
          after a reboot (see page 62)
          after an application download (see page 63)
         Refer to Controller States and Behaviors (see page 45) for further details on controller states and
         transitions.
Introduction
        The file Machine.cfg is located in the directory /usr/cfg.
        Each parameter specified by a variable type, variable ID, and value. The format is:
        id[moduleType].param[paramId].paramField=value
        where:
         moduleType is a numerical value, for example 111.
         paramId is a numerical value specifying the parameter to be modified, for example 10000.
         paramField is a string value that must be used in addition to the paramId to specify serial line
          parameters, for example, “Bauds”.
         value is the value assigned to the parameter. Its type depends on the parameter data type.
         Step        Action
         1           In the menu bar, choose Build → Generate Post Configuration
                     Result: an explorer window appears.
         2           Select the destination folder of the Post Configuration file.
         3           Click OK.
        NOTE: When you use SoMachine to create a Post Configuration file, it reads the value of each
        parameter currently assigned in your application program and then writes the new files using these
        values. This automatically generated a file explicitly assigns a value to every parameter that can
        be specified via Post configuration. After generating a Post configuration file, review the file and
        remove any parameter assignments that you wish to remain under the control of your application.
        Retain only those parameters assignments that you wish changed by the Post configuration
        function that are necessary to make you application portable.
         For more information on Files tab of the Device Editor, refer to SoMachine Programming Guide.
         NOTE:
         The parameters defined in the application will be used instead of the corresponding parameters
         defined in the Post Configuration file:
          after a Reset Warm command (see page 60)
          after a Reset Cold command (see page 60)
          after a reboot (see page 62)
          after an application download (see page 63)
         Chapter 15
         Connecting a Modicon M251 Logic Controller to a PC
Overview
         To transfer, run, and monitor the applications, connect the controller to a computer, that has
         SoMachine installed, using either a USB cable or an Ethernet connection (for those references that
         support an Ethernet port).
                                                              NOTICE
            INOPERABLE EQUIPMENT
            Always connect the communication cable to the PC before connecting it to the controller.
            Failure to follow these instructions can result in equipment damage.
                                                              WARNING
            INSUFFICENT POWER FOR USB DOWNLOAD
            Do not use a USB cable longer than 3m (9.8 ft) for USB powered download.
            Failure to follow these instructions can result in death, serious injury, or equipment
            damage.
        NOTE: It is not intended that you use the USB Powered Download on an installed controller.
        Depending on the number of I/O expansion modules in the physical configuration of the installed
        controller, there may be insufficient power from your PC USB port to accomplish the download.
                                                     WARNING
         INOPERABLE EQUIPMENT OR UNINTENDED EQUIPMENT OPERATION
            You must use a shielded USB cable such as a BMX XCAUSBH0•• secured to the functional
             ground (FE) of the system for any long-term connection.
            Do not connect more than one controller at a time using USB connections.
         Failure to follow these instructions can result in death, serious injury, or equipment
         damage.
        The communication cable should be connected to the PC first to minimize the possibility of
        electrostatic discharge affecting the controller.
To connect the USB cable to your controller, follow the steps below:
          Step          Action
          1             1a If making a long-term connection using the cable BMXXCAUSBH018, or other cable with a
                           ground shield connection, be sure to securely connect the shield connector to the functional
                           ground (FE) or protective ground (PE) of your system before connecting the cable to your
                           controller and your PC.
                        1b If making a short-term connection using the cable TCSXCNAMUM3P or other non-grounded
                           USB cable, proceed to step 2.
          2             Connect your USB cable to the computer.
          3             Open the hinged access cover.
          4             Connect the Mini connector of your USB cable to the controller USB connector.
          Step          Action
               1        Connect your Ethernet cable to the PC.
               2        Connect your Ethernet cable to the Ethernet port on the controller.
         Chapter 16
         SD Card
SD Card
Introduction
         This chapter describes how to transfer firmware, application, using an SD card to the Modicon
         M251 Logic Controller.
Introduction
          The firmware updates for Modicon M251 Logic Controller are available on the
          http://www.schneider-electric.com website (in .zip format).
          Updating the firmware is possible by:
           Using an SD card with a compatible script file
           Using the Controller Assistant
          Performing a firmware change will delete the current application program in the device, including
          the Boot Application in Flash memory.
                                                    NOTICE
          LOSS OF APPLICATION DATA
             Perform a backup of the application program to the hard disk of the PC before attempting a
              firmware change.
             Restore the application program to the device after a successful firmware change.
          Failure to follow these instructions can result in equipment damage.
          If there is a power outage or communication interruption during the transfer of the application
          program or a firmware change, your device may become inoperative. If a communication
          interruption or a power outage occurs, reattempt the transfer.
                                                    NOTICE
          INOPERABLE EQUIPMENT
             Do not interrupt the transfer of the application program or a firmware change once the transfer
              has begun.
             Do not place the device into service until the transfer has completed successfully.
          Failure to follow these instructions can result in equipment damage.
          The serial line ports of your controller are configured for the SoMachine protocol by default when
          new or when you update the controller firmware. The SoMachine protocol is incompatible with that
          of other protocols such as Modbus Serial Line. Connecting a new controller to, or updating the
          firmware of a controller connected to, an active Modbus configured serial line can cause the other
          devices on the serial line to stop communicating. Make sure that the controller is not connected to
          an active Modbus serial line network before first downloading a valid application having the
          concerned port or ports properly configured for the intended protocol.
                                                           NOTICE
          INTERRUPTION OF SERIAL LINE COMMUNICATIONS
          Be sure that your application has the serial line ports properly configured for Modbus before
          physically connecting the controller to an operational Modbus Serial Line network.
          Failure to follow these instructions can result in equipment damage.
          Step     Action
               1 Extract the .zip file to the root of the SD card.
                   NOTE: The SD card folder \sys\cmd\ contains the download script file.
               2 Remove power from the controller.
               3 Insert the SD card into the controller.
               4 Restore power to the controller.
                   NOTE: The SD LED (green) is flashing during the operation.
               5 Wait until the end of the download (theSD LED is solid green):
                  In case of a detected error, the SD LED is turned off, and the ERR (red) and I/O (red) LEDs begin
                   flashing.
                  If the download ended successfully, the ERR LED (red) is flashing regularly, and the SD LED
                   (green) is steady ON.
               6 Remove the SD card from the controller.
                 Result: The controller restarts automatically with new firmware if the download ended successfully.
          Step   Action
              1 On the Home dialog, click the Read from.... controller button.
                Result: The Controller selection dialog opens.
              2 Select the required connection type and controller and click the Reading button.
                Result: The image is transmitted from the controller to the computer.
                After this has been accomplished successfully, you are automatically redirected to the Home dialog.
              3 Click the button New / Process... and then Update firmware....
                Result: The dialog for updating the firmware opens.
              4 Execute individual steps for updating the firmware in the current image (Changes are only effected in
                the image on your computer).
                In the final step, you can decide whether you want to create a backup copy of the image read by the
                controller.
                Result: Following the update of the firmware, you are automatically returned to the Home dialog.
              5 On the Home dialog, click the Write on.... controller button.
                Result: The Controller selection dialog opens.
              6 Select the required connection type and controller and click the Write button.
                Result: The image is transmitted from your computer to the controller.
                After the transmission, you are automatically returned to the Home dialog.
          For more information about the firmware update and creating a new flash disk with firmware, refer
          to Project Settings - Firmware Update and Flash Memory Organization (see page 28).
Introduction
         The Modicon M251 Logic Controller allows file transfers with an SD card.
         To upload or download files to the controller with an SD card, use one of the following methods:
          The clone function (use of an empty SD card)
          A script stored in the SD card
         When an SD card is inserted into the SD card slot of the controller, the firmware searches and
         executes the script contained in the SD card (/sys/cmd/Script.cmd).
         NOTE: The controller operation is not modified during file transfer.
         The Mass Storage (USB or SDCard) editor lets you generate and copy the script and all
         necessary files into the SD card.
         NOTE: The Modicon M251 Logic Controller accepts only SD card formatted in FAT or FAT32.
                                                    WARNING
          UNINTENDED EQUIPMENT OPERATION
             You must have operational knowledge of your machine or process before connecting this
              device to your controller.
             Ensure that guards are in place so that any potential unintended equipment operation will not
              cause injury to personnel or damage to equipment.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
         If there is a power outage or communication interruption during the transfer of the application
         program or a firmware change, your device may become inoperative. If a communication
         interruption or a power outage occurs, reattempt the transfer.
                                                    NOTICE
          INOPERABLE EQUIPMENT
             Do not interrupt the transfer of the application program or a firmware change once the transfer
              has begun.
             Do not place the device into service until the transfer has completed successfully.
          Failure to follow these instructions can result in equipment damage.
Clone Function
          The clone function allows you to upload the application from one controller and to download it only
          to a same controller reference.
          This function clones every parameter of the controller (for example applications, firmware, data file,
          post configuration). Refer to Memory Mapping (see page 23). However, for security reasons, it
          does not duplicate the Web Server/FTP password, nor any user access-rights, on any targeted
          machine.
          NOTE: Ensure access-rights are disabled in the source controller before doing a clone operation.
          For more details about Access Rights, refer to the SoMachine Programming Guide
          (see SoMachine, Programming Guide).
          This procedure describes how to upload to your SD card the current application stored in the
          controller:
          Step      Action
              1     Erase an SD card and set the card label as follows:
                    CLONExxx
                    NOTE: The label must begin with ‘CLONE’ (not case sensitive), followed by any normal character.
              2     Remove power from the controller.
              3     Insert the prepared SD card in the controller.
              4     Restore power to the controller.
                    Result: The clone operation starts automatically. During the clone operation, the following LEDs
                    are ON: PWR, I/O, and SD.
                    NOTE: The clone operation lasts 2 or 3 minutes.
              5     Wait until the clone operation is completed (the SD LED turns OFF).
                    Result: The controller starts in normal application mode.
              6     Remove the SD card from the controller.
         This procedure describes how to download to your controller the current application stored in the
         SD card:
          Step          Action
               1        Remove power from the controller.
               2        Insert the SD card into the controller.
               3        Restore power to the controller.
                        Result: The clone operation is in progress.
                        NOTE: The SD LED (green) is flashing during the operation.
               4        Wait until the end of the download (the SD LED is solid green):
                         In case of a detected error, the SD LED is turned off, and the ERR (red) and I/O (red) LEDs
                          begin flashing.
                         If the download ended successfully, the ERR LED (red) is flashing regularly, and the SD LED
                          (green) is steady ON.
               5        Remove the SD card to restart the controller.
         NOTE: If you wish to control access to the cloned application in the target controller, you will need
         to enable and establish user access-rights, and any Web Server/FTP passwords, which are
         controller-specific. For more details about Access Rights, refer to the SoMachine Programming
         Guide.
         NOTE: Downloading a cloned application to the controller will first remove the existing application
         from controller memory, regardless of any user access-rights that may be enabled in the target
         controller.
          Element       Description
          New           Create a new script.
          Open          Open a script.
          Macros        Insert a Macro.
                        A macro is a sequence of unitary commands. A macro helps to perform many common
                        operations such as upload application, download application, and so on.
          Generate      Generate the script and all necessary files on the SD card.
          Command       Basic instructions.
          Source        Source file path on the PC or the controller.
          Destination   Destination directory on the PC or the controller.
          Add New       Add a script command.
          Move          Change the script commands order.
          Up/Down
          Delete        Delete a script command.
Commands descriptions:
         NOTE: When UserRights are activated on a controller and if the user is not allowed to
         read/write/delete file system, scripts used to Upload/Download/Delete files are disabled. It
         includes the clone operation. For more details about UserRights, refer to the SoMachine
         Programming Guide (see SoMachine, Programming Guide).
         Macros description
Transfer Procedure
                                                           WARNING
          UNINTENDED EQUIPMENT OPERATION
             You must have operational knowledge of your machine or process before connecting this
              device to your controller.
             Ensure that guards are in place so that any potential unintended equipment operation will not
              cause injury to personnel or damage to equipment.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
          Step    Action
               1 Create the script with the Mass Storage (USB or SDCard) editor.
               2 Click Generate... and select the SD card root directory.
                 Result: The script and files are transferred on the SD card.
               3 Insert the SD card into the controller.
                  NOTE: The SD LED blinks green during transfer.
                  For more information on the LED behavior during the transfer, refer to the Updating Firmware by SD
                  Card (see page 217).
               4 Remove the SD card from the controller.
                  NOTE: Changes will be applied after next restart.
          When the controller has executed the script, the result is logged on the SD card (file
          /sys/cmd/Cmd.log).
                                                           WARNING
          UNINTENDED EQUIPMENT OPERATION
          Consult the controller state and behavior diagram in this document to understand the state that
          will be assumed by the controller after you cycle power.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
EIO0000001462 11/2015
Appendices
Overview
         This appendix lists the documents necessary for technical understanding of the Modicon M251
         Logic Controller Programming Guide.
         Appendix A
         Functions to Get/Set Serial Line Configuration in User Program
Overview
         This section describes the functions to get/set the serial line configuration in your program.
         To use these functions, add the M2xx Communication library.
         For further information on adding a library, refer to the SoMachine Programming Guide.
Function Description
         GetSerialConf returns the configuration parameters for a specific serial line communication
         port.
Graphical Representation
Parameter Description
Example
         Refer to the SetSerialConf (see page 231) example.
Function Description
         SetSerialConf is used to change the serial line configuration.
Graphical Representation
         NOTE: Changing the configuration of the Serial Line(s) port(s) during programming execution can
         interrupt ongoing communications with other connected devices.
                                                 WARNING
          LOSS OF CONTROL DUE TO UNEXPECTED CONFIGURATION CHANGE
          Validate and test all the parameters of the SetSerialConf function before putting your program
          into service.
          Failure to follow these instructions can result in death, serious injury, or equipment
          damage.
Parameter Description
Example
         VAR
                MySerialConf: SERIAL_CONF
                result: WORD;
         END_VAR
Structure Description
        The SERIAL_CONF structure contains configuration information about the serial line port. It
        contains these variables:
         Appendix B
         Controller Performance
Controller Performance
Processing Performance
Introduction
         This chapter provides information about the M251 processing performance.
Logic Processing
         This table presents logic processing performance for various logical instructions:
Glossary
         A
analog output
       Converts numerical values within the logic controller and sends out proportional voltage or current
       levels.
application
       A program including configuration data, symbols, and documentation.
application source
       The collection of human-readable controller instructions, configuration data, HMI instructions,
       symbols, and other program documentation. The application source file is saved on the PC and
       you can download the application source file to most logic controllers. The application source file
       is used to build the executable program that runs in the logic controller.
ARP
         (address resolution protocol) An IP network layer protocol for Ethernet that maps an IP address to
         a MAC (hardware) address.
         B
BCD
         (binary coded decimal) The format that represents decimal numbers between 0 and 9 with a set of
         4 bits (a nybble/nibble, also titled as half byte). In this format, the 4 bits used to encode decimal
         numbers have an unused range of combinations.
         For example, the number 2,450 is encoded as 0010 0100 0101 0000.
BOOL
         (boolean) A basic data type in computing. A BOOL variable can have one of these values: 0
         (FALSE), 1 (TRUE). A bit that is extracted from a word is of type BOOL; for example, %MW10.4 is a
         fifth bit of memory word number 10.
Boot application
       (boot application) The binary file that contains the application. Usually, it is stored in the controller
       and allows the controller to boot on the application that the user has generated.
BOOTP
     (bootstrap protocol) A UDP network protocol that can be used by a network client to automatically
     obtain an IP address (and possibly other data) from a server. The client identifies itself to the server
     using the client MAC address. The server, which maintains a pre-configured table of client device
     MAC addresses and associated IP addresses, sends the client its pre-configured IP address.
     BOOTP was originally used as a method that enabled diskless hosts to be remotely booted over a
     network. The BOOTP process assigns an infinite lease of an IP address. The BOOTP service
     utilizes UDP ports 67 and 68.
byte
        A type that is encoded in an 8-bit format, ranging from 00 hex to FF hex.
        C
CFC
        (continuous function chart) A graphical programming language (an extension of the IEC 61131-3
        standard) based on the function block diagram language that works like a flowchart. However, no
        networks are used and free positioning of graphic elements is possible, which allows feedback
        loops. For each block, the inputs are on the left and the outputs on the right. You can link the block
        outputs to the inputs of other blocks to create complex expressions.
configuration
       The arrangement and interconnection of hardware components within a system and the hardware
       and software parameters that determine the operating characteristics of the system.
continuous function chart language
       A graphical programming language (an extension of the IEC61131-3 standard) based on the
       function block diagram language that works like a flowchart. However, no networks are used and
       free positioning of graphic elements is possible, which allows feedback loops. For each block, the
       inputs are on the left and the outputs on the right. You can link the block outputs to inputs of other
       blocks to create complex expressions.
control network
       A network containing logic controllers, SCADA systems, PCs, HMI, switches, ...
        Two kinds of topologies are supported:
         flat: all modules and devices in this network belong to same subnet.
         2 levels: the network is split into an operation network and an inter-controller network.
        These two networks can be physically independent, but are generally linked by a routing device.
CRC
        (cyclical redundancy check) A method used to determine the validity of a communication
        transmission. The transmission contains a bit field that constitutes a checksum. The message is
        used to calculate the checksum by the transmitter according to the content of the message.
        Receiving nodes, then recalculate the field in the same manner. Any discrepancy in the value of
        the 2 CRC calculations indicates that the transmitted message and the received message are
        different.
         D
data log
       The controller logs events relative to the user application in a data log.
DHCP
         (dynamic host configuration protocol) An advanced extension of BOOTP. DHCP is more
         advanced, but both DHCP and BOOTP are common. (DHCP can handle BOOTP client requests.)
DINT
         (double integer type) Encoded in 32-bit format.
DNS
         (domain name system) The naming system for computers and devices connected to a LAN or the
         Internet.
DTM
         (device type manager) Classified into 2 categories:
           Device DTMs connect to the field device configuration components.
          CommDTMs connect to the software communication components.
         The DTM provides a unified structure for accessing device parameters and configuring, operating,
         and diagnosing the devices. DTMs can range from a simple graphical user interface for setting
         device parameters to a highly sophisticated application capable of performing complex real-time
         calculations for diagnosis and maintenance purposes.
DWORD
    (double word) Encoded in 32-bit format.
         E
EDS
         (electronic data sheet) A file for fieldbus device description that contains, for example, the
         properties of a device such as parameters and settings.
equipment
      A part of a machine including sub-assemblies such as conveyors, turntables, and so on.
Ethernet
       A physical and data link layer technology for LANs, also known as IEEE 802.3.
expansion bus
      An electronic communication bus between expansion I/O modules and a controller.
       F
FBD
       (function block diagram) One of 5 languages for logic or control supported by the standard IEC
       61131-3 for control systems. Function block diagram is a graphically oriented programming
       language. It works with a list of networks, where each network contains a graphical structure of
       boxes and connection lines, which represents either a logical or arithmetic expression, the call of
       a function block, a jump, or a return instruction.
FE
       (functional Earth) A common grounding connection to enhance or otherwise allow normal
       operation of electrically sensitive equipment (also referred to as functional ground in North
       America).
       In contrast to a protective Earth (protective ground), a functional earth connection serves a purpose
       other than shock protection, and may normally carry current. Examples of devices that use
       functional earth connections include surge suppressors and electromagnetic interference filters,
       certain antennas, and measurement instruments.
firmware
       Represents the BIOS, data parameters, and programming instructions that constitute the operating
       system on a controller. The firmware is stored in non-volatile memory within the controller.
flash memory
       A non-volatile memory that can be overwritten. It is stored on a special EEPROM that can be
       erased and reprogrammed.
freewheeling
      When a logic controller is in freewheeling scan mode, a new task scan starts as soon as the
      previous scan has been completed. Contrast with periodic scan mode.
FTP
       (file transfer protocol) A standard network protocol built on a client-server architecture to exchange
       and manipulate files over TCP/IP based networks regardless of their size.
       H
HE10
       Rectangular connector for electrical signals with frequencies below 3 MHz, complying with IEC
       60807-2.
         I
I/O
         (input/output)
ICMP
         (Internet control message protocol) Reports errors detected and provides information related to
         datagram processing.
IEC
         (international electrotechnical commission) A non-profit and non-governmental international
         standards organization that prepares and publishes international standards for electrical,
         electronic, and related technologies.
IEC 61131-3
       Part 3 of a 3-part IEC standard for industrial automation equipment. IEC 61131-3 is concerned with
       controller programming languages and defines 2 graphical and 2 textual programming language
       standards. The graphical programming languages are ladder diagram and function block diagram.
       The textual programming languages include structured text and instruction list.
IL
         (instruction list) A program written in the language that is composed of a series of text-based
         instructions executed sequentially by the controller. Each instruction includes a line number, an
         instruction code, and an operand (refer to IEC 61131-3).
instruction list language
       A program written in the instruction list language that is composed of a series of text-based
       instructions executed sequentially by the controller. Each instruction includes a line number, an
       instruction code, and an operand (see IEC 61131-3).
INT
         (integer) A whole number encoded in 16 bits.
IP
         (Internet protocol Part of the TCP/IP protocol family that tracks the Internet addresses of devices,
         routes outgoing messages, and recognizes incoming messages.
        L
ladder diagram language
       A graphical representation of the instructions of a controller program with symbols for contacts,
       coils, and blocks in a series of rungs executed sequentially by a controller (see IEC 61131-3).
LD
        (ladder diagram) A graphical representation of the instructions of a controller program with symbols
        for contacts, coils, and blocks in a series of rungs executed sequentially by a controller (refer to
        IEC 61131-3).
LINT
        (long integer) A whole number encoded in a 64-bit format (4 times INT or 2 times DINT).
LRC
        (longitudinal redundancy checking) An error-detection method for determining the correctness of
        transmitted and stored data.
LREAL
        (long real) A floating-point number encoded in a 64-bit format.
LWORD
     (long word) A data type encoded in a 64-bit format.
        M
MAC address
      (media access control address) A unique 48-bit number associated with a specific piece of
      hardware. The MAC address is programmed into each network card or device when it is
      manufactured.
MAST
        A processor task that is run through its programming software. The MAST task has 2 sections:
          IN: Inputs are copied to the IN section before execution of the MAST task.
         OUT: Outputs are copied to the OUT section after execution of the MAST task.
MIB
        (management information base) An object database that is monitored by a network management
        system like SNMP. SNMP monitors devices are defined by their MIBs. Schneider Electric has
        obtained a private MIB, groupeschneider (3833).
ms
        (millisecond)
MSB
        (most significant bit/byte The part of a number, address, or field that is written as the left-most
        single value in conventional hexadecimal or binary notation.
         N
network
      A system of interconnected devices that share a common data path and protocol for
      communications.
NMT
         (network management) CANopen protocols that provide services for network initialization,
         detected error control, and device status control.
node
         An addressable device on a communication network.
         P
PDO
         (process data object) An unconfirmed broadcast message or sent from a producer device to a
         consumer device in a CAN-based network. The transmit PDO from the producer device has a
         specific identifier that corresponds to the receive PDO of the consumer devices.
PE
         (Protective Earth) A common grounding connection to help avoid the hazard of electric shock by
         keeping any exposed conductive surface of a device at earth potential. To avoid possible voltage
         drop, no current is allowed to flow in this conductor (also referred to as protective ground in North
         America or as an equipment grounding conductor in the US national electrical code).
post configuration
       (post configuration) An option that allows to modify some parameters of the application without
       changing the application. Post configuration parameters are defined in a file that is stored in the
       controller. They are overloading the configuration parameters of the application.
program
      The component of an application that consists of compiled source code capable of being installed
      in the memory of a logic controller.
protocol
       A convention or standard definition that controls or enables the connection, communication, and
       data transfer between 2 computing system and devices.
       R
REAL
       A data type that is defined as a floating-point number encoded in a 32-bit format.
RJ45
       A standard type of 8-pin connector for network cables defined for Ethernet.
RPDO
       (receive process data object An unconfirmed broadcast message or sent from a producer device
       to a consumer device in a CAN-based network. The transmit PDO from the producer device has a
       specific identifier that corresponds to the receive PDO of the consumer devices.
RTC
       (real-time clock) A battery-backed time-of-day and calender clock that operates continuously, even
       when the controller is not powered for the life of the battery.
       S
scan
       A function that includes:
         reading inputs and placing the values in memory
        executing the application program 1 instruction at a time and storing the results in memory
        using the results to update outputs
SDO
       (service data object) A message used by the field bus master to access (read/write) the object
       directories of network nodes in CAN-based networks. SDO types include service SDOs (SSDOs)
       and client SDOs (CSDOs).
SFC
       (sequential function chart) A language that is composed of steps with associated actions,
       transitions with associated logic condition, and directed links between steps and transitions. (The
       SFC standard is defined in IEC 848. It is IEC 61131-3 compliant.)
SINT
       (signed integer) A 15-bit value plus sign.
SNMP
       (simple network management protocol) A protocol that can control a network remotely by polling
       the devices for their status and viewing information related to data transmission. You can also use
       it to manage software and databases remotely. The protocol also permits active management
       tasks, such as modifying and applying a new configuration.
ST
       (structured text) A language that includes complex statements and nested instructions (such as
       iteration loops, conditional executions, or functions). ST is compliant with IEC 61131-3.
string
         A variable that is a series of ASCII characters.
         T
task
         A group of sections and subroutines, executed cyclically or periodically for the MAST task or
         periodically for the FAST task.
         A task possesses a level of priority and is linked to inputs and outputs of the controller. These I/O
         are refreshed in relation to the task.
         A controller can have several tasks.
TCP
         (transmission control protocol) A connection-based transport layer protocol that provides a
         simultaneous bi-directional transmission of data. TCP is part of the TCP/IP protocol suite.
terminal block
       (terminal block) The component that mounts in an electronic module and provides electrical
       connections between the controller and the field devices.
TPDO
         (transmit process data object) An unconfirmed broadcast message or sent from a producer device
         to a consumer device in a CAN-based network. The transmit PDO from the producer device has a
         specific identifier that corresponds to the receive PDO of the consumer devices.
         U
UDINT
         (unsigned double integer) Encoded in 32 bits.
UDP
         (user datagram protocol) A connectionless mode protocol (defined by IETF RFC 768) in which
         messages are delivered in a datagram (data telegram) to a destination computer on an IP network.
         The UDP protocol is typically bundled with the Internet protocol. UDP/IP messages do not expect
         a response, and are therefore ideal for applications in which dropped packets do not require
         retransmission (such as streaming video and networks that demand real-time performance).
UINT
         (unsigned integer) Encoded in 16 bits.
         V
variable
       A memory unit that is addressed and modified by a program.
       W
watchdog
      A watchdog is a special timer used to ensure that programs do not overrun their allocated scan
      time. The watchdog timer is usually set to a higher value than the scan time and reset to 0 at the
      end of each scan cycle. If the watchdog timer reaches the preset value, for example, because the
      program is caught in an endless loop, an error is declared and the program stopped.
WORD
       A type encoded in a 16-bit format.
Index
A                                      H
ASCII Manager, 185                     Hardware Initialization Values, 57
C                                      I
Controller Configuration               I/O bus configuration, 79
   Controller Selection, 72            I/O configuration general information
   PLC Settings, 73                        general practices, 78
   Services, 75                        Industrial Ethernet
                                           overview, 170
D
DHCP server, 174                       L
Download application, 63               libraries, 19
E                                      M
EtherNet                               Memory Mapping, 23
   EtherNet/IP device, 112, 134        Modbus
Ethernet                                 Protocols, 94
   FTP Server, 109                     Modbus Ioscanner, 187
   Modbus TCP Client/Server, 94        Modbus Manager, 181
   Modbus TCP slave device, 154        Modbus TCP Client/Server
   Services, 87                          Ethernet, 94
   SNMP, 111
   Web server, 96
External Event, 41                     O
                                       Output Behavior, 57, 57, 57
                                       Output Forcing, 57
F
Fast Device Replacement, 175
features
    key features, 15
FTP Server
    Ethernet, 109
G
GetSerialConf, 228
P                         S
Post Conf, 201            Serial Line
   Example, 206              ASCII Manager, 185
   File Management, 204      Modbus Manager, 181
   Presentation, 202      SERIAL_CONF, 232
Post Configuration, 201   SetSerialConf, 229
Post configuration        SNMP
   baud rate, 202, 202       Ethernet, 111
   data bits, 202            Protocols, 111
   device name, 202       Software Initialization Values, 57
Post Configuration        State diagram, 47
   Example, 206           Stop command, 59
   File Management, 204
Post configuration
   gateway adress, 202    T
   IP adress, 202         Task
   IP config mode, 202       Cyclic task, 39
   parity, 202               Event task, 41
Post Configuration           External Event Task, 41
   Presentation, 202         Freewheeling task, 40
Post configuration           Types, 39
   station address, 202      Watchdogs, 42
   stop bit, 202
   subnet mask, 202
   transfer rate, 202     W
programming languages     Web server
   IL, LD, grafcet, 15      Ethernet, 96
Protocols, 87
   IP, 89
   Modbus, 94
   SNMP, 111
R
Reboot, 62
Remanent variables, 66
Reset cold, 60
Reset origin, 61
Reset warm, 60
Run command, 59