M221 Programming Guide
M221 Programming Guide
M221 Programming Guide
EIO0000001360 04/2014
Modicon M221
Logic Controller
Programming Guide
04/2014
EIO0000001360.01
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.
2014 Schneider Electric. All rights reserved.
2 EIO0000001360 04/2014
Table of Contents
Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
About the Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Part I Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 1 About the Modicon M221 Logic Controller . . . . . . . . . 15
TM221C Logic Controller Description . . . . . . . . . . . . . . . . . . . . . . . . . 16
TM221M Logic Controller Description . . . . . . . . . . . . . . . . . . . . . . . . . 20
Chapter 2 Configuration Features . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.1 Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Addressing I/O Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Maximum Number of Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.2 Task Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Tasks and Scan Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Maximum Number of Tasks and Priorities. . . . . . . . . . . . . . . . . . . . . . 37
2.3 Controller States and Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Controller State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Controller States Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Controller State Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Persistent Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Output Behavior. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Part II Configuring the M221 Logic Controller . . . . . . . . 51
Chapter 3 How to Configure a Controller . . . . . . . . . . . . . . . . . . . 53
Building a Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Configuring the M221 Logic Controller . . . . . . . . . . . . . . . . . . . . . . . . 59
Downloading Firmware Updates with an SD Card . . . . . . . . . . . . . . . 60
Updating Firmware using Executive Loader Wizard . . . . . . . . . . . . . . 61
Chapter 4 Embedded Input/Output Configuration . . . . . . . . . . . . 63
Configuring Digital Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Configuring Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Configuring Analog Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Configuring High Speed Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Configuring Pulse Generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
EIO0000001360 04/2014 3
Chapter 5 I/O Bus Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 83
I/O Configuration General Practices . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Maximum Hardware Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Configuring Cartridges and Expansion Modules . . . . . . . . . . . . . . . . . 89
Chapter 6 Embedded Communication Configuration . . . . . . . . . 91
6.1 Ethernet Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Configuring Ethernet Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Configuring Modbus TCP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
6.2 Serial Line Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Configuring Serial Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Part III Programming the M221 Logic Controller . . . . . . 103
Chapter 7 How to Use the Source Code Examples . . . . . . . . . . . 105
How to Use the Source Code Examples . . . . . . . . . . . . . . . . . . . . . . . 105
Chapter 8 I/O Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Digital Inputs (%I). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Digital Outputs (%Q) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Analog Inputs (%IW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Analog Outputs (%QW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Chapter 9 Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
9.1 Fast Counter (%FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Programming Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
9.2 High Speed Counter (%HSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
High Speed Counter in Counting Mode . . . . . . . . . . . . . . . . . . . . . . . . 127
High Speed Counter in Frequency Meter Mode. . . . . . . . . . . . . . . . . . 132
9.3 Pulse (%PLS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Programming Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
9.4 Pulse Width Modulation (%PWM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Programming Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
4 EIO0000001360 04/2014
Chapter 10 System Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
System Bits (%S). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
System Words (%SW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Glossary ......................................... 175
Index ......................................... 179
EIO0000001360 04/2014 5
6 EIO0000001360 04/2014
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, 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.
EIO0000001360 04/2014 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 EIO0000001360 04/2014
About the Book
At a Glance
Document Scope
This document describes the configuration and programming of the Modicon M221 Logic
Controller for SoMachine Basic. For further information, refer to the separate documents provided
in the SoMachine Basic online help.
Validity Note
This document has been updated with the release of SoMachine Basic V1.1.
Related Documents
EIO0000001360 04/2014 9
Title of Documentation Reference Number
Modicon TMC2 Cartridge - Programming Guide EIO0000001782 (ENG)
EIO0000001783 (FRA)
EIO0000001784 (GER)
EIO0000001785 (SPA)
EIO0000001786 (ITA)
EIO0000001787 (CHS)
EIO0000001788 (POR)
EIO0000001789 (TUR)
Modicon TMC2 Cartridge - Hardware Guide EIO0000001768 (ENG)
EIO0000001769 (FRE)
EIO0000001770 (GER)
EIO0000001771 (SPA)
EIO0000001772 (ITA)
EIO0000001773 (CHS)
EIO0000001775 (TUR)
EIO0000001774 (POR)
Modicon TM3 Expansion Modules Configuration - Programming EIO0000001396 (ENG)
Guide EIO0000001397 (FRA)
EIO0000001398 (GER)
EIO0000001399 (SPA)
EIO0000001400 (ITA)
EIO0000001401 (CHS)
EIO0000001374 (POR)
EIO0000001375 (TUR)
Modicon TM3 Digital I/O Modules - Hardware Guide EIO0000001408 (ENG)
EIO0000001409 (FRA)
EIO0000001410 (GER)
EIO0000001411 (SPA)
EIO0000001412 (ITA)
EIO0000001413 (CHS)
EIO0000001376 (POR)
EIO0000001377 (TUR)
Modicon TM3 Analog I/O Modules - Hardware Guide EIO0000001414 (ENG)
EIO0000001415 (FRA)
EIO0000001416 (GER)
EIO0000001417 (SPA)
EIO0000001418 (ITA)
EIO0000001419 (CHS)
EIO0000001378 (POR)
EIO0000001379 (TUR)
10 EIO0000001360 04/2014
Title of Documentation Reference Number
Modicon TM3 Expert Modules - Hardware Guide EIO0000001420 (ENG)
EIO0000001421 (FRA)
EIO0000001422 (GER)
EIO0000001423 (SPA)
EIO0000001424 (ITA)
EIO0000001425 (CHS)
EIO0000001380 (POR)
EIO0000001381 (TUR)
Modicon TM3 Transmitter and Receiver Modules - Hardware Guide EIO0000001426 (ENG)
EIO0000001427 (FRA)
EIO0000001428 (GER)
EIO0000001429 (SPA)
EIO0000001430 (ITA)
EIO0000001431 (CHS)
EIO0000001382 (POR)
EIO0000001383 (TUR)
Modicon TM2 Expansion Modules Configuration - Programming EIO0000000396 (ENG)
Guide EIO0000000397 (FRE)
EIO0000000398 (GER)
EIO0000000399 (SPA)
EIO0000000400 (ITA)
EIO0000000401 (CHS)
Modicon TM2 Digital I/O Modules - Hardware Guide EIO0000000028 (ENG)
EIO0000000029 (FRA)
EIO0000000030 (GER)
EIO0000000031 (SPA)
EIO0000000032 (ITA)
EIO0000000033 (CHS)
Modicon TM2 Analog I/O Modules - Hardware Guide EIO0000000034 (ENG)
EIO0000000035 (FRA)
EIO0000000036 (GER)
EIO0000000037 (SPA)
EIO0000000038 (ITA)
EIO0000000039 (CHS)
You can download these technical publications and other technical information from our website
at www.schneider-electric.com.
EIO0000001360 04/2014 11
Product Related Information
WARNING
LOSS OF CONTROL
z 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.
z Separate or redundant control paths must be provided for critical control functions.
z System control paths may include communication links. Consideration must be given to the
implications of unanticipated transmission delays or failures of the link.
z Observe all accident prevention regulations and local safety guidelines.1
z 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
z Only use software approved by Schneider Electric for use with this equipment.
z 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.
12 EIO0000001360 04/2014
Modicon M221
Introduction
EIO0000001360 04/2014
Introduction
Part I
Introduction
Overview
This part provides general information about the Modicon M221 Logic Controller and its
configuration and programming features.
EIO0000001360 04/2014 13
Introduction
14 EIO0000001360 04/2014
Modicon M221
About the Modicon M221 Logic Controller
EIO0000001360 04/2014
Chapter 1
About the Modicon M221 Logic Controller
EIO0000001360 04/2014 15
About the Modicon M221 Logic Controller
Overview
The TM221C Logic Controller has various powerful features and can service a wide range of
applications.
Software configuration, programming, and commissioning are accomplished with the SoMachine
Basic software described in the SoMachine Basic Operating Guide and the M221 Logic Controller
- Programming Guide.
Programming Languages
The M221 Logic Controller is configured and programmed with the SoMachine Basic software,
which supports the following IEC 61131-3 programming languages:
z IL: Instruction List
z LD: Ladder Diagram
z Grafcet (List)
Power Supply
The power supply of the TM221C Logic Controller is 24 Vdc or 100...240 Vac.
Run/Stop
The M221 Logic Controller can be operated externally by the following:
z a hardware Run/Stop switch
z a Run/Stop operation by a dedicated digital input, defined in the software configuration (for more
information, refer to Configuring Digital Inputs (see page 64).)
z SoMachine Basic software (for more information, refer to Toolbar (see SoMachine Basic,
Operating Guide)).
Memory
This table describes the different types of memory:
16 EIO0000001360 04/2014
About the Modicon M221 Logic Controller
Embedded Inputs/Outputs
The following embedded I/O types are available, depending on the controller reference:
z Regular inputs
z Fast inputs associated with counters
z Regular sink/source transistor outputs
z Fast sink/source transistor outputs associated with pulse generators
z Relay outputs
z Analog inputs
z Analog outputs
Removable Storage
The M221 Logic Controllers include an embedded SD card slot.
The main uses of the SD card are:
z Initializing the controller with a new application
z Updating the controller firmware
EIO0000001360 04/2014 17
About the Modicon M221 Logic Controller
18 EIO0000001360 04/2014
About the Modicon M221 Logic Controller
Delivery Content
The following figure shows the content of the delivery for a TM221C Logic Controller:
EIO0000001360 04/2014 19
About the Modicon M221 Logic Controller
Overview
The TM221M Logic Controller has various powerful features and can service a wide range of
applications.
Hardware configuration, programming, and commissioning are accomplished with the SoMachine
Basic software described in the SoMachine Basic - Operating Guide.
Programming Languages
The M221 Logic Controller is configured and programmed with the SoMachine Basic software,
which supports the following IEC 61131-3 programming languages:
z IL: Instruction List
z LD: Ladder Diagram
z Grafcet (List)
Power Supply
The power supply of the TM221M Logic Controller is 24 Vdc (see Modicon M221 Logic Controller,
Hardware Guide).
Run/Stop
The M221 Logic Controller can be operated externally by the following:
z a hardware Run/Stop switch
z a Run/Stop operation by a dedicated digital input, defined in the software configuration (for more
information, refer to Configuring Digital Inputs (see page 64))
z SoMachine Basic software (for more information, refer to Toolbar (see SoMachine Basic,
Operating Guide)).
Memory
This table describes the different types of memory:
20 EIO0000001360 04/2014
About the Modicon M221 Logic Controller
Embedded Inputs/Outputs
The following embedded I/O types are available, depending on the controller reference:
z Regular inputs
z Fast inputs (HSC)
z Regular transistor outputs
z Fast transistor outputs (PWM/PLS)
z Relay outputs
z Analog inputs
z Analog outputs
EIO0000001360 04/2014 21
About the Modicon M221 Logic Controller
22 EIO0000001360 04/2014
About the Modicon M221 Logic Controller
Delivery Content
The following figure shows the content of the delivery for a TM221M Logic Controller:
EIO0000001360 04/2014 23
About the Modicon M221 Logic Controller
24 EIO0000001360 04/2014
Modicon M221
Configuration Features
EIO0000001360 04/2014
Configuration Features
Chapter 2
Configuration Features
Introduction
This chapter provides information related to M221 Logic Controller memory mapping, task, states,
behaviors, objects, and functions. The topics explained in this chapter allow the operator to
understand the featured specifications of M221 Logic Controller that are primarily needed to
configure and program the controller in SoMachine Basic.
EIO0000001360 04/2014 25
Configuration Features
Objects
Section 2.1
Objects
26 EIO0000001360 04/2014
Configuration Features
Objects
Overview
In SoMachine Basic, the term object is used to represent an area of logic controller memory
reserved for use by an application. Objects can be:
z Simple software variables, such as memory bits and words
z Addresses of digital or analog inputs and outputs
z Controller-internal variables, such as system words and system bits
z Predefined system functions or function blocks, such as timers and counters.
Controller memory is either pre-allocated for certain object types, or automatically allocated when
an application is downloaded to the logic controller.
Objects can only be addressed by a program once memory has been allocated. Objects are
addressed using the prefix %. For example, %MW12 is the address of a memory word, %Q0.3 is the
address of an embedded digital output, and %TM0 is the address of a Timer function block.
EIO0000001360 04/2014 27
Configuration Features
Object Types
Introduction
The language objects for the M221 Logic Controller are classified as follows in the SoMachine
Basic software:
z Memory objects
z System objects
z I/O objects
z Software objects
28 EIO0000001360 04/2014
Configuration Features
Memory objects and software objects are generic objects used in SoMachine Basic, whereas
system objects and I/O objects are controller-specific. All controller-specific objects are discussed
in the Programming (see page 103) section.
For programming details of memory objects and software objects, refer to the SoMachine Basic
Generic Functions Library Guide.
EIO0000001360 04/2014 29
Configuration Features
Addressing Examples
This table shows addressing examples for various object types:
30 EIO0000001360 04/2014
Configuration Features
EIO0000001360 04/2014 31
Configuration Features
Description
This table provides information about the maximum number of objects supported by the M221
Logic Controller:
32 EIO0000001360 04/2014
Configuration Features
EIO0000001360 04/2014 33
Configuration Features
Task Structure
Section 2.2
Task Structure
34 EIO0000001360 04/2014
Configuration Features
Overview
The Modicon TM221M Logic Controller supports the following task types:
z Master task
z Periodic task
z Event task
The master tasks can be configured in either of the following scan modes:
z Freewheeling mode
z Periodic mode
For more information, refer to the Configuring Program Behavior and Tasks (see SoMachine
Basic, Operating Guide).
Tasks
Master tasks are triggered by continuous cyclic scanning or by the software times by specifying the
scan period 2...150 ms (default 100 ms) in the periodic mode.
Periodic tasks are triggered by software timers, so are configured by specifying the scan period
5...255 ms (default 255 ms) in the periodic mode.
Event tasks are triggered by the physical inputs or the HSC function blocks. These events are
associated with embedded digital inputs (%I0.2...%I0.5) (rising, falling or both edges) or with the
high speed counters (%HSC0 and %HSC1) (when the count reaches the high speed counter
threshold). You can configure 2 events for each HSC function block.
You must configure one priority for each event task. The priority range is 0...7 and the priority 0 has
the highest priority.
Scan Modes
The freewheeling mode is a continuous cyclic scanning mode. In this mode, a new scan starts
immediately after the previous scan has completed.
This figure shows the relationship between master tasks and periodic tasks when the master task
is in freewheeling mode:
EIO0000001360 04/2014 35
Configuration Features
In periodic mode, the logic controller waits until the configured scan time has elapsed before
starting a new scan. Every scan is therefore the same duration.
This figure shows the relationship between master tasks and periodic tasks when the master task
is in periodic mode:
Event priorities control the relationship between the event tasks, master tasks, and periodic tasks.
The event task interrupts the master task and periodic task execution.
This figure shows the relationship between event tasks, master tasks, and periodic tasks in the
periodic mode:
The event tasks are triggered by a hardware interruption that sends a task event to the event task.
Watchdog Timer
You can configure a specific watchdog timer for the master task and periodic tasks. If the task
execution time exceeds the configured watchdog timer period, the logic controller goes to the
HALTED state. This watchdog timer is managed by the software timers.
A system watchdog timer checks if the user logic is loading more than 80% of the CPU processing
capacity.
36 EIO0000001360 04/2014
Configuration Features
Description
This table summarizes the task types, available scan modes for each task, scan mode triggering
conditions, operator configurable ranges, maximum number of each task, and their execution
priorities:
EIO0000001360 04/2014 37
Configuration Features
Section 2.3
Controller States and Behaviors
Introduction
This section 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 persistent
variables and the effect of SoMachine Basic task programming options on the behavior of your
system.
38 EIO0000001360 04/2014
Configuration Features
EIO0000001360 04/2014 39
Configuration Features
Introduction
This section provides a detailed description of the controller states.
WARNING
UNINTENDED EQUIPMENT OPERATION
z 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.
z Before performing any of these operations, consider the effect on all connected equipment.
z Before acting on a controller, always positively confirm the controller state by viewing its LEDs,
confirming the condition of the Run/Stop input, checking for the presence of output forcing, and
reviewing the controller status information via SoMachine Basic.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
When using Automatic Start in Run, the controller will start executing program logic when power is
applied to the equipment. It is essential to know in advance how automatic reactivation of the
outputs will affect the process or machine being controlled. Configure the Run/Stop input to help
control the Automatic Start in Run feature. In addition, the Run/Stop input is designed to give local
control over remote RUN commands. If the possibility of a remote RUN command after the
controller had been stopped locally by SoMachine would have unintended consequences, you
must configure and wire the Run/Stop input to help control this situation.
WARNING
UNINTENDED MACHINE START-UP
z Confirm that the automatic reactivation of the outputs does not produce unintended
consequences before using the Automatic Start in Run setting.
z Use the Run/Stop input to help avoid an unwanted restart in Run mode and to help prevent
the unintentional start-up from a remote location.
z Verify the state of security of your machine or process environment before applying power to
the Run/Stop input or before issuing a Run command from a remote location.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
40 EIO0000001360 04/2014
Configuration Features
EIO0000001360 04/2014 41
Configuration Features
42 EIO0000001360 04/2014
Configuration Features
NOTE: The system word %SW6 indicates the logic controller state (EMPTY, STOPPED, RUNNING,
HALTED, and POWERLESS).
EIO0000001360 04/2014 43
Configuration Features
Boot Controller
Effect: Command a reboot of the controller, for details about power-on sequence see the controller
state diagram (see page 39).
Methods:
z Power cycle
z Reboot by script
z The script on an SD card can issue a REBOOT as its final command.
Application Download
Effect: Download the application into the controller memory.
Methods:
z SoMachine Basic online button:
z Select the PC to controller (download) command.
Effect: Erase the current application and set the controller in EMPTY state. If download is
successful, a Cold Start is done and the controller is set in STOPPED state.
z Application file transfer by SD card:
z Effect: At the next reboot, erase the current application and copies the application files from
the SD card to the controller memory. If download is successful, a Cold Start is done and the
controller is set in STOPPED state.
Initialize Controller
Effect: Sets the controller in EMPTY state, and then after a Cold Start in STOPPED state.
Methods:
z SoMachine Basic online button:
z Select the Initialize controller command.
RUN Controller
Effect: Command a transition to the RUNNING controller state.
Methods:
z Run/Stop (see Modicon M221 Logic Controller, Hardware Guide) switch on front face:
z It commands a transition to RUNNING state on rising edge.
44 EIO0000001360 04/2014
Configuration Features
STOP Controller
Effect: Command a transition to the STOPPED controller state.
Methods:
z Run/Stop (see Modicon M221 Logic Controller, Hardware Guide) switch on front face:
z It forces a transition to STOPPED state on low level.
z Download command:
z It needs the controller to be set in STOPPED state (after the download the controller is in
STOPPED state).
Cold Start
Cold Start is defined to be a power-up with all data initialized to its default values, and User Logic
started from the beginning of the program with all program variables cleared. In a Cold Start
everything is initialized: software and hardware settings.
Cold Start occurs for the following reasons:
z Boot controller without validated application online modification.
z PLC without a charged backup battery always powers up via a Cold Start.
z Application Download
z Initialize controller
EIO0000001360 04/2014 45
Configuration Features
Warm Start
The Warm Start simply resume running the USER logic program, in its last operating state, with all
counters, function blocks, and system words and bits preserved.
46 EIO0000001360 04/2014
Configuration Features
Persistent Variables
EIO0000001360 04/2014 47
Configuration Features
Output Behavior
Introduction
The 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.
The possible output behaviors and the controller states to which they apply are:
z Managed by application program
z Initialization values
z Fallback Mode (see SoMachine Basic, Operating Guide)
z Maintain values
z Fallback values
z Output forcing
Initialization Values
This output state applies in the BOOTING, EMPTY and POWERLESS states.
In the initialization state, the outputs assume the following values:
z For embedded outputs:
z Fast transistor output: 0 Vdc
z Regular transistor output: 0 Vdc
z Relay output: Open
z Expert I/O functions (PLS/PWM, HSC): 0 Vdc
Fallback Values
This output state applies in the STOPPED and HALTED states.
In the fallback mode, the outputs assume the following values:
z For embedded outputs:
z Fast transistor output: according to fallback setting (Fallback Behavior (see SoMachine
Basic, Operating Guide))
z Regular transistor output: according to fallback setting (Fallback Behavior)
z Relay output: according to fallback setting (Fallback Behavior)
z Expert I/O functions (PLS/PWM, HSC):
- Fallback value: according to fallback setting (Fallback Behavior)
- Maintain values: 0 Vdc
48 EIO0000001360 04/2014
Configuration Features
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
Basic.
To do so, use the Force command in an animation table.
Output forcing overrides all other commands to an output irrespective of the task programming that
is being executed.
The forcing is not released by online change or logout of SoMachine Basic.
The forcing is automatically released by Cold Start (see page 45) and Download application
(see page 44) command.
The forcing does not apply for expert I/O functions (PLS, PWM, and HSC).
WARNING
UNINTENDED EQUIPMENT OPERATION
z You must have a thorough understanding of how forcing will affect the outputs relative to the
tasks being executed.
z 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.
z If you force an output and there is no apparent affect on the physical output, do not exit
SoMachine Basic without removing the forcing.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
EIO0000001360 04/2014 49
Configuration Features
50 EIO0000001360 04/2014
Modicon M221
Configuring the M221 Logic Controller
EIO0000001360 04/2014
Part II
Configuring the M221 Logic Controller
Overview
This part provides information about how to configure the M221 Logic Controller references.
EIO0000001360 04/2014 51
Configuring the M221 Logic Controller
52 EIO0000001360 04/2014
Modicon M221
How to Configure a Controller
EIO0000001360 04/2014
Chapter 3
How to Configure a Controller
Overview
This chapter describes how to build a configuration in SoMachine Basic and configure the M221
Logic Controller.
EIO0000001360 04/2014 53
How to Configure a Controller
Building a Configuration
Introduction
Configure a controller by building a configuration in SoMachine Basic. To build a configuration, first
create a new project or open an existing project.
Refer to SoMachine Basic Operating Guide for information on how to:
z create or open an existing project
z replace the default logic controller
z add an expansion module to the logic controller
z add a cartridge to the logic controller
z save the project.
Some general information about the SoMachine Basic user interface is provided below.
Start Page
The start page window is always displayed when you launch SoMachine Basic. Use this window
to register the SoMachine Basic software, manage the connection to the logic controller, and
create or select a project to work with.
1 Toolbar
2 Status bar
3 Module tabs
54 EIO0000001360 04/2014
How to Configure a Controller
Item Description
Toolbar Provides easy access to commonly used functions.
For more information, refer to the Toolbar .
Status bar Displays status and information messages on the current system status.
For more information, refer to the Status bar.
Module tabs To develop an application, work your way through the module tabs from left to right:
z Properties
Set up the project properties.
z Configuration
Replicate and configure the hardware configuration of the logic controller and
associated expansion modules.
z Programming
Develop the program in one of the supported programming languages.
z Commissioning
Manage the connection between SoMachine Basic and the logic controller,
upload/download applications, test, and commission the application.
Hardware Tree
The hardware tree is displayed on left-hand side in the Configuration window. It shows a
structured view of the current hardware configuration. When you add a controller, an expansion
module, or a cartridge to the project, several nodes are automatically added to the hardware tree.
NOTE: The nodes in the hardware tree are specific to the controller and the hardware
configuration. These nodes depend on the I/O functions that the controller, expansion modules,
and cartridges provide.
This figure shows the hardware tree of the controller configuration:
Item Description
Digital inputs Use to configure the embedded digital inputs of the logic controller.
Digital outputs Use to configure the embedded digital outputs of the logic controller.
n Serial line number (1 or 2, controller-specific).
EIO0000001360 04/2014 55
How to Configure a Controller
Item Description
Analog inputs Use to configure the embedded analog inputs of the logic controller.
High Speed Counters Use to configure the embedded high speed counting functions (HSC).
Pulse Generators Use to configure the embedded pulse generator functions (PLS/PWM).
IO Bus Use to configure the expansion modules and cartridges connected to the logic
controller.
ETH1 Use to configure the embedded Ethernet communications.
Modbus TCP Use to configure the Modbus TCP for the Ethernet communications.
SLn (Serial line) Use to configure the embedded serial line or the serial line added using a cartridge.
n Serial line number (1 or 2, controller-specific).
Editor
The editor area is displayed in center of the Configuration window. It displays the graphical
representation of hardware configuration of the devices. The hardware configuration in a project
can be:
z only a controller
z a controller with cartridge
z a controller with expansion modules
z a controller with cartridge and expansion modules.
If you add an expansion module to the configuration, the expansion module appears at the right-
hand side of the controller or the previously added expansion module. Cartridges are added on the
controller in the cartridge slot.
When configuring a controller, a cartridge, or an expansion module, the configuration properties of
the node currently selected in the hardware tree are displayed below the graphical configuration.
These properties allow you to configure the device.
56 EIO0000001360 04/2014
How to Configure a Controller
This figure shows the configuration of a controller with an expansion module (the controller is
selected):
EIO0000001360 04/2014 57
How to Configure a Controller
Catalog
The catalog area is displayed on right-hand side in the Configuration window. It displays the
complete range of the logic controllers, expansion modules, and cartridges that can be configured
using SoMachine Basic. It also provides a short description of the selected device.
You can drag-and-drop the objects from the catalog area to the editor area. You can also replace
the existing controller by a different controller with simple drag-and-drop from the catalog.
This figure shows the catalog of the logic controllers and the expansion modules:
58 EIO0000001360 04/2014
How to Configure a Controller
Controller Configuration
Controller configuration depends on the number and type of embedded input/outputs, I/O objects,
and communication ports.
Use the Configuration tab to configure the properties of your controller and the expansion
modules. Select a node in the hardware tree to configure the properties of the controller.
This table shows the available configurations of the M221 Logic Controller:
EIO0000001360 04/2014 59
How to Configure a Controller
Overview
You can use an SD card to download firmware updates directly to the logic controller.
Refer to Controller States and Behavior (see page 38) for information on the logic controller
operating states and status of the LEDs.
Step Action
1 Stop the logic controller and unplug the USB programming cable if connected.
2 Insert an empty SD card into the PC that is running SoMachine Basic.
3 Copy the firmware update files to the root folder of the SD card. For example:
4 Remove the SD card from the PC and insert it into the SD card slot of the logic controller.
5 Start the logic controller.
Result: Copying of the firmware file begins. During the operation, the SD system LED on the
logic controller is On. Do not stop the logic controller while the operation is in progress.
NOTE: The firmware download process has a low priority in order to minimize impact on the user
logic and communication performance of the logic controller. Depending on the amount of free
time in your program, the operation may take considerably longer to complete if the logic
controller is in RUN or STOP mode than if it is in BOOTING mode.
6 When the SD system LED is turned Off, remove the SD card.
7 Reconnect the USB programming cable to the logic controller and login to the logic controller
with the SoMachine Basic software.
60 EIO0000001360 04/2014
How to Configure a Controller
Overview
You can update the executives of the controller using the executive loader wizard (OS loader).
Refer to Controller States and Behavior (see page 38) for information on the logic controller
operating states and status of the LEDs.
Step Action
1 Close all Windows applications, including virtual machines.
2 Click Start Programs Schneider Electric SoMachine Basic M221 Firmware Update
or run the ExecLoaderWizard.exe from SoMachine Basic installation folder\Execloader folder.
EIO0000001360 04/2014 61
How to Configure a Controller
62 EIO0000001360 04/2014
Modicon M221
Embedded Input/Output Configuration
EIO0000001360 04/2014
Chapter 4
Embedded Input/Output Configuration
Overview
This chapter describes how to configure the embedded I/O objects of the M221 Logic Controller.
The number of embedded inputs and outputs depends on the controller reference. For more
information, refer to the tables TM221C Logic Controllers (see page 17) and TM221M Logic
Controller (see page 21)s.
EIO0000001360 04/2014 63
Embedded Input/Output Configuration
Introduction
By default, all digital inputs are used as regular inputs. Some of the digital inputs are fast and can
be used by configuring the high speed counters (see page 72) while other inputs can be configured
as event sources.
Step Action
1 Click the Digital inputs node in the hardware tree to display the digital input properties.
This figure shows the properties of the digital inputs in the editor area:
64 EIO0000001360 04/2014
Embedded Input/Output Configuration
EIO0000001360 04/2014 65
Embedded Input/Output Configuration
Event Yes Not Used Not Used Allows you to select an event that triggers
Falling the inputs %I0.2...%I0.5.
Edge By default, this option is disabled due to
Rising default value of Filtering. Set the
Edge Filtering to No Filter to enable the Event
Both option.
edges If you select an event from the drop-down
list (other than Not Used), the Priority
parameter enables for editing to set the
priority of the event.
66 EIO0000001360 04/2014
Embedded Input/Output Configuration
Additional configuration details are displayed in the Programming tab. For more information, refer
to Digital Inputs (%I) (see page 110).
EIO0000001360 04/2014 67
Embedded Input/Output Configuration
Introduction
By default, all digital outputs are used as regular outputs. For controllers equipped with transistor
outputs, 2 outputs are fast transistor outputs and can be used by configuring the pulse generators
(see page 80).
Step Action
1 Click the Digital outputs node in the hardware tree to display the digital output properties.
This figure shows the properties of the digital outputs in the editor area:
68 EIO0000001360 04/2014
Embedded Input/Output Configuration
Additional configuration details are displayed in the Programming tab. For more information, refer
to Digital Outputs (%Q) (see page 111).
EIO0000001360 04/2014 69
Embedded Input/Output Configuration
Introduction
The analog inputs do not have any configurable property in SoMachine Basic. By default, analog
inputs are used as regular inputs.
Step Action
1 Click the Analog inputs node in the hardware tree to display the analog input properties.
This figure shows the properties of the analog inputs in the editor area:
70 EIO0000001360 04/2014
Embedded Input/Output Configuration
Additional configuration details are displayed in the Programming tab. For more information, refer
to Analog Inputs (%IW) (see page 112).
EIO0000001360 04/2014 71
Embedded Input/Output Configuration
Introduction
You can configure high speed counters to perform any one of the following functions:
z Up/down counter
z Bi-phase counter
z Single counter
z Frequency meter
The high speed counter supports counting of digital inputs up to frequencies of 60 kHz in single
word or double word computational mode.
72 EIO0000001360 04/2014
Embedded Input/Output Configuration
Step Action
1 Click the High Speed Counters node in the hardware tree to display the high speed counter
properties.
This figure shows the properties of the high speed counters in the editor area:
This table describes each parameter of the high speed counters configuration:
EIO0000001360 04/2014 73
Embedded Input/Output Configuration
For details on the configuration of the Up/Down Counter, Bi-Phase Counter, and Single
Counter, refer to Configuring High Speed Counters (see page 75).
For details on the configuration of the Frequency Meter, refer to Configuring Frequency Meter
(see page 79).
74 EIO0000001360 04/2014
Embedded Input/Output Configuration
Item Description
1 Displays the title of the assistant dialog window.
If you are configuring the counter %HSC0, the window title appears as High Speed Counter Assistant
(%HSC0) and for the counter %HSC1, the window title appears as High Speed Counter Assistant
(%HSC1).
2 Displays the dedicated inputs, auxiliary inputs, and reflex outputs.
Properties in this area of the assistant window are different for each counter type. However, the other
parameters of this window remain same in all the cases.parameters remain same. These properties
depend upon the selected counter type for both %HSC0 and %HSC1. For more details, refer to the
Dedicated I/O Assignments (see page 72) section.
EIO0000001360 04/2014 75
Embedded Input/Output Configuration
This table describes each parameter of the assistant screen for the counters Up/Down Counter,
Bi-Phase Counter, and Single Counter, for both %HSC0 and %HSC1:
0...4294967295 0
(Double Word) (Double Word)
Threshold S0 Yes 0...65535 65535 Allows you to specify the value of
(Word) (Word) the HSC flag S0 that contains the
value of the threshold TH0.
0...4294967295 4294967295
(Double Word) (Double Word)
Threshold S1 Yes 0...65535 0...65535 Allows you to specify the value for
(Word) (Word) the HSC flag S1 that contains the
value of the threshold TH1.
0...4294967295 0...4294967295
(Double Word) (Double Word)
Trigger Yes Not Used Not Used Allows you to select a triggering
Falling Edge function for an event (for both
Rising Edge threshold TH0 and TH1) from the
Both edges drop-down list.
If you select a triggering function
from the drop-down list (other than
Not Used), the Priority parameter
enables for editing to set the
priority of the event.
Priority Yes 0...7 7 Allows you to set the priority of the
triggering function of an event (for
both threshold TH0 and TH1).
This field enables only when you
select a triggering function for the
event.
Subroutine No any empty Displays the subroutine associated
with an input configured as an
event (for both threshold TH0 and
TH1).
76 EIO0000001360 04/2014
Embedded Input/Output Configuration
EIO0000001360 04/2014 77
Embedded Input/Output Configuration
78 EIO0000001360 04/2014
Embedded Input/Output Configuration
This table describes each parameter of the High Speed Counter Assistant (%HSCx) window for
the counter type Frequency Meter:
EIO0000001360 04/2014 79
Embedded Input/Output Configuration
Introduction
The pulse generator function blocks, Pulse (PLS) and Pulse Width Modulation (PWM) are used to
generate square wave signals on dedicated output channels %Q0.0 or %Q0.1, with variable width
and duty cycle.
Step Action
1 Click the Pulse Generators node in the hardware tree to display the pulse generator properties.
This figure shows the properties of the pulse generators in the editor area:
80 EIO0000001360 04/2014
Embedded Input/Output Configuration
Time Base Yes 0.1 ms 1s Allows you to select the time base for
1 ms the frequency measurement.
10 ms
1s
Preset Yes Refer to the table 0 Allows you to specify the preset value
below for for the pulse train output.
complete range
of PLS and PWM
pulse generators.
Double Word Yes False True/False Allows you to toggle between the data
size of Word (16 bits) and Double Word
(32 bits).
By default, this parameter is disabled,
which indicates that the current data
size is Word (16 bits).
Enabling this field changes the data
size to Double Word (32 bits).
Dedicated No Normal Output Normal Output Indicates the output type of the pulse
Output Pulse Output generator.
When the output channel is configured
for the pulse or the pulse width
modulation, it displays Pulse Output
and when not used for pulse output, it
displays Normal Output.
EIO0000001360 04/2014 81
Embedded Input/Output Configuration
82 EIO0000001360 04/2014
Modicon M221
I/O Bus Configuration
EIO0000001360 04/2014
Chapter 5
I/O Bus Configuration
Overview
This chapter describes how to configure the I/O bus (expansion modules) of the M221 Logic
Controller.
EIO0000001360 04/2014 83
I/O Bus Configuration
WARNING
UNINTENDED EQUIPMENT OPERATION
Update the configuration of your program each time you add or delete any type of I/O expansions,
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.
84 EIO0000001360 04/2014
I/O Bus Configuration
Introduction
The M221 Logic Controller is a control system that offers an all-in-one solution with optimized
configurations and an expandable architecture.
Application requirements determine the architecture of your M221 Logic Controller configuration.
The following figure represents the components of a local configuration:
EIO0000001360 04/2014 85
I/O Bus Configuration
NOTE: It is prohibited to mount a TM2 module before any TM3 module as indicated in the following
figure:
Application requirements determine the architecture of your M221 Logic Controller configuration.
NOTE: You cannot use TM2 modules in configurations that include the TM3 transmitter and
receiver modules.
The following figure represents the components of a remote configuration:
86 EIO0000001360 04/2014
I/O Bus Configuration
NOTE: The configuration with its TM3 and TM2 expansion modules is validated by SoMachine
Basic software in the Configuration window.
NOTE: In some environments, the maximum configuration populated by high consummation
modules, coupled with the maximum distance allowable between the TM3 transmitter and receiver
modules, may present bus communication issues although the SoMachine Basic software allows
for the configuration. In such a case you will need to analyze the consummation of the modules
chosen for your configuration, as well as the minimum cable distance required by your application,
and possibly seek to optimize your choices.
EIO0000001360 04/2014 87
I/O Bus Configuration
NOTE: Expansion modules consume current from the 5 Vdc and 24 Vdc supplied to the I/O Bus.
Therefore, the current delivered by the logic controller to the I/O Bus defines the maximum number
of expansion modules that can be connected to the I/O Bus (validated by SoMachine Basic
software in the Configuration window).
88 EIO0000001360 04/2014
I/O Bus Configuration
Introduction
In your project, you can add the following devices to the controller:
z TMC2 Cartridges
z TM3 Digital I/O Modules
z TM3 Expert I/O Modules
z TM2 Digital I/O Modules
z TM2 Analog I/O Modules
TMC2 Cartridges
For more information about cartridge configuration, refer to the following programming and
hardware guides:
EIO0000001360 04/2014 89
I/O Bus Configuration
90 EIO0000001360 04/2014
Modicon M221
Embedded Communication Configuration
EIO0000001360 04/2014
Chapter 6
Embedded Communication Configuration
Overview
This chapter describes how to configure the communication features of the M221 Logic Controller.
EIO0000001360 04/2014 91
Embedded Communication Configuration
Ethernet Configuration
Section 6.1
Ethernet Configuration
92 EIO0000001360 04/2014
Embedded Communication Configuration
Introduction
You can configure the TCP/IP connection to the logic controller by configuring the Ethernet
network. The Ethernet establishes a local area network (LAN) between the logic controller and the
other devices. The Ethernet configuration provides you the ability to configure the IP address of
the network device.
NOTE: The controller-PC link uses the TCP/IP protocol. It is required for this protocol to be
installed on the PC.
You can obtain the Ethernet IP address by the following protocols:
z Dynamic Host Configuration Protocol (DHCP)
z Bootstrap Protocol (BOOTP)
You can also specify the Ethernet IP address by specifying the following addresses:
z IP address
z Subnet mask
z Gateway address
Ethernet Configuration
This table describes how to configure the Ethernet:
Step Action
1 Click the ETH1 node in the hardware tree to display the Ethernet properties.
This figure shows the Ethernet properties in the editor area:
EIO0000001360 04/2014 93
Embedded Communication Configuration
94 EIO0000001360 04/2014
Embedded Communication Configuration
EIO0000001360 04/2014 95
Embedded Communication Configuration
Introduction
You can configure the Ethernet port to enable the embedded Modbus TCP server giving the logic
controller Modbus TCP abilities.
Step Action
1 Click the Modbus TCP node that appears below the ETH1 node in the hardware tree to display the
Ethernet/IP adapter properties.
This figure shows the properties of the Ethernet/IP adapter in the editor area:
96 EIO0000001360 04/2014
Embedded Communication Configuration
Step Action
1 Enter the IP address in the Address field.
2 Enter the value for Unit ID and Connection timeout (100 ms).
3 Click the Add button.
Result: A list of remote servers that you have added, appears on the screen.
This figure shows the table listing the remote servers:
This table describes each column of the table listing the remote servers:
EIO0000001360 04/2014 97
Embedded Communication Configuration
Section 6.2
Serial Line Configuration
Introduction
The M221 Logic Controller references are equipped with at least 1 serial line. The controller
references without the Ethernet feature support 2 serial lines:
z SL1 (serial line)
z SL2 (serial line)
Each serial line can be configured for any one of the following protocols:
z Modbus RTU
z Modbus ASCII
z ASCII
You can configure both physical and protocol settings for the serial line. Serial lines are configured
for the Modbus RTU protocol by default.
98 EIO0000001360 04/2014
Embedded Communication Configuration
Step Action
1 Click the SL1 (Serial line) or SL2 (Serial line) node in the hardware tree to display the serial line
properties.
This figure shows the properties of the serial line for Modbus RTU and Modbus ASCII protocols:
This figure shows the properties of the serial line for ASCII protocol:
EIO0000001360 04/2014 99
Embedded Communication Configuration
Step Action
2 Edit the properties to configure the serial line.
For detailed information on the serial line configuration parameters, refer to the table below.
Part III
Programming the M221 Logic Controller
Overview
This part provides information about the system and I/O objects specific to the M221 Logic
Controller. These objects are displayed in the Programming tab.
For descriptions of all other objects, refer to SoMachine Basic Generic Functions Library Guide.
Chapter 7
How to Use the Source Code Examples
Overview
Except where explicitly mentioned, the source code examples contained in this book are valid for
both the Ladder Diagram and Instruction List programming languages. A complete example may
require more than one rung.
Reversibility Procedure
Only Instruction List source code is shown in this book.
To obtain the equivalent Ladder Diagram source code:
Step Action
1 In SoMachine Basic, create a new POU containing an empty rung.
2 In this rung, click the LD > IL button to display Instruction List source code.
3 Select and copy (Ctrl+C) the source code for the first rung of the sample program.
4 Right-click on the line number 0000 of the first instruction and choose Paste Instructions to
paste the source code into the rung:
NOTE: Remember to delete the LD instruction from the last line of the rung if you have pasted
the instructions by inserting the line(s) before the default LD operator.
5 Click the IL > LD button to display the Ladder Diagram source code.
6
Repeat the previous steps for any additional rungs in the sample program. Click on
the toolbar to add new rungs.
Example
Instruction List program:
I/O Objects
Chapter 8
I/O Objects
Introduction
Digital input bit objects are the image of digital inputs on the logic controller.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click I/O objects Digital inputs.
Result: Digital input properties appear on the screen.
Introduction
Digital output bit objects are the image of digital outputs on the logic controller.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click I/O objects Digital outputs.
Result: Digital output properties appear on the screen.
Introduction
Analog input word objects are the digital values of an analog signal connected to the logic
controller.
Two 0-10V analog inputs are embedded in the logic controller. The embedded analog inputs use
a 10 bits resolution converter so that each increment is approximately 10 mV (10V/210-1). Once
the system detects the value 1023, the channel is considered to be saturated.
Refer to M221 Hardware Guide and TMC2 Cartridges Hardware Guide used in the configuration
for more details.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click I/O objects Analog inputs.
Result: Analog input properties appear on the screen.
Introduction
Analog output word objects are the digital values of the analog signals recieved from the logic
controller using cartridges.
Two 0-10 V analog outputs and two 4-20 mA analog outputs are embedded in the cartridges
TMC2AQ2C and TMC2AQ2V respectively.
Refer to TMC2 Cartridges Hardware Guide used in the configuration for more details.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click I/O objects Analog outputs.
Result: Analog output properties appear on the screen.
Function Blocks
Chapter 9
Function Blocks
Section 9.1
Fast Counter (%FC)
Description
Introduction
Illustration
This illustration is a Fast Counter function block in single-word mode:
Inputs
The Fast Counter function block has the following inputs:
Outputs
The Fast Counter function block has the following output:
Configuration
Parameters
To configure parameters, follow the Configuring a Function Block procedure (see SoMachine
Basic, Generic Functions Library Guide) and read the description of Memory Allocation Modes in
the SoMachine Basic Operating Guide (see SoMachine Basic, Operating Guide).
The Fast Counter function block has the following parameters:
Objects
The Fast Counter function block is associated with the following objects:
Special Note
The application can change the preset value %FCi.P or %FCi.PD and the current value %FCi.V
or %FCi.VD at any time. A new value is taken into account only if the R input is active or at the
rising edge of the D output %FC.D. This allows for successive different counts without the loss of
a single pulse.
Operation
This table describes the main stages of Fast Counter function block operations:
Special Cases
This table contains a list of special operating cases for the Fast Counter function block:
Programming Example
Introduction
In this example, the application counts a number of items up to 5000 while %I0.1 is set to 1. The
input for %FC0 is the dedicated input %I0.2. When the preset value is reached, %FC0.D is set to
1 and retains the same value until %FC0.R is commanded by the result of AND on %I0.2 and %M0.
Programming
This example is a Fast Counter function block:
Rung Instruction
0 BLK %FC1
LD %I0.1
IN
LD %I0.2
AND %M0
R
OUT_BLK
LD D
ST %Q0.0
END_BLK
NOTE: Refer to the reversibility procedure (see page 105) to obtain the equivalent Ladder
Diagram.
NOTE: Refer to the reversibility procedure (see page 105) to obtain the equivalent Ladder
Diagram.
Section 9.2
High Speed Counter (%HSC)
Description
Introduction
The High Speed Counter function block can be configured by SoMachine Basic to
perform any one of the following functions:
z Up/down counter
z Bi-phase counter
z Single counter
z Frequency meter
The High Speed Counter supports counting of digital inputs up to frequencies of 60 kHz in
single word or double word computational mode.
The High Speed Counter function block uses dedicated inputs and auxiliary inputs and outputs.
Refer to hardware guide of your controller for more information on inputs and outputs.
You must configure the High Speed Counter function in the Configuration tab (High Speed
Counters High Speed Counter Assistant) before using an instance of the function block, refer
to Configuring High Speed Counters (see page 72).
Illustration
This illustration is an High Speed Counter function block:
Inputs
The High Speed Counter function block has the following inputs:
Outputs
The High Speed Counter function block has the following outputs:
Configuration
Parameters
To configure parameters, follow the Configuring a Function Block procedure (see SoMachine
Basic, Generic Functions Library Guide) and read the description of Memory Allocation Modes in
the SoMachine Basic Operating Guide (see SoMachine Basic, Operating Guide).
The High Speed Counter function block has the following parameters:
Objects
The High Speed Counter function block is associated with the following objects:
Special Cases
This table shows a list of special operating of the High Speed Counter function block:
Introduction
The High Speed Counter function block works at a maximum frequency of 60 kHz, with a range
of 0 to 65535 in single word mode and 0 to 4294967295 in double word mode.
The pulses to be counted are applied in the following way:
Notes on Outputs
For all functions in counting mode, the current value is compared to 2 thresholds (%HSC.S0 or
%HSC.S0D and %HSC.S1 or %HSC.S1D).
According to the result of these comparison 2-bit objects (%HSC.TH0 and %HSC.TH1) are:
z set to 1 if the current value is greater or equal to the corresponding threshold
z or reset to 0 in the opposite case.
Reflex outputs (if configured) are set to 1 in accordance with these comparisons.
NOTE: None, 1 or 2 outputs can be configured.
%HSC.U is an output of the function block; it gives the direction of the associated counter variation
(1 for UP, 0 for DOWN).
Special Note
Up-count or down-count operations are made on the rising edge of pulses, and only if the counting
function block is enabled.
There are 2 optional inputs used in counting mode: Catch Input and Preset Input:
z Catch input is used to capture the current value (%HSC.V or %HSC.VD) and stored it in %HSC.C
or %HSC.CD. The catch inputs are specified as %I0.3 for %HSC0 and %I0.4 for %HSC1 if
available.
z When Preset input is active, the current value is affected in the following ways:
z For up-counting, %HSC.V or %HSC.VD is reset to 0
z For down-counting, %HSC.V or %HSC.VD is written with the content of %HSC.P or %HSC.PD,
respectively.
z For frequency counting, %HSC.V or %HSC.VD is set to 0
NOTE: %HSC.F is also set to 0. The preset inputs are specified as %I0.2 for %HSC0 and %I0.5
for %HSC1 if available.
Operation
This illustration is the operation diagram of the counting mode in single word mode (in double word
mode, use the double word function variables, so):
NOTE: Outputs are managed independently from the controller cycle time. The response time is
0...1 ms.
Reflex Output Value < %HSC.S0 %HSC0.S0 <= Value < Value >= %HSC0.S1
%HSC0.S1
%Q0.2 X
%Q0.3 X X
Timing diagram:
(1) IN is set to 1: the counting function is activated (%HSC0.U = 1 because %HSC0 is an up-counter)
(2) %Q0.2 (Reflex Output) and TH0 are set to 1
(3) TH1 is set to 1
(4) The maximum value is reached so on the next count %HSC0.V is reset to 0 and F is set to 1
(5) S is set to 1, the current value, %HSC0.V, is set to 0
(6) The current function is inhibited while IN is set to 0
(7) While the function is inhibited, S is set to 1 so the current value is reset to 0
(8) Change of threshold value S1 to 17
(9) S is set to 1 so the new value of S1 will be granted at the next count
(10) Catch input is set to 1 so %HSC0.C = 17
Reflex Output Value < %HSC.S0 %HSC0.S0 <= Value < Value >= %HSC0.S1
%HSC0.S1
%Q0.2 X
%Q0.3 X X
Timing diagram:
Introduction
The frequency meter mode of an High Speed Counter is used to measure the frequency of a
periodic signal in Hz on input IA (pulse input phase A).
The frequency range which can be measured is 1 Hz to 60 kHz.
It is possible to choose between 2 time bases, the choice being made by the object %HSC.T (Time
base):
Accuracy Measurement
Semi-log curve:
Operation
This illustration is the operation diagram of the frequency meter mode:
Timing Diagram
This timing diagram is an example of using a High Speed Counter in frequency meter mode:
(1) The first frequency measurement starts at a rising edge of the TB signal
(2) %HSC0.V is updated after one period of the TB
(3) Input IN and input S are set to 1 so %HSC0.V is set to 0
(4) %HSC0.T is set to 100 ms, so the current measurement is canceled and a new one starts
(5) Input IN is set to 0, so the frequency measurement function is inhibited and %HSC0.V is held
(6) S is set to 1, so the current value %HSC0.V is set to 0
(7) S is set to 0 and IN is set to 1, so the measurement will start at the next rising edge of the TB signal
Pulse (%PLS)
Section 9.3
Pulse (%PLS)
Description
Introduction
Illustration
This illustration is a Pulse function block:
Inputs
The Pulse function block has the following inputs:
Outputs
The Pulse function block has the following outputs:
Configuration
Parameters
To configure parameters, follow the Configuring a Function Block procedure (see SoMachine
Basic, Generic Functions Library Guide) and read the description of Memory Allocation Modes in
the SoMachine Basic Operating Guide (see SoMachine Basic, Operating Guide).
The Pulse function block has the following parameters:
Objects
The Pulse function block is associated with the following objects:
Rules of Use
The output signal period T is set with Preset and the Time Base parameters such as
T = %PLSi.P x .Time Base.
This table shows the range of available periods:
The Time Base is set on the Configuration Pulse Generators, refer to Configuring Pulse
Generators (see page 80). and cannot be modified.
If %PLSi.P is:
z changed, the output signal period is changed at the end of the current period.
z set to 0, the pulse generation function is stopped.
z out of range, the parameter is forced to 0 and the pulse generation function is stopped.
Timing Diagram
This diagram displays the timing for Pulse function block:
(1) IN input is set to 1, the pulse signal is generated at the dedicated output (%Q0.0) so %PLSi.Q is set to 1
(2) The number of pulses reaches %PLS0.N (=4) so the Done flag output (%PLS0.D) is set to 1 and the pulse
generation is stopped (%PLS0.Q = 0)
(3) IN input is set to 1 so %PLS0.D is reset to 0
(4) IN input is set to 0 so the output channel is set to 0 and %PLS0.Q = 0 indicates that the signal generation
is not active
(5) %PLS0.D is set to 0 by setting R input to 1
Special Cases
Programming Example
Introduction
The Pulse function block can be configurated as in this programming example.
Programming
This example is a Pulse function block:
Rung Instruction
0 BLK %PLS0
LD %M1
IN
LD %M0
R
OUT_BLK
LD Q
ST %Q0.5
LD D
ST %M10
END_BLK
NOTE: Refer to the reversibility procedure (see page 105) to obtain the equivalent Ladder
Diagram.
NOTE: Refer to the reversibility procedure (see page 105) to obtain the equivalent Ladder
Diagram.
Section 9.4
Pulse Width Modulation (%PWM)
Description
Introduction
The Pulse Width Modulation function block generates a square wave signal on
dedicated output channel %Q0.0 or %Q0.1, with variable width and, therefore, duty cycle.
Controllers with relay outputs for these 2 channels do not support this function due to a frequency
limitation.
Refer to Maximum Number of Objects table (see page 32) for information on the number of Pulse
Width Modulation function blocks available. %PWM0 uses dedicated output %Q0.0 and %PMW1
uses dedicated output %Q0.1. The Pulse function blocks %PLS contend to use these same
dedicated outputs so you must choose between the 2 functions.
You must configure the Pulse Width Modulation function block in the Configuration Pulse
Generators before using an instance of the function block, refer to Configuring Pulse Generators
(see page 80).
NOTE: Only some references of logic controller use the Pulse Width Modulation function
block.
Illustration
This illustration is the Pulse Width Modulation function block:
Inputs
The Pulse Width Modulation function block has the following input:
Configuration
Parameters
To configure parameters, follow the Configuring a Function Block procedure (see SoMachine
Basic, Generic Functions Library Guide) and read the description of Memory Allocation Modes in
the SoMachine Basic Operating Guide (see SoMachine Basic, Operating Guide).
The Pulse Width Modulation function block has the following parameters:
Objects
The Pulse Width Modulation function block is associated with the following objects:
Rules of Use
The output signal period T is set with Preset and the Time Base parameters such as
T = %PWMi.P x Time Base.
This table shows the range of available periods:
The Time Base is set on the Configuration Pulse Generators, refer to Configuring Pulse
Generators (see page 80). and cannot be modified.
If %PWMi.P is:
z changed, the output signal period is changed at the end of the current period.
z set to 0, the pulse generation function is stopped.
z out of range, the parameter is forced to 0 and the pulse generation function is stopped.
If %PWMi.R is:
z set to 0, the pulse generation function is stopped (output set to 0).
z set to 100, the output signal is set to 1
z changed, the output signal ratio is changed at the end of the current period.
z out of range, the parameter is forced to 0.
Timing Diagram
This diagram displays the timing for the Pulse Width Modulation function block:
(1) The PWM ratio (%PWMi.R) is set to 20%, IN = 0 so the pulse generation is not active
(2) IN is set to 1 so PWM output is activated
(3) The programmable width (Tp) changes with %PWM.R
(4) IN is set to 0 so the PWM function is inhibited
Special Cases
Programming Example
Introduction
The Pulse Width Modulation function block can be configured as in this programming
example.
Programming Example
In this example:
z The signal width is modified by the program according to the state of controller input %I0.0 and
%I0.1.
z The time base is set to 10 ms.
z The preset value %PWM0.P is set to 50 so the ratio step is equal to 2%.
z The configurable period T is equal to 500 ms.
Rung Instruction
0 LDN %I0.0
ANDN %I0.1
[%PWM0.R:=20]
1 LD %I0.0
ANDN %I0.1
[%PWM0.R:=50]
2 LD %I0.0
AND %I0.1
[%PWM0.R:=80]
3 BLK %PWM0
LD %I0.2
IN
END_BLK
NOTE: Refer to the reversibility procedure (see page 105) to obtain the equivalent Ladder
Diagram.
NOTE: Refer to the reversibility procedure (see page 105) to obtain the equivalent Ladder
Diagram.
System Objects
Chapter 10
System Objects
Introduction
This section provides information about the function of system bits.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click System objects System Bits.
Result: System bit properties appear on the screen.
%S10 I/O communication Normally set to 1 (TRUE on control panel). This bit can 1 S
status be set to 0 (FALSE on control panel) by the system
when an I/O communication interruption is detected.
%S11 Watchdog overflow Normally set to 0. This bit can be set to 1 by the system 0 S
when the program execution time (scan time) exceeds
the maximum scan time (software watchdog).
Watchdog overflow causes the controller state to
change to HALT.
S Controlled by the system
U Controlled by the user
US Set to 1 by the user, reset to 0 by the system
SU Set to 1 by the system, reset to 0 by the user
SIM Applied in the Simulator
%S13 First cycle in RUN Normally at 0, this bit is set to 1 by the system during 1 S, SIM
the first scan after the controller state has been
changed to RUN.
%S17 Last ejected bit Normally set to 0. It is set by the system according to 0 SU,
the value of the last ejected bit. SIM
It indicates the value of the last ejected bit.
%S18 Arithmetic overflow Normally set to 0. It is set to 1 in the case of an overflow 0 SU,
or error when a 16-bits operation is performed, that is: SIM
z A result greater than + 32767 or less than - 32768,
in single length,
z A result greater than + 2147483647 or less than -
2147483648, in double length,
z A result greater than + 3.402824E+38 or less than -
3.402824E+38, in floating point,
z Division by 0,
z The square root of a negative number,
z BTI or ITB conversion not significant: BCD value
out of limits.
It must be tested by the user program after each
operation where there is a risk of an overflow; then
reset to 0 by the user program if an overflow occurs.
%S19 Scan period overrun Normally at 0, this bit is set to 1 by the system in the 0 SU
(periodic scan) event of a scan period overrun (scan time greater than
the period defined by the user program at configuration
or programmed in %SW0).
This bit is reset to 0 by the user program.
%S20 Index overflow Normally at 0, it is set to 1 when the address of the 0 SU,
indexed object becomes less than 0 or more than the SIM
maximum size of an object.
It must be tested by the user program, after each
operation where there is a risk of overflow; then reset
to 0 if an overflow occurs.
S Controlled by the system
U Controlled by the user
US Set to 1 by the user, reset to 0 by the system
SU Set to 1 by the system, reset to 0 by the user
SIM Applied in the Simulator
%S59 Updating the date Normally on 0, this bit can be set to 1 or 0 by the 0 U
and time using word program.
%SW59 z Set to 0, the system word %SW59 is not managed,
z Set to 1, the date and time are incremented or
decremented according to the rising edges on the
control bits set in %SW59.
%S75 Battery status This system bit is set by the system and can be read by 0 S
the user. It indicates the battery status:
z Set to 0, the external battery is operating normally.
z Set to 1, external battery power is low, or no
external battery is detected.
%S92 %MW variables Set to 1 if there is valid data saved on flash. S
saved on flash Set to 0 if the data block is invalid or the write operation
is in progress.
%S93 Backup %MW in User set this bit to 1 to store the %MW variable in the U
flash flash (up to 1000).
%S94 Restore %MW User set this bit to 1 to restore the saved data. U
S Controlled by the system
U Controlled by the user
US Set to 1 by the user, reset to 0 by the system
SU Set to 1 by the system, reset to 0 by the user
SIM Applied in the Simulator
%S101 Changing a port Used to change a port address using system words 0 U
address (Modbus %SW101 (port 1) and %SW102 (port 2). To do this,
protocol) %S101 must be set to 1.
z Set to 0, the address cannot be changed. The value
of %SW101 and %SW102 matches the current port
address,
z Set to 1, the address can be changed by changing
the values of %SW101 (port 1) and %SW102 (port 2).
Having modified the values of the system words,
%S101 must be set back to 0.
%S103 Using the ASCII Enables the use of the ASCII protocol on Comm 1 0 U
%S104 protocol (%S103) or Comm 2 (%S104). The ASCII protocol is
configured using system words %SW103 and %SW105
for Comm 1, and %SW104 and %SW106 for Comm 2.
z Set to 0, the protocol used is the one configured in
SoMachine Basic,
z Set to 1, the ASCII protocol is used on Comm 1
(%S103) or Comm 2 (%S104). In this case, the
system words %SW103, %SW105, and %sw121 must
be previously configured for COM 1, and %SW104,
%SW106, and %SW122 for COM 2. Each change of
those %SW will be tacking account after a rising
edge to %S103 or %S104.
%S119 Local I/O detected Normally set to 1. This bit can be set to 0 when an I/O 1 S
error communication interruption is detected on the base
controller. %SW118 determines the nature of the
communication interruption. Resets to 1 when the
communication interruption disappears.
S Controlled by the system
U Controlled by the user
US Set to 1 by the user, reset to 0 by the system
SU Set to 1 by the system, reset to 0 by the user
SIM Applied in the Simulator
Introduction
This section provides information about the function of system words.
Step Action
1 Select the Tools tab in the left-hand area of the Programming window.
2 Click System objects System Words.
Result: System word properties appear on the screen.
%SW11 Software Contains the maximum value of the watchdog. The value U, SIM
watchdog value (10...500 ms) is defined by the configuration.
%SW13 BOOT version For example, if %SW13=0010: U, SIM
Vxx.yy z 8 MSB=00 in hexadecimal, then xx=0 in decimal
z 8 LSB=10 in hexadecimal, then yy=16 in decimal
%SW17 Default status for When an error is detected in a floating arithmetic operation, bit %S18 S and
floating is set to 1 and the default status of %SW17 is updated according to the U, SIM
operation following coding:
z Bit[0]: Invalid operation, result is not a number (1.#NAN or -
1.#NAN),
z Bit[1]: Reserved,
z Bit[2]: Divided by 0, result is infinite (-1.#INF or 1.#INF),
z Bit[3]: Result greater in absolute value than +3.402824e+38,
result is infinite (-1.#INF or 1.#INF).
%SW18- 100 ms absolute The counter works using 2 words: S and
%SW19 timer counter z %SW18 represents the least significant word, U, SIM
z %SW19 represents the most significant word.
%SW30 Last scan time Shows execution time of the last controller scan cycle (in ms). S
(master task)
NOTE: This time corresponds to the time elapsed between the start
(acquisition of inputs) and the end (update of outputs) of a master
task scan cycle. If the scan time is 2,250 ms, the %SW30 will be 2 and
the %SW70 will be 250.
(1) If a single expansion module is missing at power-on, then all expansion module bits are set to 1 (detected
error).
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
%SW98 Post The bits are set to 1 when the post configuration was applied for the
configuration parameter:
status (Serial z Bit[0]: Hardware option (RS485 or RS232)
Line 1) z Bit[1]: Baudrate
z Bit[2]: Parity
z Bit[3]: Data size
z Bit[4]: Number of stop bits
z Bit[5]: Modbus address
z Bit[6]: Polarization (if available in the port)
%SW99 Post The bits are set to 1 when the post configuration was applied for the
configuration parameter:
status (Serial z Bit[0]: Hardware option (RS485)
Line 2) z Bit[1]: Baudrate
z Bit[2]: Parity
z Bit[3]: Data size
z Bit[4]: Number of stop bits
z Bit[5]: Modbus address
z Bit[6]: Polarization (if available in the port)
(1) If a single expansion module is missing at power-on, then all expansion module bits are set to 1 (detected
error).
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
%SW101 Value of the When bit %S101 is set to 1, you can change the Modbus address of S
%SW102 Modbus address port 1 or port 2. The address of port 1 is %SW101, and that of port 2
port is %SW102.
NOTE: In online mode, the address of port 2 cannot be changed
using system bit %S101 and system word %SW102.
(1) If a single expansion module is missing at power-on, then all expansion module bits are set to 1 (detected
error).
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
z Baud rate:
z 0: 1200 baud,
z 1: 2400 baud,
z 2: 4800 baud,
z 3: 9600 baud,
z 4: 19200 baud,
z 5: 38400 baud.
z RTS/CTS:
z 0: disabled,
z 1: enabled.
z Parity:
z 00: none,
z 10: odd,
z 11: even.
z Stop bit:
z 0: 1 stop bit,
z 1: 2 stop bits.
z Data bits:
z 0: 7 data bits,
z 1: 8 data bits.
%SW105 Configuration for When bit %S103 (Comm 1) or %S104 (Comm 2) is set to 1, the ASCII S
%SW106 use of the ASCII protocol is used. System word %SW105 (Comm 1) or %SW106 (Comm
protocol 2) must be set according to the elements below:
(1) If a single expansion module is missing at power-on, then all expansion module bits are set to 1 (detected
error).
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
Reference Code ID
TM221M16R 0x0780
TM221ME16R 0x0781
TM221M16T 0x0782
TM221ME16T 0x0783
TM221M32TK 0x0784
TM221ME32TK 0x0785
TM221C16R 0x0786
TM221CE16R 0x0787
TM221C16T 0x0788
TM221CE16T 0x0789
TM221C24R 0x078A
TM221CE24R 0x078B
TM221C24T 0x078C
TM221CE24T 0x078D
TM221C40R 0x078E
TM221CE40R 0x078F
TM221C40T 0x0790
TM221CE40T 0x0791
Glossary
0-9
2-phase counter
Uses 2 input counter signals to count up and count down.
A
analog input
Converts received voltage or current levels into numerical values. You can store and process these
values within the logic controller.
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.
B
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.
C
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.
controller
Automates industrial processes (also known as programmable logic controller or programmable
controller).
D
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.)
digital I/O
(digital input/output) An individual circuit connection at the electronic module that corresponds
directly to a data table bit. The data table bit holds the value of the signal at the I/O circuit. It gives
the control logic digital access to I/O values.
DWORD
(double word) Encoded in 32-bit format.
E
expansion bus
An electronic communication bus between expansion I/O modules and a controller.
G
GRAFCET
The functioning of a sequential operation in a structured and graphic form.
This is an analytical method that divides any sequential control system into a series of steps, with
which actions, transitions, and conditions are associated.
I
I/O
(input/output)
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).
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).
LAN
(local area network) A short-distance communications network that is implemented in a home,
office, or institutional environment.
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).
M
MAST
A processor task that is run through its programming software. The MAST task has 2 sections:
z IN: Inputs are copied to the IN section before execution of the MAST task.
z OUT: Outputs are copied to the OUT section after execution of the MAST task.
Modbus
The protocol that allows communications between many devices connected to the same network.
P
periodic execution
The task is executed either cyclically or periodically. In periodic mode, you determine a specific
time (period) in which the task is executed. If it is executed under this time, a waiting time is
generated before the next cycle. If it is executed over this time, a control system indicates the
overrun. If the overrun is too high, the controller is stopped.
PID
(proportional, integral, derivative) A generic control loop feedback mechanism (controller) widely
used in industrial control systems.
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
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.
T
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.
Index
Symbols B
%C, 30 Boot controller, 44
%DR, 30
%FC, 30, 117
%HSC, 30, 123 C
%I, 30, 110 cartridges
%IW, 30, 112 configuration, 89
%KD, 30 TMC2, 89
%KF, 30 Cold Start, 45
%KW, 30 configuration
%M, 30 building a configuration, 54
%MD, 30 configuration introduction, 54
%MF, 30 controller
%MSG, 30 configuration, 53, 59
%MW, 30 configuration features, 25
%PLS, 30, 136 controller state, 39, 40
%PWM, 30, 143 BOOTING, 41
%Q, 30, 111 EMPTY, 41
%QW, 30, 114 HALTED, 42
%R, 30 POWERLESS, 43
%S, 30 RUNNING, 42
%S (system bits), 150 STOPPED, 41
%SBR, 30
%SC, 30
%SW, 30 D
%SW (system words, 158 digital inputs, 64
%SW6, 43 configuration, 64
%TM, 30 introduction, 64
properties, 110
digital outputs, 68
A configuration, 68
analog inputs, 70 configuration parameters, 68
configuration, 70 configuring fallback values for, 68
introduction, 70 introduction, 68
properties, 112 properties, 111
analog outputs downloading applications, 43
properties, 114
application download, 44
pulse
configuration, 138
description, 136
programming example, 141
pulse generators
configuration, 80, 80
pulse width modulation
configuration, 144
description, 143
programming example, 147
R
RUN Controller, 44
Run/Stop, 66
configuring digital input as, 66
S
SD card, 60
updating firmware, 60
serial line, 98
configuration, 99
introduction, 98
STOP Controller, 45
supported devices, 89
system bits (%S), 150
system LEDs, 60
system words (%SW), 158
U
updating firmware, 60, 61
uploading applications, 43
W
Warm start, 46