m100 e m200 - Guia de Programação CLP Schneider
m100 e m200 - Guia de Programação CLP Schneider
EIO0000002019 09/2015
Modicon M100/M200
Logic Controller
Programming Guide
09/2015
EIO0000002019.02
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 EIO0000002019 09/2015
Table of Contents
Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
About the Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Part I Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 1 About the Modicon M100/M200 Logic Controller . . . . 15
M100/M200 Logic Controller Description . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 2 Configuration Features . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1 Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Overview of Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Addressing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Maximum Number of Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2 Task Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Tasks and Scan Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Maximum Number of Tasks and Priorities. . . . . . . . . . . . . . . . . . . . . . 31
2.3 Controller States and Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Controller States Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Controller States Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Controller State Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Persistent Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Output Behavior. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.4 Post Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Post Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Post Configuration File Management . . . . . . . . . . . . . . . . . . . . . . . . . 45
Part II Configuring the M100/M200 Logic Controller . . . 47
Chapter 3 How to Configure a Controller . . . . . . . . . . . . . . . . . . . 49
Building a Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Optional I/O Expansion Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Configuring the M100/M200 Logic Controller . . . . . . . . . . . . . . . . . . . 58
Updating Firmware Using Executive Loader Wizard . . . . . . . . . . . . . . 59
Chapter 4 Embedded Input/Output Configuration . . . . . . . . . . . . 61
4.1 Configuring Digital Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Configuring Digital Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.2 Configuring Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Configuring Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
EIO0000002019 09/2015 3
4.3 Configuring Pulse Generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Configuring Pulse Generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.4 Configuring High Speed Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Configuring High Speed Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Configuring Single Phase and Dual Phase . . . . . . . . . . . . . . . . . . . . . 82
Configuring Frequency Meter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Chapter 5 I/O Bus Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 91
I/O Configuration General Practices . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Configuring Expansion Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Chapter 6 Cartridge Configuration. . . . . . . . . . . . . . . . . . . . . . . . . 95
6.1 Cartridge Configuration General Information . . . . . . . . . . . . . . . . . . . . 96
General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Using Cartridges in a Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Configuring Cartridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
6.2 TMCR2••• Cartridges Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
TMCR2DM4U. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
TMCR2AI2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
TMCR2AQ2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
TMCR2AQ2V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
TMCR2AM3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
TMCR2TI2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
TMCR2SL1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
TMCR2SL1A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Chapter 7 TM3R Expansion Module Configuration . . . . . . . . . . . 123
I/O Configuration General Practices . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Configuring the TM3R Digital I/O Modules. . . . . . . . . . . . . . . . . . . . . . 125
Using I/O Modules in a Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 126
Configuring Digital I/Os . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Chapter 8 Embedded Communication Configuration . . . . . . . . . 131
8.1 Ethernet Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Configuring Ethernet Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Configuring Modbus TCP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
8.2 Serial Line Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Configuring Serial Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
8.3 Supported Modbus Function Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Supported Modbus Function Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . 143
4 EIO0000002019 09/2015
Chapter 9 Micro SD Card. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
File Management Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
SD Card Supported File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Clone Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Firmware Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Application Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Post Configuration Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Error Log Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Part III Programming the M100/M200 Logic Controller . . 159
Chapter 10 How to Use the Source Code Examples. . . . . . . . . . . . 161
How to Use the Source Code Examples . . . . . . . . . . . . . . . . . . . . . . . 161
Chapter 11 I/O Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Digital Inputs (%I) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Digital Outputs (%Q) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Analog Inputs (%IW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Analog Outputs (%QW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Chapter 12 Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
12.1 Fast Counter (%FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
12.2 High Speed Counter (%HSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
High Speed Counter in Counting Modes . . . . . . . . . . . . . . . . . . . . . . . 183
One-shot Counting Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Modulo-loop Counting Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
High Speed Counter in Frequency Meter Mode . . . . . . . . . . . . . . . . . 194
12.3 Pulse (%PLS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
12.4 Pulse Width Modulation (%PWM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Function Block Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Chapter 13 Pulse Train Output (%PTO) . . . . . . . . . . . . . . . . . . . . . . 211
13.1 Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Pulse Train Output (PTO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
EIO0000002019 09/2015 5
13.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
PTO Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Pulse Output Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Acceleration / Deceleration Ramp . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Probe Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Positioning Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
13.3 Home Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Homing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Position Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Long Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Short Reference No Reversal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Short Reference Reversal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Short Reference with INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Home Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
13.4 Data Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Function Block Object Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
13.5 Operation Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Motion State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Buffer Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
13.6 Adding / Removing a Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Adding / Removing a Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . 252
13.7 Motion Task Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
MC_MotionTask_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . 254
13.8 Power Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
MC_Power_PTO Function Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
13.9 Movement Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
MC_MoveVel_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
MC_MoveRel_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
MC_MoveAbs_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
MC_Stop_PTO Function Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
MC_Halt_PTO Function Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
13.10 Stopping / Position Function Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . 281
MC_Home_PTO Function Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
MC_SetPos_PTO Function Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
6 EIO0000002019 09/2015
13.11 Status Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
MC_ReadActVel_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . 288
MC_ReadActPos_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . 290
MC_ReadSts_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
MC_ReadMotionState_PTO Function Block. . . . . . . . . . . . . . . . . . . 294
13.12 Probe Function Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
MC_TouchProbe_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . 297
MC_AbortTrigger_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . 299
13.13 Error Handling Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
MC_ReadAxisError_PTO Function Block . . . . . . . . . . . . . . . . . . . . . 302
MC_Reset_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
13.14 Parameters Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
MC_ReadPar_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
MC_WritePar_PTO Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Chapter 14 PID Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
14.1 PID Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
PID Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
14.2 PID Auto-Tuning Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
PID Auto-Tuning Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
14.3 PID Standard Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
PID Word Address Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
PID Tuning with Auto-Tuning (AT). . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Manual Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Determining the Sampling Period (Ts) . . . . . . . . . . . . . . . . . . . . . . . . 327
14.4 PID Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Access the PID Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
General Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Input Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
PID Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
AT Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Output Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
14.5 PID Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Programming and Configuring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
PID States and Detected Error Codes. . . . . . . . . . . . . . . . . . . . . . . . . 348
14.6 PID Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Role and Influence of PID Parameters . . . . . . . . . . . . . . . . . . . . . . . . 352
PID Parameter Adjustment Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
EIO0000002019 09/2015 7
Chapter 15 System Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
System Bits (%S) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
System Words (%SW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
8 EIO0000002019 09/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, 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.
EIO0000002019 09/2015 9
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.
10 EIO0000002019 09/2015
About the Book
At a Glance
Document Scope
This document describes the configuration and programming of the Modicon M100/M200 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.3 SP3 EL.
Go to the Schneider Electric home page www.schneider-electric.com/cn/zh.
The characteristics that are presented in this manual should be the same as those characteristics
that appear online. In line with our policy of constant improvement, we may revise content over time
to improve clarity and accuracy. If you see a difference between the manual and online information,
use the online information as your reference.
Related Documents
You can download these technical publications and other technical information from our website
at http://download.schneider-electric.com
EIO0000002019 09/2015 11
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.
12 EIO0000002019 09/2015
Modicon M100/M200 Logic Controller
Introduction
EIO0000002019 09/2015
Part I
Introduction
Introduction
Overview
This part provides general information about the Modicon M100/M200 Logic Controller and its
configuration and programming features.
EIO0000002019 09/2015 13
Introduction
14 EIO0000002019 09/2015
Modicon M100/M200 Logic Controller
About the Modicon M100/M200 Logic Controller
EIO0000002019 09/2015
Chapter 1
About the Modicon M100/M200 Logic Controller
Overview
The M100/M200 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 SoMachine Basic
Generic Functions Library Guide (see SoMachine Basic, Generic Functions Library Guide).
Programming Languages
The M100/M200 Logic Controller is configured and programmed with the SoMachine Basic
software, which supports the following IEC 61131-3 programming languages:
IL: Instruction List
LD: Ladder Diagram
Grafcet (List)
Power Supply
The power supply of the M100 Logic Controller is 100...240 Vac.
The power supply of the M200 Logic Controller is 24 Vdc or 100...240 Vac.
Run/Stop
The M100/M200 Logic Controller can be operated externally by the following:
A hardware Run/Stop switch (see Modicon M100/M200 Logic Controller, Hardware Guide)
A Run/Stop (see Modicon M100/M200 Logic Controller, Hardware Guide) operation by a
dedicated digital input, defined in the software configuration. For more information, refer to
Configuring Digital Inputs (see page 62).
SoMachine Basic software. For more information, refer to the SoMachine Basic Operating
Guide.
EIO0000002019 09/2015 15
About the Modicon M100/M200 Logic Controller
Memory
This table describes the different types of memory:
Embedded Inputs/Outputs
The following embedded I/O types are available, depending on the controller reference:
Regular inputs
Fast inputs associated with counters
Regular sink transistor outputs
Fast sink transistor outputs associated with pulse generators
Relay outputs
Removable Storage
The M100/M200 Logic Controller includes an embedded micro SD card slot.
The M100/M200 Logic Controller allows the following types of file management with an micro SD
card:
Clone management (see page 150): back up the application, firmware, and post configuration
(if it exists) of the logic controller
Firmware management (see page 152): download firmware updates directly to the logic
controller
Application management (see page 153): back up and restore the logic controller application,
or copy it to another logic controller of the same reference
Post configuration management (see page 155): add, change, or delete the post configuration
file of the logic controller
Error log management (see page 157): back up or delete the error log file of the logic controller
16 EIO0000002019 09/2015
Modicon M100/M200 Logic Controller
Configuration Features
EIO0000002019 09/2015
Chapter 2
Configuration Features
Configuration Features
Introduction
This chapter provides information related to M100/M200 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 M100/M200 Logic Controller that are primarily needed to
configure and program the controller in SoMachine Basic.
EIO0000002019 09/2015 17
Configuration Features
Section 2.1
Objects
Objects
18 EIO0000002019 09/2015
Configuration Features
Overview of Objects
Definition
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:
Simple software variables, such as memory bits and words
Addresses of digital and analog inputs and outputs
Controller-internal variables, such as system words and system bits
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.
EIO0000002019 09/2015 19
Configuration Features
Object Types
Introduction
The language object types for the M100/M200 Logic Controller are described in the following table:
20 EIO0000002019 09/2015
Configuration Features
EIO0000002019 09/2015 21
Configuration Features
22 EIO0000002019 09/2015
Configuration Features
Memory objects, software objects, and communication 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 section Programming (see page 159).
For programming details of memory objects, software objects, and communication objects, refer
to the SoMachine Basic Generic Functions Library Guide.
EIO0000002019 09/2015 23
Configuration Features
Addressing Objects
Addressing Examples
This table presents addressing examples for various object types:
24 EIO0000002019 09/2015
Configuration Features
EIO0000002019 09/2015 25
Configuration Features
Description
This table provides information about the maximum number of objects supported by the
M100/M200 Logic Controller:
%KW 512
%KD / %KF 511
System objects %S 160
%SW 234
I/O objects %I 9 for TM100C16R / TM200C•16•
14 for TM100C24R / TM200C•24•
24 for TM100C40R / TM200C•40•
24 for TM100C40R / TM200C•40•
36 for TM200C•60•
%Q 7 for TM100C16R / TM200C•16•
10 for TM100C24R / TM200C•24•
16 for TM100C40R / TM200C•40•
24 for TM200C•60•
%IW NOTE: The M100/M200 Logic Controller has no embedded
%QW analog I/Os. Use cartridges or expansion modules to add
analog I/Os to your configuration.
%FC 4
%HSC 4
%PLS / %PWM / %PTO 0 for TM100C•••R / TM200C•••R
2 for TM200C•••U / TM200C•••T
26 EIO0000002019 09/2015
Configuration Features
EIO0000002019 09/2015 27
Configuration Features
Section 2.2
Task Structure
Task Structure
28 EIO0000002019 09/2015
Configuration Features
Overview
SoMachine Basic has the following scan modes:
Normal mode
Continuous cyclic scanning mode (Freewheeling mode); a new scan starts immediately after the
previous scan has completed.
Periodic mode
Periodic cyclic scanning mode; a new scan starts only after the configured scan time of the
previous scan has elapsed. Every scan is therefore the same duration.
SoMachine Basic offers the following task types:
Master task: Main task of the application.
Master task is triggered by continuous cyclic scanning (in normal scan mode) or by the software
timers (in periodic scan mode) by specifying the scan period of 2...150 ms (default 10 ms).
Periodic task: A short duration subroutine processed periodically.
Periodic tasks are triggered by software timers, so are configured by specifying the scan period
of 2...255 ms (default 255 ms) in the periodic scan mode.
Event task: A very short duration subroutine to reduce the response time of the application.
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.
Periodic tasks and events are configured in periodic scan mode. Master task can be configured in
either normal scan mode or periodic scan mode.
For more information, refer to the Configuring Program Behavior and Tasks (see SoMachine
Basic, Operating Guide).
EIO0000002019 09/2015 29
Configuration Features
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 verifies whether the program is using more than 80% of the processing
capacity.
30 EIO0000002019 09/2015
Configuration Features
Tasks Priorities
This table summarizes the task types and their priorities:
Events Priorities
Refer to Event Priorities and Queues (see SoMachine Basic, Operating Guide).
EIO0000002019 09/2015 31
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.
32 EIO0000002019 09/2015
Configuration Features
EIO0000002019 09/2015 33
Configuration Features
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,
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 the Start In Run feature, 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 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
Confirm that the automatic reactivation of the outputs does not produce unintended
consequences before using the Start In Run feature.
Use the Run/Stop input to help control the Start In Run feature and to help prevent the
unintentional start-up from a remote location.
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.
34 EIO0000002019 09/2015
Configuration Features
EIO0000002019 09/2015 35
Configuration Features
NOTE: The system word %SW6 indicates the logic controller state (EMPTY, STOPPED, RUNNING,
HALTED, and POWERLESS).
36 EIO0000002019 09/2015
Configuration Features
Boot Controller
Effect: Command a reboot of the logic controller. For details about power-on sequence, refer to the
controller state diagram (see page 33).
Methods:
Power cycle
Reboot by script
The script on a micro SD card can issue a REBOOT as its last command.
Application Download
Effect: Download the application into the logic controller memory.
Methods:
SoMachine Basic online button:
Select the PC to controller (download) command.
Effect: Erase the application in the logic controller and set the logic controller in EMPTY state.
Download the application in the logic controller memory. If download is successful, a Cold
Start is done and the logic controller is set in STOPPED state.
Application file transfer by SD card:
Effect: At the next reboot, erase the application in the logic controller and download the
application files from the micro SD card to the logic controller memory. If download is
successful, a Cold Start is done and the logic controller is set in STOPPED state.
Initialize Controller
Effect: Set the controller in EMPTY state, and then, after a Cold Start, in STOPPED state.
Methods:
SoMachine Basic online button:
Select the Initialize controller command.
EIO0000002019 09/2015 37
Configuration Features
RUN Controller
Effect: Command a transition to the RUNNING state.
Methods:
Run/Stop (see Modicon M100/M200 Logic Controller, Hardware Guide) switch on front face:
It commands a transition to RUNNING state on rising edge.
STOP Controller
Effect: Command a transition to the STOPPED state.
Methods:
Run/Stop (see Modicon M100/M200 Logic Controller, Hardware Guide) switch on front face:
It forces a transition to STOPPED state on low level.
Download command:
It needs the controller to be set in STOPPED state (after the download the controller is in
STOPPED state).
38 EIO0000002019 09/2015
Configuration Features
Cold Start
Cold Start is defined to be a power-up with all data initialized to its default values, and program
started from the beginning with program variables cleared. Software and hardware settings are
initialized.
Cold Start occurs for the following reasons:
Boot controller without validated application online modification.
Download application
Initialize logic controller
EIO0000002019 09/2015 39
Configuration Features
Persistent Variables
40 EIO0000002019 09/2015
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:
Managed by application program
Initialization values
Fallback Mode (see SoMachine Basic, Operating Guide)
Maintain values
Fallback values
Output forcing
Managed by Application
Your application manages outputs normally. This applies in the RUNNING state.
EIO0000002019 09/2015 41
Configuration Features
Fallback Values
This output state applies in the STOPPED and HALTED states.
In the fallback mode, the outputs assume the following values:
For embedded outputs:
Fast transistor output: according to fallback setting (Fallback Behavior (see SoMachine
Basic, Operating Guide))
Regular transistor output: according to fallback setting (Fallback Behavior)
Relay output: according to fallback setting (Fallback Behavior)
Expert I/O functions (HSC, PLS, PWM, and PTO):
- Fallback value: according to fallback setting (Fallback Behavior)
- Maintain values (see SoMachine Basic, Operating Guide): 0 Vdc
For expansion module outputs:
Regular transistor output: according to fallback setting (Fallback Behavior)
Relay output: according to fallback setting (Fallback Behavior)
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 39) and Application Download
(see page 37) command.
The forcing does not apply for expert I/O functions (HSC, PLS, PWM, and PTO).
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 Basic without removing the forcing.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
42 EIO0000002019 09/2015
Configuration Features
Section 2.4
Post Configuration
Post Configuration
Introduction
This section describes how to manage and configure the post configuration file of the Modicon
M100/M200 Logic Controller.
EIO0000002019 09/2015 43
Configuration Features
Post Configuration
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 communication parameters are set in the configuration of the application. However,
under certain conditions, some or all of these parameters can be modified automatically using the
post configuration mechanism. One or more communication parameters can be specified in the
post configuration file, and those parameters can override the parameters specified by the
configuration. For example, one parameter may be stored in the post configuration file to change
the EtherNet/IP address of the controller while leaving the other Ethernet parameters, such as the
gateway address, unchanged.
Parameters
The post configuration file allows you to modify network parameters.
Ethernet parameters:
Address configuration mode
IP address
Subnet mask
Gateway address
Device name
Serial line parameters, for each serial line in the application (embedded port or
TMCR2SL1/TMCR2SL1A cartridge):
Physical medium
Baud rate
Parity
Data bits
Stop bit
Modbus address
Polarization (for RS-485)
Operating Mode
The post configuration file is read and applied:
after a Cold Start (see page 39)
after a reboot (see page 37)
after an application download (see page 37)
For further details on controller states and transitions, refer to Controller States and Behaviors
(see page 32).
44 EIO0000002019 09/2015
Configuration Features
Introduction
The file Machine.cfg must be stored in the directory /usr/cfg of the controller.
The post configuration file can be transferred, modified, or deleted with a micro SD card.
The Ethernet parameters of the post configuration file can also be modified with SoMachine Basic
during the connection with a logic controller.
NOTE: A post configuration file example is available in the directory
Firmwares & PostConfiguration\PostConfiguration\add_change\usr\cfg of the
SoMachine Basic installation directory.
EIO0000002019 09/2015 45
Configuration Features
46 EIO0000002019 09/2015
Modicon M100/M200 Logic Controller
Configuring the M100/M200 Logic Controller
EIO0000002019 09/2015
Part II
Configuring the M100/M200 Logic Controller
Overview
This part provides information about how to configure the M100/M200 Logic Controller references.
EIO0000002019 09/2015 47
Configuring the M100/M200 Logic Controller
48 EIO0000002019 09/2015
Modicon M100/M200 Logic Controller
How to Configure a Controller
EIO0000002019 09/2015
Chapter 3
How to Configure a Controller
Overview
This chapter describes how to build a configuration in SoMachine Basic and configure the
M100/M200 Logic Controller.
EIO0000002019 09/2015 49
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:
Create or open an existing project
Replace the default logic controller
Add an expansion module to the logic controller
Add a cartridge to the logic controller
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.
50 EIO0000002019 09/2015
How to Configure a Controller
This figure presents the toolbar, status bar, and the module tabs in the main window:
1 Toolbar
2 Status bar
3 Module tabs
Item Description
Toolbar Provides easy access to commonly used functions.
For more information, refer to the Toolbar (see SoMachine Basic, Operating Guide).
Status bar Displays status and information messages on the system status.
For more information, refer to the Status bar (see SoMachine Basic, Operating Guide).
Module tabs To develop an application, work your way through the module tabs from left to right:
Properties
Set up the project properties.
Configuration
Replicate and configure the hardware configuration of the logic controller and
associated expansion modules.
Programming
Develop the program in one of the supported programming languages.
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 presents a
structured view of the 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.
EIO0000002019 09/2015 51
How to Configure a Controller
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.
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/PTO).
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 protocol for Ethernet communications.
SLn (Serial line) Use to configure the embedded serial line or the serial line added using a cartridge.
NOTE: All M100/M200 references can support only one serial line 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:
Only a controller
A controller with cartridge(s)
A controller with expansion modules
A controller with cartridge(s) 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.
52 EIO0000002019 09/2015
How to Configure a Controller
EIO0000002019 09/2015 53
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 presents the catalog of the logic controllers and the expansion modules:
54 EIO0000002019 09/2015
How to Configure a Controller
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 ontroller 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:
TM3R I/O expansion modules
TM3 I/O expansion modules
TM2 I/O expansion modules
The application must be configured with a functional level of at least Level 3.2 for modules marked
as optional to be recognized as such by the logic controller.
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.
EIO0000002019 09/2015 55
How to Configure a Controller
Step Action
1 Drag-and-drop the I/O expansion module from the catalog to the editor.
2 In the Device information area, select the Optional module check box:
Step Action
1 Select the I/O expansion module in the editor.
2 In the Device information area, select the Optional module check box.
56 EIO0000002019 09/2015
How to Configure a Controller
The selection of the Optional module feature is used by the logic controller to start the I/O bus.
The following system words are updated to indicate the status of the physical I/O bus configuration:
EIO0000002019 09/2015 57
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 M100/M200 Logic Controller:
58 EIO0000002019 09/2015
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 32) 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 SoMachine Basic
Firmware Update or run the ExecLoaderWizard.exe from the SoMachine Basic installation
folder\Execloader folder.
3 Follow the steps on the wizard to complete the firmware update.
EIO0000002019 09/2015 59
How to Configure a Controller
60 EIO0000002019 09/2015
Modicon M100/M200 Logic Controller
Embedded Input/Output Configuration
EIO0000002019 09/2015
Chapter 4
Embedded Input/Output Configuration
Overview
This chapter describes how to configure the embedded I/O objects of the M100/M200 Logic
Controller.
The number of embedded inputs and outputs depends on the controller reference. For more
information, refer to the table of M100/M200 Logic Controller references (see Modicon M100/M200
Logic Controller, Hardware Guide).
EIO0000002019 09/2015 61
Embedded Input/Output Configuration
Section 4.1
Configuring Digital Inputs
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 78) 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:
62 EIO0000002019 09/2015
Embedded Input/Output Configuration
EIO0000002019 09/2015 63
Embedded Input/Output Configuration
Run/Stop Yes True/False False Allows you to configure 1 digital input as an additional
Run/Stop switch.
If you configure a digital input as Run/Stop switch, you
cannot use the input in any other function block (for
example, high speed counter function block, fast counter
function block, and so on).
If you enable Run/Stop for an input, you cannot configure
that input for:
Latch
Event
Event Yes Not Used Not Used Allows you to select an event that triggers the inputs
Falling Edge %I0.2...%I0.5.
Rising Edge By default, this option is disabled due to default value of
Both edges Filtering. Set the Filtering to No Filter to enable the
Event option.
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.
Priority Yes 0...7 7 Allows you to set the priority of the triggering event for the
inputs %I0.2...%I0.5.
You can set the priority of each event using the Priority
parameter that is editable only for the inputs configured as
event.
Assign each configured event a different priority: if 2
events have same priority, a detected error message
appears in the window.
64 EIO0000002019 09/2015
Embedded Input/Output Configuration
Additional configuration details are displayed in the Programming tab. For more information, refer
to Digital Inputs (%I) (see page 166).
EIO0000002019 09/2015 65
Embedded Input/Output Configuration
Section 4.2
Configuring Digital Outputs
Introduction
By default, all digital outputs are used as regular outputs. For controllers equipped with transistor
outputs, two outputs are fast transistor outputs and can be used by configuring the pulse
generators (see page 68).
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:
66 EIO0000002019 09/2015
Embedded Input/Output Configuration
Additional configuration details are displayed in the Programming tab. For more information, refer
to Digital Outputs (%Q) (see page 167).
EIO0000002019 09/2015 67
Embedded Input/Output Configuration
Section 4.3
Configuring Pulse Generators
Introduction
The pulse generator function blocks, Pulse (PLS), Pulse Width Modulation (PWM), and
Pulse Train Output (PTO) are used to generate square or modulated wave signals on
dedicated output channels %Q0.0 or %Q0.1.
The PWM outputs feature a modulated wave signal with a variable width and duty cycle while the
PTO outputs generate a square wave to control a linear single-axis stepper or servo drive in open
loop mode. The PLS also creates a square wave for a programmed number of pulses.
Step Action
1 Click the Pulse Generators node in the hardware tree to display the pulse generator properties.
This figure presents the properties of the pulse generators in the editor area:
68 EIO0000002019 09/2015
Embedded Input/Output Configuration
EIO0000002019 09/2015 69
Embedded Input/Output Configuration
This table describes the parameter of the Pulse Generator Assistant window:
70 EIO0000002019 09/2015
Embedded Input/Output Configuration
PLS Configuration
This graphic presents the Pulse Generator Assistant window when the Type of pulse generator
is set to PLS:
EIO0000002019 09/2015 71
Embedded Input/Output Configuration
The table describes each parameter available when the channel is configured in PLS mode:
72 EIO0000002019 09/2015
Embedded Input/Output Configuration
PWM Configuration
This graphic presents the Pulse Generator Assistant window when the Type of pulse generator
is set to PWM:
The table describes each parameter available when the channel is configured in PWM mode:
EIO0000002019 09/2015 73
Embedded Input/Output Configuration
PTO Configuration
This graphic presents the Pulse Generator Assistant window when the Type of pulse generator
is set to PTO:
74 EIO0000002019 09/2015
Embedded Input/Output Configuration
The table describes each parameter available when the channel is configured in PTO mode:
EIO0000002019 09/2015 75
Embedded Input/Output Configuration
76 EIO0000002019 09/2015
Embedded Input/Output Configuration
Section 4.4
Configuring High Speed Counters
EIO0000002019 09/2015 77
Embedded Input/Output Configuration
Introduction
You can configure high speed counters to perform any one of the following functions:
Single phase
Dual phase [Pulse / Direction]
Dual phase [Clock Wise / Counter Clock Wise]
Dual phase [Quadrature X1]
Dual phase [Quadrature X2]
Dual phase [Quadrature X4]
Frequency meter
Several modes are available with Single Phase and Dual Phase HSC type counter:
Single Phase
One Shot
Modulo Loop
Free Large
Dual Phase
Modulo Loop
Free Large
In One Shot mode, each pulse applied to the input increments the current value. The counter stops
when its current value reaches the maximum value. The overflow flag is then set. For more details,
refer to One-shot Counting Mode (see page 191).
In Modulo Loop mode, the counter repeatedly counts from 0 to a user-defined modulo value. It then
returns to 0 and restarts counting. In reverse, the counter counts down from the modulo value to 0
then presets to the modulo value and restarts counting. For more details, refer to Modulo-Loop
Counting Mode (see page 192).
In Free Large mode, the counter behaves like a standard up and down counter. This mode can be
used with one encoder.
The high speed counter supports counting of digital inputs up to frequencies of 100 kHz in single
word or double word computational mode.
78 EIO0000002019 09/2015
Embedded Input/Output Configuration
EIO0000002019 09/2015 79
Embedded Input/Output Configuration
Step Action
1 Click the High Speed Counters node in the hardware tree to display the high speed counter
properties.
Result: The properties of the high speed counters are displayed in the editor area:
For detailed information on the high speed counter configuration, refer to the following table.
2 Click the [...] button to configure a high speed counter.
Result: The high speed counter configuration parameters are displayed in the assistant window.
For more details on configuration of single phase and dual phase modes with the assistant, refer to
Configuring Single Phase and Dual Phase (see page 82).
For more details on configuration of frequency meter mode with the assistant, refer to Configuring
Frequency Meter (see page 88).
This table describes each parameter of the high speed counters configuration:
80 EIO0000002019 09/2015
Embedded Input/Output Configuration
EIO0000002019 09/2015 81
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).
82 EIO0000002019 09/2015
Embedded Input/Output Configuration
Item Description
2 Displays the input mode of particular type of high speed counter.
3 Displays the dedicated inputs, auxiliary inputs, and reflex outputs.
Properties in this area of the assistant window are different for each counter type and %HSC instance.
For more details, refer to the Dedicated I/O Assignments (see page 78) section.
This table describes each parameter of the assistant screen for high speed counters for both
%HSC0 and %HSC1:
EIO0000002019 09/2015 83
Embedded Input/Output Configuration
0...4294967295* 0
(Double Word) (Double Word)
when configuring
Dual Phase
[Quadrature X1]
Modulo Value Yes 0...65535 0 Allows you to specify the modulo value for
(%HSC.P/.PD) (Word) (Word) the counting functions.
0...4294967295*
(Double Word) 0
0...2147483647 (Double Word)
(Double Word)
when configuring
Dual Phase
[Quadrature X1]
Threshold S0 Yes 0...65535 65535 Allows you to specify the value of the HSC
(Word) (Word) flag S0 that contains the value of the
threshold TH0.
0...4294967295* 4294967295*
(Double Word) (Double Word)
0...2147483647
(Double Word)
when configuring
Dual Phase
[Quadrature X1]
Threshold S1 Yes 0...65535 65535 Allows you to specify the value for the HSC
(Word) (Word) flag S1 that contains the value of the
threshold TH1.
0...4294967295* 4294967295*
(Double Word) (Double Word)
0...2147483647
(Double Word)
when configuring
Dual Phase
[Quadrature X1]
Trigger Yes Not Used Not Used Allows you to select a triggering function for
Falling Edge an event (for both threshold TH0 and TH1)
Rising Edge from the drop-down list.
Both edges 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.
* for X1 the value is limited to 2147483647
84 EIO0000002019 09/2015
Embedded Input/Output Configuration
EIO0000002019 09/2015 85
Embedded Input/Output Configuration
For TM100•••R/TM200•••R:
%Q0.0 for %HSC0
%Q0.2 for %HSC1
Reflex Output 1 No True/False False Allows you to enable or disable the reflex
output at the address:
For TM200•••U/TM200•••T:
%Q0.5 for %HSC0
%Q0.7 for %HSC1
For TM100•••R/TM200•••R:
%Q0.1 for %HSC0
%Q0.3 for %HSC1
Value < S0 Yes True/False False Allows you to enable or disable the condition
in which the counter is constantly compared
to the output value to set the reflex output
when the output value is less than the value
of HSC flag S0.
* for X1 the value is limited to 2147483647
86 EIO0000002019 09/2015
Embedded Input/Output Configuration
EIO0000002019 09/2015 87
Embedded Input/Output Configuration
This table describes each parameter of the High Speed Counter Assistant (%HSCx) window for
the counter type Frequency Meter:
88 EIO0000002019 09/2015
Embedded Input/Output Configuration
EIO0000002019 09/2015 89
Embedded Input/Output Configuration
90 EIO0000002019 09/2015
Modicon M100/M200 Logic Controller
I/O Bus Configuration
EIO0000002019 09/2015
Chapter 5
I/O Bus Configuration
Overview
This chapter describes how to configure the I/O bus (expansion modules) of the M100/M200 Logic
Controller.
EIO0000002019 09/2015 91
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
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.
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.
NOTE: For more details about this feature, refer to Optional I/O Expansion Modules (see page 55).
92 EIO0000002019 09/2015
I/O Bus Configuration
Introduction
In your project, you can add the following devices to the controller:
TM3 Digital I/O Modules
TM3R Digital Mixed I/O Modules
TM3 Analog I/O Modules
TM2 Digital I/O Modules
TM2 Analog I/O Modules
EIO0000002019 09/2015 93
I/O Bus Configuration
94 EIO0000002019 09/2015
Modicon M100/M200 Logic Controller
Cartridge Configuration
EIO0000002019 09/2015
Chapter 6
Cartridge Configuration
Cartridge Configuration
Overview
This chapter describes how to configure the cartridges of the M100/M200 Logic Controller.
EIO0000002019 09/2015 95
Cartridge Configuration
Section 6.1
Cartridge Configuration General Information
96 EIO0000002019 09/2015
Cartridge Configuration
General Description
Introduction
The TMCR2••• cartridges connect to Modicon M100/M200 Logic Controllers to increase the
number of I/Os or serial lines available on the controller.
Cartridges can be:
Digital cartridges
Analog cartridges
Serial line cartridges
Cartridges Features
The following table describes the TMCR2••• cartridge features:
Reference Description
TMCR2DM4U TMCR2 cartridge with 2 digital inputs and 2 transistor sink outputs
TMCR2AI2 TMCR2 cartridge with 2 analog voltage or current inputs (0...10 V, 0...20 mA,
4...20 mA), 12 bits
TMCR2AQ2C TMCR2 cartridge with 2 analog current outputs (4...20 mA), 12 bits
TMCR2AQ2V TMCR2 cartridge with 2 analog voltage outputs (0...10 V), 12 bits
TMCR2AM3 TMCR2 cartridge with 2 analog voltage inputs and 1 analog voltage output
(0...10 V), 16 bits
TMCR2TI2 TMCR2 cartridge with 2 analog temperature inputs (thermocouple, RTD),
14 bits
TMCR2SL1 TMCR2 cartridge with 1 serial line (RS-232 or RS-485)
TMCR2SL1A TMCR2 cartridge with 1 isolated serial line (RS-485)
EIO0000002019 09/2015 97
Cartridge Configuration
NOTICE
ELECTROSTATIC DISCHARGE
Verify that empty cartridge slots have their covers in place before applying power to the
controller.
Do not touch the contacts of the cartridge.
Only handle the cartridge on the housing.
Take the necessary protective measures against electrostatic discharges.
Failure to follow these instructions can result in equipment damage.
98 EIO0000002019 09/2015
Cartridge Configuration
Adding a Cartridge
TMCR2••• cartridges can be connected to the M100/M200 Logic Controller with 1 or 2 cartridge
slots.
NOTE: It is not possible to add 2 serial line cartridges to the same logic controller. For more
information on cartridge compatibility with the M100/M200 Logic Controller, refer to Logic
Controller Compatibility (see page 98).
NOTE: The controller must have at least one free cartridge slot.
The following steps explain how to add a cartridge to a logic controller in a SoMachine Basic
configuration:
Step Description
1 Click the Configuration tab in the SoMachine Basic window.
2 In the hardware catalog area of the window, select M200 Cartridges.
3 Select a cartridge reference.
Result: A description of the physical characteristics of the selected cartridge appears in the bottom
right-hand corner of the SoMachine Basic window.
4 Drag and drop the cartridge onto an empty cartridge slot of the M100/M200 Logic Controller.
Result: The cartridge is added to the MyController IO Bus area of the device tree.
For serial line cartridges, the SL2 (Serial line) node appears. For analog cartridges, the Analog
inputs or Analog outputs subnode appears immediately below the cartridge reference.
The following information about the selected cartridge is displayed in the lower central area of the
SoMachine Basic window:
Information about the current status of the cartridge.
For application cartridges, a list of project templates available for the cartridge.
Removing a Cartridge
To remove a cartridge from a controller, either click the cartridge and press the Delete key, or right-
click on the cartridge and click Remove on the contextual menu that appears.
If the cartridge contains at least one address being used in the user logic of the program, a
message appears asking you to confirm the operation. Click Yes to continue.
EIO0000002019 09/2015 99
Cartridge Configuration
Configuring Cartridges
Overview
You can configure cartridges on:
The Configuration tab
The Programming tab
Step Description
1 Select the Configuration tab.
2 For digital cartridges, select Cartridge x Digital inputs or Cartridge x Digital outputs in
the device tree on the left of the SoMachine Basic window.
For analog cartridges, select Cartridge x Analog inputs or Cartridge x Analog outputs
in the device tree on the left of the SoMachine Basic window.
For serial line cartridges, select Cartridge x SL2 (Serial line) in the device tree on the left of
the SoMachine Basic window.
The properties of the selected cartridge are displayed.
3 Refer to TMCR2 Standard Cartridges Configuration (see page 102) for configuration details.
Step Description
1 Select the Programming tab.
2 For digital cartridges, click Tools I/O objects Digital inputs or Tools I/O objects
Digital outputs
For analog cartridges, click Tools I/O objects Analog inputs or Tools I/O objects
Analog outputs
A list of I/O addresses appears in the lower central area of the SoMachine Basic window
(%I for digital inputs, %Q for digital outputs, %IW for analog inputs, %QW for analog outputs).
Step Description
3 Scroll down to the range of addresses corresponding to the cartridge you are configuring. The
following properties are displayed:
Used. Whether the address is being used in your program
Address. The analog input or analog output address.
Symbol. An optional symbol associated with the address.
Double-click in the Symbol column and type the name of a symbol to associate with this input.
If a symbol already exists, right-click in the Symbol column and choose Search and Replace
to find and replace occurrences of this symbol in the application.
Comment. An optional comment associated with the address.
Double-click in the Comment column and type a comment to associate with this address.
Section 6.2
TMCR2••• Cartridges Configuration
TMCR2DM4U
Introduction
The TMCR2DM4U is a standard M200 cartridge featuring 2 digital sink/source inputs and 2 digital
transistor sink outputs.
For further hardware information, refer to TMCR2DM4U (see Modicon M100/M200 Logic
Controller, Hardware Guide).
TMCR2AI2
Introduction
The TMCR2AI2 is a standard cartridge featuring 2 analog voltage or current input channels with
12-bit resolution.
The channel input types are:
0...10 V
0...20 mA
4...20 mA
For further hardware information, refer to TMCR2AI2 (see Modicon M100/M200 Logic Controller,
Hardware Guide).
If you have physically wired, for example, your analog channel for a voltage signal and you
configure the channel for a current signal in SoMachine Basic, you may damage the analog circuit.
NOTICE
INOPERABLE EQUIPMENT
Verify that the physical wiring of the analog circuit is compatible with the software configuration
for the analog channel.
Failure to follow these instructions can result in equipment damage.
TMCR2AQ2C
Introduction
The TMCR2AQ2C is a standard cartridge featuring 2 analog current output channels with 12-bit
resolution.
The channel output types are:
4...20 mA
For further hardware information, refer to TMCR2AQ2C (see Modicon M100/M200 Logic
Controller, Hardware Guide).
If you have physically wired, for example, your analog channel for a voltage signal and you
configure the channel for a current signal in SoMachine Basic, you may damage the analog circuit.
NOTICE
INOPERABLE EQUIPMENT
Verify that the physical wiring of the analog circuit is compatible with the software configuration
for the analog channel.
Failure to follow these instructions can result in equipment damage.
TMCR2AQ2V
Introduction
The TMCR2AQ2V is a standard cartridge featuring 2 analog voltage output channels with 12-bit
resolution.
The channel output types are:
0...10 V
For further hardware information, refer to TMCR2AQ2V (see Modicon M100/M200 Logic
Controller, Hardware Guide).
If you have physically wired, for example, your analog channel for a voltage signal and you
configure the channel for a current signal in SoMachine Basic, you may damage the analog circuit.
NOTICE
INOPERABLE EQUIPMENT
Verify that the physical wiring of the analog circuit is compatible with the software configuration
for the analog channel.
Failure to follow these instructions can result in equipment damage.
TMCR2AM3
Introduction
The TMCR2AM3 is a standard M200 cartridge featuring 2 analog current or voltage input channels
and 1 analog current or voltage output channels with 16-bit resolution.
The channel input types are:
0...5V
0...10 V
0...20 mA
4...20 mA
For further hardware information, refer to TMCR2AM3 (see Modicon M100/M200 Logic Controller,
Hardware Guide).
If you have physically wired, for example, your analog channel for a voltage signal and you
configure the channel for a current signal in SoMachine Basic, you may damage the analog circuit.
NOTICE
INOPERABLE EQUIPMENT
Verify that the physical wiring of the analog circuit is compatible with the software configuration
for the analog channel.
Failure to follow these instructions can result in equipment damage.
Filter Unit - -
Units - -
Comment Double-click and type an optional comment
to associate with the channel.
TMCR2TI2
Introduction
The TMCR2TI2 is a standard cartridge featuring 2 analog input channels with 14-bit resolution.
The channel input types are:
K Thermocouple
J Thermocouple
R Thermocouple
S Thermocouple
B Thermocouple
E Thermocouple
T Thermocouple
N Thermocouple
C Thermocouple
PT100
PT1000
NI100
NI1000
For further hardware information, refer to TMCR2TI2 (see Modicon M100/M200 Logic Controller,
Hardware Guide).
If you have physically wired, for example, your analog channel for a voltage signal and you
configure the channel for a current signal in SoMachine Basic, you may damage the analog circuit.
NOTICE
INOPERABLE EQUIPMENT
Verify that the physical wiring of the analog circuit is compatible with the software configuration
for the analog channel.
Failure to follow these instructions can result in equipment damage.
TMCR2SL1
Introduction
The TMCR2SL1 is a standard cartridge module featuring 1 serial line.
For further hardware information, refer to TMCR2SL1 (see Modicon M100/M200 Logic Controller,
Hardware Guide).
The serial line can be configured for any one of the following protocols:
Modbus RTU
Modbus ASCII
ASCII
You can configure both physical and protocol settings for the serial line. Serial lines are configured
for the Modbus RTU protocol by default.
NOTE: You can only add one serial line cartridge to the controller.
Step Action
1 Click the 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:
TMCR2SL1A
Introduction
The TMCR2SL1A is a standard cartridge module featuring 1 isolated serial line.
For further hardware information, refer to TMCR2SL1A (see Modicon M100/M200 Logic
Controller, Hardware Guide).
The serial line can be configured for any one of the following protocols:
Modbus RTU
Modbus ASCII
ASCII
You can configure both physical and protocol settings for the serial line. Serial lines are configured
for the Modbus RTU protocol by default.
NOTE: You can only add one serial line cartridge to the controller.
Step Action
1 Click the 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:
Chapter 7
TM3R Expansion Module Configuration
Overview
This chapter describes how to configure the TM3R expansion modules of the M100/M200 Logic
Controller.
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.
Introduction
The range of TM3R digital I/O expansion modules includes:
TM3R Digital Mixed Input/Output Modules
Adding a Module
The following steps explain how to add a TM3R expansion module to the logic controller in a
SoMachine Basic project:
Step Action
1 Click the Configuration tab in the SoMachine Basic window.
2 In the catalog area, click one of the following module types to expand the list of expansion modules:
TM3 Digital I/O Modules
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.
Removing a Module
You can remove an expansion module by pressing the Delete key or by right-clicking the module
and clicking Remove on the contextual menu that appears.
If the expansion module contains at least one address being used in a program, a message
appears asking you to confirm the operation. Click Yes to continue.
In this case, however, the I/O bus of the logic controller operates at the speed of the slower module
type. For example, when both TM2 and TM3 modules are used, the I/O bus of the logic controller
operates at the speed of the TM2 modules.
Overview
You can configure digital I/Os of your expansion module using:
Configuration tab:
Digital inputs
Digital outputs
Programming tab.
Step Description
1 Click the Configuration tab in the SoMachine Basic window.
2 In the hardware tree, click MyController IO Bus Module x Digital inputs, where x is the
expansion module number on the controller.
Result: The digital input properties of the selected module are displayed in the editor area, for
example:
Step Description
1 Click the Configuration tab in the SoMachine Basic window.
2 In the hardware tree, click MyController IO Bus Module x Digital outputs, where x is
the expansion module number on the controller.
Result: The digital output properties of the selected module are displayed in the editor area, for
example:
Step Description
1 Click the Programming tab in the SoMachine Basic window.
2 In the left-hand area of the Programming tab, click on the Tools tab and from the I/O objects
branch, select one of the following I/O types to display the properties:
Digital inputs
Digital outputs
Analog inputs
Analog outputs
Result: A list of all embedded and expansion module I/O addresses appears in the lower central
area of the SoMachine Basic window, for example:
3 Scroll down to the range of addresses corresponding to the expansion module you are configuring.
The following properties are displayed:
Used: Indicates whether the corresponding address is being used in the program or not.
Address: Displays the address of the digital output on the expansion module. For details on
addressing I/O objects, refer to I/O Addressing.
Symbol: Allows you to specify a symbol to associate with the corresponding I/O object to be
used in the program.
Double-click in the Symbol column, type the symbol name of the corresponding object, and
press Enter.
If a symbol already exists, right-click in the Symbol column and choose Search and Replace
to find and replace occurrences of this symbol throughout the program and/or program
comments.
Comment: Allows you to specify a comment to associate with the corresponding I/O object.
Double-click in the Comment column, type a comment for the corresponding object, and press
Enter.
4 Click Apply to save the changes.
Chapter 8
Embedded Communication Configuration
Overview
This chapter describes how to configure the communication features of the M100/M200 Logic
Controller.
Section 8.1
Ethernet Configuration
Ethernet 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
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 IP address by the following protocols:
Dynamic Host Configuration Protocol (DHCP)
Bootstrap Protocol (BOOTP)
You can also specify the IP address by specifying the following addresses:
IP address
Subnet mask
Gateway address
Ethernet Services
The logic controller supports the following services:
Modbus TCP Server
Modbus TCP Client
Modbus TCP Slave Device
Each server based on TCP manages its own set of connections. When a client tries to open a
connection that exceeds the poll size, the logic controller closes the oldest connection. If the
connections are busy (exchange in progress), when a client tries to open a new one, the new
connection is denied. The server connections stay open as long as the logic controller stays in its
present operational state (RUNNING, STOPPED, or HALTED). The server connections is closed
when a transition is made from its present operational state (RUNNING, STOPPED, or HALTED),
except in case of power outage (because the controller does not have time to close the
connections).
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 in the editor area.
NOTE: The Security Parameters displayed depend on the functional level selected for the
application.
This table describes each parameter of the Ethernet configuration:
NOTE: When a protocol listed in Security Parameters is disabled, requests from the
corresponding server type are ignored. The corresponding configuration screen remains
accessible; however, program execution is not affected.
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 in the editor area.
2 Select Enabled to edit the properties to configure the Modbus TCP protocol.
For detailed information on the Modbus TCP configuration parameters, refer to the table below.
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 presents the table that lists the remote servers:
This table describes each column of the table listing the remote servers:
Section 8.2
Serial Line Configuration
Introduction
The M100/M200 Logic Controller references are equipped with one serial line (SL1).
The serial line can be configured for any one of these protocols:
Modbus RTU
Modbus ASCII
ASCII
You can configure both physical and protocol settings for the serial line. The serial line is
configured for the Modbus RTU protocol by default.
Step Action
1 Click the SL1 (Serial line) node in the hardware tree to display the serial line properties.
This figure presents the properties of the serial line for Modbus RTU and Modbus ASCII protocols:
This figure presents the properties of the serial line for ASCII protocol:
Section 8.3
Supported Modbus Function Codes
Presentation
This table lists the function codes supported by both serial Modbus and Modbus TCP and their
effect on controller memory variables.:
NOTE:
The impact of Modbus function codes used by a master M221 Logic Controller depends on the
slave device type. In the major types of slave device:
Internal bit means %M
Input bit means %I
Internal register means %MW
Input register means %IW
Depending on the type of slave and the slave address, an internal bit should be a %M or %Q; an
input bit should be a %I or %S, an input register should be a %IW or a %SW and an internal register
should be a %MW or a %QW. For more details, refer to the slave device.
Chapter 9
Micro SD Card
Micro SD Card
Introduction
The Modicon M100/M200 Logic Controller allows file transfers with a Micro SD card.
This chapter describes how to manage Modicon M100/M200 Logic Controller files with a Micro SD
card.
Introduction
The Modicon M100/M200 Logic Controller allows the following types of file management with an
micro SD card:
Clone management (see page 150): back up the application, firmware, and post configuration
(if it exists) of the logic controller
Firmware management (see page 152): download firmware updates directly to the logic
controller
Application management (see page 153): back up and restore the logic controller application,
or copy it to another logic controller of the same reference
Post configuration management (see page 155): add, change, or delete the post configuration
file of the logic controller
Error log management (see page 157): back up or delete the error log file of the logic controller
NOTE:
Logic controller operation is not affected during file transfers.
The Modicon M100/M200 Logic Controller accepts only micro SD cards formatted in FAT or
FAT32.
Micro SD card operations are performed regardless of any user access-rights that may be
enabled in the target logic controller.
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.
NOTE: Before inserting a micro SD card in the controller, verify that the micro SD card contains a
valid script file if the micro SD card is not empty. Otherwise, the controller remains in BOOTING
mode as it does not detect any valid script during booting. In this case, remove the micro SD card
to make the controller start normally.
Introduction
This table lists the file locations and types of file that can be managed by cloning or script
commands:
NOTE:
All commands can only be executed when the controller in the STOP or BOOTING state. No
command is executed if a micro SD card is inserted when the controller is in RUN mode.
When a micro SD card command is in progress, start controller commands are ignored. When
the micro SD card command completes, you must start the controller manually.
Script Log
A script.log file is automatically created in the SD card root directory after script operations.
The status of the script operations can be verified reading this file.
Clone Management
Cloning
Cloning allows you to automatically back up the application, firmware, and post configuration (if it
exists) of the Modicon M100/M200 Logic Controller to the micro SD card.
The micro SD card can then be used to later restore the firmware, application, and post
configuration (if it exists) to the logic controller, or copy them to another logic controller with the
same reference.
Before cloning a controller, the M100/M200 Logic Controller verifies whether the application is
copy-protected or not . For details, refer to Password Protecting an Application (see SoMachine
Basic, Operating Guide).
NOTE:
The micro SD card must be empty and correctly formatted to perform this procedure.
The detected error log and data memory are not cloned.
If the application is password-protected, the clone operation is completed but the user
application cannot be restored and the ERR LED is permanently on.
Step Action
1 Format a micro SD card on the PC.
2 Insert the micro SD card in the controller.
Result: The clone operation starts automatically. During the clone operation, the following LEDs
are ON: PWR, and SD.
3 Wait until the clone operation is completed (the SD LED turns OFF).
NOTE: The clone operation lasts 2 to 3 minutes. The clone operation 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 longer to complete
if the logic controller is in STOP mode.
4 Remove the micro SD card from the controller.
Step Action
1 Remove power from the controller.
2 Insert the micro SD card into the controller.
3 Restore power to the controller.
Result: The clone operation is in progress.
NOTE: The SD LED is turned on during the operation.
4 Wait until the end of the download (the SD LED is turned off).
If an error is detected, the SD LED is flashes, and the ERR LED starts flashing.
5 Remove the micro SD card to restart the controller.
NOTE: Downloading a cloned application to the controller first removes the existing application
from controller memory, regardless of any user access-rights that may be enabled in the target
controller.
Firmware Management
Overview
You can use a micro SD card to download firmware updates directly to the logic controller.
Refer to Controller States and Behavior (see page 32) 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 micro SD card into the PC that is running SoMachine Basic.
3 Create a file called script.cmd in the SD card root directory.
4 Edit the file and insert the following commands:
Download "/sys/os"
Reboot
5 Create the folder path \sys\os in the SD card root directory and copy the firmware file in the
os folder:
NOTE: A firmware file example and the script are available in the directory Firmwares &
PostConfiguration\M200M100\ of the SoMachine Basic installation directory.
The default firmware file name for the M100/M200 Logic Controller is M200M100.mfw.
6 Remove the micro SD card from the PC and insert it into the micro SD card slot of the logic
controller.
7 Start the logic controller.
Result: Copying of the firmware file begins. During the operation, the SD system LED on the
logic controller is on.
NOTE: Do not stop the logic controller while the operation is in progress.
8 When the SD system LED is turned off, remove the SD card.
9 Reconnect the USB programming cable to the logic controller and login to the logic controller
with the SoMachine Basic software.
10 The status of the controller firmware update can be verified reading the script.log file
created automatically in the SD card root directory.
Application Management
Overview
You can use a micro SD card to back up and restore your controller application, or copy it to
another controller with the same reference.
Backing Up an Application
This table describes how to back up the controller application on the micro SD card:
Step Action
1 Create a script.cmd file with a text editor on your PC.
2 Edit the file and insert the following line:
Upload "/usr/app"
3 Copy the script file to the root folder of the micro SD card.
4 Insert the prepared micro SD card in the controller.
Result: Copying of the application 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 application backup process has a low priority in order to minimize impact on the
program 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 STOPPED state than if it is in BOOTING state.
5 When the SD system LED is off, remove the micro SD card.
Result: The application file (*.smbk) is saved on the micro SD card.
6 The status of the application backup can be verified reading the script.log file created on the
micro SD card root directory.
Step Action
1 Edit the script.cmd file in the root folder of the micro SD card with a text editor.
2 Replace the content of the script by the following lines:
Delete "/usr/app"
Download "/usr/app"
Reboot
3 Remove power from the controller.
4 Insert the prepared micro SD card in the controller.
Step Action
5 Restore power to the controller.
Result: Copying of the application 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: Before the executing a Download command, the controller verifies the format of the
Machine.cfg file and that the communication channels, parameters and configured values are
valid. If errors are detected, the download is cancelled: the SD LED is on and a message written
to the log file. If this occurs during system power-up, remove the SD to initialize the controller.
6 When the SD system LED is off, remove the micro SD card to restart the controller.
7 The status of the application transfer can be verified reading the script.log file created on
the micro SD card root directory.
Overview
You can use an SD card to add, change, or delete the post configuration file of your controller.
Step Action
1 Insert an empty SD card into the PC that is running SoMachine Basic.
2 Copy the post configuration file (Machine.cfg) to the folder \usr\cfg and the script file to the
root folder of the SD card:
NOTE: A post configuration file example and the associated script are available in the directory
Firmwares & PostConfiguration\PostConfiguration\add_change\ of the
SoMachine Basic installation directory.
3 If necessary, edit the Machine.cfg file to configure your post configuration parameters.
4 Insert the prepared SD card in the controller.
Result: Downloading of the post configuration 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: Before the download the file format is checked, as well as if all of the channels,
parameters, and values configured are valid; in case of detected error the download is aborted.
5 When the SD system LED is turned off, remove the SD card.
6 Restart the controller to apply the new post configuration file.
7 The status of the operation can be verified reading the script.log file created on the SD card
root directory.
Step Action
1 Insert an empty SD card into the PC that is running SoMachine Basic.
2 Copy the script file available in the directory Firmwares &
PostConfiguration\PostConfiguration\remove\ of the SoMachine Basic installation
directory to the root directory of the SD card.
3 Insert the prepared SD card in the controller.
Result: The post configuration file is removed. 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.
4 When the SD system LED is turned off, remove the SD card.
5 Restart the controller to apply the application parameters.
6 The status of the operation can be verified reading the script.log file created automatically
in the SD card root directory.
Overview
You can use the micro SD card to back up or delete the error log file of the logic controller.
Step Action
1 Create a script.cmd file with a text editor on your PC.
2 Edit the file and insert the following line:
Upload "/sys/log"
3 Copy the script file to the root folder of the micro SD card.
4 Insert the prepared micro SD card in the logic controller.
Result: Transfer of the error log 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 backup process has a low priority in order to minimize impact on the program and
communication performance of the logic controller. Depending on the amount of free time in your
program, the operation may require more time to complete if the logic controller is in STOPPED
state than if it is in BOOTING state.
5 When the SD system LED is turned off, remove the micro SD card.
Result: The error log file (PlcLog.csv) is saved on the micro SD card.
6 The status of the operation can be verified reading the script.log file created automatically
in the micro SD card root directory.
Step Action
1 Create a script.cmd file with a text editor on your PC.
2 Edit the file and insert the following line:
Delete "/sys/log"
3 Copy the script file to the root folder of the micro SD card.
4 Insert the prepared micro SD card in the logic controller.
Result: Deleting of the error log 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.
5 When the SD system LED is turned off, remove the micro SD card.
Result: The error log file (PlcLog.csv) is deleted from the logic controller.
6 The status of the operation can be verified reading the script.log file created automatically
in the micro SD card root directory.
After an upload through the micro SD card, the code is represented as in the example below:
02/06/14, 12:04:01, 0x01110001
This table describes the meaning of the hexadecimal error representation:
Part III
Programming the M100/M200 Logic Controller
Overview
This part provides information about the system and I/O objects specific to the M100/M200 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 10
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
To obtain the equivalent Ladder Diagram source code:
Step Action
1 Select and copy (Ctrl+C) the source code for the first rung of the sample program shown in
this manual.
2
In SoMachine Basic, create a new rung by clicking on the toolbar.
3 In this rung, click the LD > IL button to display Instruction List source code.
4 Select the line number 0000, then right-click 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.
Example
Instruction List program:
Chapter 11
I/O Objects
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 cartridges TMCR2AI2, TMCR2TI2, and
TMCR2AM3. 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 the M100/M200 Hardware Guide (see Modicon M100/M200 Logic Controller, Hardware
Guide) 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 received from the logic
controller using cartridges.
Two 0-10 V analog outputs and two 4-20 mA analog outputs are embedded in the cartridges
TMCR2AQ2C and TMCR2AQ2V respectively.
One 0-5 V/0-10 V analog voltage output or 4-20 mA analog current output is embedded in the
cartridge TMCR2AM3.
Refer to Modicon M100/M200 Logic Controller Hardware Guide (see Modicon M100/M200 Logic
Controller, Hardware Guide) 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.
Chapter 12
Function Blocks
Function Blocks
Section 12.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 159) to obtain the equivalent Ladder
Diagram.
Section 12.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:
Single Phase
Dual Phase [Pulse / Direction]
Dual Phase [Clock Wise / Counter Clock Wise]
Dual Phase [Quadrature X1]
Dual Phase [Quadrature X2]
Dual Phase [Quadrature X4]
Frequency Meter
The High Speed Counter function block works at a maximum frequency of 100 kHz for all
counting modes with a range 65535 in single word and 4294967295 in double word.
The High Speed Counter function block uses dedicated inputs and auxiliary inputs and outputs.
Refer to the M100/M200 Logic Controller - Hardware Guide (see Modicon M100/M200 Logic
Controller, Hardware Guide) for more information on inputs and outputs.
You must initialize the High Speed Counter function in the Configuration tab using the High
Speed Counter Assistant before using an instance of the function block. Refer to Configuring
High Speed Counters (see page 78).
Graphical Representation
Inputs
The High Speed Counter function block has the following inputs:
The High Speed Counter function block is associated with the following input objects:
Outputs
The High Speed Counter function block has the following outputs:
The High Speed Counter function block is associated with the following output objects:
Properties
The High Speed Counter function block has the following properties:
Special Cases
This table presents a list of special cases when programming the High Speed Counter function
block:
Introduction
The High Speed Counter function block works at a maximum frequency of 100 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:
Output Thresholds
During counting, the current value is compared to two thresholds: %HSCi.S0 or %HSCi.S0D and
%HSCi.S1 or %HSCi.S1D.
According to the result of the comparisons, the bit objects, %HSCi.TH0 and %HSCi.TH1, are:
set to 1 if the current value is greater than or equal to the corresponding threshold
reset to 0 if the current value is less than the corresponding threshold.
Physical reflex outputs can be configured to respond differentially within the context of the compare
results of the threshold values and the current value of the counters.
NOTE: None, 1 or 2 reflex outputs can be configured.
For more information on the configuration of reflex outputs, refer to Configuring Single Phase and
Dual Phase (see page 82).
%HSCi.U is an output of the function block; it gives the direction of the associated counter variation
(1 for UP, 0 for DOWN).
Auxiliary Inputs
Counting operations are made on the rising edge of pulses, and only if the counting function block
is enabled.
There are two optional inputs used in counting mode: Catch Input and Preset Input:
The Catch Input is used to capture the current value (%HSCi.V or %HSCi.VD) and store it in
%HSCi.C or %HSCi.CD. The catch inputs are specified as %I0.3 for %HSC0 and %I0.4 for
%HSC1 if available.
When the Preset Input is active, the current value is affected in the following ways:
%HSCi.V and %HSCi.VD are respectively written with the content of %HSCi.P or %HSCi.PD.
For frequency counting, %HSCi.V or %HSCi.VD is set to 0.
NOTE: %HSCi.F is also set to 0. The Preset Input is specified as %I0.2 for %HSC0 and/or %I0.5
for %HSC1.
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):
NOTE: Reflex outputs are managed independently from the controller cycle time.
Reflex Output Value < %HSC0.S0 %HSC0.S0 <= Value < %HSC0.S1 Value >= %HSC0.S1
%Q0.4 – X –
%Q0.5 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.4 (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
Reflex Output Value < %HSC0.S0 %HSC0.S0 <= Value < %HSC0.S1 Value >= %HSC0.S1
%Q0.4 – – X
%Q0.5 X X –
Timing diagram:
(8) S is set to 1 so the new preset value (%HSC0.P = 20) is taken into account and the reflex outputs are
updated
(9) IN input is set to 1 and the function restarts in down counting mode
(10) The threshold value %HSC0.S1 is set to 17
(11) S input active makes threshold S1 new value to be granted at the next count and resets %HSC0.V to
preset value 17
(12) A catch of the current value %HSC0.V is made so %HSC0.C = 20
Dual Phase [Quadrature X1], Dual Phase [Quadrature X2], Dual Phase [Quadrature X4] Timing
Diagram
The encoder signal is counted according to the input mode selected, as shown below:
X1 1 count for each encoder cycle
X2 2 counts for each encoder cycle
X4 4 counts for each encoder cycle
Timing diagram:
Quadrature X1 When channel A leads channel B, the counter increments on the rising edge of channel A.
When channel B leads channel A, the counter decrements on the falling edge of channel A.
Quadrature X2 Counter increments or decrements on each edge of channel A, depending on which channel
leads the other. Each cycle results in two increments or decrements.
Quadrature X4 The counter increments or decrements on each edge of channels A and B. Whether the
counter increments or decrements depends on which channel leads the other. Each cycle results in 4
increments or decrements.
Overview
Only one input is required for pulse.
On the rising edge of the preset condition, the counter is enabled and the current value is set to
the preset value.
When counter is enabled, each pulse applied to the input increments the current value. The
counter stops when its current value reaches the maximum value. The overflow flag is then set.
The counter value remains at maximum value even if new pulses are applied to the input.
A new preset is needed to activate the counter again.
1
Sync Condition
2 4
Enable Condition
Preset Value
Counter Current Value
3 Time
0
Stage Action
1 On the rising edge of the Preset condition, the preset value is loaded in the counter
(regardless of the current value) and the counter is enabled.
2 When Enable condition = 1, the current counter value increments on each pulse on
input A until it reaches 0.
3 The counter waits until the next rising edge of the Preset condition.
Note: At this point, pulses on input A have no effect on the counter.
4 When Enable condition = 0, the counter ignores the pulses from input A and retains
its current value until the Enable condition = 1. The counter resumes counting
pulses from input A on the rising edge of the Enable input from the held value.
Overview
The Modulo-loop mode can be used for repeated actions on a series of moving objects, such as
packaging and labeling applications.
Principle
On a rising edge of the preset condition, the counter is enabled and the current value is reset to 0.
When counter is enabled:
Incrementing direction: the counter increments until it reaches the modulo value. At the next
pulse, the counter is reset to 0, a modulo flag is set to 1, and the counting continues.
Decrementing direction: the counter decrements until it reaches 0. At the next pulse, the counter
is set to the modulo value, a modulo flag is set to 1, and the counting continues.
Stage Action
1 On the rising edge of preset condition, the current value is reset to 0 and the counter is enabled.
2 When Enable condition = 1, each pulse on A increments the counter value.
3 When the counter reaches the (modulo-1) value, the counter loops to 0 at the next pulse and the
counting continues. Modulo_Flag is set to 1.
4 On the rising edge of preset condition, the current counter value is reset to 0.
Stage Action
5 When Enable condition = 1, each pulse on B decrements the counter.
6 When the counter reaches 0, the counter loops to (modulo-1) at the next pulse and the counting
continues.
7 When Enable condition = 0, the pulses on the inputs are ignored.
8 On the rising edge of preset condition, the current counter value is reset to 0.
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 100 kHz.
It is possible to choose between 2 time bases, the choice being made by the object %HSC.T (Time
base):
Accuracy Measurement
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) On input S rising edge, the current value %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) On input S rising edge, the current value %HSC0.V is set to 0
(7) S is set to 0 and IN is set to 1, so the measurement starts at the next rising edge of the TB signal
Section 12.3
Pulse (%PLS)
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 and cannot be modified. Refer
to Configuring Pulse Generators (see page 68).
If %PLSi.P is:
Changed, the output signal period is changed at the end of the current period.
Set to 0, the pulse generation function is stopped.
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 159) to obtain the equivalent Ladder
Diagram.
Section 12.4
Pulse Width Modulation (%PWM)
Description
Introduction
The Pulse Width Modulation function block generates a variable wave signal on a
dedicated output channel, %Q0.0 or %Q0.1, with variable width and, therefore, duty cycle.
Controllers with relay outputs for these two channels do not support this function.
%PWM0 uses dedicated output %Q0.0 and %PMW1 uses dedicated output %Q0.1. The pulse
function blocks %PLS can also be configured to use these same dedicated outputs. You can
configure one or the other of these two functions, but not both, for any given output.
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 68).
Illustration
This illustration is the Pulse Width Modulation function block:
Inputs
The Pulse Width Modulation function block has the following input:
Overview
To configure the Pulse Generator resource, refer to Configuring Pulse Generators
(see page 68).
To configure the Pulse Generator resource as a PWM, refer to PWM Configuration
(see page 73).
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 properties:
NOTE: The Num. Pulse, Current, and Done properties that appear in the Pulse Generators
properties table under the Programming tab do not apply to the PWM function.
Objects
The Pulse Width Modulation function block is associated with the following objects:
If %PWMi.P is:
changed, the output signal period is affected at the end of the ongoing period.
set to 0, the pulse generation function is stopped.
out of range, the parameter is forced to 0 and the pulse generation function is stopped.
If %PWMi.R is:
set to 0, the pulse generation function is stopped (output set to 0).
set to 100, the output signal is set to 1
changed, the output signal ratio is changed at the end of the current period
out of range, the parameter is forced to 0.
Time Base
The Time Base is set on the Configuration Pulse Generators and can only be modified under
the Configuration tab. Refer to Configuring Pulse Generators (see page 68).
The output signal period T is set with the Preset and Time Base parameters such that
T = %PWMi.P x Time Base.
This table shows the range of available periods:
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:
The signal width is modified by the program according to the state of controller input %I0.0 and
%I0.1.
The time base is set to 10 ms.
The preset value %PWM0.P is set to 50 so the ratio step is equal to 2%.
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 159) to obtain the equivalent Ladder
Diagram.
Chapter 13
Pulse Train Output (%PTO)
Section 13.1
Description
Description
Introduction
The M200 PTO function provides two pulse train output channels for a specified number of pulses
and a specified velocity (frequency). The PTO function is used to control the positioning or speed
of one or two independent linear single-axis stepper or servo drives in open loop mode. The PTO
function does not have any position feedback information from the process. Therefore, position
information must be integrated in the drive.
The PTO, PWM (pulse width modulation), and PLS (pulse) functions use the same dedicated
outputs. Only one of these three functions can be used on the same channel. Using different
functions on channel 0 and channel 1 is allowed.
A PTO channel can use up to:
five physical inputs, if optional interface signals for homing (Ref), event (Probe), limits (LimP,
LimN), or drive interface (DriveReady) are used,
three physical outputs, if optional drive interface signal (DriveEnable) is used, along with the two
PTO fast outputs.
Automatic origin offset is also managed to improve positioning accuracy. Diagnostics are available
for status monitoring, allowing a comprehensive and quick troubleshooting.
Supported Functions
The two PTO channels support the following functions:
two output modes (two channels for Pulse and Direction or one channel for CW/CCW)
single axis moves (velocity and position)
relative and absolute positioning, with automatic direction management
trapezoidal and S-curve acceleration and deceleration
homing (four modes with offset compensation)
dynamic acceleration, deceleration, velocity, and position modification
switch from speed to position mode
move queuing (buffer of one move)
position capture and move trigger on event (using probe input)
limits (hardware and software)
diagnostics
NOTE: The motion function blocks act on the position of the axis according to the motion state
diagram (see page 248). The administrative function blocks do not influence the motion state.
NOTE: The MC_Power_PTO function block is mandatory before a move command can be issued.
WARNING
UNINTENDED EQUIPMENT OPERATION
Do not use the same function block instance in different program tasks.
Do not change the function block reference (AXIS) while the function block is executing.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
PTO Characteristics
There are up to five physical inputs for a PTO channel:
Two are assigned to the PTO function through configuration and are taken into account upon a
rising edge on the input:
Ref input (%I0.2 for %PTO0 and %I0.5 for %PTO1)
Probe input (%I0.3 for %PTO0 and %I0.4 for %PTO1)
Three are assigned to the MC_Power_PTO function block. They have no fixed assignment (they
are not configured in the configuration screen), and are read with all other inputs:
DriveReady input
Limit positive input
Limit negative input
NOTE: These inputs are managed like any other regular input, but are used by the PTO function
when assigned to MC_Power_PTO function block.
NOTE: The positive and negative limit inputs are required to help prevent over-travel.
WARNING
UNINTENDED EQUIPMENT OPERATION
Ensure that controller hardware limit switches are integrated in the design and logic of your
application.
Mount the controller hardware limit switches in a position that allows for an adequate braking
distance.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
Characteristic Value
Number of channels 2
Number of axis 1 per channel
Position range -2,147,483,648...2,147,483,647 (32 bits)
Minimum velocity 0 Hz
Characteristic Value
Maximum velocity 100 kHz (for a 40/60 duty cycle and max. 200 mA)
Minimum step 1 Hz
Accuracy on velocity 1%
Acceleration / deceleration (min) 1 Hz/ms
Acceleration / deceleration (max) 100 kHz/ms
Origin offset -2,147,483,648...2,147,483,647 (32 bits)
Software limits range -2,147,483,648...2,147,483,647 (32 bits)
Section 13.2
Configuration
Configuration
Overview
This section describes how to configure a PTO channel and the associated parameters.
PTO Configuration
Overview
To configure the Pulse Generator resource, refer to Configuring Pulse Generators
(see page 68).
To configure the Pulse Generator resource as a PTO, refer to PTO Configuration
(see page 74).
Overview
There are two possible output modes:
ClockWise / CounterClockwise
Pulse / Direction
Special Cases
Start Velocity
The Start Velocity is the minimum frequency at which a stepper motor can produce movement,
with a load applied, without the loss of steps.
Start Velocity parameter is used when starting a motion from velocity 0.
Start Velocity must be in the range 0...MaxVelocityAppl.
Value 0 means that the Start Velocity parameter is not used. In this case, the motion starts at a
velocity = acceleration rate x 1 ms.
Stop Velocity
The Stop Velocity is the maximum frequency at which a stepper motor stops producing
movement, with a load applied, without loss of steps.
Stop Velocity is only used when moving from a higher velocity than Stop Velocity, down to
velocity 0.
Stop Velocity must be in the range 0...MaxVelocityAppl.
Value 0 means that the Stop Velocity parameter is not used. In this case, the motion stops at a
velocity = deceleration rate x 1 ms.
Acceleration / Deceleration
Acceleration is the rate of velocity change, starting from Start Velocity to target velocity.
Deceleration is the rate of velocity change, starting from target velocity to Stop Velocity. These
velocity changes are implicitly managed by the PTO function in accordance with Acceleration,
Deceleration and JerkRatio parameters following a trapezoidal or an S-curve profile.
JerkRatio 66%: 2/3 of the acceleration and deceleration time is spent in increasing and
decreasing the acceleration and deceleration value.
JerkRatio 100%: The entire time is spent in increasing and decreasing the acceleration and
deceleration value.
NOTE: The JerkRatio parameter value is common for acceleration and deceleration so that
concave time and convex time are equal.
Probe Event
Description
The Probe input is enabled by configuration, and activated using the MC_TouchProbe_PTO
function block.
The Probe input is used as an event to:
capture the position,
start a move independently of the task.
Both functions can be active at the same time, that is, the same event captures the position and
start a motion function block (see page 213).
NOTE: Only the first event after the rising edge at the MC_TouchProbe_PTO function block Busy
output is valid. Once the Done output is set to TRUE, subsequent events are ignored. The function
block needs to be reactivated to respond to other events.
Position Capture
The position captured is available in %MC_TouchProbe_PTO.RecordedPos.
Motion Trigger
The BufferMode input of a motion function block must be set to seTrigger.
This example illustrates a change target velocity with enable window:
This example illustrates a move of pre-programmed distance, with simple profile and no enable
window:
This example illustrates a move of pre-programmed distance, with complex profile and enable
window:
Positioning Limits
Introduction
Positive and negative limits can be set to control the movement boundaries in both directions. Both
hardware and software limits are managed by the controller.
Hardware and software limit switches are used to manage boundaries in the controller application
only. They are not intended to replace any functional safety limit switches wired to the drive. The
controller application limit switches must necessarily be activated before the functional safety limit
switches wired to the drive. In any case, the type of functional safety architecture, which is beyond
the scope of the present document, that you deploy depends on your safety analysis, including,
but not limited to:
risk assessment according to EN/ISO 12100
FMEA according to EN 60812
WARNING
UNINTENDED EQUIPMENT OPERATION
Ensure that a risk assessment is conducted and respected according to EN/ISO 12100 during
the design of your machine.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
Once either the controller hardware or software limits are crossed, an error is detected and a Fast
stop deceleration is performed:
the axis switches to ErrorStop state, with AxisErrorId 1002 to 1005. Refer to
MC_ReadAxisError_PTO (see page 302) and Axis Control Advisory Alerts (see page 244).
the function block under execution detects the error state,
on other applicable function blocks, the CmdAborted outputs are set to TRUE.
To clear the axis error state, and return to a Standstill state, execution of MC_Reset_PTO is
required as any motion command will be rejected while the axis remains outside the limits (function
block terminates with ErrorId=InvalidDirectionValue). It is only possible to execute a
motion command in the opposite direction under these circumstances.
Software Limits
Software limits can be set to control the movement boundaries in both directions.
Limit values are enabled and set in the configuration screen, such that:
Positive limit > Negative limit
Values in the range -2,147,483,648 to 2,147,483,647
They can also be enabled, disabled, or modified in the application program (MC_WritePar_PTO
and PTO Parameter (see page 243)).
NOTE: When enabled, the software limits are valid after an initial homing is successfully performed
(that is, the axis is homed, MC_Home_PTO (see page 282)).
Hardware Limits
Hardware limits are required for the homing procedure, and for helping to prevent damage to the
machine. The appropriate inputs must be used on the %MC_Power_PTO.LimP and
%MC_Power_PTO.LimN inputs. The hardware limit devices must be of a normally closed type such
that the input to the function block is FALSE when the respective limit is reached.
NOTE: The restrictions over movement are valid while the limit inputs are FALSE and regardless
of the sense of direction. When they return to TRUE, movement restrictions are removed and the
hardware limits are functionnally rearmed. Therefore, use falling edge contacts leading to RESET
output instructions prior to the function block. Then use those bits to control these function block
inputs. When operations are complete, SET the bits to restore normal operation.
WARNING
UNINTENDED EQUIPMENT OPERATION
Ensure that controller hardware limit switches are integrated in the design and logic of your
application.
Mount the controller hardware limit switches in a position that allows for an adequate braking
distance.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
NOTE: Adequate braking distance is dependent on the maximum velocity, maximum load (mass)
of the equipment being moved, and the value of the Fast stop deceleration parameter.
Section 13.3
Home Modes
Home Modes
Overview
This section describes the PTO home modes.
Homing Modes
Description
Homing is the method used to establish the reference point or origin for absolute movement.
A homing movement can be made using different methods. The M200 PTO channels provide
several standard homing movement types:
position setting (see page 233),
long reference (see page 234),
short reference no reversal (see page 236),
short reference reversal (see page 238),
short reference with INDEX (see page 238).
A homing movement must be terminated without interruption for the new reference point to be
valid.
%MC_ReadSts_PTO.IsHomed is set to TRUE when a homing movement is finished
successfully. If the homing movement is interrupted, it needs to be started again.
%MC_ReadSts_PTO.IsHomed is set to FALSE when the axis state is DISABLED, or when no
homing movement was finished successfully.
Refer to MC_Home_PTO (see page 282) and home modes function block object codes
(see page 242).
Home Position
Homing is done with an external switch and the homing position is defined on the switch edge.
Then the motion is decelerated until stop.
The actual position of the axis at the end of the motion sequence may therefore differ from the
position parameter set on the function block:
To simplify the representation of a stop in the homing mode diagrams, the following presentation
is made to represent the actual position of the axis:
Limits
Hardware limits are necessary for the correct functioning of the MC_Home_PTO function block
(Positioning Limits (see page 226) and MC_Power_PTO (see page 258)). Depending on the
movement type you request with the homing mode, the hardware limits help assure that the end
of travel is respected by the function block.
When a homing action is initiated in a direction away from the reference switch, the hardware limits
serve to either:
indicate a reversal of direction is required to move the axis toward the reference switch or,
indicate that an error has been detected as the reference switch was not found before reaching
the end of travel.
For homing movement types that allow for reversal of direction, when the movement reaches the
hardware limit the axis stops using the configured deceleration, and resumes motion in a reversed
direction.
In homing movement types that do not allow for the reversal of direction, when the movement
reaches the hardware limit, the homing procedure is aborted and the axis stops with the Fast stop
deceleration.
WARNING
UNINTENDED EQUIPMENT OPERATION
Ensure that controller hardware limit switches are integrated in the design and logic of your
application.
Mount the controller hardware limit switches in a position that allows for an adequate braking
distance.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
NOTE: Adequate braking distance is dependent on the maximum velocity, maximum load (mass)
of the equipment being moved, and the value of the Fast stop deceleration parameter.
Position Setting
Description
In the case of position setting, the current position is set to the specified position value. No move
is performed.
Long Reference
Description
The PTOHome and PTOEnhancedHome function blocks are used to set the axis to a reference
position.
The Short Reference with INDEX homing method uses the two homing-specific inputs:
The PROX input, used as the positive limit signal: On the rising edge of the signal (negative
side), the axis must change direction.
The Origin input, used as the zero marker signal (Z)
The following diagram illustrates the Short Reference with INDEX homing method:
Error Detection
When the PROX input is enabled, an error is reported in the LIMIT_FLT status object when the
limit is crossed.
Home Offset
Description
If the origin cannot be defined by switches with enough accuracy, it is possible to make the axis
move to a specific position away from the origin switch. Home offset allows making a difference
between mechanical origin and electrical origin.
Home offset is set in number of pulses (-2,147,483,648...2,147,483,647, default value 0). When
set by configuration, the MC_Home_PTO (see page 282) command is executed first, and then the
specified number of pulses is output at the home low velocity in the specified direction.
NOTE: The MC_Home_PTO command busy flag is only released after origin offset has been
completed.
Section 13.4
Data Parameters
Data Parameters
Direction
This table lists the values for the direction function block object codes:
Buffer Modes
This table lists the values for the buffer modes function block object codes:
Homing Modes
This table lists the values for the homing modes function block object codes:
PTO Parameter
This table lists the values for the PTO parameters function block object codes:
An Axis Control Alert switches the axis in ErrorStop state (MC_Reset_PTO is mandatory to get
out of ErrorStop state). The resulting axis status is reflected by MC_ReadSts_PTO and
MC_ReadAxisError_PTO.
A Motion State Alert or a Range Alert does not affect the axis state, nor any move currently
executing, nor the move queue. In this case, the error is only local to the applicable function block:
the Error output is set to TRUE, and the ErrorId object output is set to the appropriate PTO
motion command error code.
Section 13.5
Operation Modes
Operation Modes
Overview
This section describes the operation modes.
State Diagram
The axis is always in one of the defined states in this diagram:
State Description
Disabled Initial state of the axis, no motion command is allowed. The axis is not homed.
Standstill Power is on, no error is detected, and no motion commands are active on the axis.
Motion command is allowed.
ErrorStop Highest priority, applicable when an error is detected on the axis or in the controller.
Any ongoing move is aborted by a Fast Stop Deceleration. Error output is set to
TRUE on applicable function blocks, and an ErrorId sets the error code. As long as
an error is pending, the state remains ErrorStop. No further motion command is
accepted until a reset has been done using MC_Reset_PTO.
Homing Applicable when MC_Home_PTO controls the axis.
Discrete Applicable when MC_MoveRel_PTO, MC_MoveAbs_PTO, or MC_Halt_PTO controls
the axis.
State Description
Continuous Applicable when MC_MoveVel_PTO controls the axis.
Stopping Applicable when MC_Stop_PTO controls the axis.
NOTE: Function blocks which are not listed in the state diagram do not affect a change of state of
the axis.
The entire motion command including acceleration and deceleration ramps cannot exceed
4,294,967,295 pulses. At the maximum frequency of 100 kHz, the acceleration and deceleration
ramps are limited to 80 seconds.
Command Next
Home MoveVel MoveRel MoveAbs Halt Stop
Current Standstill Allowed Allowed (1) Allowed (1) Allowed (1) Allowed Allowed
NOTE: When an error is detected in the motion transition, the axis goes into ErrorStop state. The
ErrorId is set to InvalidTransition.
Buffer Mode
Description
Some of the motion function blocks have an input object called BufferMode. With this input
object, the function block can either start immediately, start on probe event, or be buffered.
The available options are defined in the buffer modes function block object codes (see page 242):
An aborting motion (mcAborting) starts immediately, aborting any ongoing move, and clearing
the motion queue.
An event motion (seTrigger) is an aborting move, starting on probe event (see page 223).
A buffered motion (mcBuffered, mcBlendingPrevious, seBufferedDelay) is queued,
that is, appended to any moves currently executing or waiting to execute, and starts when the
previous motion is done.
NOTE:
Only a valid motion can be queued. If the function block execution terminates with the Error
output set to TRUE, the move is not queued, any move currently executing is not affected, and
the queue is not cleared.
When the queue is already full, the Error output is set to TRUE on the applicable function
block, and ErrorId output returns the error MotionQueueFull (see page 245).
Section 13.6
Adding / Removing a Function Block
Step Action
1 Select the Programming tab.
2 Select Function Blocks PTO Motion or Function Blocks PTO Administrative as
shown in the following graphic:
Step Action
1 In the Programming tab, click the instance of the function block.
2 Press Delete to remove the selected function block.
Section 13.7
Motion Task Function Block
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis and motion task
table. Double-click the function block to display the function block properties, choose the axis and table,
then click Apply.
Inputs
This table describes the inputs of the function block:
When reset to FALSE after being set to TRUE, the current motion task
execution resumes in the following conditions:
The motion task resumes whatever the value of the current velocity.
The current active step parameters are used.
The absolute target position is not changed. If the current motion task is
MC_MoveRel_PTO, there is no distance added.
In the current step, the Next step condition is reset (for example: the delay
is restarted from 0, Probe input event is enabled and waiting for an
edge).
Outputs
This table describes the outputs of the function block:
If a loop is requested (Loop input), the Ended output is TRUE for one
cycle when the sequence starts again.
Busy - When TRUE, function block execution is in progress.
When FALSE, execution of the function block has been terminated.
The function block must be kept in an active task of the application
program for at least as long as Busy is TRUE.
Active - When TRUE, the function block instance has control of the axis. Only
one function block at a time can set Active TRUE for the same axis.
Operating Modes
MC_MotionTask_PTO start: The function block can only be started from Standstill state.
MC_MotionTask_PTO stop: The function block can be stopped by one of the following actions:
Setting Pause input to TRUE.
Executing a MC_Stop_PTO
The execution of the steps in the motion task follows the same rules and restrictions as each single-
axis function block. Generally, in case of detected errors the function block behaves as follows:
If a motion state or range error is detected during the function block execution:
A motion stop command is applied to the motion task using the current step deceleration
parameter value. If the step deceleration parameter is not valid, a fast stop deceleration is
applied.
During the controlled motion stop, the function block outputs Active and Busy remain
TRUE, with the output object ActiveStep = 0.
Once the motion is stopped, the function block execution is finished with Error = 1, and the
ErrorId output object set to the value corresponding to the detected error type.
If an axis control error is detected, the axis switches to the Stopping state. The function block
execution is finished with Error = 1, and the ErrorId output object set to the value
corresponding to the detected error type.
Section 13.8
Power Function Block
Behavior
The axis is disabled, when:
%MC_Power_PTO.Enable = FALSE, or
%MC_Power_PTO.DriveReady = FALSE, or
an Hardware limit error is detected (HwPositionLimitP / HwPositionLimitN)
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Section 13.9
Movement Function Blocks
Overview
This section describes the movement function blocks.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
NOTE:
To stop the motion, the function block has to be interrupted by another function block issuing a
new command.
If a motion is ongoing, and the direction is reversed, first the motion is halted with the
deceleration of the MC_MoveVel_PTO function block, and then the motion resumes backward.
The acceleration/deceleration duration of the segment block must not exceed 80 seconds.
The diagram illustrates a complex profile from Continuous state with change of direction:
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
NOTE:
The function block completes with velocity zero if no further blocks are pending.
If the distance is too short for the target velocity to be reached, the movement profile is
triangular, rather than trapezoidal.
If a motion is ongoing, and the commanded distance is exceeded due to the current motion
parameters, the direction reversal is automatically managed: the motion is first halted with the
deceleration of the MC_MoveRel_PTO function block, and then the motion resumes backward.
The acceleration/deceleration duration of the segment block must not exceed 80 seconds.
The diagram illustrates a complex profile from Continuous state with change of direction:
The diagram illustrates a complex profile from Discrete state with change of direction:
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
NOTE:
The function block completes with velocity zero if no further blocks are pending.
The motion direction is automatically set, according to the current and target positions.
If the distance is too short for the target velocity to be reached, the movement profile is
triangular, rather than trapezoidal.
If the position cannot be reached with the current direction, the direction reversal is
automatically managed. If a motion is ongoing, it is first halted with the deceleration of the
MC_MoveAbsolute_PTO function block, and then the motion resumes backward.
The acceleration/deceleration duration of the segment block must not exceed 80 seconds.
The diagram illustrates a complex profile from Discrete state with change of direction:
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
NOTE:
Calling this function block in state Standstill changes the state to Stopping, and back to
Standstill when Execute is FALSE.
The state Stopping is kept as long as the input Execute is TRUE.
The Done output is set when the stop ramp is finished.
If Deceleration = 0, the fast stop deceleration is used.
The function block completes with velocity zero.
The deceleration duration of the segment block must not exceed 80 seconds.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Section 13.10
Stopping / Position Function Blocks
Overview
This section describes the stopping and the position function blocks.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
NOTE: The acceleration/deceleration duration of the segment block must not exceed 80 seconds.
Behavior
This function block modifies the coordinates of the actual position of the axis without any physical
movement. It can only be used when the axis is in a Standstill state.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Section 13.11
Status Function Blocks
Overview
This section describes the status function blocks.
Function Description
This function block returns the value of the actual velocity of the axis.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Function Description
This function block returns the value of the actual position of the axis.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Function Description
This function block returns the state diagram (see page 248) status of the axis.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Function Description
This function block returns the actual motion status of the axis.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Section 13.12
Probe Function Blocks
Overview
This section describes the probe function blocks.
Function Description
This function block is used to activate a trigger event on the probe input. This trigger event allows
to record the axis position, and/or to start a buffered move.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
NOTE:
Only one instance of this function block is allowed on the same axis.
Only the first event after the rising edge at the MC_TouchProbe_PTO function block Busy
output is valid. Once the Done output is set to TRUE, subsequent events are ignored. The
function block needs to be reactivated to respond to other events.
Function Description
This function block is used to abort function blocks which are connected to trigger events (for
example, MC_TouchProbe_PTO).
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Section 13.13
Error Handling Function Blocks
Overview
This section describes the error handling function blocks.
Function Description
This function block retrieves the axis control error. If no axis control error is pending, the function
block returns AxisErrorId = 0.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Behavior
This function block resets all axis-related errors, conditions permitting, to allow a transition from the
states ErrorStop to Standstill. It does not affect the output of the function blocks instances.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Section 13.14
Parameters Function Blocks
Overview
This section describes the parameters function blocks.
Function Description
This function block is used to get parameters from the PTO.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Function Description
This function block is used to write parameters to the PTO.
Graphical Representation
NOTE: When you first enter the function block, you must configure it to use the intended axis. Double-click on
the function block to display the function block properties, choose the axis and click Apply.
Inputs
This table describes the inputs of the function block:
Outputs
This table describes the outputs of the function block:
Chapter 14
PID Function
PID Function
Section 14.1
PID Operating Modes
Introduction
The SoMachine Basic PID controller offers 4 distinct operating modes, configurable in the General
tab (see page 333) of the PID Assistant in SoMachine Basic.
The PID operating modes are:
PID mode
AT + PID mode
AT mode
Word address
PID Mode
The simple PID controller mode is active by default when the PID controller starts up. The gain
values Kp, Ti, and Td to be specified in the PID tab (see page 338) must be known in advance to
successfully control the process. You can choose the corrector type of the controller (PID or PI) in
the PID tab of the PID Assistant screen (see page 330). If the PI corrector type is selected, the
derivative time Td field is disabled.
Using PID mode, the Auto-Tuning function is disabled and the AT tab (see page 340) of the
Assistant Configuration screen is therefore unavailable.
AT + PID Mode
In this mode, the Auto-Tuning function is active when the PID controller starts up. The Auto-Tuning
function then calculates the gain values Kp, Ti, and Td (see page 338) and the type of PID action
(see page 342). At the end of the Auto-Tuning sequence, the controller switches to PID mode for
the adjusted setpoint, using the parameters calculated by Auto-Tuning.
If the Auto-Tuning algorithm detects an error (see page 349):
No PID parameter is calculated.
The Auto-Tuning output is set to the output that was applied to the process before starting Auto-
Tuning.
An error message appears in the List of PID States drop-down list.
The PID control is cancelled.
While in AT + PID mode, the transition from Auto-Tuning to PID mode is automatic and seamless.
AT Mode
In this mode, the Auto-Tuning function is active when the PID controller starts up and automatically
calculates both the gain values Kp, Ti, and Td (see page 338) and the type of PID action
(see page 342). After convergence of the Auto-Tuning process and successful completion with the
determination of the Kp, Ti, and Td parameters and the type of PID action (see page 342) (or after
detection of an error in the Auto-Tuning algorithm), the Auto-Tuning numerical output is set to 0
and the Auto-Tuning Complete message appears in the List of PID States (see page 348) drop-
down. The PID controller then stops and waits. The calculated Kp, Ti, and Td PID coefficients are
available in their respective memory words (%MWx).
Word Address
This PID mode is selected by assigning the desired value to the word address associated with this
selection:
%MWxx = 0: The controller is disabled.
%MWxx = 1: The controller operates in simple PID mode.
%MWxx = 2: The controller operates in AT+ PID mode.
%MWxx = 3: The controller operates in AT mode only.
%MWxx = 4: The controller operates in simple PID mode, with PI corrector type.
This mode word address enables you to manage the PID controller operating mode with the
application, thus making it possible to adapt to your requirements.
Section 14.2
PID Auto-Tuning Configuration
Introduction
This section guides you through all the steps necessary to configure the SoMachine Basic PID
controller using Auto-tuning (AT).
This section contains the following steps:
Step Topic
1 Configuring analog channel (see page 314)
2 Pre-requisites for PID configuration (see page 314)
3 Configuring the PID (see page 315)
4 Control set-up (see page 316)
Phase Description
1 PID is enabled in the program (see page 345).
2 Scan Mode is set to periodic (see page 347).
WARNING
INOPERABLE EQUIPMENT OR UNINTENDED EQUIPMENT OPERATION
Do not use relay outputs in conjunction with the PID function.
Only use solid state outputs if a digital output is required to drive the system to be controlled.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
Step Action
1 In the General tab (see page 333) of the PID Assistant screen (in offline mode), select
AT+PID (or AT) or select Word Address setting the associated word to 2 or 3, from the
Operating Modes (see page 312).
2 Activate the PID States checkbox and enter the address of the memory word in the field.
3 In the Input tab (see page 336), enter the address of the analog input used as a
measurement.
4 If Conversion or Alarms are required, refer to Input tab (see page 336) of PID Assistant
screen.
5 In the PID tab (see page 338), enter the value of the setpoint. In general, this value is a
memory address or an analog input.
6 Corrector type in the PID tab must be set to PID or PI.
7 Set the Parameters in the PID tab: Kp (x0,01), Ti (x0,1s), and Td (x0,1s). When AT+PID or
AT are the Operating modes (see page 312), the parameters should be memory words
addresses (%MWxx) so the Auto-Tuning algorithm fills in the computed value of the
parameters.
8 Enter the PID Sampling period (Ts (see page 327)) in the PID tab. The Sampling period is
a key parameter and must be carefully determined.
9 In the AT tab, the AT Mode must be set to Authorize by default. Enter the Min. and Max.
values if the Measurement Range is activated (Authorize checkbox). Select the Dynamic
AT corrector from the list that contains Fast, Medium, Slow, or Word address corrector
type. For further details, refer to the AT tab in PID Assistant (see page 340).
10 In the AT tab, enter the AT Trigger memory bit to store the value of the step change during
Auto-Tuning. For further details, refer to the AT tab in PID Assistant (see page 340).
Step Action
11 In the Output tab (see page 342), set the Action to Bit Address from the list. Enter the
memory bit address in the Bit field. Limits can be configured if necessary from Output tab
(see page 342). In Analog output field, set the address of the word: an analog output or a
memory word. Set the Output PWM (see page 342) to Authorize. In the manual mode, enter
the value in the Period (0.1 s) field or the memory word address of the output in the Output
field. For more details about manual mode operation, refer to Output tab (see page 342).
12 Click OK to confirm the PID controller configuration.
WARNING
INOPERABLE EQUIPMENT OR UNINTENDED EQUIPMENT OPERATION
Do not use relay outputs in conjunction with the PID function.
Only use solid state outputs if a digital output is required to drive the system to be controlled.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
To start operation in AT+PID operating mode (see page 312) perform the following steps:
Step Action
1 Connect the PC to the controller and transfer the application.
2 Switch the controller to RUN mode.
NOTE: Before switching the controller to RUN mode, verify that the operating conditions of the
machine allow the RUN mode for the rest of the application.
Step Action
1 Create an animation table containing the objects defined during configuration. Refer to the
SoMachine Basic Operating Guide for further details about animation table creation.
Step Action
2 Verify the consistency of the process value and application’s values. This test is important as
successful operation of the PID controller depends on the accuracy of the measurement. If
you have any doubt about the accuracy of the measurement, set the logic controller to the
STOP state and verify the wiring of analog channels.
If the actuator is not controlled:
For analog output verify the output voltage or current from analog channel.
For PWM output, verify that the:
LED of the dedicated output is lit
wiring of the supplies and 0V circuit
actuator power supply is being applied
4 Set the logic controller scan period so that the Sampling period (Ts) value of the PID
controller is an exact multiple of the scan period. For further details on how to determine the
Sampling period, refer to Tuning PID (see page 322).
5 When the Auto-Tuning sequence is complete, the parameters Kp, Ti, and Td are written in to
the RAM memory of the logic controller. The values are saved for as long as the application
is valid (power-down less than 30 days) and no cold-start is performed.
The Auto-Tuning process is repeated each time a rising edge is detected on the AT trigger
memory bit.
Section 14.3
PID Standard Configuration
Introduction
This section guides you through all the steps required to configure the SoMachine Basic PID
controller using word address operating mode (see page 312). This mode provides greater
flexibility of use than the other PID modes.
This section contains the following steps:
Step Topic
1 Prerequisites for PID configuration (see page 319)
2 Configuring the PID (see page 319)
3 Control set-up (see page 320)
Phase Description
1 An analog input is configured as well as an analog output if required.
2 PID is enabled in the program (see page 345).
3 Scan mode is set to periodic (see page 347).
WARNING
INOPERABLE EQUIPMENT OR UNINTENDED EQUIPMENT OPERATION
Do not use relay outputs in conjunction with the PID function.
Only use solid state outputs if a digital output is required to drive the system to be controlled.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
The following steps explain how to implement a PID controller in word address mode. For more
details on how to configure the PID, refer to the PID Assistant (see page 330).
For the dynamic modification of the PID parameters (in offline and in online mode), enter the
memory addresses in the associated fields, thus avoiding the need to switch to offline mode to
make on-the-fly changes to values.
Step Action
1 In the General tab of the PID Assistant screen (in offline mode), in the Operating Modes ;
drop-down list select Word address. Check the box associated to PID States and enter the
address of the memory word in the field.
2 In the Input tab (see page 336), enter the address of the analog input used as a
measurement. If Conversion or Alarms are required, refer to Input tab (see page 336) of PID
Assistant (see page 330).
3 In the PID tab, enter the value of the Setpoint. In general, this value is a memory address or
an analog input. The Parameters (Kp, Ti, and Td) should be memory words addresses
(%MWxx).
Enter the PID Sampling period (Ts (see page 327)) in the PID tab (see page 338). This
parameter can also be a memory word (the value can then be set using the animation table).
In Word Address operating mode, the Corrector type is set to Auto and greyed out (it cannot
be modified manually).
4 In the AT tab, the AT mode should be checked to Authorize. Enter the Dynamic corrector
and the AT Trigger. For further details, refer to AT tab (see page 340) in PID Assistant
screen.
5 In the Output tab, Action should be set to Bit Address. Enter a memory bit address. Limits
can be configured if necessary from the Output tab (see page 342). In Analog output field set
the address of the word: an analog output or a memory word. If required, set the Output PWM,
refer to Output tab (see page 342) in PID Assistant (see page 330).
6 Click OK to confirm the PID controller configuration.
Step Action
1 Connect the PC to the logic controller and transfer the application.
2 Switch the logic controller to RUN mode.
NOTE: Before switching the logic controller to RUN mode, verify that the operating conditions of
the machine allow RUN mode for the rest of the application. The procedure remains the same as
the one used in AT and AT+PID operating modes. The word address configuration allows you to
modify the PID operating modes by software. In the case of the PID mode, the procedure is
significantly simplified, assuming the parameters (Kp, Ti, Td, and Ts) are known and there is no
need to perform Auto-Tuning.
This table gives the generic procedure to set up the PID controller
Step Action
1 Create an animation table containing the objects defined during configuration. Refer to the
SoMachine Basic Operating Guide for details.
2 Verify the consistency of the process value and other values defined in the animation table. If
you have any doubt about the accuracy of the measurement, set the logic controller to STOP
and verify the wiring of analog channels.
If you see that the actuator is not being controlled:
For analog output, verify the output voltage or current from analog channel.
For PWM output, verify that the:
LED of dedicated output is lit
wiring of the supplies and 0 V circuit is correct
actuator power supply is being applied
3 Set the logic controller scan period so that the Sampling period (Ts) of the PID controller is
an exact multiple of the scan period. For further details on Sampling period, please refer to
Determining Sampling Period (see page 327).
4 If you plan to use the Auto-Tuning (see page 322) function, you may need to run Manual Mode
(see page 325) to know the Dynamic corrector and the AT Trigger defined in the AT tab
(see page 340) of the PID Assistant.
5 Power up the loop controller using the animation table:
Set the operating mode (see page 312).
Enable the PID controller (see page 345).
Set the values defined during configuration (see page 319) to appropriate values
depending on the selected operating mode.
Introduction
The Auto-Tuning mode allows automatic tuning of the Kp, Ti, Td, and action parameters to achieve
refined convergence of the PID function.The Auto-Tuning function provided by SoMachine Basic
is particularly suited for automatic tuning of thermal processes.
This section contains the following topics:
Auto-Tuning requirements
Description of Auto-Tuning process
Storage of Calculated Coefficients
Adjusting PID parameters
Repetition of Auto-Tuning
Limitations on using the Auto-Tuning and the PID control
Auto-Tuning Requirements
When using the Auto-Tuning function, make sure that the control process and the logic controller
meet the following requirements:
Process requirements:
The process must be a stable open-loop system.
The process must be mostly linear over the entire operating range.
The process response to a change in level of the analog output follows a transient asymptotic
pattern.
The process is in a steady state with a null input at the start of the Auto-Tuning sequence.
The process must be free of disturbances throughout the entire process. Otherwise, either
calculated parameters will be incorrect or the Auto-Tuning process will not operate correctly.
Configuration requirements:
Configure the logic controller to periodic scan mode to ensure a correct run of the Auto-
Tuning function.
Only use the Auto-Tuning function when no other PID controllers are running.
Configure the Kp, Ti, and Td coefficients as memory word addresses (%MWxx).
Set the Action type in the Output tab to a memory bit address (%Mxx).
Auto-Tuning Description
Phase
1 The stabilization phase(1) starts when you launch the Auto-Tuning process. During this
phase, the Auto-Tuning function performs checks to ensure that the process value is in
steady state.
2 The first step change is applied to the process. It produces a process step-response similar
to the one shown in the above figure.
(1) The output last applied to the process before start of the Auto-Tuning is used as both the starting point
and the relaxation point for the Auto-Tuning process.
Auto-Tuning Description
Phase
3 The relaxation phase(1) starts when the first step-response has stabilized.
4 The second step change is applied to the process in the same amount and manner as in
Phase 2 described above. The Auto-Tuning process ends. The process value is restored(1)
and the Auto-Tuning parameters are calculated and stored in their respective memory words.
Refer to Storage of Calculated Coefficients description (see page 324).
(1) The output last applied to the process before start of the Auto-Tuning is used as both the starting point
and the relaxation point for the Auto-Tuning process.
Repetition of Auto-Tuning
In the AT tab, the AT Trigger enables the repetition of Auto-Tuning sequence. The auto-tuning
process is launched at each rising edge of the signal linked to AT Trigger.
Auto-Tuning is best suited for processes in which the time constant () and delay time () meet
the following criteria:
10 s < ( + ) < 2700 s (i.e.: 45 min)
2 < / < 20
Manual Mode
Introduction
The manual mode is accessible through the PID Assistant screen (Output tab (see page 342)).
This mode allows you to bypass orders from the PID. There are 2 main objectives using Manual
mode:
Initialize the set-up
Determine the sampling period.
Description
The manual mode lets you specify the Output value (see page 342). This operation can be
particularly well suited for testing the system response.
Setting the bit address from the Output tab (see page 342) to 1 activates the manual mode. If
Allow is set, then the manual mode is the only accessible mode.
Application
When the manual mode is active the output is assigned a fixed value that you set. This output value
is from 0 to 10,000 (0 to 100% for PWM output).
You can also use manual mode to make trials to determine the minimum/maximum output
limitation.
Manual mode is also required to use the process response curve method (see page 327) that
helps to find the correct sampling time (Ts).
Step Description
1 Enable manual mode by setting the dedicated memory bit to 1. For more details refer to the
Output tab (see page 342).
2 If using PWM, set the PWM period to the desired value.
3 Set the memory word associated with the Operating mode in the General tab (see page 333)
of the PID Assistant to 1 (PID mode). For more details on operating modes using word
address refer to the operating mode description (see page 312).
4 Set the memory word associated with the manual output in the Output tab (see page 342) to
the desired value. This manual setpoint value can be selected several times on condition that
the system is left in its initial state.
5 Enable the loop controller (see page 319).
Step Description
1 Disable the loop controller (see page 319).
2 Inhibit the manual mode by setting the dedicated memory bit to 0. For more details refer to the
Output tab (see page 342).
3 Set the memory word associated with the Operating mode in the General tab (see page 333)
for the PID controller to 0. For more details on operating modes using word address, refer to
the operating mode description (see page 312).
4 Set the memory word associated to the manual output in the Output tab (see page 342) to 0.
Introduction
The Sampling Period (Ts) is the key parameter for PID regulation. The Sampling Period (Ts)
should be carefully set in the PID tab (see page 338) of the PID Assistant screen. This parameter
is highly correlated with the time constant () of the process to control.
This section describes the use of online mode and two methods to determine the sampling period
(Ts) are described in this section:
Process response curve method,
Trial-and-error method.
Step Action
1 It is assumed that you have already configured the various settings in the General, Input, PID,
AT and Output tabs of the PID.
2 Select the Output tab (see page 342) from the PID Assistant screen.
3 Select Allow or Address bit from the Manual Mode drop-down list to authorize manual
output.
4 Set the Output field to a high level (in the [5,000...10,000] range).
5 Download your application to the logic controller. For further details on how to download an
application refer to the SoMachine Basic Operating Guide.
6 Run the PID and check the response curve rise.
7 When the response curve has reached a steady state, stop the PID measurement.
8 Use the following graphical method to determine the time constant () of the control process:
1. Calculate the process value output at 63% rise (S[63%]) by using the following formula:
S[63%] = S[initial] + (S[final]-S[initial])x63%
2. Calculate graphically the time abscissa (t[63%]) that corresponds to S(63%).
3. Calculate graphically the initial time (t[initial]) that corresponds the start of the process
response rise.
4. Compute the time constant () of the control process by using the following relationship:
= t[63%]-t[initial]
(1) The base unit for the sampling period is 10ms. Therefore, you should round up/down the value of Ts to
the nearest 10ms.
(2) You must choose "n" so that the resulting Scan Period is a positive integer in the range [2...150] ms.
Step Action
9 Calculate the sampling period (Ts)(1) based on the value of () that you determined in the
previous step, using the following rule: Ts = /75
10 Set the Scan period of the Periodic scan mode so that the Sampling Period (Ts) is an exact
multiple of the scan period:Scan Period = Ts / n , where n is a positive integer(2)
(1) The base unit for the sampling period is 10ms. Therefore, you should round up/down the value of Ts to
the nearest 10ms.
(2) You must choose "n" so that the resulting Scan Period is a positive integer in the range [2...150] ms.
Trial-and-Error Method
The trial-and-error method involves providing successive guesses of the sampling period to the
Auto-Tuning function until the algorithm converges successfully towards satisfactory values of Kp,
Ti, and Td.
NOTE: Unlike the process response curve method, the trial-and-error method is not based on any
approximation law of the process response. However, it has the advantage of converging towards
a value of the sampling period that is in the same order of magnitude as the actual value.
To perform a trial-and-error estimation of the Auto-Tuning:
Step Action
1 Select the AT tab from the PID configuration window.
2 Set the Output limitation of Auto-Tuning to 10,000.
3 Download your application to the logic controller. For further details on how to download an
application, refer to SoMachine Basic Operating Guide.
4 Select the PID tab from the PID Assistant screen.
5 Provide the first or nth guess in the Sampling Period(1) field.
6 Launch Auto-Tuning (see page 314).
7 Wait until the Auto-Tuning process ends.
8 Two cases can occur:
Auto-Tuning completes successfully: Continue to Step 10.
Auto-Tuning unsuccessful: Refer to Auto-Tuning detected error codes (see page 349).
This means that the current guess for the sampling period (Ts) is not correct. Try a new Ts
guess and repeat steps 3 through 8, as many times as required until the Auto-Tuning
process eventually converges.
(1) If you do not have any first indication of the possible range for the sampling period, set this value to the
minimum possible: 1 (1 unit of 10 ms).
(2) If the PID regulation provided by this set of control parameters does not provide results that are totally
satisfactory, you may still refine the trial-and-error evaluation of the sampling period until you obtain the
correct set of Kp, Ti, and Td control parameters.
Step Action
9 Follow these guidelines to provide a new Ts guess:
Auto-Tuning ends with the detected error code 800C hex. This means the sampling period
Ts is too large. Decrease the value of Ts to provide a new guess.
Auto-Tuning ends with the detected error code 800A hex. This means the sampling period
Ts is too small. Increase the value of Ts to provide a new guess.
10 Adjust the PID control parameters(2) (Kp, Ti, and Td) in the PID tab (see page 338) of the PID
Assistant screen, as needed.
(1) If you do not have any first indication of the possible range for the sampling period, set this value to the
minimum possible: 1 (1 unit of 10 ms).
(2) If the PID regulation provided by this set of control parameters does not provide results that are totally
satisfactory, you may still refine the trial-and-error evaluation of the sampling period until you obtain the
correct set of Kp, Ti, and Td control parameters.
Online Mode
In online mode, when the logic controller is in the periodic task, the value displayed in the Ts field
(in the PID Assistant screen (see page 330)) can be different from the parameter entered (%MW).
The Ts value is a multiple of the periodic task, whereas the %MW value is the value read by the
logic controller.
Section 14.4
PID Assistant
PID Assistant
Introduction
Use the PID Assistant window of SoMachine Basic to enable you to configure the PID controller.
Configuration Assistant
In the PID properties table, click the Configuration [...] button. The PID Assistant screen will
appear.
This graphic displays the PID Assistant screen:
The PID Assistant screen displays several tabs, depending whether, you are in offline or online
mode:
Once an operating mode is selected, tabs containing empty fields that require values are shown
General Tab
Introduction
This section describes the General tab of the PID. General tab is displayed by default when you
access the PID Assistant in offline mode.
Description
The table below describes the settings on the General tab.
Parameter Description
Operating Mode Represents the PID mode to use:
Not configured
PID
AT + PID
AT
Word address
For further details about operating modes, refer to PID Operating Mode
(see page 312).
Word address You can provide a memory word in this text box (%MWxx) that is used to
programmatically set the operating mode. The memory word can take 4 possible
values depending on the operating mode you want to set:
%MWx = 0 (PID disabled)
%MWx = 1 (to set PID only)
%MWx = 2 (to set AT + PID)
%MWx = 3 (to set AT only)
%MWx = 4 (to set PI only)
PID States If you check the box to enable this option, you can provide a memory word in the
associated field (%MWxx) that is used by the PID controller to store the current PID
state while running the PID controller and/or the Auto-Tuning function. For more
details, refer to PID States and Detected Error Codes (see page 348).
Graphical Assistant
The graphical assistant helps you to visualize how the PID function is built. This is a dynamic
graphic that is updated according to the configuration.
The icons shown below describe when it is accessible or what happens if you click on it:
Display Description
Click this button to display the SetPoint field of the PID tab (see page 338).
Click this button to display the PID tab (see page 338).
Click this button to display the Output tab (see page 342).
Click this button to display the Input tab (see page 336).
Display Description
Click this button to display the AT tab (see page 340).
This button appears when the Authorize option is checked in the Conversion zone of
the Input tab (see page 336).
This button appears when the Authorize option is checked in the Alarms zone of the
Input tab (see page 336).
This button appears if Limits is not equal to inhibit in the limits zone of the Output tab
(see page 342).
This button appears if manual mode is not equal to Inhibit in the manual mode zone of the
Output tab (see page 342).
Click this button to display the Output tab (see page 342).
This button appears when the Authorize option is checked in the Output PWM zone of
the Output tab (see page 342).
Input Tab
Introduction
This section describes the Input tab of PID. The input tab is used to enter the PID input
parameters.
This tab is only accessible in offline mode and when an operating mode is selected from the
General tab.
NOTE: To retain input values following a cold restart, use memory words (%MW) and not analog
inputs (%IW).
Description
The table below describes the settings that you may define.
Parameter Description
Measure Specify the variable that contains the process value to be controlled.
The default scale is from 0 to 10,000. You can enter either a memory word (%MWxx) or an
analog input.
Conversion Authorize Activate this box to convert the process value [0...10,000] into a linear
range [Min...Max].
Min value Specify the minimum and maximum values of the conversion scale.
Max value The process value is then automatically rescaled within the [Min
value...Max value] interval.
Min value or Max value can be memory words (%MWxx), constant
words (%KWxx), or a value from -32768 to +32767.
Note: The Min value must be less than the Max value.
Filter Authorize Activate this box to apply a filter to the measured input.
(100 ms) Specify the filter value from 0 to 10000 or a memory word address
(%MWxx). The filter time base unit is 100 ms.
Parameter Description
Alarms Authorize Activate this box to activate alarms in input variables.
The alarm values should be determined relative to the process value
obtained after the conversion phase. The alarm values must be from
Min value to Max value when conversion is active. Otherwise, the
alarm values will be from 0 to 10,000.
Low Specify the low alarm value in the Low field.
Output This value can be a memory word (%MWxx), a constant (%KWxx), or a
direct value.
Output must contain the address of the bit, which will be set to 1 when
the lower limit is reached. Output can be either a memory bit (%Mxx)
or an output.
High Specify the high alarm value in the High field.
Output This value can be a memory word (%MWxx), a constant (%KWxx), or a
direct value.
Output must contain the address of the bit, which will be set to 1 when
the upper limit is reached. Output can be either a memory bit (%Mxx),
or an output.
PID Tab
Introduction
Use PID tab to enter the internal PID parameters.
This tab is only accessible in offline mode and if an operating mode has been selected from the
General tab.
Description
This table describes the settings that you may define:
Parameter Description
Setpoint Specify the PID setpoint value. This value can be a memory word (%MWxx), a constant
word (%KWxx), or a direct value.
This value must therefore be between 0 and 10,000 when conversion is inhibited.
Otherwise it must be between the Min value and the Max value for the conversion.
Corrector type If the PID or AT + PID operating mode has been previously chosen in the PID properties
table, you can select the desired corrector type (PID or PI) from the drop-down list. If
other operating modes (AT or Word Address) have been chosen, the Corrector type
is set to Auto and greyed out (it cannot be modified manually).
If PI is selected from the drop-down list, the Td parameter is forced to 0 and this field is
disabled.
Parameters (1) Kp (x0,01s) Specify the PID proportional gain, multiplied by 100.
This value can be a memory word (%MWxx), a constant word
(%KWxx), or a direct value.
The valid range for the Kp parameter is: 0 < Kp < 10,000.
Note: If Kp is mistakenly set to 0 (Kp 0 is invalid), the default value
Kp=100 is automatically assigned by the PID function.
Ti (x0,1s) Specify the integral time for a timebase of 0.1 seconds.
This value can be a memory word (%MWxx), a constant word
(%KWxx), or a direct value.
It must be from 0 to 36,000.
Note: To disable the integral action of the PID, set this coefficient
to 0.
Td (x0,1s) Specify the derivative time for a timebase of 0.1 seconds.
This value can be a memory word (%MWxx), a constant word
(%KWxx), or a direct value.
It must be from 0 to 10,000.
Note: To disable the derivative action of the PID, set this coefficient
to 0.
(1) When Auto-Tuning is enabled, you no longer need to set the Kp, Ti, and Td parameters as they are
automatically and programmatically set by the Auto-Tuning algorithm. In this case, you must enter in these
fields an internal word address only (%MWxx). Do not enter a constant or a direct value when Auto-
Tuning is enabled.
Parameter Description
Sampling period Specify the PID sampling period here for a timebase of 10-2 seconds (10 ms).
This value can be a memory word (%MWxx), a constant word (%KWxx), or a direct
value.
It must be from 1 (0.01 s) to 10,000 (100 s).
(1) When Auto-Tuning is enabled, you no longer need to set the Kp, Ti, and Td parameters as they are
automatically and programmatically set by the Auto-Tuning algorithm. In this case, you must enter in these
fields an internal word address only (%MWxx). Do not enter a constant or a direct value when Auto-
Tuning is enabled.
AT Tab
Introduction
The AT tab is related to the Auto-Tuning function. For more details, refer to PID tuning with Auto-
Tuning (see page 322).
This tab is only accessible in offline mode and if an operating mode has been selected from the
General tab.
Description
PID Auto-Tuning is an open-loop process that acts directly on the control process without
regulation or any limitation other than provided by the Process Value (PV) limit and the output
setpoint. Therefore, both values must be carefully selected within the allowable range as specified
by the process to prevent potential process overload.
WARNING
UNSTABLE PID OPERATION
The Process Value (PV) limit and the output setpoint values must be set with complete
understanding of their effect on the machine or process.
Do not exceed the allowable range for Process Value and Output Setpoint values.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
WARNING
UNINTENDED EQUIPMENT OPERATION
Do not use a relay output with the PID function.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
Field Description
AT Mode Authorize Activate this box to enable Auto-Tuning operation.
There are 2 ways to use this checkbox, depending on whether you set the
operating mode manually or via a word address in the General tab of the PID
function:
If you set the Operating mode to PID + AT or AT from the General tab
(see page 333), then the Authorize option is activated and not editable.
If you set the operating mode via a word address %MWx (%MWx = 2: PID + AT;
%MWx = 3: AT), then you have to activate the Authorize option manually to
allow configuring of the Auto-Tuning parameters.
Measurement Authorize Activate this box to enable the range measurement.
Range NOTE: If the range measurement is deactivated the Min. value is set to 0 and the
Max. value is set to 10000.
Min. Specify the minimum and maximum values of the range measurement.
Max. The values can be immediate value from 1 to 10000 or a memory word %MWx.
NOTE: The Min. value must be less than the Max. value.
Dynamic AT Dynamic AT This parameter allows you to choose the dynamic of the AT process. This
corrector corrector parameter affects the proportional gain (Kp) value computed by the AT process.
AT Trigger AT Trigger This parameter allows you to launch the AT process each time a rising edge is
detected on the dedicated bit (memory bit or digital input bit).
Output Tab
Introduction
This tab is used to enter the PID output parameters.
This tab is only accessible in offline mode and if an operating mode has been selected from the
General tab.
NOTE: To retain output values following a cold restart, use memory words (%MW) and not analog
outputs (%QW).
Description
This table describes the settings that you may define:
Field Description
Action Specify the type of PID action on the process here. Three options are available:
Reverse, Direct, and Bit Address. If an increase in the output causes an increase
in the process value measurement, define inverted action (Reverse); on the other
hand, if this causes a process value reduction, make the PID direct (Direct).
If you select Bit Address(1), you can modify the action type by modifying the
associated bit, which is either a memory bit (%Mxx) or an input address (%Ix.y).
The memory bit is set to 1 if the action is Direct and the memory bit is set to 0 if the
action is Reverse.
Limits Specify whether to place limits on the PID output. 3 options are available: Enable,
Disable, and Bit Address.
Select Enable to set the Bit to 1 or select Disable to set the Bit to 0.
Select Bit Address for limit management of the bit by modifying the associated bit,
which is either a memory bit (%Mxx) or an input address (%Ix.y).
Set the high and low limits for the PID output.
Min. or Max can be memory word (%MWxx), constant word (%KWxx), or a value
from 1 to 10,000.
Note: The Min. must always be less than the Max.
Manual mode Specify whether to change the PID to manual mode. 3 options are available: Enable,
Disable, and Bit Address.
If you select Bit Address, you can switch to manual mode (bit to 1) or automatic
mode (bit to 0) using the program, by modifying the associated bit which is either a
memory bit (%Mxx) or an input.
The Output of manual mode must contain the value that you wish to assign to the
analog output when the PID is in manual mode (see page 325). This Output can be
either a word (%MWxx) or a direct value in the [0...10,000] format.
Analog output Specify the PID output to use when in auto-tuning mode.
This Analog output(2) can be a memory word address or an analog output address.
(1) When Auto-Tuning is enabled, the Auto-Tuning algorithm automatically determines the correct type of
action direct or reverse for the control process. You must then enter in the associated Bit Address textbox
a memory bit (%Mxx) only.
(2) Enter a memory address (%MWxx) or an analog output address (%QWx.y).
Field Description
Output PWM Check this box to use the PWM function of PID.
Specify the modulation period in the Period (0.1 s) text box. This period must be from
1 to 500 and can be a memory word (%MWxx) or a constant word (%KWxx). PWM
precision depends on both the PWM period and the scan period. The precision is
improved when the PWM ratio (%PWM.R) has the greatest number of values. For
instance, with scan period = 20ms and PWM period = 200ms, PWM.R can take
values 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%. With scan
period = 50 ms and PWM period = 200 ms, PWM.R can take values 0%, 25%, 50%,
75% and 100% of the period PWM.P.
Specify the PWM output bit as the value in Output. This can be either a memory bit
(%Mxx) or an output address. For further details about PWM function, refer to the
Functions Library Guide of your logic controller.
(1) When Auto-Tuning is enabled, the Auto-Tuning algorithm automatically determines the correct type of
action direct or reverse for the control process. You must then enter in the associated Bit Address textbox
a memory bit (%Mxx) only.
(2) Enter a memory address (%MWxx) or an analog output address (%QWx.y).
Section 14.5
PID Programming
PID Programming
Description
Introduction
A proportional–integral–derivative (PID) is a generic control loop feedback mechanism (controller)
widely used in industrial control systems. The PID controller uses an algorithm that involves 3
separate constant parameters: the proportional, the integral, and derivative values, denoted by P,
I, and D respectively.
Key Features
The key features of the SoMachine Basic PID function are as follows:
Analog input
Linear conversion of the configurable measurement
High or low configurable input alarm
Analog or PWM output
Cutoff for the configurable output
Configurable direct or inverse action
Auto-tuning function
Illustration
This is the PID function in the Ladder editor of SoMachine Basic:
NOTE: There must be a space between PID and the PID number (for example, PID<space>0).
Parameters
Unlike the Timer or the Counter function blocks, there is no PID function block in SoMachine
Basic. The instruction [PID x] only enables the PID control loop function, where x is the PID
number.
To configure the PID function, goto the Programming window, click Tools PID, and then edit
the PID properties (refer to the table below for the configuration parameters).
Introduction
This section describes how to program and configure the SoMachine Basic PID controller.
Rung Instruction
0 LD %M0
[PID 0]
NOTE: Refer to the reversibility procedure (see page 159) to obtain the equivalent Ladder
Diagram.
Introduction
The SoMachine Basic PID controller has the ability to write the current state of both the PID
controller and the Auto-Tuning process to a user-defined memory word. For further information on
how to enable and configure the PID States memory word, refer to the General tab (see page 333)
of the PID Assistant (see page 330).
The PID state memory word can record the following types of PID information:
Current state of the PID controller
Current state of the Auto-Tuning process
PID detected error codes
Auto-Tuning detected error codes
Section 14.6
PID Parameters
PID Parameters
Introduction
This section describes the role and influence of PID parameters.
Computational Algorithms
Two different computational algorithms are used depending on the value of the integral time
constant (Ti):
If Ti 0, an incremental algorithm is used,
If Ti = 0, a positional algorithm is used, along with a +5000 offset that is applied to the PID
output.
Influence of Actions
Proportional action is used to influence the process response speed. An increase of the
proportional action implies:
a faster response
a lower static error
decrease in stability
Integral action is used to cancel out the static error. An increase of integration action (that is, a
decrease of the integral time Ti) induces:
A faster response
A decrease in stability
Derivative action is anticipatory. In practice, it adds a term which takes account of the speed of
variation in the deviation (which makes it possible to anticipate changes by accelerating process
response times when the deviation increases and by slowing them down when the deviation
decreases). An increase of derivative action (that is, an increase of the derivative time) implies:
A slower response
A reduced overshoot
NOTE: Given the derivative time, Td is the time used to anticipate the variation of the deviation.
Values of Td that are too low or too high can lead to unwanted oscillations.
For each action, a suitable compromize must be found between speed and stability.
where:
: model time constant
: model delay
The suitable PID process control is attained in the following domain: 2< <20
PID process control is best suited for the regulation of processes that satisfy the following
condition:
For <2, in other words for fast control loops (low ) or for processes with a large delay
(high t) the PID process control is no longer suitable. In such cases more complex algorithms
should be used.
Introduction
Numerous methods to adjust the PID parameters exist. The preferred method is the Ziegler and
Nichols, which has 2 variants:
closed loop adjustment
open loop adjustment
Before implementing one of these methods, you must set the PID action (see page 342).
Depending on the correct type used (PID or PI), the adjustment of the coefficients is executed with
the following values:
When the PID is implemented with Auto-Tuning, the Dynamic AT Corrector parameter affects the
proportional gain (Kp) value. The computation of the proportional gain in AT process depends on
the selected speed of the dynamic corrector. Selecting Fast provides fast response with more
overshoot, whereas selecting Slow provides slower response time with less overshoot.
The intersection point on the right hand side, which is representative of the integrator with the time
axes, determines the time Tu. Next, the Tg time is defined as the time necessary for the controlled
variable (measurement) to have the same variation size (% of the scale) as the regulator output.
Depending on the corrector type used (PID or PI), the adjustment of the coefficients is executed
with the following values:
NOTE: For further details about parameter units, refer to PID tab (see page 338).
This adjustment method also provides a very dynamic command, which can express itself through
unwanted overshoots during the change of pulses of the setpoints. In this case, lower the
proportional gain until you get the required behavior. The method does not require any
assumptions about the nature and the order of the procedure. You can apply it just as well to the
stable procedures as to real integrating procedures. In the case of slow procedures (for example,
the glass industry), the user only requires the beginning of the response to regulate the coefficients
Kp, Ti, and Td.
Chapter 15
System Objects
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) or
overload of processor (%SW75 exceeds 80%).
Watchdog overflow causes the controller state to
change to HALT.
%S12 Logic Controller in This bit indicates that the controller in RUNNING state. 0 S, SIM
RUNNING state The system sets the bit to:
1 when the controller state is RUNNING,
0 for STOPPED, BOOTING or any other state.
%S13 First cycle in Normally set to 0, this bit is set to 1 by the system 1 S, SIM
RUNNING state during the first scan after the controller state has been
changed to RUNNING.
%S15 Input forced Normally set to 0. Set to 1 by the system if at least one 0 S, SIM
input is being forced.
%S16 Output forced Normally set to 0. Set to 1 by the system if at least one 0 S, SIM
output is being forced.
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.
The %SW1 value can be modified in the program at each end of a cycle, in the
program or in an animation table without having to stop the program. Cycle
times can be correctly observed while the program is running.
%SW6 Controller Controller state: S, SIM
state 0 = EMPTY
%MW60012 2 = STOPPED
3 = RUNNING
4 = HALTED
5 = POWERLESS
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
%SW11 Software Contains the maximum value of the watchdog. The value (10...500 ms) is U, SIM
watchdog defined by the configuration.
value
%SW13 BOOT version For example, if %SW13 = 000E hex: U, SIM
Vxx.yy 8 MSB = 00 in hexadecimal, then xx=0 in decimal
8 LSB = 0E in hexadecimal, then yy=14 in decimal
The double word (%SW18 - %SW19) increases from 0 to 2^31 each 100 ms as
a counter modulo 2^31. This double word is also reset during the INIT phase
and on a reset of %S0.
%SW30 Last scan time Indicates the 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 is 2 and the %SW70 is 250.
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
Bit [6]: Set to 1 if the controller contains a valid application in RAM memory.
Bit [10]: Difference between internal RAM and Flash memory (1 = yes).
Set to 1 if there is a difference.
%SW97 TM3 slot 4 Indicates the firmware version of the TM3 expansion module in slot 4. S
version
%SW98 Post The bits are set to 1 when the post configuration was applied for the parameter: S
configuration Bit[0]: Hardware option (RS-485 or RS-232)
status (Serial Bit[1]: Baudrate
Line 1) Bit[2]: Parity
Bit[3]: Data size
Bit[4]: Number of stop bits
Bit[5]: Modbus address
Bit[6]: Polarization (if available in the port)
%SW99 Post The bits are set to 1 when the post configuration was applied for the parameter: S
configuration Bit[0]: Hardware option (RS-485)
status (Serial Bit[1]: Baudrate
Line 2) Bit[2]: Parity
Bit[3]: Data size
Bit[4]: Number of stop bits
Bit[5]: Modbus address
Bit[6]: Polarization (if available in the port)
The post configuration has priority over the configuration provided by your
application. The configuration of your application is not taken into account if the
M100/M200 logic controller has a post configuration.
%SW101 Value of the When bit %S101 is set to 1, you can change the Modbus address of port 1 or S
%SW102 Modbus port 2. The address of port 1 is %SW101. The address of port 2 is %SW102.
address port
NOTE: The update is applied immediately after writing a new address to
%SW101 or %SW102.
After a cold start (%S0 = 1), all dynamic values are lost and the initial port
address values are restored. %S101 is also updated.
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
Baud rate:
000: 1200 baud,
001: 2400 baud,
010: 4800 baud,
011: 9600 baud,
100: 19200 baud,
101: 38400 baud.
110: 57600 baud.
111: 115200 baud.
RTS/CTS:
0: disabled,
1: enabled.
Parity:
00: none,
10: odd,
11: even.
Stop bit:
0: 1 stop bit,
1: 2 stop bits.
Data bits:
0: 7 data bits,
1: 8 data bits.
%SW105 Configuration When bit %S103 (Comm 1) or %S104 (Comm 2) is set to 1, the ASCII protocol S, U
%SW106 for use of the is used. System word %SW105 (Comm 1) or %SW106 (Comm 2) must be set
ASCII protocol according to the elements below:
%SW114 Enable Enables or disables operation of schedule blocks by the program. S and U,
schedule Bit 0: 1 = enables schedule block number 0 SIM
blocks ...
Bit 15: 1 = enables schedule block number 15
Initially all schedule blocks are enabled.
If schedule blocks are configured the default value is FFFF hex
If no schedule blocks are configured, the default value is 0.
%SW118 Logic Indicates conditions on logic controller. S, SIM
controller All the other bits of this word are set to 1 and are reserved. For a controller
status word operating normally, the value of this word is FFFF hex.
Bit 9: 0 = External error detected or communication interruption, for example
duplicate IP address.
Bit 10: 0 = Invalid internal configuration; contact Schneider Electric customer
care.
Bit 13: 0 = Configuration error detected (mandatory modules, as defined by the
I/O expansion bus configuration, are absent or otherwise inoperative when the
logic controller attempts to start the I/O expansion bus). In this case, the I/O
bus does not start.
Bit 14: 0 = One or more modules have stopped communication with the logic
controller after the I/O expansion bus is started. This is the case when an I/O
expansion module is defined as mandatory or optional but present at start-up.
Bit 15: 0 = Cartridge error detected (configuration or runtime operation).
NOTE: The other bits of this word are set to 1 and are reserved.
%SW119 Optional 1 bit for each expansion module in the configuration. S, SIM
module feature Bit 0 = Reerved for the logic controller
configuration Bit n = Module n.
0 = Module is marked as optional in the configuration.
1 = Module is not marked as optional in the configuration.
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
%SW130 Event Indicates the last execution time in µs of the event input %I0.2. S
execution time
%SW131 Event Indicates the last execution time in µsof the event input %I0.3. S
execution time
%SW132 Event Indicates the last execution time in µs of the event input %I0.4. S
execution time
%SW133 Event Indicates the last execution time in µs of the event input %I0.5. S
execution time
%SW134 Event Indicates the last execution time in µs of the event task associated with the S
execution time Threshold 0 of HSC0 or HSC2
S Controlled by the system
U Controlled by the user
SIM Applied in the simulator
Reference Code ID
TM100C16R 0x07C1
TM100C24R 0x07C2
TM100C40R 0x07C4
TM200C16R 0x07A1
TM200C16T 0x07A3
TM200C16U 0x07A2
Reference Code ID
TM200C24R 0x07A7
TM200CE24R 0x07A8
TM200C24T 0x07AB
TM200CE24T 0x07AC
TM200C24U 0x07A9
TM200CE24U 0x07AA
TM200C40R 0x07AD
TM200CE40R 0x07AE
TM200C40T 0x07B1
TM200CE40T 0x07B2
TM200C40U 0x07AF
TM200CE40U 0x07B0
TM200C60R 0x07B3
Glossary
A
absolute movement
A movement to a position defined from a reference point.
acceleration / deceleration
Acceleration is the rate of velocity change, starting from Start Velocity to target velocity.
Deceleration is the rate of velocity change, starting from target velocity to Stop Velocity. These
velocity changes are implicitly managed by the PTO function in accordance with Acceleration,
Deceleration and JerkRatio parameters following a trapezoidal or an S-curve profile.
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.
ASCII
(American standard code for Information Interchange) A protocol for representing alphanumeric
characters (letters, numbers, certain graphics, and control characters).
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
EtherNet/IP
(Ethernet industrial protocol) An open communications protocol for manufacturing automation
solutions in industrial systems. EtherNet/IP is in a family of networks that implement the common
industrial protocol at its upper layers. The supporting organization (ODVA) specifies EtherNet/IP
to accomplish global adaptability and media independence.
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.
H
homing
The method used to establish the reference point for absolute movement.
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).
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).
J
jerk ratio
The proportion of change of the acceleration and deceleration as a function of time.
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).
LSB
(least significant bit/byte) The part of a number, address, or field that is written as the right-most
single value in conventional hexadecimal or binary notation.
M
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.
Modbus
The protocol that allows communications between many devices connected to the same network.
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.
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.
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
RS-485
A standard type of serial communication bus, based on 2 wires (also known as EIA RS-485).
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
S-curve ramp
An acceleration / deceleration ramp with a JerkRatio parameter greater than 0%.
start velocity
The minimum frequency at which a stepper motor can produce movement, with a load applied,
without the loss of steps.
stop velocity
The maximum frequency at which a stepper motor stops producing movement, with a load applied,
without the loss of steps.
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.
trapezoidal ramp
An acceleration / deceleration ramp with a JerkRatio parameter set to 0%.
Index
A
acceleration ramp, 221
addressing
when moving modules, 126
configuring D
cartridges, 100
deceleration ramp, 221
controller, 58
description
digital I/Os, 128
cartridge, 97
digital inputs, 62, 128
device tree, 99
digital outputs, 66
digital inputs, 62
expansion modules, 93, 93
configuration, 62
fallback values, 129
configuration parameters, 62
high speed counters, 78
configuring, 128
modbus TCP, 136
properties, 166
serial line, 138
digital outputs, 66
configuring
configuration, 66
ethernet, 133
configuration parameters, 66
controller
configuring fallback values for, 66, 129
configuration, 49, 58
properties, 167
configuration features, 17
DIRECTION, 242
features, 15
displaying
output behavior, 41
programming details, 100, 130
persistent variables, 40
downloading applications, 36
programming languages, 15
state transitions, 37
states, 34
controller output behavior, 41
E
fallback values, 42 embedded communication
hardware initialization values, 41 configuration, 131
output forcing, 42 features, 16
software initialization values, 41 embedded input/output
controller state, 34 configuration, 61
BOOTING, 35 overview, 16
EMPTY, 35 ethernet, 133
HALTED, 36 configuration, 133
POWERLESS, 36 configuration parameters, 134
RUNNING, 35 exec loader, 59
STOPPED, 35 updating firmware, 59
controller state transitions, 37 expansion modules
application download, 37 configuration, 93
boot, 37 configuring, 128
cold start, 39 TM2, 93
halted, 38 TM3, 93
initialize, 37 TM3R, 93
run, 38
stop, 38
controller states, 33
HOMING_MODE, 243
F HSC Modes of Embedded HSC
fallback Modulo-loop, 192
values, configuring, 66, 129
fallback values, 42
fast counter I
configuration, 175
I/O bus
description, 173
configuration, 91
programming example, 177
I/O bus speed, 127
features
I/O configuration general information
cartridge, 97
general practices, 92, 124
embedded communication, 15
I/O objects
key features, 15
analog inputs, 168
firmware, 59, 152
analog outputs, 170
updating with exec loader, 59
digital inputs, 166
updating with SD card, 152
digital outputs, 167
firmware updates, 36
initialize controller, 37
firmware, backing up to SD card, 150
inserting a module, 126
Function Block Object Codes
BUFFER_MODE, 242
DIRECTION, 242 J
HOMING_MODE, 243
JerkRatio, 221
PTO_PARAMETER, 243
function blocks
fast counter, 173 L
high speed counter, 179
pulse, 198 logic controller
pulse width modulation, 206 adding to SoMachine Basic configuration,
Functionalities 126
PTO, 212 embedded I/Os, 126
H M
HALTED state, 38 Machine.cfg post configuration file, 44, 45
hardware initialization values, 41 maximum number of modules, 127
hardware tree, 126 memory, 16
high speed counter memory words
counting mode, 183 automatic save on power outage, 40
description, 179 save on user request, 40
frequency meter mode, 194 micro SD card
high speed counters, 78, 82, 88 see SD card, 146
configuration, 78, 82, 88 mixing module types, 127
configuration parameters, 80 modbus TCP, 136
dedicated I/O assignments, 78 configuration, 136
dual phase, pulse/direction, 82 configuration parameters, 136
frequency meter, 88 remote servers, 137
T
tasks, 29
tasks and scan modes, 29
TM3R
configuration, 123