EcoStruxure Machine ExpertProgramming Guide
EcoStruxure Machine ExpertProgramming Guide
EIO0000002854 06/2019
EcoStruxure Machine
Expert
Programming Guide
06/2019
EIO0000002854.00
www.schneider-electric.com
The information provided in this documentation contains general descriptions and/or technical
characteristics of the performance of the products contained herein. This documentation is not
intended as a substitute for and is not to be used for determining suitability or reliability of these
products for specific user applications. It is the duty of any such user or integrator to perform the
appropriate and complete risk analysis, evaluation and testing of the products with respect to the
relevant specific application or use thereof. Neither Schneider Electric nor any of its affiliates or
subsidiaries shall be responsible or liable for misuse of the information contained herein. If you
have any suggestions for improvements or amendments or have found errors in this publication,
please notify us.
You agree not to reproduce, other than for your own personal, noncommercial use, all or part of
this document on any medium whatsoever without permission of Schneider Electric, given in
writing. You also agree not to establish any hypertext links to this document or its content.
Schneider Electric does not grant any right or license for the personal and noncommercial use of
the document or its content, except for a non-exclusive license to consult it on an "as is" basis, at
your own risk. All other rights are reserved.
All pertinent state, regional, and local safety regulations must be observed when installing and
using this product. For reasons of safety and to help ensure compliance with documented system
data, only the manufacturer should perform repairs to components.
When devices are used for applications with technical safety requirements, the relevant
instructions must be followed.
Failure to use Schneider Electric software or approved software with our hardware products may
result in injury, harm, or improper operating results.
Failure to observe this information can result in injury or equipment damage.
© 2019 Schneider Electric. All rights reserved.
2 EIO0000002854 06/2019
Table of Contents
Safety Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Part I Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Chapter 1 General Introduction to the EcoStruxure Machine Expert
Logic Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
What is the EcoStruxure Machine Expert Logic Builder? . . . . . . . . . . 30
Tasks Performed by the EcoStruxure Machine Expert Logic Builder . 31
Chapter 2 EcoStruxure Machine Expert Logic Builder User Interface 33
Elements of the EcoStruxure Machine Expert Logic Builder Screen. . 34
Multi-Tabbed Navigators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Functional tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Multi-Tabbed Catalog View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Customizing the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
User Interface in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Menus and Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Chapter 3 Basic Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Introduction and Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Part II Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Chapter 4 Installing Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Integration of Sercos Devices from Third-Party Vendors . . . . . . . . . . 63
Chapter 5 Managing Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.1 Adding Devices by Drag and Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Adding Devices by Drag and Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.2 Adding Devices by Contextual Menu or Plus Button . . . . . . . . . . . . . . 69
Adding a Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Adding Expansion Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Adding Communication Managers . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Adding Devices to a Communication Manager . . . . . . . . . . . . . . . . . . 74
Adding Devices from Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.3 Updating Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Updating Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.4 Converting Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Converting Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
EIO0000002854 06/2019 3
5.5 Converting Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Converting SoMachine Basic and Twido Projects . . . . . . . . . . . . . . . . 81
Chapter 6 Common Device Editor Dialogs . . . . . . . . . . . . . . . . . . . . 101
6.1 Device Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
General Information About Device Editors. . . . . . . . . . . . . . . . . . . . . . 103
Communication Settings in Controller Selection Mode . . . . . . . . . . . . 105
Communication Settings in Simple Mode . . . . . . . . . . . . . . . . . . . . . . 125
Communication Settings in Classic Mode . . . . . . . . . . . . . . . . . . . . . . 128
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Synchronized Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
PLC Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Users and Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Access Rights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Task Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6.2 I/O Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
I/O Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Working with the I/O Mapping Dialog. . . . . . . . . . . . . . . . . . . . . . . . . . 158
I/O Mapping in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Implicit Variables for Forcing I/Os . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Part III Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Chapter 7 Program Components . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
7.1 Program Organization Unit (POU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
POU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Adding and Calling POU Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
POUs for Implicit Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
4 EIO0000002854 06/2019
7.2 Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
General Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Function Block Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Calling a Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Configuring a Memory Reserve for the Online Change of Function
Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Extension of a Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Implementing Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Method Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
SUPER Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
THIS Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
7.3 Application Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Data Type Unit (DUT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Global Variable List - GVL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Network Variable List (Receiver) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Persistent Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
External File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Text List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Image Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
7.4 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Chapter 8 Task Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Task Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Adding Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Chapter 9 Managing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . 249
9.1 General Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
9.2 Building and Downloading Applications. . . . . . . . . . . . . . . . . . . . . . . . 252
Building Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Build Process at Changed Applications. . . . . . . . . . . . . . . . . . . . . . . . 256
Downloading an Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
9.3 Running Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Running Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
9.4 Maintaining Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Core Dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
EIO0000002854 06/2019 5
Programming Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Refactoring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Static Analysis Light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Creating an Archive in Your Controller on Download. . . . . . . . . . . . . . 287
Part IV Logic Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Chapter 10 Common Features of Graphic Editors . . . . . . . . . . . . . . . 291
Common Features of Graphic Editors . . . . . . . . . . . . . . . . . . . . . . . . . 291
Chapter 11 FBD/LD/IL Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
11.1 Information on the FBD/LD/IL Editor . . . . . . . . . . . . . . . . . . . . . . . . . . 294
FBD/LD/IL Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Function Block Diagram (FBD) Language . . . . . . . . . . . . . . . . . . . . . . 296
Ladder Diagram (LD) Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Instruction List (IL) Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Modifiers and Operators in IL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Working in the FBD and LD Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Working in the IL Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Cursor Positions in FBD, LD, and IL . . . . . . . . . . . . . . . . . . . . . . . . . . 316
FBD/LD/IL Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
FBD/LD/IL Editor in Online Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
11.2 FBD/LD/IL Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
FBD/LD/IL Toolbox. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Network in FBD/LD/IL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Assignment in FBD/LD/IL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Jump in FBD/LD/IL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Label in FBD/LD/IL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Boxes in FBD/LD/IL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
RETURN Instruction in FBD/LD/IL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Branch / Hanging Coil in FBD/LD/IL. . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Parallel Branch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Branch Start / End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Set/Reset in FBD/LD/IL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Set/Reset Coil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
11.3 LD Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Contact. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Coil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
6 EIO0000002854 06/2019
Chapter 12 Continuous Function Chart (CFC) Editor . . . . . . . . . . . . 351
Continuous Function Chart (CFC) Language . . . . . . . . . . . . . . . . . . . 352
CFC Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Cursor Positions in CFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
CFC Elements / ToolBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Working in the CFC Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
CFC Editor in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
CFC Editor Page-Oriented . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Chapter 13 Sequential Function Chart (SFC) Editor . . . . . . . . . . . . . 371
SFC Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
SFC - Sequential Function Chart Language . . . . . . . . . . . . . . . . . . . . 374
Cursor Positions in SFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Working in the SFC Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
SFC Element Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
SFC Elements / ToolBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Qualifier for Actions in SFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
Implicit Variables - SFC Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Sequence of Processing in SFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
SFC Editor in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Chapter 14 Structured Text (ST) Editor. . . . . . . . . . . . . . . . . . . . . . . 401
14.1 Information on the ST Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
ST Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
ST Editor in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
14.2 Structured Text ST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Structured Text ST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Part V Object Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Chapter 15 Declaration Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Textual Declaration Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
Tabular Declaration Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Declaration Editor in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
Chapter 16 Device Type Manager (DTM) Editor . . . . . . . . . . . . . . . . 433
DTM Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
Chapter 17 Data Unit Type (DUT) Editor. . . . . . . . . . . . . . . . . . . . . . 435
Data Unit Type Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Chapter 18 Global Variables List (GVL) Editor . . . . . . . . . . . . . . . . . 437
GVL Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
EIO0000002854 06/2019 7
Chapter 19 Network Variables List (NVL) Editor . . . . . . . . . . . . . . . . . 439
19.1 Information on the NVL Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Network Variables List Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
19.2 General Information on Network Variables . . . . . . . . . . . . . . . . . . . . . 441
Introduction to Network Variables List (NVL) . . . . . . . . . . . . . . . . . . . . 442
Configuring the Network Variables Exchange . . . . . . . . . . . . . . . . . . . 446
Network Variables List (NVL) Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . 452
Operating State of the Sender and the Receiver . . . . . . . . . . . . . . . . . 455
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
Compatibility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Chapter 20 Task Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Information on the Task Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 466
Properties Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
System Events Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Monitor Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Variable Usage Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
Configuration of a Specific Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Task Processing in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Chapter 21 Watch List Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Watch View / Watch List Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Creating a Watch List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Watch List in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Chapter 22 Tools Within Logic Editors . . . . . . . . . . . . . . . . . . . . . . . . 485
Function and Function Block Finder. . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Input Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Part VI Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Chapter 23 Data Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Introduction to Data Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Chapter 24 Recipe Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Recipe Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Recipe Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
RecipeMan Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Loading Recipe Values from the Controller . . . . . . . . . . . . . . . . . . . . . 514
Memory Usage by Recipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Chapter 25 Trace Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
25.1 Trace Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Trace Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Creating a Trace Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
8 EIO0000002854 06/2019
25.2 Trace Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Trace Configuration - Tree Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Variable Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Record Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Display Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Advanced Trace Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
Display Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
25.3 Trace Editor in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Trace Editor in Online Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
25.4 Keyboard Operations for Trace Diagrams . . . . . . . . . . . . . . . . . . . . . . 543
Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Chapter 26 Trend Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
26.1 Trend Recording Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Trend Recording Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
Trend Recording Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
26.2 Trend Recording Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Trend Recording Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
Record Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
Variable Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
Steps for Trend Recording Configuration . . . . . . . . . . . . . . . . . . . . . . 556
26.3 Recording Trend Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Start the Recording Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Chapter 27 Unit Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Unit Conversion Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Usage in IEC Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Chapter 28 Symbol Configuration Editor . . . . . . . . . . . . . . . . . . . . . . 567
Symbol Configuration Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
Symbol Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Adding a Symbol Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
Chapter 29 EcoStruxure Machine Expert Controller - HMI Data
Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
EcoStruxure Machine Expert Single Variable Definition . . . . . . . . . . . 578
Publishing Variables in the Controller Part . . . . . . . . . . . . . . . . . . . . . 582
Selecting Variables in the HMI Part . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
Publishing Variables in the HMI Part . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Parameterization of the Physical Media . . . . . . . . . . . . . . . . . . . . . . . 587
Communication Performance on Controller - HMI Data Exchange . . . 588
Indications for HMI Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
EIO0000002854 06/2019 9
Chapter 30 Cam Motion Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
30.1 Cam Motion Editor - General Information . . . . . . . . . . . . . . . . . . . . . . 594
General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Adding a Cam Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
Opening the Motion Editor of a Cam Object . . . . . . . . . . . . . . . . . . . . 597
30.2 Generating IEC Program Code from Cam Data. . . . . . . . . . . . . . . . . . 598
Using Cam Data for Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . 599
Copying the Source Code of the Cam Diagram. . . . . . . . . . . . . . . . . . 601
30.3 Online View and Functions of the Cam Motion Editor . . . . . . . . . . . . . 602
Online View and Functions of the Cam Motion Editor . . . . . . . . . . . . . 602
30.4 Discontinuous Courses of the Positions. . . . . . . . . . . . . . . . . . . . . . . . 603
Discontinuous Courses of the Positions. . . . . . . . . . . . . . . . . . . . . . . . 603
30.5 Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Motion Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
Generating IEC Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
Part VII Programming Reference . . . . . . . . . . . . . . . . . . . . . 617
Chapter 31 Variables Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
31.1 Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
Recommendations on the Naming of Identifiers . . . . . . . . . . . . . . . . . 624
Variables Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Shortcut Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
AT Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
31.2 Variable Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
Variable Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
Attribute Keywords for Variable Types. . . . . . . . . . . . . . . . . . . . . . . . . 641
Variables Configuration - VAR_CONFIG . . . . . . . . . . . . . . . . . . . . . . . . 645
31.3 Method Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
FB_Init, FB_Reinit, and FB_ExitMethods. . . . . . . . . . . . . . . . . . 647
31.4 Pragma Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
Pragma Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
Message Pragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
Conditional Pragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
Region Pragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
10 EIO0000002854 06/2019
31.5 Attribute Pragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
Attribute Pragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
User-Defined Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
Attribute call_after_global_init_slot. . . . . . . . . . . . . . . 672
Attribute call_after_init. . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
Attribute call_after_online_change_slot . . . . . . . . . . . . 674
Attribute call_before_global_exit_slot. . . . . . . . . . . . . . 675
Attribute call_on_type_change . . . . . . . . . . . . . . . . . . . . . . . 676
Attribute const_replaced, Attribute const_non_repla
ced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
Attribute 'dataflow' . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
Attribute displaymode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
Attribute estimated-stack-usage . . . . . . . . . . . . . . . . . . . . . 680
Attribute ExpandFully . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
Attribute global_init_slot. . . . . . . . . . . . . . . . . . . . . . . . . . . 682
Attribute hide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
Attribute hide_all_locals. . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
Attribute initialize_on_call . . . . . . . . . . . . . . . . . . . . . . . . 686
Attribute init_namespace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
Attribute init_On_Onlchange . . . . . . . . . . . . . . . . . . . . . . . . . 688
Attribute instance-path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
Attribute linkalways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
Attribute monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
Attribute namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Attribute no_assign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
Attribute no_check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
Attribute no_copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
Attribute no-exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
Attribute no_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
Attribute no_instance_in_retain . . . . . . . . . . . . . . . . . . . . . 702
Attribute no_virtual_actions . . . . . . . . . . . . . . . . . . . . . . . . 703
Attribute pingroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
Attribute pin_presentation_order_inputs/outputs . . . . 707
Attribute obsolete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
Attribute pack_mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
Attribute qualified_only. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
Attribute reflection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
EIO0000002854 06/2019 11
Attribute subsequent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
Attribute symbol. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Attribute warning disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
Attribute enable_dynamic_creation . . . . . . . . . . . . . . . . . . . 717
31.6 The Smart Coding Functionality. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
Smart Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
Chapter 32 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
32.1 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
32.2 Standard Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
Standard Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
32.3 Extensions to IEC Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
UNION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
BIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
32.4 User-Defined Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
Defined Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
Subrange Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
Chapter 33 Programming Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . 753
33.1 Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
33.2 Prefixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756
Prefix Parts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
Order of Prefixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Scope Prefix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
Data Type Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
Property Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
POU Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
Namespace Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Chapter 34 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
34.1 Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
ADD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
MUL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
SUB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
12 EIO0000002854 06/2019
DIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
MOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
SIZEOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
34.2 Bitstring Operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
OR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
XOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
NOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
34.3 Bit-Shift Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
SHL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788
SHR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
ROL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
ROR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
34.4 Selection Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
SEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
MIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
LIMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
MUX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
34.5 Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
GT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
LT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
LE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
GE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
EQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
NE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
34.6 Address Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
ADR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
Content Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
BITADR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
34.7 Calling Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
CAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
34.8 Type Conversion Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
Type Conversion Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
BOOL_TO Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
TO_BOOL Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
Conversion Between Integral Number Types . . . . . . . . . . . . . . . . . . . 819
EIO0000002854 06/2019 13
REAL_TO / LREAL_TO Conversions. . . . . . . . . . . . . . . . . . . . . . . . . . 820
TIME_TO/TIME_OF_DAY Conversions . . . . . . . . . . . . . . . . . . . . . . . . 822
DATE_TO/DT_TO Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
STRING_TO Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
TRUNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
TRUNC_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
ANY_..._TO Conversions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
TO_<xxx> Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
34.9 Numeric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832
ABS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
SQRT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
LN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
LOG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
EXP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
SIN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
COS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
TAN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
ASIN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
ACOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
ATAN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
EXPT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
34.10 IEC Extending Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
IEC Extending Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
__DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
__ISVALIDREF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
__NEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
__QUERYINTERFACE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
__QUERYPOINTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
AND_THEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
OR_ELSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
__TRY, __CATCH, __FINALLY, __ENDTRY . . . . . . . . . . . . . . . . . 860
__VARINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
Scope Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865
34.11 Initialization Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
INI Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
14 EIO0000002854 06/2019
Chapter 35 Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
35.1 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
BOOL Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
TIME Constants. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
DATE Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874
DATE_AND_TIME Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875
TIME_OF_DAY Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
Number Constants. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
REAL/LREAL Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
String Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
Typed Constants / Typed Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
35.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
Addressing Bits in Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
35.3 Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
Direct Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
35.4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
Part VIII EcoStruxure Machine Expert Templates . . . . . . . . . 891
Chapter 36 General Information about Templates . . . . . . . . . . . . . . 893
36.1 EcoStruxure Machine Expert Templates . . . . . . . . . . . . . . . . . . . . . . . 894
General Information About EcoStruxure Machine Expert Templates . 895
Administration of EcoStruxure Machine Expert Templates . . . . . . . . . 897
Chapter 37 Managing Device Templates . . . . . . . . . . . . . . . . . . . . . 905
37.1 Managing Device Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
Facts of Device Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
Adding Devices from Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
Creating a Device Template on the Basis of Field Devices or I/O
Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911
Visualizations Suitable for Creating Device Templates . . . . . . . . . . . . 912
Further Information on Integrating Control Logic into Device Templates 913
Steps to Create a Device Template. . . . . . . . . . . . . . . . . . . . . . . . . . . 915
Chapter 38 Managing Function Templates . . . . . . . . . . . . . . . . . . . . 919
38.1 Managing Function Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 920
Facts of Function Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921
Adding Functions from Template. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 922
Application Functions as Basis for Function Templates . . . . . . . . . . . 928
Steps to Create a Function Template . . . . . . . . . . . . . . . . . . . . . . . . . 930
EIO0000002854 06/2019 15
Part IX Troubleshooting and FAQ . . . . . . . . . . . . . . . . . . . . 935
Chapter 39 Generic - Troubleshooting and FAQ. . . . . . . . . . . . . . . . . 937
39.1 Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938
How Can I Enable and Configure Analog Inputs on CANopen? . . . . . 939
Why is EcoStruxure Machine Expert Startup Performance Sometimes
Slower? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 940
How Can I Manage Shortcuts and Menus? . . . . . . . . . . . . . . . . . . . . . 941
How Can I Increase the Memory Limit Available for EcoStruxure
Machine Expert on 32-Bit Operating Systems? . . . . . . . . . . . . . . . . . . 943
How Can I Reduce the Memory Consumption of EcoStruxure Machine
Expert?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 944
How Can I Increase the Build-Time Performance of EcoStruxure
Machine Expert? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
What Can I Do in Case of Issues with Modbus IOScanner on Serial
Line? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946
What Can I Do If My Network Variables List (NVL) Communication Has
Been Suspended? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947
Chapter 40 Accessing Controllers - Troubleshooting and FAQ . . . . . 949
40.1 Troubleshooting: Accessing New Controllers . . . . . . . . . . . . . . . . . . . 950
Accessing New Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951
Connecting via IP Address and Address Information. . . . . . . . . . . . . . 953
40.2 FAQ - What Can I Do in Case of Connection Problems With the
Controller? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 955
FAQ - Why is a Connection to the Controller not Possible? . . . . . . . . 956
FAQ - Why has the Communication Between PC and Controller been
Interrupted? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961
Appendix A Network Communication . . . . . . . . . . . . . . . . . . . . . . . . . 963
Network Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 964
Addressing and Routing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 965
Structure of Addresses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967
Appendix B Python Script Language . . . . . . . . . . . . . . . . . . . . . . . . . . 971
B.1 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 972
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
Accessing the Python Interpreter in EcoStruxure Machine Expert . . . 976
Using the Logic Builder Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981
Using the Logic Builder Scripting Immediate View. . . . . . . . . . . . . . . . 989
Keyboard Commands in the Logic Builder Shell and the Scripting
Immediate View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 992
Explore EcoStruxure Machine Expert Python API (with dir() and
inspectapi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 993
16 EIO0000002854 06/2019
Using Logic Builder Shell with Microsoft Visual Studio and PTVS . . . 998
Using Logic Builder Shell with JetBrains PyCharm . . . . . . . . . . . . . . . 1004
Using Logic Builder Shell with Microsoft Visual Studio Code and
Python Extension. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1008
Executing Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1012
Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014
Reading .NET API Documentations . . . . . . . . . . . . . . . . . . . . . . . . . . 1016
EcoStruxure Machine Expert Python API . . . . . . . . . . . . . . . . . . . . . . 1018
EcoStruxure Machine Expert Scripting - Python API. . . . . . . . . . . . . . 1019
Calling Scripts Via Toolbar Icons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1024
B.2 Schneider Electric Script Engine Examples . . . . . . . . . . . . . . . . . . . . 1026
New Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027
Device Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1029
Compiler Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1031
Visualization Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1032
Update Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1034
Update Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1035
Clean and Build Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1036
Communication Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1037
Start ETEST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1038
Reset Diagnostic Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1040
Reboot the Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041
Convert Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1042
Comparing Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1046
Advanced Library Management Functions . . . . . . . . . . . . . . . . . . . . . 1047
Accessing POUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1048
B.3 CoDeSys Script Engine Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 1050
Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1051
Online Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1060
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1063
Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064
System / User Interface (UI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1069
Reading Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1073
Reading Values From Recipe and Send an Email . . . . . . . . . . . . . . . 1075
Determine Device Tree of the Open Project . . . . . . . . . . . . . . . . . . . . 1077
Script Example 4: Import a Device in PLCOpenXML From Subversion 1078
EIO0000002854 06/2019 17
Script Example 5: Creating and Editing POUs. . . . . . . . . . . . . . . . . . . 1080
Script Example 6: User Interface / Interaction with the User . . . . . . . . 1081
Script Example 7: Manipulation of the Project information Object . . . . 1083
Advanced Example: Checkout a Library from SVN and Installation in
EcoStruxure Machine Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084
Appendix C Controller Feature Sets for Migration . . . . . . . . . . . . . . . . 1085
Controller Feature Sets for Migration . . . . . . . . . . . . . . . . . . . . . . . . . . 1085
Appendix D Know-How Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1089
Know-How Protection of Projects and Libraries. . . . . . . . . . . . . . . . . . 1089
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1095
18 EIO0000002854 06/2019
Safety Information
Important Information
NOTICE
Read these instructions carefully, and look at the equipment to become familiar with the device
before trying to install, operate, service, or maintain it. The following special messages may appear
throughout this documentation or on the equipment to warn of potential hazards or to call attention
to information that clarifies or simplifies a procedure.
EIO0000002854 06/2019 19
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.
20 EIO0000002854 06/2019
About the Book
At a Glance
Document Scope
This document describes the graphical user interface of the EcoStruxure Machine Expert software
and the functions it provides. For further information, refer to the separate documents provided in
the EcoStruxure Machine Expert online help.
Validity Note
This document has been updated for the release of EcoStruxureTM Machine Expert V1.1.
Related Documents
EIO0000002854 06/2019 21
Document title Reference
EcoStruxure Machine Expert Controller Assistant EIO0000001671 (ENG);
User Guide EIO0000001672 (FRE);
EIO0000001673 (GER);
EIO0000001675 (SPA);
EIO0000001674 (ITA);
EIO0000001676 (CHS)
EcoStruxure Machine Expert Device Type Manager EIO0000003047 (ENG);
(DTM) User Guide EIO0000003048 (FRE);
EIO0000003049 (GER);
EIO0000003051 (SPA);
EIO0000003050 (ITA);
EIO0000003052 (CHS)
EcoStruxure Machine Expert TwidoEmulationSupport EIO0000001692 (ENG);
Library Guide EIO0000001693 (FRE);
EIO0000001694 (GER);
EIO0000001696 (SPA);
EIO0000001695 (ITA);
EIO0000001697 (CHS)
EcoStruxure Machine Expert Network Variable EIO0000002974 (ENG);
Configuration SE_NetVarUdp Library Guide EIO0000002975 (FRE);
EIO0000002976 (GER);
EIO0000002978 (SPA);
EIO0000002977 (ITA);
EIO0000002979 (CHS)
You can download these technical publications and other technical information from our website
at www.schneider-electric.com/en/download.
22 EIO0000002854 06/2019
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.
EIO0000002854 06/2019 23
Terminology Derived from Standards
The technical terms, terminology, symbols and the corresponding descriptions in this manual, or
that appear in or on the products themselves, are generally derived from the terms or definitions
of international standards.
In the area of functional safety systems, drives and general automation, this may include, but is not
limited to, terms such as safety, safety function, safe state, fault, fault reset, malfunction, failure,
error, error message, dangerous, etc.
Among others, these standards include:
Standard Description
IEC 61131-2:2007 Programmable controllers, part 2: Equipment requirements and tests.
ISO 13849-1:2015 Safety of machinery: Safety related parts of control systems.
General principles for design.
EN 61496-1:2013 Safety of machinery: Electro-sensitive protective equipment.
Part 1: General requirements and tests.
ISO 12100:2010 Safety of machinery - General principles for design - Risk assessment and risk
reduction
EN 60204-1:2006 Safety of machinery - Electrical equipment of machines - Part 1: General
requirements
ISO 14119:2013 Safety of machinery - Interlocking devices associated with guards - Principles
for design and selection
ISO 13850:2015 Safety of machinery - Emergency stop - Principles for design
IEC 62061:2015 Safety of machinery - Functional safety of safety-related electrical, electronic,
and electronic programmable control systems
IEC 61508-1:2010 Functional safety of electrical/electronic/programmable electronic safety-
related systems: General requirements.
IEC 61508-2:2010 Functional safety of electrical/electronic/programmable electronic safety-
related systems: Requirements for electrical/electronic/programmable
electronic safety-related systems.
IEC 61508-3:2010 Functional safety of electrical/electronic/programmable electronic safety-
related systems: Software requirements.
IEC 61784-3:2016 Industrial communication networks - Profiles - Part 3: Functional safety
fieldbuses - General rules and profile definitions.
2006/42/EC Machinery Directive
2014/30/EU Electromagnetic Compatibility Directive
2014/35/EU Low Voltage Directive
24 EIO0000002854 06/2019
In addition, terms used in the present document may tangentially be used as they are derived from
other standards such as:
Standard Description
IEC 60034 series Rotating electrical machines
IEC 61800 series Adjustable speed electrical power drive systems
IEC 61158 series Digital data communications for measurement and control – Fieldbus for use in
industrial control systems
Finally, the term zone of operation may be used in conjunction with the description of specific
hazards, and is defined as it is for a hazard zone or danger zone in the Machinery Directive
(2006/42/EC) and ISO 12100:2010.
NOTE: The aforementioned standards may or may not apply to the specific products cited in the
present documentation. For more information concerning the individual standards applicable to the
products described herein, see the characteristics tables for those product references.
EIO0000002854 06/2019 25
26 EIO0000002854 06/2019
EcoStruxure Machine Expert
Introduction
EIO0000002854 06/2019
Part I
Introduction
Introduction
EIO0000002854 06/2019 27
Introduction
28 EIO0000002854 06/2019
EcoStruxure Machine Expert
General Introduction to the EcoStruxure Machine Expert Logic Builder
EIO0000002854 06/2019
Chapter 1
General Introduction to the EcoStruxure Machine Expert Logic Builder
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 29
General Introduction to the EcoStruxure Machine Expert Logic Builder
General Description
The Logic Builder provides the configuration and programming environment for EcoStruxure
Machine Expert projects.
It displays the different elements of your project in separate views that you can arrange on the
EcoStruxure Machine Expert user interface and on your desktop according to your individual
requirements. This view structure allows you to add hardware and software elements to your
project by drag and drop. The main configuration dialog boxes that allow you to create content for
the project are provided in the center of the Logic Builder screen.
In addition to easy configuration and programming, the Logic Builder also provides powerful
diagnostic and maintenance features.
30 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
General Introduction to the EcoStruxure Machine Expert Logic Builder
Building Projects
The Logic Builder provides different ways (such as Build, Build all, or Clean all) to build your
EcoStruxure Machine Expert project.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 31
General Introduction to the EcoStruxure Machine Expert Logic Builder
32 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
EcoStruxure Machine Expert Logic Builder User Interface
EIO0000002854 06/2019
Chapter 2
EcoStruxure Machine Expert Logic Builder User Interface
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 33
EcoStruxure Machine Expert Logic Builder User Interface
Overview
Logic Builder consists of the following elements:
Menus and toolbars
Navigator views
Catalog views
Main editor pane
When you open the Logic Builder, it provides a default screen layout. This document describes the
default positions.
You can adapt the elements according to your individual requirements as described in the
Customizing the User Interface chapter (see page 51). You can see and modify the present
settings in the Customize dialog box. It is by default available in the Tools menu.
You can also arrange the views and windows anytime via shifting, docking/undocking views,
resizing or closing windows. The positions are saved with the project. When you reopen a project,
the elements are placed at the positions where they were when the project was saved. The
positions of views are saved separately in perspectives (see page 53).
34 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
1 Menu bar
2 Toolbar
3 Multi-tabbed Navigators: Devices tree, Tools tree, Applications tree, Functional tree
4 Messages view
5 Information and status bar
6 Multi-tabbed catalog view: hardware catalog: Controller, HMI & iPC, Devices & Modules, Diverse software
catalog: Variables, Assets. Macros, ToolBox, Libraries
7 Multi-tabbed editor view
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 35
EcoStruxure Machine Expert Logic Builder User Interface
Default Components
The Logic Builder screen contains the following components that are visible by default:
Component Description
Menu bar Provides menus which contain the available commands as defined in
the Tools → Customize dialog box.
Toolbar Contains buttons to execute the available tools as defined in the Tools
→ Customize dialog box.
Multi-tabbed Navigators The following Navigators are available as tabs where the different
objects of a project are organized in a tree structure:
Devices tree
Applications tree
Tools tree
Functional tree
Software Catalog
Variables
Assets
Macros
ToolBox
Libraries
36 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
Component Description
Multi-tabbed editor window Used for creating the particular object in the respective editor.
In the case of language editors (for example, ST editor, CFC editor),
usually the window combines the language editor in the lower part and
the declaration editor in the upper part.
In the case of other editors, it can provide dialog boxes (for example,
task editor, device editor). The name of the POU or the resource object
is displayed in the title bar of this view. You can open the objects in the
editor window in offline or online mode by executing the Edit Object
command.
Abbreviation Description
Ln Line in which the cursor is placed.
Col Column in which the cursor is placed.
(A column includes exactly one space, character, or digit.)
Ch Number of characters.
(In this context, a character can be a single character or digit as well as a tab
including, for example, four columns.)
Double-click one of the fields to open the dialog box Go To Line. Here you can enter a different
position where the cursor is placed.
The status of the editing mode is indicated by the following abbreviations:
Abbreviation Description
INS Insert mode
OVR Overwrite mode
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 37
EcoStruxure Machine Expert Logic Builder User Interface
Text Description
Program loaded Program loaded on device.
Program unchanged Program on device matches that in the programming system.
Program modified (Online Program on device differs from that in the programming system, online
Change) change required.
Program modified (Full Program on device differs from that in the programming system, full download
download) required.
38 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
Switching Windows
EcoStruxure Machine Expert allows you to switch between open views and editors. To switch
between open views and editors, press the Ctrl and Tab keys simultaneously. A window opens that
lists the views and editors that are open. As long as the Ctrl key is pressed the window stays open.
Use the Tab key or the Arrow keys simultaneously to select a specific view or editor.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 39
EcoStruxure Machine Expert Logic Builder User Interface
Multi-Tabbed Navigators
Overview
The multi-tabbed Navigators are default components of the Logic Builder screen.
By default, the following navigators are available:
Devices tree: It allows you to manage the devices on which the application is to run.
Applications tree: It allows you to manage project-specific as well as global POUs, and tasks in
a single view.
Tools tree: It allows you to manage project-specific as well as global libraries or other elements
in a single view.
Functional tree: It allows you to group the content of a controller according to your individual
requirements.
You can access views via the View menu.
Repositioning Objects
To reposition objects, use the clipboard commands (Cut, Copy, Paste, Delete) from the Edit menu.
Alternatively, you can drag the selected object with the mouse while the mouse-button (plus CTRL
key for copying) is pressed. When you add devices using the copy and paste function, the new
device gets the same name followed by an incrementing number.
40 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 41
EcoStruxure Machine Expert Logic Builder User Interface
1 Root node
2 Programmable device (with applications)
3 Symbolic device name
4 Device name defined in device description file
Each entry in the Devices tree displays the symbol, the symbolic name (editable), and the
device type (= device name as provided by the device description).
A device is programmable or configurable. The type of the device determines the possible
position within the tree and also which further resources can be inserted below the device.
Within a single project, you can configure one or several programmable devices - regardless of
manufacturer or type (multi-resource, multi-device, networking).
Configure a device concerning communication, parameters, I/O mapping in the device dialog
(device editor). To open the device editor, double-click the device node in the Devices tree (refer
to the description of the device editor (see page 103)).
In online mode, the status of a device is indicated by an icon preceding the device entry:
Controller is connected, application is running, device is in operation, data is exchanged.
The option Update IO while in stop in the PLC settings view of the device editor
(see page 141) can be enabled or disabled.
Controller is connected and stopped (STOP). The option Update IO while in stop in the
PLC settings view of the device editor (see page 141) is disabled.
42 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
Device is configured but not fully operational. Data is not exchanged. For example,
CANopen devices are in startup and preoperational.
Redundancy mode active: The fieldbus master is not sending data because another
master is in active mode.
Device description was not found in device repository. For further information on installing
and uninstalling devices in the Device Repository dialog box, refer to the description of the
Device Repository (see EcoStruxure Machine Expert, Menu Commands, Online Help).
The names of the connected devices and applications are displayed green shaded.
The names of devices running in simulation mode (refer to the description of the Simulation
command) are displayed in italics.
Additional diagnostic information is provided in the Status view of the device editor
(see page 153).
You can also run the active application on a simulation device which is by default automatically
available within the programming system. Therefore, no real target device is needed to test the
online behavior of an application (at least that which does not rely on hardware resources for
execution). When you switch to simulation mode (see EcoStruxure Machine Expert, Menu
Commands, Online Help), an entry in the Devices tree is displayed in italics, and you can log into
the application.
You can also connect to the controller in online configuration mode (refer to chapter Online Config
Mode (see EcoStruxure Machine Expert, Menu Commands, Online Help)) without the need of first
having loaded a real application into the controller. This is useful for the initial start-up of an I/O
system because you can access and test the I/Os in the controller configuration before you build
and load a real application program.
For information on the conversion of device references when opening projects, refer to the
Compatibility and Migration User Guide.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 43
EcoStruxure Machine Expert Logic Builder User Interface
44 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 45
EcoStruxure Machine Expert Logic Builder User Interface
Functional tree
Overview
The Functional tree is available for controllers that have a Functional Model node in the Devices
tree. It allows you to group multiple objects, such as IEC code or devices, and link them to a
function. Once this function is created, you can reuse it. By creating this modularity, it is possible
for you to reuse your developments more easily and to improve your vision of the project. You can
export / import the Functional tree and reuse it in another project.
Selecting Controllers
Select controllers for the Functional tree as follows:
46 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
Adding Nodes
To group the content of a controller according to your individual requirements, the Functional tree
allows you to create subnodes below the controller nodes.
Deleting Nodes
To delete a node from the Functional tree, right-click it, and execute the command Delete from the
contextual menu. You are requested to decide whether to delete the selected object, with its child
objects, only from the Functional tree or from the whole project.
Child objects cannot be removed from the Functional tree only. If you intend to delete a child object,
you are prompted to confirm that the object is removed from the whole project.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 47
EcoStruxure Machine Expert Logic Builder User Interface
It is not possible to copy and paste attached objects in the Functional tree.
48 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
Overview
The multi-tabbed Hardware Catalog is a default component of the Logic Builder screen.
It contains the following tabs:
Controller: Contains the Logic, HMI, and Motion controllers that can be inserted in your
EcoStruxure Machine Expert project.
Devices & Modules: Contains the PLC Components, I/O Modules, and the Communication,
Motor Control, Safety, and Sensor devices that can be inserted in your EcoStruxure Machine
Expert project. It also allows you to insert devices by using a device template.
HMI & iPC: Contains the HMI and iPC devices that can be inserted in your EcoStruxure Machine
Expert project.
Diverse: Contains third-party devices that can be inserted in your EcoStruxure Machine Expert
project.
The content of the individual tabs depends on the project. If the controllers integrated in the
EcoStruxure Machine Expert project do not support, for example, CANopen, then CANopen
devices are not displayed in the catalogs.
You can extend this view by the tabs of the Software Catalog (Variables, Assets, Macros, ToolBox,
Libraries) via the menu View → Software Catalog.
The buttons Hardware Catalog and Software Catalog in the toolbar allow you to display
or hide the catalog views.
You can add the elements from the catalogs to the project by simple drag and drop as described
in the Adding Devices by Drag and Drop chapter (see page 66).
Favorites List
Each tab of the catalog view contains a Favorites list. To provide quick access, you can add
frequently used elements to this Favorites list by drag and drop.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 49
EcoStruxure Machine Expert Logic Builder User Interface
Adding Devices From Device Templates in the Devices & Modules Tab
The Devices & Modules tab contains the option Device Template at the bottom. Activate this option
to display the available templates of field devices in the lists of the Devices & Modules tab. Add
them to the Devices tree as described in the Adding Devices from Template chapter
(see page 908).
50 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
Overview
The look of the user interface, in terms of arrangement and configuration of the particular
components, depends on the following:
Default pre-settings for menus, keyboard functions, and toolbars. You can overwrite the
EcoStruxure Machine Expert default settings via the Customize dialog box (see EcoStruxure
Machine Expert, Menu Commands, Online Help) (by default available in the Tools menu). The
present settings are saved on the local system. A reset function is available for restoring the
default values at any time.
Properties of an editor as defined in the respective Tools → Options dialog box
(see EcoStruxure Machine Expert, Menu Commands, Online Help). You can also overwrite
these settings. The present configuration is saved on the local system.
The way you arrange views or editor windows within the project. The present positions are
saved with the project (see below).
The selected perspective. By default, the Logic Configuration perspective is selected. For
further information, refer to the Perspectives paragraph in this chapter (see page 53).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 51
EcoStruxure Machine Expert Logic Builder User Interface
View is placed here: the view currently placed at this position and the new
one are arranged as icons.
52 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
When you release the mouse-button, the view is placed at the new position.
Views with an Auto Hide button can be placed as independent windows (floating) anywhere on the
screen by moving them and not dragging them on one of the arrow symbols. In this case, the view
looses the Auto Hide button. As an alternative, execute the commands Dock and Float from the
Window menu.
Hiding views: You can hide views with Auto Hide buttons at the border of the EcoStruxure Machine
Expert window. Click the Auto Hide down button in the upper right corner of the view. The view will
be displayed as a tab at the nearest border of the frame window. The content of the view is only
visible as long as the cursor is moved on this tab. The tab displays the icon and the name of the
view. This state of the view is indicated by the docking button changed to Auto Hide.
Unhiding views: To unhide a view, click the Auto Hide button.
An alternative way of hiding and unhiding a view is provided by the Auto Hide command that is by
default available in the Window menu.
It is not possible to reposition the information and status bar on the lower border of the user
interface (see page 35).
Perspectives
A perspective is used to save the layout of EcoStruxure Machine Expert views. It stores whether
the Messages and Watch views are open and at which position the view windows are located
(docked or independent windows).
By default, EcoStruxure Machine Expert provides 4 perspectives for the following use cases in the
Window → Switch Perspective menu or in the perspective table in the toolbar.
Perspective name Use case Navigators (on the left Catalog views (on the Views at the bottom of
side) right side) the screen
Device For adding / Devices tree Hardware catalog Messages (in Auto
Configuration configuring devices. Applications tree Controller Hide mode)
Tools tree Devices & Modules
HMI & iPC
Diverse
Logic Configuration For adding / creating Devices tree Software catalog Messages (in Auto
logic. Applications tree Variables Hide mode)
Tools tree Assets
Macros
ToolBox
Libraries
CODESYS Classic Standard CoDeSys Devices Hardware catalog Messages (in Auto
views. POUs Controller Hide mode)
Devices & Modules
HMI & iPC
Diverse
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 53
EcoStruxure Machine Expert Logic Builder User Interface
Perspective name Use case Navigators (on the left Catalog views (on the Views at the bottom of
side) right side) the screen
Online For online mode. Devices tree Hardware catalog Messages (in Auto
Applications tree Controller Hide mode)
Tools tree Devices & Modules Watch 1
HMI & iPC
Diverse
The Online perspective is automatically selected when the application is switched to online mode.
Creating your own perspective:
In addition to these default perspectives, you can create your own view layout and save it in
different perspectives according to your individual requirements.
To create your own perspective, proceed as follows:
Step Action
1 Resize, open, or close views according to your individual requirements.
2 Execute the command Save Perspective from the Window menu to save your modifications to
a new perspective.
3 In the Save Perspective dialog box, enter a name for your perspective.
Result: The present view layout is saved. The new perspective is available in the Window →
Switch Perspective menu and in the perspective table in the toolbar.
Zoom
Each editor window provides a zoom function. Click the zoom button in the lower right corner
of the window to open a list. It allows you to choose one of the zoom levels 25, 50, 100, 150, 200,
and 400 percent or to enter a zoom factor of your choice. A printout always refers to the 100% view.
Customization of the user interface is possible in offline and in online mode.
54 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
Overview
As soon as you log in with the project, the objects which have already been opened in offline mode,
are automatically viewed in online mode. The perspective is automatically switched to the Online
perspective (see page 53) which means that the Watch view opens by default.
To open an object in online mode which is not already open, double-click the node in the
Applications tree or execute the Project → Edit Object command. The object will be opened in
online mode.
If there are several instances of the selected object (such as function blocks) contained in the
project, a dialog box named Select Online State <object name> will display. It allows you to choose
whether an instance or the base implementation of the object should be viewed and whether the
object should be displayed in online or offline mode.
Select Online State dialog box
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 55
EcoStruxure Machine Expert Logic Builder User Interface
The Device/Application field contains the device and application to which the respective object is
associated.
To open the online view of the object, activate the option Online mode and click OK. To see the
offline view, activate the option Offline mode.
If the object is a function block, the Function block instance field contains a list of the instances
currently used in the application.
In this case, the options available are:
Either select one of the instances and activate Online or Offline mode.
Or select the option Implementation which - independently of the selected instance - will open
the base implementation view of the function block. The Implementation option has no affect for
non-instantiated objects.
For more information on the online views of the particular editors, refer to the respective editor
descriptions.
The status bar (see page 35) provides information on the current status of the application.
56 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert Logic Builder User Interface
Overview
The following figure shows the default menu bar:
Some commands are not visible in the default view. To add a command to a menu, insert it in a
menu of your choice by using the Tools → Customize dialog box (see EcoStruxure Machine
Expert, Menu Commands, Online Help).
Specific commands, for a particular editor for example, are usually available in a corresponding
menu. These commands are only visible when the editor is open. For example: when you edit an
object in the SFC editor, the SFC menu is added to the menu bar.
To reorganize the menu structures, use the Tools → Customize dialog box.
For a description of the menus and commands, refer to the separate EcoStruxure Machine Expert
Menu Commands Online Help (see EcoStruxure Machine Expert, Menu Commands, Online Help).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 57
EcoStruxure Machine Expert Logic Builder User Interface
58 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Basic Concepts
EIO0000002854 06/2019
Chapter 3
Basic Concepts
Basic Concepts
Overview
EcoStruxure Machine Expert is a device-independent controller programming system.
Conforming to the IEC 61131-3 standard, it supports all standard programming languages.
Object Orientation
The object-oriented approach is not only reflected by the availability of appropriate programming
elements and features, but also in the structure and version handling of EcoStruxure Machine
Expert and in the project organization. Multi-device usage of a EcoStruxure Machine Expert project
is possible based on jointly used, instantiated programming units.
Version Handling
A parallel installation of several versions of EcoStruxure Machine Expert components and working
with the desired combination of versions is possible. This also pertains the device-specific use of
different compiler versions. Individual functions can be added without having to update the whole
version.
For further information, refer to the Compatibility and Migration User Guide.
Project Organization
Project organization is also determined in an object oriented fashion. A EcoStruxure Machine
Expert project contains a controller program composed of various programming objects and it
contains definitions of the resources which are needed to run instances of the program
(application) on defined target systems (devices, controllers).
So there are two main types of objects in a project:
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 59
Basic Concepts
Code Generation
Code generation by integrated compilers and the subsequent use of the resulting machine code
provides for short execution times.
Additionally, EcoStruxure Machine Expert provides an editor for programming in CFC that is not
part of the IEC standard:
CFC editor (see page 351) for continuous function chart
60 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Configuration
EIO0000002854 06/2019
Part II
Configuration
Configuration
EIO0000002854 06/2019 61
Configuration
62 EIO0000002854 06/2019
EcoStruxure Machine Expert
Installing Devices
EIO0000002854 06/2019
Chapter 4
Installing Devices
Installing Devices
Introduction
Via the Device Repository dialog box (see EcoStruxure Machine Expert, Menu Commands, Online
Help), you can integrate Sercos devices with generic I/O profiles in your programming system.
To install this Sercos device, you need the SDDML (Sercos Device Description Markup Language)
file (device description file for Sercos devices) provided by the vendor of the device. The
SDDML file is a device description file for Sercos devices.
There are two types of Sercos devices with generic I/O profiles available:
Block I/O devices
A block I/O device is a pre-assembled block that consists of a bus interface and an I/O module.
Modular I/O devices
Modular I/O devices are I/O modules which can be connected to a bus interface.
Step Action
1 Select Tools → Device Repository... from the menu bar.
Result: The Device Repository dialog box opens.
2 Click the Install... button in the Device Repository dialog box.
Result: The Install Device Description dialog box opens.
3 Select the file type SERCOS III I/O device descriptions (*.xml) and browse your file system for
the SDDML file to open.
4 Select the SDDML file and click Open.
Result: The SDDML file is converted and imported into a compatible file format for EcoStruxure
Machine Expert.
NOTE: If the selected SDDML file is not compatible or if the Sercos device of the third-party vendor
is not using a compatible FSP (Function Specific Profile) type, then a corresponding diagnostic
message is indicated in the Messages view (see EcoStruxure Machine Expert, Menu Commands,
Online Help).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 63
Installing Devices
Step Action
1 Select Tools → Device Repository... from the menu bar.
Result: The Device Repository dialog box opens.
2 In the tree structure Installed device descriptions, expand the node Fieldbusses → Sercos.
3 Expand the subnode Slave to verify whether the Sercos bus interfaces that you integrated are
available in the list.
4 Expand the subnode Module to verify whether the Sercos I/O modules that you integrated are
available in the list.
For further information, refer to the description of the Device Repository dialog box
(see EcoStruxure Machine Expert, Menu Commands, Online Help).
64 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Managing Devices
EIO0000002854 06/2019
Chapter 5
Managing Devices
Managing Devices
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 65
Managing Devices
Section 5.1
Adding Devices by Drag and Drop
Overview
EcoStruxure Machine Expert provides a multi-tabbed catalog view on the right-hand side of the
EcoStruxure Machine Expert Logic Builder.
Two different types of catalog views are available:
The Hardware Catalog
The Software Catalog
To add a device to the Devices tree, select the respective entry in the Hardware Catalog, drag it to
the Devices tree, and drop it at a suitable node. It is added automatically to your project.
Step Action
1
Open the Hardware Catalog by clicking the Hardware Catalog button in the EcoStruxure
Machine Expert Logic Builder toolbar if it is not already opened.
2 Select the tab Controller in the Hardware Catalog.
Result: The controllers suitable for your EcoStruxure Machine Expert project are displayed in
the Hardware Catalog.
3 Select a controller entry in the Controller tab, drag it to the Devices tree and drop it at a suitable
node. You can drop a controller at any empty space inside the Devices tree.
Result: The controller is added to the Devices tree as a new node with different subnodes
depending on the controller type.
66 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Step Action
1
Open the Hardware Catalog by clicking the Hardware Catalog button in the EcoStruxure
Machine Expert Logic Builder toolbar if it is not already opened.
2 Select the tab Devices & Modules in the Hardware Catalog.
Result: The expansion devices suitable for your EcoStruxure Machine Expert project are
displayed in the Hardware Catalog.
3 Select your expansion device, drag it to the Devices tree and drop it at a suitable subnode of a
controller.
NOTE: Suitable subnodes are expanded and highlighted by EcoStruxure Machine Expert.
Result: The expansion device is added to the Devices tree below the subnode of the controller.
4 If the expansion device requires a communication manager, this node is added automatically to
the Devices tree.
If several communication managers are available for your expansion device, a dialog box is
displayed allowing you to select the suitable communication manager.
Step Action
1
Open the Hardware Catalog by clicking the Hardware Catalog button in the EcoStruxure
Machine Expert Logic Builder toolbar if it is not already opened.
2 Select the tab Devices & Modules in the Hardware Catalog.
Result: The field devices suitable for your EcoStruxure Machine Expert project are displayed in
the Hardware Catalog.
3 Select a field device entry in the Devices & Modules catalog view, drag it to the Devices tree,
and drop it at a suitable subnode of a controller.
NOTE: Suitable subnodes are expanded and highlighted by EcoStruxure Machine Expert.
Result: The field device is added to the Devices tree below the subnode of the controller.
4 If the field device requires a communication manager, this node is added automatically to the
Devices tree.
If several communication managers are available for your field device, a dialog box is displayed
allowing you to select the suitable communication manager.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 67
Managing Devices
Step Action
1
Open the Hardware Catalog by clicking the Hardware Catalog button in the EcoStruxure
Machine Expert Logic Builder toolbar if it is not already opened.
2 Select the tab Devices & Modules in the Hardware Catalog.
3 Select the option Device Template at the bottom of the Devices & Modules tab.
Result: The device templates suitable for your EcoStruxure Machine Expert project are
displayed in the Devices & Modules tab.
4 Add them to the Devices tree as described in the Adding Devices from Template chapter
(see page 908).
Step Action
1
Open the software catalog by clicking the Software Catalog button in the EcoStruxure
Machine Expert Logic Builder toolbar if it is not already opened.
2 Select the tab Macro in the Software Catalog.
Result: The function templates available in EcoStruxure Machine Expert are displayed in the
Software Catalog.
3 Select a function template entry in the Macro view, drag it to the Devices tree, and drop it at a
suitable subnode of a controller.
NOTE: Suitable subnodes are expanded and highlighted by EcoStruxure Machine Expert.
Result: The device based on the function template is added to the Devices tree.
68 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Section 5.2
Adding Devices by Contextual Menu or Plus Button
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 69
Managing Devices
Adding a Controller
Introduction
As an alternative to dragging and dropping devices on the Devices tree, click the green plus button
that is displayed at the suitable node in the Tree. Alternatively, you can right-click a node of the
Tree to add a suitable device using the contextual menu. The Add Device dialog box opens that
allows you to determine whether the device will be appended, inserted, or plugged to the selected
node (see EcoStruxure Machine Expert, Menu Commands, Online Help).
When you add a controller to your project, several nodes are automatically added to the Devices
tree. These subnodes are controller-specific, depending on the functions the controller provides.
The following paragraph describes the general procedure of adding a controller. For details on a
specific controller, refer to the programming manual for your particular controller.
Adding a Controller
To add a device to your EcoStruxure Machine Expert project, proceed as follows:
Step Action
1 Select a project node, right-click the project node and execute the Add Device... command from the
contextual menu.
Result: The Add Device dialog box opens.
2 In the Add Device dialog box, select Schneider Electric from the list box Vendor.
3 Choose the controller you want to insert into the project.
4 Rename your device by typing a name in the text box Name.
NOTE: Choose a name that complies to the IEC standard. Do not use special characters, leading
digits, or spaces within the name. The name must not exceed a length of 32 characters. If you do
not rename the device, a name is given by default.
Naming the device meaningfully may ease the organization of your project.
5 Click the Add Device button.
Result: The selected controller is added to the project and appears as a new node in the Devices
tree. The Add Device dialog box remains open. You can do the following:
You can add another controller by going back to step 3
You can click the Close button to close the Add Device dialog box
70 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
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.
Step Action
1 Select a controller node and click the green plus button of the node or right-click the controller node and
execute the Add Device... command from the contextual menu.
Result: The Add Device dialog box opens.
2 In the Add Device dialog box, select Schneider Electric from the Vendor list.
3 Choose the expansion device you want to add to your controller from the Device list below.
4 Rename your expansion device by typing a name in the text box Name.
NOTE: The name must not contain any space character. If you do not rename the expansion device, a
name is given by default.
Naming the expansion device meaningfully may ease the organization of your project.
5 Click the Add Device button.
Result: The selected expansion device is added to the project and is displayed in the Devices Tree as a
new subnode of your controller.
The Add Device dialog box remains open. You can do the following:
You can add another expansion device by going back to step 3 of this description
You can click the Close button
NOTE: When you add a TWDNOI10M3 object (AS-Interface Master Module), the corresponding
Virtual AS interface bus fieldbus manager will automatically be inserted.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 71
Managing Devices
Overview
Communication managers are mandatory to activate and configure any hardware bus interface,
for example CANopen or serial line.
Two types of communication managers exist:
Fieldbus managers which allow to configure fieldbus devices (for example CANopen slaves or
Modbus slaves)
General communication managers
72 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Step Action
1 In the Devices Tree, select the bus interface (Serial Line, CANopen bus / CANbus, Ethernet)
and click the green plus button of the node or right-click the bus interface node and execute the
Add Device... command from the contextual menu.
Result: The Add Device dialog box opens.
2 In the Add Device dialog box, select Schneider Electric from the list Vendor.
Note: You can filter the devices by brand by clicking the list Vendor.
3 Select the Communication manager from the list.
4 Rename your device by typing a name in the Name box.
Note: Do not use spaces within the name. If you do not rename the device, a name is given by
default.
Naming the device meaningfully may ease the organization of your project.
5 Click the Add Device button.
6 Click the Close button to close the Add Device dialog box.
7 Configure the Communication manager.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 73
Managing Devices
Overview
You can add field devices to the communication manager by selecting the field device manager
node (for example, CANopen or Modbus manager) in the Devices Tree and clicking the green plus
sign. Alternatively, you can right-click the field device manager node in the Devices Tree and
execute the Add Device command.
As a prerequisite, the device must be available in the Device Repository dialog box
(see EcoStruxure Machine Expert, Menu Commands, Online Help).
Adding Devices
Step Action
1 Select the field device manager node (CANopen or Modbus manager) in the Devices Tree and
click the green plus sign, or right-click the field device manager node and execute the Add
Device... command from the contextual menu.
Result: The Add Device dialog box opens.
2 In the Add Device dialog box, select Schneider Electric from the list box Vendor.
Note: You can filter the devices by brand by clicking the list box Vendor.
3 Select the device of your choice from the list below.
4 Rename your device by typing a name in the Name textbox.
NOTE: Do not use spaces within the name. Do not use an underscore character (_) at the end
of the name.
If you do not rename the device, a name is given by default.
Naming the device meaningfully may ease the organization of your project.
5 Click the Add Device button.
Result: The field device is added to the field device manager.
NOTE: The Add Device dialog box remains open.
You can do the following:
You can add another device by going back to step 2.
You can click the Close button.
74 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
WARNING
UNINTENDED EQUIPMENT OPERATION
Use the g_aNetDiagnosis data structure within the application to monitor CAN slave
responses to configuration commands.
Verify that the application does not start up or put the machine or process in an operational
state in the event of receiving SDO abort messages from any of the CAN slaves.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
After adding the CanConfig Extern library to your application, use the Net Diagnostic definition
within your application to test for SDO abort messages from the CAN slaves.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 75
Managing Devices
The following code example illustrates the use of the CAN diagnostic data structure:
IF g_aNetDiagnosis[CAN_Net_Number].ctSDOErrorCounter = 0 THEN
(* No error is detected in the configuration*)
ELSE
(* An error has been detected during configuration. Get the latest
error information.*)
// node ID of the slave which sent the abort code
ReadLastErrorNodeID := g_aNetDiagnosis[CAN_Net_Number].usiNodeID;
// index used in the aborted SDO
ReadLastErrorIndex := g_aNetDiagnosis[CAN_Net_Number].wIndex;
// subIndex used in the aborted SDO
ReadLastErrorSubIndex := g_aNetDiagnosis[CAN_Net_Number].bySubIndex
;
//SDO abort code
ReadLastErrorSdoAbortCode := g_aNetDiagnosis [CAN_Net_Number].udiAb
ortCode;
(* Do not allow the start-
up or other operation of the machine or process *)
END_IF
NOTE: In this example, the CAN_Net_Number would be 0 for the CAN0 port and, if the controller
is so equipped, 1 for the CAN1port.
76 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Overview
It is also possible to add a new device using a device template. For a description of this procedure,
refer to the Managing Device Templates section (see page 908).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 77
Managing Devices
Section 5.3
Updating Devices
Updating Devices
Updating Devices
Introduction
The update device function allows you to replace a device selected in the Devices tree
By another version of the same device or
By a different type of device.
Updating Devices
To replace a device of your EcoStruxure Machine Expert project by another version or by a
different device, proceed as follows:
Step Action
1 Select the device you want to replace in the Devices tree and execute the command Update Device... from
the Project menu.
OR
Right-click the device you want to replace in the Devices tree and execute the command Update Device... from
the contextual menu.
Result: The Update Device dialog box opens.
OR
Right-click the device you want to replace in the Devices tree and execute the command Add Device... from
the contextual menu. In the Add Device dialog box select the Action: Update device.
Result: The Add Device dialog box is converted into the Update Device dialog box.
2 From the Device: list, choose the device that should replace the present device.
To select a specific version of the device, select the options Display all versions (for experts only) and/or
Display outdated versions.
3 Click the Update Device button.
Result: The device that had been selected in the Devices tree is replaced by the new device type or the new
version. The new device type or the new version is now displayed at the selected node in the Devices tree.
78 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Section 5.4
Converting Devices
Converting Devices
Converting Devices
Introduction
EcoStruxure Machine Expert 4.0 and later versions allow you to convert a device that is configured
in your project to a different, but compatible device. EcoStruxure Machine Expert automatically
converts the currently configured device into the selected device and displays the changes that are
made in the Messages view.
The Convert Device command may automatically add or remove modules. These hardware
changes also have influences on the addressing and the libraries.
To help to avoid unintended behavior after a device was converted:
Verify that the new device supports all functions and communication ports that are required in
your project
Avoid using direct addresses in your application
Perform a backup of the project to the PC before converting a device
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that any direct addresses used in your application (for example, %IB5) have been
converted correctly after device conversion.
Verify that the modified project contains the intended configurations and provides the intended
functionality after you have converted the device.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
NOTICE
LOSS OF DATA
Perform a backup of the project to the PC before converting a device.
Failure to follow these instructions can result in equipment damage.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 79
Managing Devices
Converting a Device
To convert a device to a compatible device, proceed as follows:
Step Action
1 Perform a backup of the project to the PC by executing the File → Save Project As... command before
converting a device.
2 Right-click the device you want to convert in the Devices Tree.
3 Execute the Convert Device command from the contextual menu.
Result: The Convert Device dialog box is displayed. It lists those devices that are compatible to the device
you selected and provides further information on the selected device.
4 Select the device from the list in which you want to convert your currently configured device.
To display the available versions of a device, select the option Display all versions (for experts only).
5 If you have not yet performed a backup of your project, click Cancel to stop without changes and perform
a backup before you start the procedure once again.
To start the conversion, click OK.
Result: The currently configured device is converted into the device you selected from the list. The
information you entered is conserved if the related modules are still available. Any modifications or
configurations that could not be converted are listed in the Messages view.
6 Check whether the converted project still contains the intended configurations and provides the intended
functions. If not, adapt the configuration or restore the backup of the unchanged project file.
To save the information displayed in the Messages view, you can copy it to the Clipboard (press
CTRL + C) and paste it to a data file (press CTRL + V).
80 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Section 5.5
Converting Projects
Converting Projects
Introduction
With EcoStruxure Machine Expert, you can convert a SoMachine Basic or TwidoSoft/TwidoSuite
project and the configured controller to a selectable EcoStruxure Machine Expert logic controller
(see page 1085). The controller and the corresponding logic are converted and integrated in the
EcoStruxure Machine Expert project.
For the conversion process, execute the File → Convert SoMachine Basic Project or the File →
Convert Twido Project command. The Convert SoMachine Basic Project dialog box or Convert
Twido Project dialog box opens. If the commands are not available, you can insert them in a menu
of your choice by using the Tools → Customize dialog box (see EcoStruxure Machine Expert,
Menu Commands, Online Help).
The SoMachine Basic versions supported by this conversion mechanism are listed in the release
notes of EcoStruxure Machine Expert. If you convert a SoMachine Basic project that was created
with a SoMachine Basic version that is newer than the latest supported version, this is indicated
by a message in the Messages view (see EcoStruxure Machine Expert, Menu Commands, Online
Help). You can then continue or cancel the conversion. If you continue, the application will be
converted, but it may not be possible to do so without encountering errors that will need to be
rectified. In this case, review and verify both the message view and your application before
attempting to put it into service.
NOTE: Verify that the SoMachine Basic or Twido project is valid before you convert it into
EcoStruxure Machine Expert.
NOTE: It is not possible to convert password-protected projects.
To help to avoid unintended behavior after a project was converted, verify that the target controller
supports the functions and communication ports that are required in your project.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 81
Managing Devices
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that the program for the target controller contains the intended configurations and
provides the intended functions after you have converted the project.
Fully debug, verify, and validate the functionality of the converted program before putting it into
service.
Before converting a program, verify that the source program is valid, i.e., is downloadable to
the source controller.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
NOTE: For more information, advice and important safety information concerning importing
projects into EcoStruxure Machine Expert, see the Compatibility and Migration User Guide
(see EcoStruxure Machine Expert Compatibility and Migration, User Guide).
82 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Step Action
1 To start the conversion process, perform one of the three actions in the EcoStruxure Machine Expert
Logic Builder (as listed in the Introduction block of this chapter (see page 81)).
Result: The Convert SoMachine Basic Project dialog box or Convert Twido Project dialog box opens:
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 83
Managing Devices
Step Action
3 Enter the path to the SoMachine Basic or Twido project file in the Project File box, or click the ... button
to browse for the file.
NOTE: If you already browsed for your SoMachine Basic or Twido project in the Open project dialog box,
the path has been entered automatically in the Project File field and cannot be edited.
4 Select the programming language in which the logic will be converted from the Implementation Language
list.
The following programming languages are supported:
Ladder diagram (LD)
Function block diagram (FBD)
Instruction list (IL)
Continuous function chart (CFC)
5 Select the target controller from the Devices list in which you want to convert your SoMachine Basic or
Twido controller. Further information on the selected device is displayed in the Information area of the
dialog box.
6 Click Convert to start the conversion.
Result: The SoMachine Basic or Twido project is converted and integrated in the open EcoStruxure
Machine Expert project. Modifications or configurations that could not be converted are listed in the
Messages view (see EcoStruxure Machine Expert, Menu Commands, Online Help).
7 Consult the category Project Conversion of the Messages view and verify the errors and alerts detected
and listed.
8 Verify whether the converted project contains the intended configurations and provides the intended
functions. If not, adapt the configuration.
TwidoEmulationSupport Library
The TwidoEmulationSupport library (see EcoStruxure Machine Expert, Twido Emulation Support
Library, Library Guide) contains functions and function blocks that provide SoMachine Basic and
TwidoSoft/TwidoSuite functionality in a EcoStruxure Machine Expert application. The TwidoEmu-
lationSupport library is automatically integrated in the EcoStruxure Machine Expert project with the
converted controller.
84 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
In EcoStruxure Machine Expert, there is only the memory word area for memory objects:
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 85
Managing Devices
The graphic provides an overview of the different layouts of %MD and %MF addresses in SoMachine
Basic / Twido and EcoStruxure Machine Expert.
86 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
The relationship between %KW, %KD, and %KF objects is the same as for %MW, %MD, and %MF objects.
For example, %KD4 / %KF4 are mapped on the same location as %KW4. Uneven %KD / %KF
addresses cannot be mapped.
Remote Access
Memory objects (%MW, %MD, %MF, and %M) can be accessed by a remote device through Modbus
services:
If a remote device accesses %MW, %MD or %MF objects in the source application, this access will
still be available in the EcoStruxure Machine Expert application.
If a remote device accesses %M objects in the source application, this access will no longer be
available in the EcoStruxure Machine Expert application.
Handling Rising and Falling Edges
A rising/falling edge contact is converted as follows:
1. An additional global variable with the suffix _Rise/_Fall is created (for example, M1_Rise
for a rising edge contact for %M1).
2. This variable is set via an R_TRIG/F_TRIG instance in the SystemFunctions program.
Edge detection is performed at the beginning of the controller cycle.
A FALLING/RISING instruction is directly converted into an R_TRIG/F_TRIG instance.
Edge detection is performed at the same place of the execution sequence as in the original
application.
Counters %C FB_Counter
PID FB_PID
Exchange / message %MSG FB_EXCH
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 87
Managing Devices
88 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 89
Managing Devices
Other system variables are not supported by the conversion. If an unsupported system variable is
used by the source application program, a message is generated in the category Project
Conversion of the Messages view (see EcoStruxure Machine Expert, Menu Commands, Online
Help).
90 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Conversion of Symbols
Symbols defined in a SoMachine Basic / Twido project are automatically transferred into the
EcoStruxure Machine Expert project.
The following restrictions apply to the naming of symbols:
For the complete list of symbol modifications that were required, refer to the Messages view.
Conversion of Fast Counters, High-Speed Counters (Twido: Very Fast Counters) and Pulse Generators
The function blocks provided by EcoStruxure Machine Expert differ from the function blocks
provided by SoMachine Basic / Twido. Nevertheless, the configuration of fast counters, high-speed
counters, and pulse generators is converted as far as possible. The following sections provide an
overview of the restrictions that apply.
General Restrictions
The following general restrictions apply:
Restriction Solution
The inputs and outputs used by the converted high- Take this into account in the wiring of the converted
speed counters and pulse generators may differ from controller.
the used inputs and outputs of the source application. The reassignment of inputs and outputs is reported in
the Messages view (see EcoStruxure Machine
Expert, Menu Commands, Online Help).
The SoMachine Basic controller may support a You have to adapt your application manually.
different number of counters and pulse generators
than the selected target controller. The conversion
function only converts the counters and pulse
generators that are supported by the target controller.
Constraints Pertaining to the Conversion of %FC, %HSC / %VFC, %PLS, and %PWM
For each %FC, %HSC / %VFC, %PLS, and %PWM function block being used in the SoMachine Basic /
Twido application, a single program is created in EcoStruxure Machine Expert. You can improve
this basic implementation according to the needs of your application.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 91
Managing Devices
Restriction Solution
The access to function block parameters is performed If the source application accesses parameters of the
differently in SoMachine Basic and EcoStruxure function block, you have to extend the converted
Machine Expert. application accordingly.
In SoMachine Basic, the parameters of a function
block can be accessed directly by the application
program, for example, %HSC.P = 100.
In EcoStruxure Machine Expert, a controller-specific
function block (for example, EXPERTSetParam) has
to be used to access a parameter.
The behavior of counters differs in EcoStruxure You have to adapt your application manually.
Machine Expert from SoMachine Basic / Twido when
the preset value is set.
In Twido:
The down counter continues counting if zero is
reached.
The up counter continues counting if the preset
value is reached.
In EcoStruxure Machine Expert:
The down counter stops counting if zero is
reached.
The up counter starts to count from the beginning
if the preset value is reached.
The following parameters of SoMachine Basic You have to adapt your application manually.
function blocks cannot be converted to EcoStruxure
Machine Expert:
Function block %PLS:
Output parameter D [Done]
Parameter R [Duty Cycle]
92 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Constraints Pertaining to the Conversion of PTO Function Blocks %PTO and %MC_xxxx
For M241:
The PTO function blocks provided by EcoStruxure Machine Expert for M241 controllers are
compatible with the PTO function blocks provided by SoMachine Basic. PTO function blocks are
converted without restrictions. The only exception is the MC_MotionTask_PTO function block.
The MC_MotionTask_PTO is not converted.
For HMISCU:
The PTO function blocks provided by EcoStruxure Machine Expert for HMISCU controllers are not
compatible with the PTO function blocks provided by SoMachine Basic. PTO function blocks are
not converted.
Constraints Pertaining to the Conversion of Frequency Generator Function Block %FREQGEN
The frequency generator function block %FREQGEN is converted without restrictions for both M241
and HMISCU controllers.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 93
Managing Devices
94 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
A graphical Grafcet POU can be initialized by setting the system bit %S21. If this bit is set in the
SoMachine Basic project, the converter activates the implicit variable SFCInit and uses it to
initialize the SFC program.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 95
Managing Devices
Source TM2 expansion module Target TM3 expansion module Further information
TM2DDI8DT TM3DI8 –
TM2DAI8DT TM3DI8A –
TM2DDO8UT TM3DQ8U –
TM2DDO8TT TM3DQ8T –
TM2DRA8RT TM3DQ8R –
TM2DDI16DT TM3DI16 –
TM2DDI16DK TM3DI16K –
TM2DRA16RT TM3DQ16R –
TM2DDO16UK TM3DQ16UK –
TM2DDO16TK TM3DQ16TK –
TM2DDI32DK TM3DI32K –
TM2DDO32UK TM3DQ32UK –
TM2DDO32TK TM3DQ32TK –
TM2DMM8DRT TM3DM8R –
TM2DMM24DRF TM3DM24R –
TM2AMI2HT TM3AI2H –
TM2AMI4LT TM3TI4 It is possible that the behavior of the converted
temperature module differs from the original
module. Carefully verify the converted module.
TM2AMI8HT TM3AI8 –
TM2ARI8HT – The TM2 modules TM2ARI8HT, TM2ARI8LRJ,
and TM2ARI8LT are not converted because there
is no corresponding TM3 expansion module. You
can replace this module by two TM3TI4 modules.
TM2AMO1HT TM3AQ2 The target TM3 expansion module has more
I/O channels than the source TM2 module.
TM2AVO2HT –
TM2AMM3HT TM3TM3 –
TM2ALM3LT It is possible that the behavior of the converted
temperature module differs from the original
module. Carefully verify the converted module.
96 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
Source TM2 expansion module Target TM3 expansion module Further information
TM2AMI2LT TM3TI4 The target TM3 expansion module has more
I/O channels than the source TM2 module.
It is possible that the behavior of the converted
temperature module differs from the original
module. Carefully verify the converted module.
TM2AMM6HT TM3AM6 –
TM2ARI8LRJ – The TM2 modules TM2ARI8HT, TM2ARI8LRJ,
and TM2ARI8LT are not converted because there
is no corresponding TM3 expansion module. You
can replace this module by two TM3TI4 modules.
TM2ARI8LT – The TM2 modules TM2ARI8HT, TM2ARI8LRJ,
and TM2ARI8LT are not converted because there
is no corresponding TM3 expansion module. You
can replace this module by two TM3TI4 modules.
NOTE: If you are using TM2 as well as TM3 expansion modules in your EcoStruxure Machine
Expert project, note their position in the tree structure: If TM3 nodes are located below TM2 nodes
in the tree structure, this is reported as a detected Build error in the Messages view.
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that the program for the target controller contains the intended configurations and
provides the intended functions after you have converted the project.
Fully debug, verify, and validate the functionality of the converted program before putting it into
service.
Before converting a program, verify that the source program is valid, i.e., is downloadable to
the source controller.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 97
Managing Devices
Configuration
The IOScanner configuration is completely converted:
The devices are converted to the Generic Modbus Slave device. The source device type is not
preserved.
The device configuration is completely converted. This includes initialization requests, channel
settings, and reset variable.
Function Blocks
The drive function blocks for the control of Altivar drives over the Modbus IOScanner
(MC_xxx_ATV) are not converted.
Status Handling
Since the IOScanner status handling differs for SoMachine Basic and EcoStruxure Machine
Expert, these features can only be partly converted. If your application uses IOScanner status
information, verify that this logic still works.
98 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Devices
If you use these communication features in your Twido application, you have to adapt the
EcoStruxure Machine Expert application manually.
During conversion, one variable is created for each related I/O object in order to allow the
EcoStruxure Machine Expert application to be built successfully. These variables are collected in
separate global variable lists. This helps you in identifying the variables to be replaced.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 99
Managing Devices
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that the program for the target controller contains the intended configurations and
provides the intended functions after you have converted the project.
Fully debug, verify, and validate the functionality of the converted program before putting it into
service.
Before converting a program, verify that the source program is valid, i.e., is downloadable to
the source controller.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
A warning message indicates that the conversion process made some adjustments that, in all
likelihood, do not have impact on the functions of your application.
An error message indicates that some parts of the application could not be fully converted. In
this case, you have to adapt the application manually in order to preserve the same functionality
in the target application.
If the application program makes use of functionality that cannot be completely converted, the
converter creates variables for the unsupported language objects. This allows you to compile
your application successfully. However, verify this unsupported functionality after the
conversion.
To save the information displayed in the Messages view, you can copy it to the Clipboard (press
CTRL + C) and paste it to a data file (press CTRL + V).
100 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Common Device Editor Dialogs
EIO0000002854 06/2019
Chapter 6
Common Device Editor Dialogs
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 101
Common Device Editor Dialogs
Section 6.1
Device Configuration
Device Configuration
102 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Overview
The device editor provides parameters for the configuration of a device, which is managed in the
Devices tree.
To open the device editor for a specific device, do the following:
Double-click the node of the device in the Devices tree or
Select device in the Devices tree and execute the Edit Object command via the contextual menu
or via the Project menu.
The Tools → Options → Device editor dialog box allows you to make the generic device
configuration views invisible (see page 132).
This chapter describes the main device editor dialogs. Bus-specific configuration dialogs are
described separately.
Tab Description
Communication Settings in Controller Configuration of the connection between programming system and
selection mode (see page 105) a programmable device (controller). The tab that is displayed
Communication Settings in Simple depends on the mode selected with the parameter Communication
page in the Tools → Options → Device editor dialog box
mode (see page 125)
(see EcoStruxure Machine Expert, Menu Commands, Online Help).
Communication Settings in Classic
mode (see page 128)
Configuration (see page 132) Display or configuration of the device parameters.
Parameter (see page 133) Display or configuration of the device parameters of PacDrive
controllers.
Applications (see page 134) List of applications running on the controller. Refer to the description
in the Program chapter (see page 167).
Synchronized Files (see page 136) List of files that are downloaded to the controller with an application
download.
Files (see page 137) Configuration of a file transfer between host and controller.
Log (see page 139) Display of the controller log file.
PLC settings (see page 141) Configuration of:
Application noticed for I/O handling
I/O behavior in stop status
Bus cycle options
Users and Groups (see page 143) User management concerning device access during runtime.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 103
Common Device Editor Dialogs
Tab Description
Access Rights (see page 148) Configuration of the access rights on runtime objects and files for
the particular user groups.
Task Deployment (see page 152) Display of inputs and outputs assigned to the defined task - used for
troubleshooting.
Status (see page 153) Device-specific status and diagnostic messages.
Information (see page 154) General information on the device (for example: name, provider,
version).
I/O Mapping (see page 155) Mapping of the input and output channels of an I/O device on project
(application) variables.
OPC UA server configuration Provides various functionalities to edit the server configuration file
ServerConfig.ini on the Compact Flash (CF) card of the
controller.
The OPC UA server configuration allows you to perform the
following actions:
Define default properties for new server certificates.
View and delete existing server certificates.
View and add sampling rates.
Import and export server certificates.
Enable and manage various settings.
104 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Overview
The Communication Settings tab in controller selection mode is displayed when the mode
Controller selection mode has been selected for the parameter Communication page in the Tools
→ Options → Device editor dialog box (see EcoStruxure Machine Expert, Menu Commands,
Online Help). The tab provides access to the Network Device Identification service that allows you
to scan the Ethernet network for available controllers and to display them in a list. You can
configure the parameters for the communication between the devices (referred to as controllers in
this chapter) and the programming system.
The list of controllers contains those controllers in the network that have sent a response to the
request of EcoStruxure Machine Expert. It may happen that the controller of your choice is not
included in this list. This can have several causes. For causes and suitable solutions, refer to the
chapter Accessing Controllers - Troubleshooting and FAQ (see page 949).
Communication Settings tab in controller selection mode
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 105
Common Device Editor Dialogs
Button Description
Optical Click this button to cause the selected controller to indicate an optical
signal: It flashes a control LED quickly. This can help you to identify the
respective controller if many controllers are used.
The function stops on a second click or automatically after about
30 seconds.
NOTE: The optical signal is issued only by controllers that support this
function.
Optical and acoustical Click this button to cause the selected controller to indicate an optical and
an acoustical signal: It starts to beep and flashes a control LED quickly.
This can help you to identify the respective controller if many controllers
are used.
The function stops on a second click or automatically after about
30 seconds.
NOTE: The optical and acoustical signals are issued only by controllers
that support this function.
Update Click this button to refresh the list of controllers. A request is sent to the
controllers in the network. Controllers that respond to the request are
listed with the present values.
Pre-existing entries of controllers are updated with every new request.
Controllers that are already in the list but do not respond to a new request
are not deleted. They are marked as inactive by a red cross being added
to the controller icon.
The Update button corresponds to the Refresh list command that is
provided in the contextual menu if you right-click a controller in the list.
To refresh the information of a selected controller, the contextual menu
provides the command Refresh this controller. This command requests
more detailed information from the selected controller.
NOTE: The Refresh this controller command can also refresh the
information of other controllers.
Remove inactive controllers from Controllers that do not respond to a network scan are marked as inactive
list. in the list. This is indicated by a red cross being added to the controller
icon. Click this button to remove the controllers that are marked as
inactive controllers from the list.
NOTE: A controller can be marked as inactive even if this is not the case.
The contextual menu that opens if you right-click a controller in the list
provides two other commands for removing controllers:
The Remove selected controller from list command allows you to
remove only the selected controller from the list.
The Remove all controllers from list command allows you to remove
all controllers simultaneously from the list.
106 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Button Description
New Favorite... and Favorite 0 You can use Favorites to adjust the selection of controllers to your
personal requirements. This can help you keep track of many controllers
in the network.
A Favorite describes a collection of controllers that are recognized by a
unique identifier.
Click a favorite button (such as Favorite 0) to select or deselect it. If you
have not selected a favorite, all detected controllers are visible.
You can also access Favorites via the contextual menu. It opens upon
right-clicking a controller in the list.
Move the cursor over a favorite button in the toolbar to view the
associated controllers as a tooltip.
List of Controllers
The list of controllers in the middle of the Communication Settings tab of the device editor lists
those controllers that have sent a response to the network scan. It provides information on each
controller in several columns. You can adapt the columns displayed in the list of controllers
according to your individual requirements.
To achieve this, right-click the header of a column to open the Process columns dialog box.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 107
Common Device Editor Dialogs
You can create your own layout of this table. Click New, and enter a name for your layout. Shift
columns from the list of Possible columns to the list of Current columns and vice versa by clicking
the horizontal arrow buttons. To change the order of the columns in the Current columns list, click
the arrow up and arrow down buttons.
Step Action
1 Select the controller in the list of controllers.
2 Right-click the controller entry and execute the command Edit communication settings... from
the contextual menu.
Result: The Edit communication settings dialog box opens with the settings of the controller.
NOTE: Most controllers provide a parameter (such as RemoteAccess) that helps prevent
changing communication parameters of the controller.
108 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Step Action
3 Configure the communication parameters:
Boot Mode
FIXED: A fixed IP address is used according to the values entered below (IP address,
Subnet mask, Gateway).
BOOTP: The IP address is received dynamically by BOOTP (bootstrap protocol). The
values below will be ignored.
DHCP: The IP address is received dynamically by DHCP (dynamic host configuration
protocol). The values below will be ignored.
NOTE: Not all devices support BOOTP and/or DHCP.
IP address
When configuring IP addresses, refer to the hazard message below.
This box contains the IP address of the controller. It is a unique address that consists of
four numbers in the range of 0...255 separated by periods. The IP address has to be unique
in this (sub)network.
Subnet mask
The subnet mask specifies the network segment to which the controller belongs. It is an
address that consists of four numbers in the range of 0...255 separated by periods.
Generally, only the values 0 and 255 are used for standard subnet mask numbers.
However, other numeric values are possible. The value of the subnet mask is generally the
same for all controllers in the network.
Gateway
The gateway address is the address of a local IP router that is located on the same network
as the controller. The IP router passes the data to destinations outside of the local network.
It is an address that consists of four numbers in the range of 0...255 separated by periods.
The value of the gateway is generally the same for all controllers in the network.
To save the communication settings in the controller even if it is restarted, activate the
option Save settings permanently.
4 Click OK to transfer the settings to the controller.
Carefully manage the IP addresses because each device on the network requires a unique
address. Having multiple devices with the same IP address can cause unintended operation of
your network and associated equipment.
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that all devices have unique addresses.
Obtain your IP address from your system administrator.
Confirm that the device’s IP address is unique before placing the system into service.
Do not assign the same IP address to any other equipment on the network.
Update the IP address after cloning any application that includes Ethernet communications to
a unique address.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 109
Common Device Editor Dialogs
Managing Favorites
To manage favorites in the list of controllers, proceed as follows:
Step Action
1 Select the controller in the list of controllers.
2 Right-click the controller and select one of the commands:
New Favorite to create a new group of favorites.
Favorite n in order to
Add the selected controller to this list of favorites
Remove the selected controller from this list of favorites
Remove all controllers from this list of favorites
Select a favorite
Rename a favorite
Remove a favorite
Consult the Programming Guide specific to your controller for information on the support of TLS.
The following scenarios are possible when you attempt to log into a controller using encrypted
communication:
110 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
WARNING
UNINTENDED EQUIPMENT OPERATION
Ensure that all devices have unique nodenames.
Confirm that the device’s nodename is unique before placing the system into service.
Do not assign the same nodename to any other equipment on the network.
Update the nodename after cloning any application that includes Ethernet communications to
a unique nodename.
Create a unique nodename for each device that does not create it automatically, such as M241
and M251 controllers.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Depending on the type of controller, the automatic creation of the NodeName (device name) may
differ in procedure. To create a unique name, some controllers integrate their IP address, others
use the MAC address of the Ethernet adapter. In this case, you do not have to change the name.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 111
Common Device Editor Dialogs
Step Action
1 Right-click the controller in the list and execute the command Change device name... from the
contextual menu.
Result: The Change device name dialog box opens.
2 In the Change device name dialog box, enter a unique device name in the box New.
3 Click the OK button to confirm.
Result: The device name you entered is assigned to the controller and is displayed in the
column NodeName of the list.
NOTE: Device name and NodeName are synonymous.
112 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Example:
Connection Mode → Nodename via NAT (Remote TCP) selected and address and nodename
specified
If you switch to Connection Mode → Automatic, the information is converted to a URL, starting with
the prefix enodename3://
If an IP address has been entered for the connection mode, the information is converted to a URL
starting with a prefix. For the Connection Mode → IP Address , the prefix etcp3:// is used. For
the Connection Mode → IP Address (Fast TCP) , the prefix etcp4:// is used. For example,
etcp4://<IpAddress>.
NOTE: In the Controller Assistant and the Diagnostics tools, an IP address can additionally have
the prefix etcp2://. This is only available for PacDrive M controllers.
If a nodename has been entered for the connection mode (for example, when Connection Mode
→ Nodename has been selected), the information is converted to a URL starting with the prefix
enodename3://. For example, enodename3://<Nodename>.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 113
Common Device Editor Dialogs
1 PC
2 NAT router
3 Target device
114 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Enter the port of the NAT router to be used. Otherwise, the default port 1105 is used.
The information you enter is interpreted as a URL that creates a remote TCP bridge - using
TCP block driver - and then connects by scanning for a controller with the given nodename on the
local gateway.
NOTE: The NAT router can be located on the target controller itself. You can use it to create a
TCP bridge to a controller.
You can also scan a remote network via a remote controller (bridge controller). To achieve this,
enter the NAT Address/Port, and click the refresh button right to the NAT Address/Port text field.
The controllers that send a response to the remote network scan are listed in the list of controllers.
Each of these entries is marked by the icon REM being displayed in the first column. To fill the list
with more detailed information, right-click a controller entry and execute the command Refresh this
controller. If the controller supports this function, further information on the controller is added to
the list. Consult the Programming Guide specific to your controller.
1 Refresh button
2 REM icon
In the following example, the bridge controller, controller 2, and controller 3 are scanned.
1 Local subnet
2 Remote subnet
3 Bridge controller
4 Controller 3
5 Controller 2
6 NAT router
7 PC
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 115
Common Device Editor Dialogs
1 PC
2 NAT router
3 Target device
116 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
1 Refresh button
2 REM icon
In the following example, the bridge controller, controller 2, and controller 3 are scanned.
1 Local subnet
2 Remote subnet
3 Bridge controller
4 Controller 3
5 Controller 2
6 NAT router
7 PC
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 117
Common Device Editor Dialogs
1 PC / HMI
2 PC / HMI / devices with installed EcoStruxure Machine Expert gateway
3 Target device
118 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
The graphic shows an example that allows a connection from the PC to the target controller 3 (item
4 in the graphic) by using the address of hop PC2 (item 5 in the graphic) that must have a
EcoStruxure Machine Expert gateway installed.
1 Hop PC 1
2 Target controller 1: MyNotUniqueNodename
3 Target controller 2: MyNotUniqueNodename
4 Target controller 3: MyNotUniqueNodename
5 Hop PC 2
6 PC / HMI
7 Router
8 Ethernet
To verify whether the connection to a specific controller can be established, enter the Gateway
Address/Port, and click the Test button. If the controller sends a response to the network scan, an
entry for this controller is added to the list of controllers. This entry is marked by the icon GAT being
displayed in the first column.
To scan a specific gateway for available controllers, enter the Gateway Address/Port, and click the
refresh button right to the Gateway Address/Port text field. The controllers that send a response to
the gateway scan are listed in the list of controllers. Each of these entries is marked by the icon
GAT being displayed in the first column. To fill the list with more detailed information, right-click a
controller entry and execute the command Refresh this controller. If the controller supports this
function, further information on the controller is added to the list. Consult the Programming Guide
specific to your controller.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 119
Common Device Editor Dialogs
1 Refresh button
2 GAT icon
The gateway that is scanned can be located on a PC or on an HMI that can reside in the local or
in a remote subnet. In the following example, the bridge target controller 1 and target controller 2
are scanned.
1 Local subnet
2 Remote subnet
3 Target controller 1
4 Target controller 2
5 Gateway
6 PC
7 Ethernet
120 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
1 PC / HMI
2 PC / HMI / devices with installed EcoStruxure Machine Expert gateway
3 Target device
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 121
Common Device Editor Dialogs
The graphic shows an example that allows a connection from hop PC2 (item 5 in the graphic) that
must have a EcoStruxure Machine Expert gateway installed to the target controller 3 (item 4 in the
graphic).
1 Hop PC 1
2 Target controller 1: 10.128.156.20
3 Target controller 2: 10.128.156.20
4 Target controller 3: 10.128.156.20
5 Hop PC 2
6 PC
7 Router
8 Ethernet
To verify whether the connection to a specific controller can be established, enter the Gateway
Address/Port, and click the Test button. If the controller sends a response to the network scan, an
entry for this controller is added to the list of controllers. This entry is marked by the icon GAT being
displayed in the first column.
To scan a specific gateway for available controllers, enter the Gateway Address/Port, and click the
refresh button right to the Gateway Address/Port text field. The controllers that send a response to
the gateway scan are listed in the list of controllers. Each of these entries is marked by the icon
GAT being displayed in the first column. To fill the list with more detailed information, right-click a
controller entry and execute the command Refresh this controller. If the controller supports this
function, further information on the controller is added to the list. Consult the Programming Guide
specific to your controller.
122 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
1 Refresh button
2 GAT icon
The gateway that is scanned can be located on a PC or on an HMI that can reside in the local or
in a remote subnet. In the following example, the bridge target controller 1 and target controller 2
are scanned.
1 Local subnet
2 Remote subnet
3 Target controller 1
4 Target controller 2
5 Gateway
6 PC
7 Ethernet
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 123
Common Device Editor Dialogs
1 PC
2 PC / MODEM
3 Target modem
4 Target device
5 Phone line
To establish a connection to the modem, click the MODEM → Connect button. In the Modem
Configuration dialog box, enter the Phone number of the target modem and configure the
communication settings. Click OK to confirm and to establish a connection to the modem.
If the EcoStruxure Machine Expert gateway is stopped and restarted, any connection of the local
gateway is terminated. EcoStruxure Machine Expert displays a message that has to be confirmed
before the restart process is started.
After the connection to the modem has been established successfully, the MODEM button
changes from Connect to Disconnect. The list of controllers is cleared and refreshed scanning the
modem connection for connected controllers. You can double-click an item from the list of
controllers or enter a nodename in the Target Nodename: box to connect to a specific controller.
Click the MODEM → Disconnect button to terminate the modem connection and to stop and restart
the EcoStruxure Machine Expert gateway. The list of controllers is cleared and refreshed scanning
the Ethernet network.
124 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Overview
The Communication Settings tab in simple mode is displayed when the mode Simple mode has
been selected for the parameter Communication page in the Tools → Options → Device editor
dialog box (see EcoStruxure Machine Expert, Menu Commands, Online Help). It provides a
graphic view to configure the parameters for the communication between device and programming
system.
The Communication Settings tab in simple mode contains an illustration of the programming
device, the present gateway, and the target device with the connection status.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 125
Common Device Editor Dialogs
Select a gateway and a target device in the selection fields. The list entries you can select are
determined by the Manage gateways and Manage favorite devices parameters.
You can enter the target device in different ways:
By the IP address, for example 192.168.101.109
By the device address, for example [056D]
By the device name, for example MyDevice
NOTE: To search for a device via the device name, unique device names are required within the
network.
A status bullet at the right bottom of the gateway symbol indicates the communication status:
Color Description
Red Connection cannot be established.
Green Connection is established.
Black Connection state is not defined.
NOTE: Some communication protocols do not allow a periodic verification of the gateway. Thus,
the status cannot be displayed.
Click the status bullet of the target device to start a network scan for the device. However, this is
only possible if the gateway has not already started searching.
Element Description
Scan network... button Opens the Select Device dialog box that lists the
configured gateways and their associated devices.
Gateway list –
Add new gateway... Opens the Gateway dialog box for adding a new
gateway (see EcoStruxure Machine Expert, Menu
Commands, Online Help).
Manage gateways... Opens the Manage gateways dialog box showing an
overview of all gateways. In this dialog box, you can
add or remove gateways. You can change the order
of the gateway entries by using the buttons.
Configure local Opens the Gateway Configuration dialog box
gateway... (see EcoStruxure Machine Expert, Menu
Commands, Online Help). It enables you to set up the
block driver configuration for the local gateway.
Device list –
Add current device to Adds the defined device to the list of favorite devices.
favorites
126 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Element Description
Manage favorite Opens a dialog box showing the list of favorite
devices... devices. In this dialog box, you can add or remove
devices or change the order of the entries. The
device at top of the list defines the default device.
Rename active device... Opens a dialog box for renaming the device.
Wink active device The connected controller flashes during login.
Send echo service EcoStruxure Machine Expert implements the echo
service that is similar to the ping tool.
In order to verify the quality of the network
connection, EcoStruxure Machine Expert sends five
echo data packets to the controller. The amount of
user data that is consecutively added to these
packets depends on the communication buffer size of
the controller.
A result message is displayed that indicates the
average round-trip delay time and the amount of user
data that has been echoed through the connection.
Store communication If this option is activated, EcoStruxure Machine
settings in project Expert can automatically restore the communication
settings, even if you are going to open the project on
another computer. If this option is not selected, the
settings are stored in the local EcoStruxure Machine
Expert options on your computer. In this case, you
must reconfigure them if you are going to use the
project on another computer.
Confirmed online mode If this option is activated, EcoStruxure Machine
Expert prompts the user for confirmation each time
one of the following online commands is to be
executed: Force values, Write values, Multiple
download, Release force list, Single cycle, Start,
Stop.
Filter network scans by If this option is activated, the list is reduced to those
target ID devices which have the same target ID as the device
configured in the project.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 127
Common Device Editor Dialogs
Overview
The Communication Settings tab in classic mode is displayed when the mode Classic mode has
been selected for the parameter Communication page in the Tools → Options → Device editor
dialog box (see EcoStruxure Machine Expert, Menu Commands, Online Help). It allows you to
configure the parameters for the communication between device and programming system.
The Communication Settings tab in classic mode provides a tree structure to configure the
parameters:
128 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Color Description
Red Connection cannot be established.
Green Connection is established.
Black Connection state is undefined.
NOTE: Some communication protocols do not allow a periodic verification of the gateway. Thus,
the status cannot be displayed.
Indented below the Gateway node (open/close via the +/- sign), you will see entries for the devices
which are reachable through this gateway. The device entries are preceded by a symbol.
Entries with a target ID different to that of the device configured in the project, are displayed in gray
font. To obtain an up-to-date list of the available devices, use the button Scan network.
The device nodes consist of a symbol followed by the node name and the node address. In the
right part of the window, the respective Device Name, Device Address, Number of Channels,
Target ID, Target Name, Target Type, Target Vendor, and Target Version are shown.
In the Select the network path to the controller field, the gateway channel is specified automatically
by selecting the channel in the tree structure.
NOTE: The parameter Number of Channels displays the number of channels that is supported by
the selected controller. You cannot monitor online the number of channels that are being used.
A channel is a connection to a client (such as Diagnostics, Logic Builder, WebVisu, OPC, HMI).
Depending on the communication service, a client may occupy more than one channel for a short
time. When all channels supported by the controller are being used, Logic Builder displays the
message Connection denied by device: All available communication channels are already in use.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 129
Common Device Editor Dialogs
130 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Option Description
Don't store communication Activate this option if the network path definition should not be stored in the
settings in project project, but in the local option settings on your computer. Therefore, the
path setting is restored if the project is reopened on the same computer. It
will have to be redefined if the project is used on another system.
Confirmed online mode Activate this option if the user should be prompted for confirmation when
selecting one of the following online commands: Force values, Multiple
download, Release force list, Single cycle, Start, Stop, Write values.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 131
Common Device Editor Dialogs
Configuration
Overview
The Configuration view is only available in the device editor if the option Show generic device
configuration views in the Tools → Options → Device editor dialog box is activated. The
Configuration view shows the device-specific parameters, and, if allowed by the device description,
provides the possibility to edit the parameter values.
Configuration view of the device editor
Element Description
Parameter Parameter name, not editable
Type Data type of parameter, not editable
Value Primarily, the default value of the parameter is displayed directly or
by a symbolic name. If the parameter can be modified (this depends
on the device description, non-editable parameters are displayed as
gray-colored), click the table cell to open an edit frame or a selection
list to change the value. If the value is a file specification, the dialog
box for opening a file opens by double-clicking the cell. It allows you
to select another file.
Default Value Default parameter value, not editable
Unit Unit of the parameter value (for example: ms for milliseconds), not
editable
Description Short description of the parameter, not editable
132 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Parameter
Overview
The Parameter view displays the controller-specific parameters in a table. You can edit the Value
of those parameters that are defined as editable in the device description. This function is not
available for all supported controllers. Consult the Programming Guide specific to your controller
for further information.
The view contains the following elements:
Element Description
Parameters Indicates the parameter name, not editable.
Type Indicates the data type of the parameter, not editable.
Value The default value of the parameter is displayed directly or by a
symbolic name.
If the value can be modified, double-click the field to open an edit
frame, a selection list, or a file selection dialog box.
Parameters that are not defined as editable in the device description
are displayed as gray-colored in this list.
Default Value Indicates the default parameter value as defined in the device
description, not editable
Unit Indicates the unit of the parameter value (for example: ms for
milliseconds), not editable.
Description Indicates the short description of the parameter as defined in the
device description, not editable.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 133
Common Device Editor Dialogs
Applications
Overview
The Applications view of the device editor serves to scan and to remove applications on the
controller. Information on the content of the application can be available as well as some details on
the application properties.
Element Description
Applications on the PLC This text box lists the names of applications which have been found
on the controller during the last scan (by clicking Refresh List).
If no scan has been executed yet or if a scan is not possible because
no gateway is configured (see page 125) for a connection, an
appropriate message is displayed.
Remove Click these buttons to remove the application currently selected in
Remove All the list or all applications from the controller.
Details Click this button to open a dialog box showing the information as
defined in the Information tab of the Properties dialog box of the
application object.
Content If, in the View → Properties → Application build options, the option
Download Application Info is activated for the application object
(see EcoStruxure Machine Expert, Menu Commands, Online Help),
then additional information on the content of the application is loaded
to the controller.
Click the Content button to view the different POUs, in a comparison
view. Upon several downloads, this information allows you to
compare the code of the new application with that already available
on the controller. This provides more information for decisions on
how to log in. For further information, refer to the description of the
Login command.
Refresh List Click this button to scan the controller for applications. The list will be
updated accordingly.
134 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 135
Common Device Editor Dialogs
Synchronized Files
Overview
The Synchronized Files view of the device editor lists the files that are downloaded to the controller
when the application is downloaded:
External files, for example, that were added to an application.
Implicit files, such as the source code archive file, are displayed only in this view if the time of
download is configured and the option Show implicit files for application download on the editor
of a PLC is selected in the Tools → Options → Device Editor dialog box (see EcoStruxure
Machine Expert, Menu Commands, Online Help).
This function is not available for all supported controllers. Consult the Programming Guide specific
to your controller for details on this function.
136 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Files
Overview
The Files view of the device editor serves to transfer files between the host and the controller. You
can choose any file from a directory of the local network to copy it to the file directory of the
currently connected runtime system, or vice versa.
This view is divided in two parts:
The left part shows the files on the Host.
The right part shows the files on the Runtime system.
Element Description
Updates the Runtime list.
Location Specifies the folder of the respective file system that will be used for
the file transfer.
Select an entry from the list or browse in the file system tree.
<< >> File transfer between EcoStruxure Machine Expert and controller
(see paragraph below).
For the directories in the file trees there are the following variants:
Element Description
Normal file directory.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 137
Common Device Editor Dialogs
138 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Log
Overview
The Log view of the device editor is used to display the events which have been logged on the
runtime system of the controller.
This concerns:
Events at system start or shutdown (loaded components and their versions)
Application download and boot project download
Customer-specific entries
Log entries of I/O drivers
Log entries of the data server
Element Description
Severity The events of the log are grouped in four categories:
warning
error
exception
information
The buttons in the bar above the listing display the number
of loggings in the respective category. Click the buttons to
switch on or off the display of the entries of each category.
Time Stamp Date and time:
Example: 13.01.2007 09:48.
Description Description of the event:
Example: <Application> started
Component Choose a particular component in order to obtain only
displayed log entries regarding this component. The default
setting is <All components>.
Logger The selection list provides the available loggings. The default
setting is <Default Logger>, which is defined by the runtime
system.
Updates the list.
Exports the list to an XML file. The dialog box for saving a file
opens. The file filter is set to xml-files (*.xml). The log file is
stored with the specified file name with extension .XML in the
chosen directory.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 139
Common Device Editor Dialogs
Element Description
Displays log entries stored in an XML file which may have
been exported as described above. The dialog box for
browsing for a file opens. The filter is set to xml-files (*.xml).
Choose the desired log file. The entries of this file are
displayed in a separate window.
Clears the log table by removing the displayed entries.
Troubleshooting
In case an error is detected and displays the text *SOURCEPOSITION*, you can open the
respective function by double-click or by executing the command Show source code in editor from
the contextual menu. The cursor marks the relevant position. You can also use the project archive
including the Download information files and the exported log file for diagnostics. In case of
protected functions, the message The source code is not available for <function name> is
displayed.
140 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
PLC Settings
Overview
The PLC settings view of the device editor is used to configure general settings for the controller.
Element Description
Application for I/O handling Define here the application assigned to the device in the Devices
tree that will be monitored for the I/O handling. For EcoStruxure
Machine Expert, there is only one application available.
PLC settings area
Update IO while in stop Note for PacDrive controllers: Supported by TM5 / TM7 IOs but not
by controls or drive based IOs.
If this option is activated (default), the values of the input and output
channels are updated when the controller is stopped. In case of
expiration of the watchdog, the outputs are set to the defined default
values.
Behaviour for outputs in Stop From the selection list, choose one of the following options to define
how the values at the output channels are handled in case of
controller stop:
Keep current values
The present values will not be modified.
Set all outputs to default
The default values resulting from the mapping will be assigned.
Execute program
You can determine the outputs behavior by a program available
within the project. Enter the name of this program here and it will
be executed when the controller gets stopped. Click the button ...
to use the Input Assistant for this purpose.
Always update variables Global definition, if the I/O variables are updated in the bus cycle
task. This setting takes effect for the I/O variables of the slaves and
modules only if their update setting is defined as Disabled.
Disabled (update only if used in a task): The I/O variables are
only updated if they are used in a task.
Enabled 1 (use bus cycle task if not used in any task): The I/O
variables are updated in the bus cycle task if not used in any
other task.
Enabled 2 (always in bus cycle task): All variables are updated in
every cycle of bus cycle task, regardless of whether they are
being used or whether they are mapped to an input or to an
output channel.
You can set this option separately for each device in the I/O Mapping
dialog (see page 160).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 141
Common Device Editor Dialogs
Element Description
Bus cycle options area
Bus cycle task The selection list offers the tasks defined in the Task Configuration
of the active application (for example, MAST). The default setting
MAST is entered automatically.
<unspecified> means that the task is selected according to
controller-internal settings, which are therefore controller-
dependent.
NOTE: Setting the bus cycle task to <unspecified> may cause unintended behavior of your
application. Consult the Programming Guide specific to your controller.
WARNING
UNINTENDED EQUIPMENT OPERATION
Do not set the Bus cycle task to <unspecified>, unless you understand the bus cycle task settings
of the controller.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Additional Settings
Element Description
Generate force variables for IO This setting is only available if supported by the device. Consult the
mapping: Programming Guide specific to your controller for further
information.
If the option is activated, for each I/O channel, which is assigned to
a variable in the I/O Mapping dialog box, 2 global variables will be
created as soon as the application is built. These variables can be
used in an HMI visualization for forcing the I/O value. For further
information, refer to the I/O Mapping chapter (see page 155).
Enable diagnosis for device The library CAA Device Diagnosis is added to the project
automatically. For each device, a function block is generated in the
Applications tree. If the function block already exists, an extended
FB is used (for example, EtherCAT) or an additional function block
instance is added. This function block contains the general
implementation for the device diagnostics. By use of these function
block instances, the status of the devices can be retrieved in the
application. Furthermore, detected errors can be evaluated. The
library also provides functions for the programmatical evaluation of
the Devices tree (for example, search in child devices or jump to the
parent device). For detailed information, see the PDF document
CAA Device Diagnosis which is part of the library.
Show I/O warnings as errors Warnings concerning the I/O configuration are dumped as detected
errors.
142 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Overview
The Users and Groups view of the device editor is provided for devices supporting device Users
and Groups management. If supported by the device, you can view and edit the Users and Groups
management for the device. Thereafter, you can assign rights to allow certain user groups to
access objects on the controller at runtime by assigning Access Rights.
For the user management at the project level, refer to the Project → User Management →
Permissions... command (see EcoStruxure Machine Expert, Menu Commands, Online Help).
The device Users and Groups management can be pre-defined in the device description.
As in the project user management, users have to be members of at least one user group. Only
user groups can be assigned specific access rights (see page 148).
For managing Users and Groups, you have to login as Administrator user.
NOTE: It is not intended that the Users and Groups feature be used to protect the EcoStruxure
Machine Expert project against malicious access, but rather to help prevent mistakes from trusted
users.
If you want to protect your entire project, activate the option Enable project file encryption in the
Project Settings → Security dialog box (see EcoStruxure Machine Expert, Menu Commands,
Online Help).
If you want to protect only a part of your code inside the project, put this code inside a compiled
library (see EcoStruxure Machine Expert, Menu Commands, Online Help).
CAUTION
UNAUTHENTICATED, UNAUTHORIZED ACCESS
Do not expose controllers and controller networks to public networks and the Internet as much
as possible.
Use additional security layers like VPN for remote access and install firewall mechanisms.
Restrict access to authorized people.
Change default passwords at start-up and modify them frequently.
Validate the effectiveness of these measurements regularly and frequently.
Failure to follow these instructions can result in injury or equipment damage.
NOTE: You can use the security-related commands (see EcoStruxure Machine Expert, Menu
Commands, Online Help) which provide a way to add, edit, and remove a user in the online Users
and Groups management of the target device where you are logged in.
NOTE: You must establish user access-rights using EcoStruxure Machine Expert software. If you
have cloned an application from one controller to another, you will need to enable and establish
user access-rights in the targeted controller.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 143
Common Device Editor Dialogs
NOTE: The only way to gain access to a controller that has user access-rights enabled and for
which you do not have the password(s) is by performing an Update firmware operation using an
SD card or USB memory key (refer to the Controller Assistant User Guide for further information),
depending on the support of your particular controller, or by running a script. Since the process of
running a script is specific to each controller, refer to the chapters File Transfer with SD Card or
File Transfer with USB Memory Key in the Programming Guide of the controller you are using. This
will effectively remove the existing application from the controller memory, but will restore the ability
to access the controller.
Element Description
Synchronization Click the Synchronization button to switch on / off the synchronization
between the editor and the Users and Groups management in the controller.
If Synchronization is not activated, then the editor contains a Users and
Groups management configuration that has been imported from disk, or it
does not contain any configuration at all.
If Synchronization is activated, the data displayed in the editor is continuously
synchronized with the Users and Groups management configuration on the
connected controller.
If you invoke Synchronization while the editor contains a Users and Groups
configuration that is not synchronized with the device, you are prompted to
decide what will be displayed in the editor:
Upload from the device and overwrite the editor content: The Users and
Groups configuration from the controller is loaded to the editor. The
contents of the editor is overwritten.
Download the editor content to the device and overwrite the user
management there: The configuration from the editor is loaded to the
controller. The contents of the controller is overwritten.
Import from disk Click the Import from disk button to open a dialog box for selecting and
importing a Users and Groups management configuration from the disk.
When you click the button in the Users and Groups view, the file type is set
to Device user management files (*.dum). The Import from disk is available
when you are in offline mode or Synchronization is deactivated.
Export to disk Click the Export to disk button to open a dialog box for saving a file to the disk.
The Users and Groups management configuration is saved as an XML file.
When you click the button in the Users and Groups view, the file type is set
to Device user management files (*.dum).
Device user Name of the user who is logged into the controller.
144 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Editing or Viewing the Users and Groups Management Before any Users and Groups Have Been
Established
If the controller supports device Users and Groups management, proceed as follows during first
login:
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 145
Common Device Editor Dialogs
Setting up a New User in the Users and Groups Management of the Controller
If the controller supports device Users and Groups management, you can add a new user as
follows:
146 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Loading a Users and Groups Management From a *.dum File, Modifying it, and Later Downloading it to
the Controller
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 147
Common Device Editor Dialogs
Access Rights
Overview
In the Access Rights view of the device editor, define the device access rights of device users to
objects in the controller.
In order for the Access Rights view to be available in the device editor of controllers, activate the
Show access rights page option in the Tools → Options → Device Editor dialog box
(see EcoStruxure Machine Expert, Menu Commands, Online Help). Furthermore, Users and
Groups management must be set up in the controller.
Access Rights view of the device editor
148 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Modifying Access Rights to Controller Objects in the Users and Groups Management of the Controller
If the controller supports device Users and Groups management, you can assign access rights as
follows:
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 149
Common Device Editor Dialogs
Element Description
Synchronization Click the Synchronization button to switch on / off the synchronization
between the editor and the Access Rights management in the controller.
If Synchronization is not activated, then the editor contains an Access Rights
management configuration that has been imported from disk, or it does not
contain any configuration at all.
If Synchronization is activated, the data displayed in the editor is continuously
synchronized with the Access Rights management configuration on the
connected controller.
If you invoke Synchronization while the editor contains an Access Rights
management configuration that is not synchronized with the device, you are
prompted to decide what will be displayed in the editor:
Upload from the device and overwrite the editor content: The Access
Rights configuration from the controller is loaded to the editor. The
contents of the editor is overwritten.
Download the editor content to the device and overwrite the user
management there: The configuration from the editor is loaded to the
controller. The contents of the controller is overwritten.
Load from disk Click the Load from disk button to open a dialog box for selecting and
importing a user access rights management configuration from the disk.
When you click the button in the Access Rights view, the file type is by default
set to Device rights management files (*.drm).
Save to disk Click the Save to disk button to open a dialog box for saving a file to the disk.
When you click the button in the Access Rights view, the file type is by default
set to Device rights management files (*.drm).
Device user Name of the user who is logged into the controller.
Objects Area
In the Objects tree structure on the left-hand side, the objects are listed that allow actions to be
executed in runtime mode. The objects are assigned by their object source. They are partially
sorted in object groups. In the Rights area on the right-hand side, you can configure the access
options of the selected object for a user group.
On the top level of the Objects tree structure there are two object categories grouped in folders:
File system objects
Runtime system objects
Indented below the object categories, there are further subnodes. The subnode Device, for
example, can, in turn, have the following subnodes:
Logger
PlcLogic
Settings
UserManagement
150 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Rights Area
In the Rights area on the right-hand side, the access rights of the selected object are displayed in
a table. For every user group, it displays the rights configured for the possible actions on the
selected object.
The following actions can be configured for the object:
Add/Remove
Modify
View
Execute
Icon Description
Access (action) is permitted explicitly.
The access right has been inherited from the parent object.
Access has not been permitted or denied explicitly, even for the parent
object. No access is possible
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 151
Common Device Editor Dialogs
Task Deployment
Overview
The Task deployment view of the device editor shows a table with inputs/outputs and their
assignment to the defined tasks. Before the information can be displayed, the project has to be
compiled and the code has to be generated. This information helps in troubleshooting in case that
the same input/output is updated in different tasks with different priorities.
Task deployment of the device editor
The table shows the tasks sorted by their task priority. Click the column heading (task name) to
display only the variables assigned to this task. To show all variables again, click the first column
(I/O channels).
To open the I/O mapping table of a channel, double-click the input or output.
A blue arrow indicates the task of the bus cycle.
In the example above, the variable usiBK5120Out AT %QB0 is used in 2 different tasks. In this
situation, the output, set by one task, can be overwritten by the other task: this can lead to an
undefined value. In general, it is ill-advised to write output references in more than one task, as it
makes the program difficult to debug and often may lead to unintended results in the operation of
your machine or process.
WARNING
UNINTENDED EQUIPMENT OPERATION
Do not write to an output variable in more than one task.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
152 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Status
Overview
The Status view of the device editor shows status information (for example, Running, Stopped) and
specific diagnostic messages from the respective device; also on the used card and the internal
bus system.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 153
Common Device Editor Dialogs
Information
Overview
The Information view of the device editor shows some general information on the device currently
selected in the Devices tree: Name, Vendor, Type, Version number, Order Number, Description,
Image.
154 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Section 6.2
I/O Mapping
I/O Mapping
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 155
Common Device Editor Dialogs
I/O Mapping
Overview
The I/O Mapping view of the device editor is named <devicetype> I/O Mapping (for example,
PROFIBUS DP I/O Mapping). It serves to configure an I/O mapping of the controller. This means
that project variables used by the application are assigned to the input, output, and memory
addresses of the controller.
Define the application which should handle the I/Os in the PLC settings view (see page 141).
NOTE: If supported by the device, you can use the online configuration mode to access the I/O
hardware without having an application loaded beforehand. For further information, refer to the
description of the Online Config Mode (see EcoStruxure Machine Expert, Menu Commands,
Online Help).
See the following chapters:
Working with the I/O Mapping Dialog (see page 158)
I/O Mapping in Online Mode (see page 163)
Implicit Variables for Forcing I/Os (see page 164)
156 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Element Description
Create variable on I/Os mapping Select or deselect this option to activate or deactivate the automatic
I/O mapping function.
Mapping area
Bitwise Select this option to create variables for each bit.
Module-wise Select this option to create a variable for each module, not for the
individual bits.
Naming Rule area
text box Enter the following characters preceded by a # symbol to specify the
parts the variable name will consist of:
Enter #X to integrate an i for inputs and a q for outputs in the
variable name.
Enter #T to integrate the prefix code for the respective data type
of the variable in the variable name. The prefixes that are used for
the different data types are listed in the Recommendations on the
Naming of Identifiers chapter (see page 624).
Enter #D to integrate the name of the device in the variable name.
Enter #C to integrate the name as defined in the Channel column
in the variable name.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 157
Common Device Editor Dialogs
Overview
The following is an illustration of the I/O Mapping tab of the device editor:
Element Description
Channel Symbolic name of the input or output channel of the device
Address Address of the channel, for example: %IW0
Type Data type of the input or output channel, for example: BOOL
If the data type is not standard, but a structure or bit field defined in the device
description, it will be listed only if it is part of the IEC standard. It is indicated
as IEC type in the device description. Otherwise, the entry of the table will be
empty.
158 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Element Description
Default value Default value that is assigned to the channel when the controller is set to
STOP mode.
This column is only available if the option Set all outputs to default is selected
for the parameter Behaviour for outputs in Stop in the PLC Settings view of
the device editor (see page 141).
You can edit this field only if you are mapping to a new created variable or if
no mapping is specified. When you are mapping to an existing variable, the
initialization value of the variable is used as the default value.
NOTE: In case a “new” variable and an “existing” variable (by using the
AT declaration) are mapped to the same output, the initialization value of the
“existing” variable is used as default value.
Unit Unit of the parameter value, for example: ms for milliseconds
Description Short description of the parameter
Current Value Present value of the parameter, displayed in online mode
NOTE: Inputs and outputs that are not used in the application are not read by the controller in
online mode. To indicate that these inputs and outputs are not used, they are marked with a gray
background. Any values that might appear in these gray lines are invalid.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 159
Common Device Editor Dialogs
If the value has been modified, the subsequent addresses (up to the next fixed address) will be
adapted correspondingly:
If you want to remove the fixation of the value, reopen the address edit field, delete the address
entry, and close with Enter. The address and the identified succeeding addresses will be set back
to the values they had before the manual modification. The M symbol will be removed.
160 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
See in the following example an output mapping on the existing variable xBool_4:
NOTE: When you are mapping to an existing variable, the initialization value of the variable is used
as the default value. You can edit the Default value field only if you are mapping to a new created
variable or if no mapping is specified.
If you want to define a new variable, enter the desired variable name.
Example: bVar1
In this case, the symbol will be inserted in the Mapping column and the variable will be
internally declared as a global variable. From here, the variable will be available globally within
the application. The mapping dialog is another place for the declaration of global variables.
NOTE: Alternatively, an address can also be read or written within a program code, such as
in ST (structured text).
Considering the possibility of changes in the device configuration, do the mappings within the
device configuration dialog.
NOTE: If a UNION is represented by I/O channels in the mapping dialog, it depends on the device
whether the root element is mappable or not.
If a declared variable of a given data type is larger than that to which it is being mapped, the value
of the variable being mapped will be assigned a truncated to the size of the mapped target variable.
For example, if the variable is declared as a WORD data type, and it is mapped to a BYTE, only
8 bits of the word will be mapped to the byte.
This implies that, for the monitoring of the value in the mapping dialog, the value displayed at the
root element of the address will be the value of the declared variable - as currently valid in the
project. In the subelements below the root, the particular element values of the mapped variable
will be monitored. However, only part of the declared value may be displayed among the
subelements.
A further implication is when you map a declared variable to physical outputs. Likewise, if you map
a data type that is larger than the output data type, the output data type may receive a truncated
value such that it may affect your application in unintended ways.
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that the declared data type that is being mapped to physical I/O is compatible with the
intended operation of your machine.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 161
Common Device Editor Dialogs
Element Description
Reset mapping Click this button to reset the mapping settings to the defaults
defined by the device description file.
Always update variables Definition if the I/O variables are updated in the bus cycle
task (see page 141). The default value is defined in the
device description.
Use parent device settings: Update according to the
settings of the parent device.
Enabled 1 (use bus cycle task if not used in any task):
The I/O variables are updated in the bus cycle task if not
used in another task.
Enabled 2 (always in bus cycle task): The variables are
updated in every cycle of bus cycle task, regardless of
whether they are being used or whether they are mapped
to an input or to an output channel.
IEC Objects
This part of the tab is only available if implicitly a function block instance of a device has been
created, which can be accessed by the application (for example, in order to restart a bus or to poll
information). Whether such an instance is available and how it can be used, depends on the
controller. Consult the Programming Guide specific to your controller.
162 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 163
Common Device Editor Dialogs
Overview
During the commissioning of a plant or a machine, it may be necessary to force I/Os. For this
purpose, you can generate special force variables for each I/O channel which is mapped on a
variable in the I/O Mapping tab of the device editor.
As a precondition the setting Generate force variables for IO mapping has to be activated in the
PLC settings tab. Then, at each build run of the application, for each mapped I/O channel,
two variables are generated according to the following syntax. Any empty spaces in the channel
name are replaced by underscores.
<devicename>_<channelname>_<IECaddress>_Force of type BOOL, for activating and
deactivating the forcing
<devicename>_<channelname>_<ECaddress>_Value of datatype of the channel, for defining the
value to be forced on the channel
These variables will be available in the input assistant in category Variables → IoConfig_Globals_-
Force_Variables. They can be used in any programming objects, in visualizations, symbol
configuration, and so on, within the programming system.
A rising edge at the force variable activates the forcing of the respective I/O with the value define
by the value variable. A falling edge deactivates the forcing. Deactivating by setting the force
variable back to FALSE is necessary before a new value can be forced.
Consider the restrictions listed below.
Example
If the mapping is completed as shown in figure I/O Mapping tab of the device editor (see page 158),
then at a build (F11) of the application, the following variables will be generated and be available
in the input assistant:
Digitax_ST_Control_word_QW0_Force : BOOL;
Digitax_ST_Control_word_QW0_Value : UINT;
Digitax_ST_Target_position_QD1_Force : BOOL;
Digitax_ST_Target_position_QD1_Value : DINT;
Digitax_ST_Status_word_IW0_Force : BOOL;
Digitax_ST_Status_word_IW0_Value : UINT;
Digitax_ST_Position_actual_value_ID1_Force : BOOL;
Digitax_ST_Position_actual_value ID1_Value : DINT;
164 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Common Device Editor Dialogs
Restrictions
Only channels which are mapped on a variable in the I/O Mapping tab (i.e., a variable has to be
defined in the Variable column, no matter whether it is a new or an existing) can be forced by
the above described implicit variables.
Unused inputs / outputs as well as those which are mapped via AT declaration in an application
program cannot be forced.
The respective I/O channels have to be used in at least one task.
Forced I/Os are not indicated in the monitoring (watch view, I/O mapping dialog). The value is
only used implicitly in the I/O driver for writing onto the device.
Forced inputs are displayed correctly by the red force symbol (F), not however, forced
inputs/outputs.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 165
Common Device Editor Dialogs
166 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Program
EIO0000002854 06/2019
Part III
Program
Program
Chapter 7
Program Components
Program Components
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 169
Program Components
Section 7.1
Program Organization Unit (POU)
170 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
POU
Overview
The term Program Organizational Unit (POU) is used for all programming objects (programs,
function blocks, functions, etc.) which are used to create a controller application.
As defined in the IEC 61131 standard, a POU is a program, a function block, or a function.
However, in this document the term POU is used for programming elements in general that can
contain IEC code, such as methods, properties, interfaces etc. Whenever this document refers to
POUs in the more restricted sense as defined in IEC 61131, the term POU object is used.
POU Management
POUs which are managed in the Global node of the Applications tree are not device-specific but
they can be instantiated for the use on a device (application). For this purpose, program POUs
must be called by a task of the respective application.
But POU also is the name of a certain sub-category of these objects in the Add Object menu. At
this place, it just comprises programs, function blocks, and functions.
Therefore, a POU object in general is a programming unit. It is an object which is managed either
non-device-specifically in the Global node of the Applications tree or directly below an application
in the Applications tree. It can be viewed and edited in an editor view. A POU object can be a
program, function, function block.
It is possible to set certain Properties (such as build conditions, etc.) for each particular POU
object.
For a description on how to create a POU object, refer to the section Adding POU Objects to an
Application (see page 173). The POU objects you have created are added to the Assets view of
the Software catalog.
You can add a POU object available in the Assets view to the project in 2 different ways:
Select a POU object in the Assets view and drag it to the suitable node in the Applications tree.
Select a POU object in the Assets view and drag it to the logic editor view (see page 289).
Besides the POU objects, there are device objects used for running the program on the target
system (Resource, Application, Task Configuration etc.). They are managed in the Applications
tree.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 171
Program Components
Introduction
You can add Program Organization Unit (POU) objects to your application in the Software catalog
→ Assets or in the Applications tree.
The different types of POU objects are:
Program: It returns one or several values during operation. All values are retained from the last
time the program was run until the next. It can be called by another POU object.
Function Block: It provides one or more values during the processing of a program. As opposed
to a function, the values of the output variables and the necessary internal variables shall persist
from one execution of the function block to the next. So invocation of a function block with the
same arguments (input parameters) need not always yield the same output values.
Function: It yields exactly one data element (which can consist of several elements, such as
fields or structures) when it is processed. The call in textual languages can occur as an operator
in expressions.
172 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Step Action
1 In the Software catalog → Assets → POUs section, select an Application node, click the green plus
button, and execute the command POU.... As an alternative, you can right-click the Application node
of the controller and choose Add Object → POU.
The two methods are also available in the Applications tree.
Result: The Add POU dialog box opens.
2 In the Add POU dialog box, assign a name to your POU object by typing a name in the text field
Name.
NOTE: The name must not contain any space characters. If you do not enter a name, a name is
given by default.
Assigning a meaningful name to a POU may ease the organization of your project.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 173
Program Components
Step Action
3 Select the type of POU object you want:
Program
Function Block:
a. If you want your function block to extend an already existing function block, select Extends and
click the browser to select the function block you want in the Input Assistant.
b. Click the OK button.
c. If you want your function block to implement an interface, select Implements and click the
browser to select the interface you want in the Input Assistant.
d. Click the OK button.
e. If your function block implements an interface, in the list box Method implementation language,
select the programming language you want for editing the methods and properties defined in
the implemented interface.
Function:
a. Click the browse button to select the Return type you want in the Input Assistant.
b. Click the OK button.
4 From the list box Implementation Language, select the programming language you want for editing
your POU object.
5 Click the Open button.
Already defined POU objects are listed in the Software catalog → Assets → POUs section. You
can add them to your application, by dragging them to the Applications tree and dropping them on
an Application node. You can also drop a POU object on the logic editor view.
Step Action
1 Under the node Task Configuration of the controller, double-click the task to which you want to add
your program. In the Configuration tab, click Add Call.
Alternatively, in the Applications tree select the task to which you want to assign your program and
click the green plus button. Execute the command Program Call... from the list. Click the ... button.
Result: The Input Assistant dialog box is displayed.
2 In the tab Categories of the Input Assistant dialog box, select Programs.
3 Click to clear the check box Structured view.
4 In the Items panel, select the POU you want.
5 Click the OK button.
174 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Calling POUs
POUs can call other POUs. Recursion however is not allowed (a POU that calls itself).
When a POU assigned to an application calls another POU just by its name (without any
namespace (see page 866) added), consider the following order of browsing the project for the
POU to be called:
1. current application
2. Library Manager of the current application in the Tools tree
3. Global node of the Applications tree
4. Library Manager in the Global node of the Tools tree
If a POU with the name specified in the call is available in a library of the Library Manager of the
application as well as an object in the Global node of the Applications tree, there is no syntax for
explicitly calling the POU in the Global node of the Applications tree, just by using its name. In this
case move the respective library from the Library Manager of the application to the Library
Manager of the Global node of the Applications tree. Then you can call the POU from the Global
node of the Applications tree just by its name (and, if needed, that from the library by preceding the
library namespace).
Also refer to the chapter POUs for Implicit Checks (see page 192).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 175
Program Components
Program
Overview
A program is a POU object which returns one or several values during operation. All values are
retained from the last time the program was run until the next. However, there are not separate
instances of programs, unlike function blocks. When calling a function block, only the values in the
given instance of the function block are modified. The modifications are only affected when the
same instance is called again. Program value modifications will be retained until the program gets
called again even if called from another POU.
Adding a Program
To add a program to an existing application, select the application node in the Applications tree,
click the green plus button, and execute the command POU.... As an alternative, right-click the
Application node, and execute the command Add Object → POU from the contextual menu. To
add an application-independent POU, select the Global node of the Applications tree, and execute
the same commands.
In the Add POU dialog box select the Program option, enter a name for the program, and select
the desired implementation language. Click Open to confirm. The editor view for the new program
opens and you can start editing the program.
Declaring a Program
Syntax:
PROGRAM <program name>
This is followed by the variable declarations of input (see page 637), output (see page 638), and
program variables. Access variables are available as options as well.
Example of a program
176 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Calling a Program
A program can be called by another POU. However, a program call in a Function (see page 178)
is not allowed. There are no instances of programs.
If a POU has called a program and if the values of the program have been modified, these
modifications will be retained until the program gets called again. This applies even if it is called
from within another POU. Consider that this is different from calling a function block. When calling
a function block, only the values in the given instance of the function block are modified. The
modifications are only affected when the same instance is called again.
In order to set input and/or output parameters in the course of a program call, in text language
editors (for example, ST), assign values to the parameters after the program name in parentheses.
For input parameters, use := for this assignment, as with the initialization of variables
(see page 629) at the declaration position. For output parameters, use =>. See the following
example.
If the program is inserted via the Input Assistant using the option Insert with arguments in the
implementation view of a text language editor, it will be displayed automatically according to this
syntax with all parameters, though you do not necessarily have to assign these parameters.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 177
Program Components
Function
Overview
A function is a POU which yields exactly one data element (which can consist of several elements,
such as fields or structures) when it is processed. Its call in textual languages can occur as an
operator in expressions.
Adding a Function
To assign the function to an existing application, select the application node in the Applications
tree, click the green plus button, and execute the command POU.... As an alternative, right-click
the Application node, and execute the command Add Object → POU from the contextual menu.
To add an application-independent POU, select the Global node of the Applications tree, and
execute the same commands.
In the Add POU dialog box, select the Function option. Enter a Name (<function name>) and a
Return Data Type (<data type>) for the new function and select the desired implementation
language. To choose the return data type, click the button ... to open the Input Assistant dialog box.
Click Open to confirm. The editor view for the new function opens and you can start editing.
Declaring a Function
Syntax:
FUNCTION <function name> : <data type>
This is followed by the variable declarations of input and function variables.
Assign a result to the function. This means that the function name is used as an output variable.
Do not declare local variables as RETAIN or PERSISTENT in a function because this will have no
effect.
Example of a function in ST: this function takes 3 input variables and returns the product of the last
2 added to the first one.
178 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Calling a Function
The call of a function in ST can appear as an operand in expressions.
In IL, you can position a function call only within actions of a step or within a transition.
Functions (in contrast to a program or function block) contain no internal state information, that is,
invocation of a function with the same arguments (input parameters) always will yield the same
values (output). For this reason, functions may not contain global variables and addresses.
Example:
fun(formal1 := actual1, actual2); // -> error message
fun(formal2 := actual2, formal1 := actual1); // same semantics as the f
ollowing:
fun(formal1 := actual1, formal2 := actual2);
According to the IEC 61131-3 standard, functions can have additional outputs. They can be
assigned in the call of the function. In ST, for example, according to the following syntax:
out1 => <output variable 1> | out2 => <output variable 2> | ...further output variables
Example
Function fun is defined with 2 input variables in1 and in2 and two output variables out1 and
out2. The output values of fun are written to the locally declared variables loc1 and loc2.
fun(in1 := 1, in2 := 2, out1 => loc1, out2 => loc2);
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 179
Program Components
Method
Overview
A method is a language element similar to a function that can be used in a context of a function
block (see page 194). It can be regarded as a function which contains an instance of the respective
function block. Such as a function, a method has a return value, and its own declaration part for
temporary variables and parameters.
Also as a means of object-oriented programming, you can use interfaces (see page 185) to
organize the methods available in a project.
NOTE: When copying or moving a method or property from a POU to an interface, the contained
implementations are deleted automatically. When copying or moving from an interface to a POU,
you are requested to specify the desired implementation language.
Inserting a Method
To assign a method to a function block or interface, select the appropriate function block or
interface node in the Applications tree, click the green plus button and execute the command
Method. Alternatively, you can right-click the function block or interface node and execute the
command Add Object → Method from the contextual menu.
In the Add Method dialog box, enter a Name, the desired Return Type, the Implementation
Language, and the Access Specifier (see below). For choosing the return data type, click the
button ... to open the Input Assistant... dialog box.
Access specifier: For compatibility reasons, access specifiers are optional. The specifier PUBLIC
is available as an equivalent for having set no specifier.
Alternatively, choose one of the options from the selection list:
PRIVATE: The access on the method is restricted to the function block.
PROTECTED: The access on the method is restricted to the function block and its derivation.
INTERNAL: The access on the method is restricted to the present namespace (the library).
180 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Declaring a Method
Syntax:
METHOD <access specifier> <method name> : <return data type>VAR_INPUT ... END_VAR
For a description on how to declare interface handling methods, refer to the Interface chapter
(see page 185).
Calling a Method
Method calls are also named virtual function calls. For further information, refer to the chapter
Method Invocation (see page 208).
Note the following for calling a method:
The data of a method is temporary and only valid during the execution of the method (stack
variables). This means that the variables and function blocks declared in a method are
reinitialized at each call of the method.
Methods defined in an interface (see page 185) are only allowed to have input, output, and
input/output variables, but no body (implementation part).
Methods such as functions can have additional outputs. They must be assigned during method
invocation (see page 208).
Implementing a Method
Note the following for implementing a method:
In the body of a method, access to the function block instance variables is allowed.
If necessary, use the THIS pointer (see page 212) which always points on the present instance.
VAR_TEMP variables of the function block cannot be accessed in a method.
Method Description
Init A method named FB_init is by default declared implicitly, but can also be declared
explicitly. It contains initialization code for the function block as declared in the
declaration part of the function block. Refer to FB_init method (see page 647).
Reinit If a method named FB_reinit is declared for a function block instance, it is called
after the instance has been copied (like during Online Change) and will reinitialize the
new instance module. Refer to FB_init, FB_reinit methods (see page 647).
Exit If an exit method named FB_exit is desired, it has to be declared explicitly. There is
no implicit declaration. The Exit method is called for each instance of the function
block before a new download, a reset or during online change for all moved or deleted
instances. Refer to FB_exit method (see page 647).
Properties (see page 183) and interface properties (see page 186) each consist of a Set and/or a
Get accessor method.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 181
Program Components
182 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Property
Overview
A property in extension to the IEC 61131-3 is available as a means of object-oriented
programming. It consists of a pair of accessor methods (Get, Set). They allow encapsulating a
read or write access to variables declared inside of a POU or a GVL into a function call, while
keeping the syntax of a variable access.
To insert a property as an object below a program (see page 176), a function block (see page 194),
a GVL (see page 218), or an interface (see page 185) node, select the node in the Applications
tree, click the green plus button, and execute the command Property. As an alternative, right-click
the node and execute the command Add Object → Property from the contextual menu.
In the Add Property dialog box specify the Name, Return Type, desired Implementation Language,
and optionally an Access Specifier.
The same access specifiers are available as for methods (see page 180):
PUBLIC
PRIVATE
PROTECTED
INTERNAL
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 183
Program Components
Example:
Function block FB1 has a property seconds that uses a local variable milli. This variable is
determined by the properties Get and Set:
Get implementation example
seconds := milli / 1000;
Set implementation example
milli := seconds * 1000;
You can write the property of the function block (Set method), for example by
fbinst.seconds := 22;.
(fbinst is the instance of FB1).
You can read the property of the function block (Get method) for example by
testvar := fbinst.seconds;.
In the following example, property seconds is assigned to function block FB1:
A property can have additional local variables but no additional inputs and - in contrast to a function
(see page 178) or method (see page 180) - no additional outputs.
NOTE: When copying or moving a method or property from a POU to an interface, the contained
implementations are deleted automatically. When copying or moving from an interface to a POU,
you are requested to specify the desired implementation language.
Monitoring a Property
A property can be monitored in online mode either with help of inline monitoring (see page 404) or
with help of a watch list (see page 480). The precondition for monitoring a property is the addition
of the pragma {attribute 'monitoring' := 'variable'} (refer to the chapter Attribute
Monitoring (see page 691)) on top of its definition.
184 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Interface
Overview
The use of interfaces is a means of object-oriented programming. An interface POU defines a set
of methods (see page 180) and properties (see page 183) without an implementation. An interface
can be described as an empty shell of a function block (see page 194). It must be implemented
(see page 206) in the declaration of the function block in order to get realized in the function block
instances. A function block can implement one or several interfaces.
The same method can be realized with identical parameters but different implementation code by
different function blocks. Therefore, an interface can be used/called in any POU without the need
that the POU identifies the particular function block that is concerned.
1 or multiple function blocks can now be inserted, implementing the above defined interface ITF.
Creating a function block implementing an interface
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 185
Program Components
When function block POU is added to the Applications tree, the methods Method1 and Method2
are automatically inserted below as defined by ITF. Here they can be filled with function block-
specific implementation code.
Using the interface in the function block definition
An interface can extend other interfaces by using EXTENDS (see following example Example for
Extending an Interface (see page 187)) in the interface definition.
Interface Properties
An interface can also define an interface property, consisting of the accessor methods Get and/or
Set. For further information on properties, refer to the chapter Property (see page 183). A property
in an interface like the possibly included methods is just a prototype that means it contains no
implementation code. Like the methods, it is automatically added to the function block, which
implements the interface. There it can be filled with specific programming code.
186 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Considerations
Consider the following:
It is not allowed to declare variables within an interface. An interface has no body (implemen-
tation part) and no actions. Just a collection of methods is defined within an interface and those
methods are only allowed to have input variables, output variables, and input/output variables.
Variables declared with the type of an interface are treated as references.
A function block implementing an interface must have assigned methods and properties which
are named exactly as they are in the interface. They must contain identically named inputs,
outputs, and inputs/outputs.
NOTE: When copying or moving a method or property from a POU to an interface, the contained
implementations are deleted automatically. When copying or moving from an interface to a POU,
you are requested to specify the desired implementation language.
Inserting an Interface
To add an interface to an application, select the Application node in the Applications tree or in the
Software Catalog → Assets, click the green plus button and select Add Other Objects... →
Interface. Alternatively, execute the command Add Object → Interface. If you select the node
Global before you execute the command, the new interface is available for all applications.
In the Add Interface dialog box, enter a name for the new interface (<interface name>). Optionally
you can activate the option Extends: if you want the current interface to be an extension
(see page 203) of another interface.
Click Add to confirm the settings. The editor view for the new interface opens.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 187
Program Components
Declaring an Interface
Syntax
INTERFACE <interface name>
For an interface extending another one:
INTERFACE <interface name> EXTENDS <base interface name>
Example
INTERFACE interface1 EXTENDS interface_base
188 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Action
Overview
You can define actions and assign them to function blocks (see page 194) and programs
(see page 176). An action is an additional implementation. It can be created in a different language
than the basic implementation. Each action is given a name.
An action works with the data of the function block or program to which it belongs. It uses the
input/output variables and local variables defined and does not contain its own declarations.
In this example, each call of the function block FB1 increases or decreases the output variable out,
depending on the value of the input variable in. Calling action Reset of the function block sets the
output variable out to 0. The same variable out is written in both cases.
Inserting an Action
To add an action, select the respective program or function block node in the Applications Tree or
in the Global node of the Applications Tree, click the green plus button, and execute the command
Action.... Alternatively, right-click the program or function block node, and execute the command
Add Object → Action. In the Add Action dialog box, define the action Name and the desired
Implementation Language.
EcoStruxure Machine Expert facilitates object-oriented programming using inheritance within
function blocks: When you execute Add Object on a function block that inherits from another
function block, the Action, Method, Property, and Transition elements used in the base function
block are listed for selection:
Action, Method, Property, and Transition elements with Access specifier = PUBLIC,
PROTECTED, and INTERNAL defined in the base function block are available for selection.
You can adapt the definition for the inherited object. In the inherited object, the same Access
specifier is assigned as to the source elements.
Action, Method, Property, and Transition elements with Access specifier = PRIVATE are not
available for selection because access is restricted to the base function block.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 189
Program Components
Calling an Action
Syntax
<Program_name>.<Action_name>
or
<Instance_name>.<Action_name>
Consider the notation in FBD (see the following example).
If it is required to call the action within its own block, that is the program or function block it belongs
to it is sufficient to use the action name.
Examples
This section provides examples for the call of the above described action from another POU.
Declaration for all examples:
PROGRAM PLC_PRG
VAR
Inst : Counter;
END_VAR
Call of action Reset in another POU, which is programmed in IL:
CAL Inst.Reset(In := FALSE)
LD Inst.out
ST ERG
Call of action Reset in another POU, which is programmed in ST:
Inst.Reset(In := FALSE);
Erg := Inst.out;
Call of action Reset in another POU, which is programmed in FBD:
Action in FBD
NOTE: The IEC standard does not recognize actions other than actions of the sequential function
chart (SFC). These actions are an essential part containing the instructions to be processed at the
particular steps of the chart.
190 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Transition
Overview
You can use transition objects as transition elements in a program or function block implemented
in SFC.
For further information, refer to the description of steps and transitions in the chapter SFC
Elements / ToolBox (see page 381).
EcoStruxure Machine Expert facilitates object-oriented programming using inheritance within
function blocks: When you execute Add Object on a function block that inherits from another
function block, the Action, Method, Property, and Transition elements used in the base function
block are listed for selection:
Action, Method, Property, and Transition elements with Access specifier = PUBLIC,
PROTECTED, and INTERNAL defined in the base function block are available for selection.
You can adapt the definition for the inherited object. In the inherited object, the same Access
specifier is assigned as to the source elements.
Action, Method, Property, and Transition elements with Access specifier = PRIVATE are not
available for selection because access is restricted to the base function block.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 191
Program Components
Overview
You have to add special POUs below an application to provide implicitly available check functions.
They verify array and range boundaries, the validity of pointers and verify the presence of division
by zero during runtime.
NOTE: The availability of the check functions have a runtime performance impact.
NOTE: For the check functions to verify the code of uncompiled referenced libraries, you have to
enter the Compiler defines string checks_in_libs in the Build tab of the Properties dialog box
(see EcoStruxure Machine Expert, Menu Commands, Online Help) of the application.
To add monitoring functions under an application, select the application node in the Applications
tree and click the green plus button or execute the command Add Object → POU for implicit
checks....
The dialog box allows you to activate the following check functions for the selected application:
When you insert a check POU, the option is no longer available in the dialog box to help avoid a
double insertion. If the different types of check POUs have been added below the application, the
Add Object dialog box does not provide the POUs for implicit checks option any longer.
192 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
CAUTION
INCORRECT IMPLICIT CHECKS FUNCTIONALITY
Do not modify the declaration part of an implicit check function in order to maintain its functional
integrity.
Failure to follow these instructions can result in injury or equipment damage.
NOTE: You may, however, add local variables to the declaration part of an implicit check function.
NOTE: After having removed implicit check function (such as CheckBounds) from your application,
no Online Change is possible, just a download. An appropriate message is displayed.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 193
Program Components
Section 7.2
Function Block
Function Block
194 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
General Information
Overview
A function block is a POU (see page 171) which provides 1 or more values during the processing
of a controller program. As opposed to a function, the values of the output variables and the
necessary internal variables shall persist from one execution of the function block to the next.
Therefore, invocation of a function block with the same arguments (input parameters) need not
always yield the same output values.
In addition to the functionality described by standard IEC11631-3, object-oriented programming is
supported and function blocks can be defined as extensions (see page 203) of other function
blocks. They can include interface (see page 206) definitions concerning Method invocation
(see page 208). Therefore, inheritance can be used when programming with function blocks.
A function block always is called via an instance (see page 198), which is a reproduction (copy) of
the function block.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 195
Program Components
Option Description
Extends Enter the name of another function block available in the project, which
should be the base for the current one. For details, refer to Extension of a
Function Block (see page 203).
Implements Enter the names of interfaces (see page 185) available in the project, which
should be implemented in the current function block. You can enter several
interfaces separated by commas. For details, refer to Implementing
Interfaces (see page 206).
Access specifier For compatibility reasons, access specifiers are optional. Specifier PUBLIC
is available as an equivalent for having set no specifier.
Alternatively, choose one of the options from the selection list:
INTERNAL: The access on the function block is restricted to the current
namespace (the library).
FINAL: Deriving access is not possible that is the function block cannot
be extended by another one. Enables optimized code generation.
NOTE: The access specifiers are valid as of compiler version 3.4.4.0
and thus can be used as identifiers in earlier versions.
For further information, refer to the EcoStruxure Machine
Expert/CoDeSys compiler version mapping table in the EcoStruxure
Machine Expert Compatibility and Migration User Guide
(see EcoStruxure Machine Expert Compatibility and Migration, User
Guide).
Method implementation Choose the desired programming language for all method and property
language objects created via the interface implementation, independently from that set
for the function block itself.
Click Add to confirm the settings. The editor view for the new function block opens and you can
start editing.
196 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Example
FBexample shown in the following figure has 2 input variables and 2 output variables out1 and
out2.
out1 is the sum of the 2 inputs, out2 is the result of a comparison for equality.
Example of a function block in ST
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 197
Program Components
Overview
Function blocks are called (see page 199) through an instance which is a reproduction (copy) of a
function block (see page 195).
Each instance has its own identifier (instance name), and a data structure containing its inputs,
outputs, and internal variables.
Instances like variables are declared locally or globally. The name of the function block is indicated
as the data type of an identifier.
Example
Declaration (for example, in the declaration part of a program) of instance INSTANCE of function
block FUB:
INSTANCE: FUB;
The declaration parts of function blocks and programs can contain instance declarations.
198 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Overview
Function blocks (see page 195) are called through a function block instance. Thus a function block
instance has to be declared locally or globally. Refer to the chapter Function Block Instance
(see page 198) for information on how to declare.
Then the desired function block variable can be accessed using the following syntax.
Syntax
<instance name>.<variable name>
Considerations
Only the input and output variables of a function block can be accessed from outside of a
function block instance, not its internal variables.
Access to a function block instance is limited to the POU (see page 171) in which it was
declared unless it was declared globally.
At calling the instance, the desired values can be assigned to the function block parameters.
See the following paragraph Assigning Parameters at Call.
The input / output variables (VAR_IN_OUT) of a function block are passed as pointers.
In SFC, function block calls can only take place in steps.
The instance name of a function block instance can be used as an input parameter for a function
or another function block.
All values of a function block are retained until the next processing of the function block.
Therefore, function block calls do not always return the same output values, even if done with
identical arguments.
NOTE: If at least 1 of the function block variables is a remanent variable, the total instance is stored
in the retain data area.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 199
Program Components
200 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Overview
You can configure a memory reserve for the online change of function blocks. After you have made
modifications on the declaration of a function block (in particular after you have added a new
variable), and you perform an online change, it is no longer necessary to copy the instances of the
function block to a new memory area. Thus, the online change is performed faster and fewer errors
are detected.
If the memory reserve you configured is depleted, a message is displayed before the online change
is performed.
It is a good practice to configure the memory reserve for a function block before you download the
application to the controller. If you configure the memory reserve when the application is already
located on the controller, then you have to perform an online change that is even more time-
consuming.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 201
Program Components
Procedure of Configuring a Memory Reserve for the Online Change of Function Blocks
If you intend to perform later modifications on a function block that would require the function block
instance to be copied to other memory locations when executing an online change, then you can
use the Online Change Memory Reserve Settings command.
By default, the command is not available in the menus. Add this command via the Tools →
Customize menu (see EcoStruxure Machine Expert, Menu Commands, Online Help).
When you download the application to the controller, the memory size that is reserved for the
function block is calculated by the present size of the function block plus the memory reserve you
configured in the Online Change Memory Reserve view.
Future modifications to the function block can be downloaded to the controller with the online
change without having to copy all instances of the function block to a new memory area.
202 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Overview
Supporting object-orientated programming, a function block can be derived from another function
block. This means a function block can extend another, thus automatically getting the
methods/properties/actions/transitions and variables of the basing function block in addition to its
own.
The extension is performed by using the keyword EXTENDS in the declaration of a function block.
You can choose the EXTENDS option already during adding a function block to the project via the
Add Object dialog box.
For further information, refer to the sections describing how to add a method (see page 180), a
property (see page 183), an action (see page 189), or a transition (see page 191).
Syntax
FUNCTION_BLOCK <function block name> EXTENDS <function block name>
This is followed by the declaration of the variables.
Example
Definition of function block fbA
FUNCTION_BLOCK fbA
VAR_INPUT
x:int;
END_VAR
...
Definition of function block fbB
FUNCTION_BLOCK fbB EXTENDS fbA
VAR_INPUT
ivar: INT := 0;
END_VAR
...
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 203
Program Components
Extension by EXTENDS
Extension by EXTENDS means:
fbB contains all data and methods which are defined by fbA. An instance of fbB can now be
used in any context where a function block of type fbA is expected.
fbB is allowed to override the methods/properties/actions/transitions defined in fbA. This
means: fbB can declare a method with the same name and the same inputs and output as
declared by A.
fbB is not allowed to declare function block variables with the same name as used in fbA. In
this case, the compiler will generate an error message.
fbA variables and methods can be accessed directly within an fbB scope by using the SUPER
pointer (see page 210) (SUPER^.<method>).
NOTE: A function block can implement multiple interfaces, but it can only extend a single function
block.
Example
FUNCTION_BLOCK FB_Base
VAR_INPUT
END_VAR
VAR_OUTPUT
iCnt : INT;
END_VAR
VAR
END_VAR
THIS^.METH_DoIt();
THIS^.METH_DoAlso();
204 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 205
Program Components
Implementing Interfaces
Overview
In order to support object-oriented programming, a function block can implement several interfaces
(see page 185) which allows you to use methods (see page 180).
Syntax
FUNCTION_BLOCK <function block name> IMPLEMENTS <interface_1 name>|,<interface_2
name>, ..., <interface_n name>
A function block that implements an interface must contain all methods and properties (interface
properties (see page 186)) defined by this interface. This includes name, inputs, and the output of
the particular method or property which must be exactly the same.
For this purpose - when creating a new function block implementing an interface - automatically all
methods and properties defined in this interface will be inserted below the new function block in
the Applications Tree.
NOTE: If afterwards, methods are added to the interface definition, they will not be added
automatically in the concerned function blocks and thus produce compiler errors. Execute the
command Implement interfaces... (see EcoStruxure Machine Expert, Menu Commands, Online
Help) to perform this update explicitly.
When you use inheritance for function blocks, consider that if methods or attributes were created
by inheritance of an interface, either implement them, or delete them if the implementation of the
base function block is to be used. Pragma attributes are automatically inserted. They are detected
during compilation and messages are generated to remind you that the inherited methods or
properties have to be verified. Delete the pragma attributes after you have completely implemented
the new function block.
For further information, refer to the description of the Implement interfaces... command
(see EcoStruxure Machine Expert, Menu Commands, Online Help).
206 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Example
INTERFACE I1 includes method GetName:
METHOD GetName : STRING
Function blocks A and B each implement interface I1:
FUNCTION_BLOCK A IMPLEMENTS I1
FUNCTION_BLOCK B IMPLEMENTS I1
Thus in both function blocks the method GetName has to be available and will be inserted
automatically below each when the function blocks are inserted in the Applications Tree.
Consider a declaration of a variable of type I1:
FUNCTION DeliverName : STRING
VAR_INPUT
l_i : I1;
END_VAR
This input can receive all function blocks that implement interface I1.
Example for function calls:
DeliverName(l_i := A_instance); // call with instance of type A
DeliverName(l_i := B_instance); // call with instance of type B
NOTE: A variable of an interface-type must get assigned an instance of a function block before a
method can be called on it. A variable of an interface-type always is a reference to the assigned
function block instance.
Thus a call to the interface method results in a call to the function block implementation. As soon
as the reference is assigned, the corresponding address is monitored in online mode. Otherwise,
if no reference has been assigned yet, the value 0 is displayed within monitoring in online mode.
For this example see in the implementation part of the function DeliverName:
DeliverName := l_i.GetName(); // in this case it depends on the "real"
type of l_i whether A.GetName or B.GetName is called
NOTE: See also the possibility to extend a function block (see page 203) by using the keyword
EXTENDS in the declaration.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 207
Program Components
Method Invocation
Overview
Object-oriented programming with function blocks is - besides of the possibility of extension
(see page 203) via EXTENDS - supported by the possible use of interfaces (see page 206) and
inheritance. This requires dynamically resolved method invocations, also called virtual function
calls.
Virtual function calls need some more time than normal function calls and are used when:
a call is performed via a pointer to a function block (pfub^.method)
a method of an interface variable is called (interface1.method)
a method calls another method of the same function block
a call is performed via a reference to a function block
VAR_IN_OUT of a base function block type can be assigned an instance of a derived function
block type
Virtual function calls make possible that the same call in a program source code will invoke
different methods during runtime.
For more information and in-depth view, refer to:
Method (see page 180) for further information on methods.
THIS Pointer (see page 212) for using THIS pointer.
SUPER Pointer (see page 210) for using SUPER pointer.
Calling Methods
According to the IEC 61131-3 standard, methods such as normal functions (see page 178) can
have additional outputs. They can be assigned in the method call according to syntax:
<method>(in1:=<value> |, further input assignments, out1 => <output variable 1> | out2 => <output
variable 2> | ...further output variables)
This has the effect that the output of the method is written to the locally declared variables as given
within the call.
208 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Example
Assume that function blocks fub1 and fub2 EXTEND function block fubbase and IMPLEMENT
interface1. Method method1 is contained.
Possible use of the interfaces and method calls:
PROGRAM PLC_PRG
VAR_INPUT
b : BOOL;
END_VAR
VAR
pInst : POINTER TO fubbase;
instBase : fubbase;
inst1 : fub1;
inst2 : fub2;
instRef : REFERENCE to fubbase;
END_VAR
IF b THEN
instRef REF= inst1; (* Reference to fub1 *)
pInst := ADR(instBase);
ELSE
instRef REF= inst2; (* Reference to fub2 *)
pInst := ADR(inst1);
END_IF
pInst^.method1(); (* If b is true, fubbase.method1 is c
alled, else fub1.method1 is called *)
instRef.method1(); (* If b is true, fub1.method1 is call
ed, else fub2.method1 is called *)
Assume that fubbase of the upper example contains 2 methods method1 and method2. fub1
overrides method2 but not method1.
method1 is called as shown in the upper example.
pInst^.method1(); (* If b is true fubbase.method1 is called, else fub1.
method1 is called *)
For calling via THIS pointer, refer to THIS Pointer (see page 212).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 209
Program Components
SUPER Pointer
Overview
For each function block that extends a base function block, a pointer with name SUPER is
automatically available. It points to the base function block instances.
This provides an effective solution for the following issue:
SUPER offers access to methods of the base function block implementation. With the keyword
SUPER, a method can be called which is valid in the base (parent) class instance. Thus, no
dynamic name binding takes place.
SUPER may only be used in methods and in the associated function block implementation.
Because SUPER is a pointer to the base function block, you have to dereference it to get the
address of the function block: SUPER^.METH_DoIt
NOTE: The functionality of SUPER is not yet implemented for Instruction List.
210 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Example
Use of SUPER and THIS pointers.
FUNCTION_BLOCK FB_Base
VAR_OUTPUT
iCnt : INT;
END_VAR
METHOD METH_DoIt : BOOL
iCnt := -1;
PROGRAM PLC_PRG
VAR
myBase: FB_Base;
myFB_1: FB_1;
iTHIS: INT;
iBase: INT;
END_VAR
myBase();
iBase := myBase.iCnt;
myFB_1();
iTHIS := myFB_1.iCnt;
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 211
Program Components
THIS Pointer
Overview
For each function block, a pointer with name THIS is automatically available. It points to its own
function block instance.
This provides an effective solution for the following issues:
If a locally declared variable in the method hides a function block variable.
If you want to refer a pointer to its own function block instance for using in a function.
NOTE: The functionality of THIS is not yet implemented for Instruction List.
212 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Example 1
Local variable iVarB shadows the function block variable iVarB.
FUNCTION_BLOCK fbA
VAR_INPUT
iVarA: INT;
END_VAR
iVarA := 1;
PROGRAM PLC_PRG
VAR
MyfbB: fbB;
END_VAR
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 213
Program Components
Example 2
Function call that needs a reference to its own instance.
FUNCTION funA
VAR_INPUT
pFB: fbA;
END_VAR
...;
FUNCTION_BLOCK fbA
VAR_INPUT
iVarA: INT;
END_VAR
...;
PROGRAM PLC_PRG
VAR
MyfbB: fbB;
END_VAR
MyfbB(iVarA:=0 , iVarB:= 0);
MyfbB.DoIt();
214 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Section 7.3
Application Objects
Application Objects
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 215
Program Components
Overview
Along with the standard data types, you can define your own data types. You can create structures
(see page 744), enumeration types (see page 746), and references (see page 732) as data type
units (DUTs) in a DUT editor (see page 435).
For a description of the particular standard and the user-defined data types, refer to the description
of the data types (see page 722).
216 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Example
The following example contains 2 DUTS, defining structures struct1 and struct2; struct2
extends struct1, which means that you can use struct2.a in your implementation to access
variable a.
TYPE struct1 :
STRUCT
a:INT;
b:BOOL;
END_STRUCT
END_TYPE
TYPE struct2 EXTENDS struct1 :
STRUCT
c:DWORD;
d:STRING;
END_STRUCT
END_TYPE
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 217
Program Components
Overview
A global variables list (GVL) is used to declare global variables (see page 639). If a GVL is placed
in the Global node of the Software catalog → Variables → Global Variables or the Applications
tree, the variables will be available for the entire project. If a GVL is assigned to a certain
application, the variables will be valid within this application.
To add a GVL to an existing application, select the application node in the Software catalog →
Assets → POUs or Applications tree, click the green plus button and select Global Variable List....
Alternatively you can right-click the node and execute the command Add Object → Add Global
Variable List.... If you select the Global node in these views, the new GVL object will application-
independent.
Use the GVL editor (see page 437) to edit a global variable list.
The variables contained in a GVL can be defined to be available as network variables
(see page 963) for a broadcast data exchange with other devices in the network. For this purpose,
configure appropriate network properties (in the menu View → Properties → Network Variables or
Network Variable Sender Properties) for the GVL.
NOTE: The maximum size of a network variable is 255 bytes. The number of network variables is
not limited.
NOTE: Variables declared in GVLs get initialized before local variables of POUs.
218 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Select the library in the upper part of the Library Manager to get the module tree. Select Param in
order to open the tab Library Parameters showing the declarations. Select the cell in column Value
(editable) and use the empty space to open an edit field. Enter the desired new value for
g_c_Arraysize. It will be applied to the current, local scope of the library after having closed the
edit field.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 219
Program Components
Overview
A network variable list (receiver) is used in the Software catalog → Variables → Global Variables
view and in the Applications tree. It defines variables, which are specified as network variables in
another device within the network.
NOTE: The maximum size of a network variable is 255 bytes. The number of network variables is
not limited.
Thus you can add a network variable list (receiver) object to an application if a network variable list
(sender) with special network properties (network variable list) is available in one of the other
network devices. This is independent of whether defined in the same project or in different projects.
If several of appropriate network variable lists (sender) are found within the present project for the
present network, select the desired network variable list (sender) from a selection list Sender when
adding a network variable list (receiver) via the dialog box Add Object → Network Variable List
(Receiver). Network variable lists (sender) from other projects must be imported as described in
this chapter.
This means that each network variable list (receiver) corresponds exactly to one network variable
list (sender) in another device.
Dialog box Add Network Variable List (Receiver)
220 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
NOTE: Only arrays whose bounds are defined by a literal or a constant are transferred to the
remote application. Constant expressions in this case are not allowed for bounds definition.
Example: arrVar : ARRAY[0..g_iArraySize-1] OF INT ; is not transferred
arrVar : ARRAY[0..10] OF INT ; is transferred
For further information, refer to the Network Communication chapter (see page 963).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 221
Program Components
222 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Step 2: Define the network properties of the network variable list (sender):
3 Click OK. The dialog box is closed and the network variable
list (sender) network properties are set.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 223
Program Components
224 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Step 2: View and / or modify the network settings of the network variable list (receiver):
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 225
Program Components
3 Under the Application node of the controller The editor for prog_rec opens on the right-hand
Dev_Receiver, double-click the POU prog_rec. side.
4 Enter the following code for the variable –
ivar_local:
5 Log on with sender and receiver applications within The variable ivar_local in the receiver gets the
the same network and start the applications. values of iglobvar as currently displayed in the
sender.
226 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Persistent Variables
Overview
This object is a global variable list (GVL), which only contains persistent variables of an application.
Thus it has to be assigned to an application. For this purpose, it has to be inserted in the
Applications tree via selecting the respective node, clicking the green plus button, and selecting
Add Other Objects → Persistent Variables....
Only those variables which are declared with VAR PERSISTENT and which are contained in this
list are persistent. The Add all Instance Paths command (see EcoStruxure Machine Expert, Menu
Commands, Online Help) adds all PERSISTENT declarations found in other POUs to the list.
Variables declared with VAR PERSISTENT are also retain variables. Retain variables have the
capacity to keep their values after executing a Reset warm command (see EcoStruxure Machine
Expert, Menu Commands, Online Help). The difference is, that persistent variables are only
reinitialized upon executing the Reset origin command (see EcoStruxure Machine Expert, Menu
Commands, Online Help) or by a new application download (after the application had been
removed from the controller). An exception is made if you modified their names or data types.
Persistent variable list
For further information, refer to the description of remanent variables (see page 641).
Also refer to the description of the special commands for handling persistent variables
(see EcoStruxure Machine Expert, Menu Commands, Online Help).
Edit a persistent variable list in the persistence editor, which corresponds to the GVL editor
(see page 437). The VAR_GLOBAL PERSISTENT RETAIN is already preset in the first line.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 227
Program Components
Step Action
1 Select the respective application node in the Applications tree, click the green plus
button, and select Add Other Objects → Persistent Variables....
Alternatively, you can right-click the application node, and execute the command Add
Object → Persistent Variables....
2 In the Add Persistent Variables dialog box type a name for this list in the Name text
box.
3 Click Add.
Result: A persistent variable node is created in the Applications tree. For an example,
refer to the Overview paragraph in this chapter.
228 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
External File
Overview
To add an external file to the Global node of the Applications Tree or Tools Tree, select the Global
node, click the green plus button and execute the commands Add other objects → External File....
Click the ... button to open the dialog box for browsing a file. The path of this file is entered in the
File path text box. In the Name text box, the name of the chosen file is entered automatically
without extension. You can edit this field to define another name for the file under which it should
be handled within the project.
Add External File dialog box:
Description of the What Do You Want to Do with the External File? Section of the Dialog Box
Select one of the following options:
Option Description
Remember the link. The file will be available in the project only if it is available in the defined link path
Remember the link and embed into A copy of the file will be stored internally in the project but also the link to the
project. external file will be recalled. As long as the external file is available as defined,
the defined update options will be implemented accordingly. Otherwise just the
file version stored in the project will be available.
Embed into project. Just a copy of the file will be stored in the project. There will be no further
connection to the external file.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 229
Program Components
Description of the When the External File Changes, Then Section of the Dialog Box
If the external file is linked to the project, you can additionally select one of the options:
Option Description
reload the file automatically. The file is updated within the project as soon as it has been changed
externally.
prompt whether to reload the file. A dialog box pops up as soon as the file has been changed externally.
You can decide whether the file is updated also within the project.
do nothing. The file remains unchanged within the project, even when it is changed
externally.
Button Description
Display file properties... This button opens the dialog box for the properties of a file. This dialog
box also appears when you select the file object in the Applications
Tree or Tools Tree and execute the command Properties. In the tab
External file of this dialog box, you can view and modify the properties.
Add After you have completed the settings, click the Add button to add the
file to the Global node of the Applications Tree or Tools Tree. It is
opened in that tool which is defined as default for the given file format.
230 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Text List
Overview
A text list is an object managed globally in the Global node of the Applications Tree or assigned to
an application in the Applications Tree.
It serves the following purposes:
Multi-language support for static (see page 232) and dynamic (see page 233) texts and tooltips
in visualizations and in the alarm handling
Dynamic text exchange
Text lists can be exported and (re-) imported (see page 236). Export is necessary, if a language
file in XML format has to be provided for a target visualization, but is also useful for translations
(see page 237).
Possible formats of text lists:
Text
XML
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 231
Program Components
232 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Example of a GlobalTextList
Create Global Text List
NOTICE
UNINTENDED MODIFICATION OF IDENTIFIERS
Do not modify the identifiers when editing the exported list.
Failure to follow these instructions can result in equipment damage.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 233
Program Components
Detailed Example
This example explains how to configure a visualization element, which displays the corresponding
message when an error is detected in an application that processes error events identified via
numeric IDs assigned to an integer variable ivar_err.
Provide a dynamic textlist named ErrorList where the message texts for error IDs 0 to 4 are defined
in languages German, English, and Default:
Within a table cell, you can add a line break by pressing the keyboard shortcut Ctrl + Enter.
To use the error IDs in the visualization configuration, define a STRING variable, for example
strvar_err. To assign the integer value of ivar_err to strvar_err, use
strvar_err:=INT_TO_STRING(ivar_err);.
strvar_err can be entered as Textindex parameter in the configuration of the Dynamic texts
properties of a visualization element. This element will display the appropriate message in online
mode.
234 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
The next example is for processing the error ID using project variables and configuration of a
visualization element (Properties), which should display the appropriate message:
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 235
Program Components
Formatting of Texts
The texts can contain formatting definitions (%s,%d,…), which allow to include the present values
of variables in a text. For the possible formatting strings, see the Visualization part of the
EcoStruxure Machine Expert online help.
When using text with formatting strings, the replacement is done in the following order:
The actual text string to be used is searched via list name and ID.
If the text contains formatting definitions, these are replaced by the value of the respective
variable.
236 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 237
Program Components
Image Pool
Overview
Image pools are tables defining the file path, a preview, and a string ID for each image. By
specifying the ID and (for unique accessing) additionally the image file name, the image can be
referenced, for example, when being inserted in a visualization (configuration of the properties of
an image element, refer to Using Images Which are Managed in Image Pools (see page 241) ).
In a library project, you can create an image pool. If you then declare the library to be a symbol
library, you can use the images it contains inside your project visualizations. To achieve this, right-
click the ImagePool node of the library project, select Properties, and set the Symbol library
settings in the Image Pool tab (by clicking the button Mark library as symbol library and optionally
selecting a Text list for symbol translation).
After you have added the library to your project, the image pool will appear (as you named it) in the
ToolBox when a visualization editor is active.
NOTE: Reduce the size of an image file as much as possible before adding it to an image pool.
Otherwise, the project size and the loading and storing efforts of visualization applications,
including images, can become large.
238 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Element Description
ID String ID (for example logo, y_icon, 2);
A unique referencing of an image is achieved by the combination of image list
name and ID (for example, List1.basic_logo).
File name Path of the image file (for example, C:\programs\images\logo.bmp).
Image formats supported by EcoStruxure Machine Expert:
BMP
EMF
GIF
ICO
JPG
PNG
SVG
TIFF
The controller you are using may not support all image formats. Consult the
Programming Guide specific to your controller for further information.
If the image file is stored in the directory for image files (as defined in Tools →
Options → Visualization, you only have to enter the file name in this text box.
Image Preview of the image.
Link type Information on how the image file is linked to the project.
Specify the Link type when you add the image file manually in the dialog box
Select image. Refer to the description Creating and Editing an Image Pool
(see page 240).
NOTE: If the target system does not support images in the vector image format SVG, they are
automatically converted to the format PNG during download. For information on the supported
image formats, refer to the device descriptions provided by your hardware manufacturer.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 239
Program Components
240 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Element Description
Image File
Enter the path of the image file or click the button for getting the
standard dialog box for browsing the local file system. Select the desired file
or files. Multiple selection is possible.
What do you want to do with Choose a link type:
the image file? Remember the link: The file is only available in the project if it is available
in the specified path. Files specified without path must be stored in the
project folder.
Remember the link and embed into project: A copy of the file is stored
internally in the project. The link to the specified path is stored as well. As
long as the image file is available under the stored path, the update action
as defined below, is valid. As soon as the image file is removed from the
specified location, only the copy of the file stored internally in the project
will be used.
Embed into project: Only a copy of the file is stored internally in the
project. The link to the external path is not stored.
If you choose the option Remember the link and embed into project, you can
select one of the following update actions:
When the image file changes, then
reload the file automatically.
prompt whether to reload the file.
do nothing.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 241
Program Components
242 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Program Components
Section 7.4
Application
Application
Application
Overview
An application is a set of objects which are needed for running a particular instance of the controller
program on a certain hardware device (controller). For this purpose, independent objects managed
in the Global node of the Applications tree are instantiated and assigned to a device. This meets
the concept of object-orientated programming. However, you can also use purely application-
specific POUs.
An application is represented by an application object in the Applications tree. Below an application
entry, insert the objects defining the application resource set.
One application is available for each controller. It is not possible to add further applications.
A part of each application is the Task Configuration controlling the run of a program (POU
instances or application-specific POUs). Additionally, it can have assigned resource objects like
global variable lists, libraries, and so on. These - in contrast to those managed in the Global node
of the Applications tree - can only be used by the particular application and children. For the rules,
refer to the description of arranging and configuring objects in the Devices tree (see page 44).
Consideration
When going to log in with an application on a target device (controller or simulation target), two
checks are performed: Which application is currently in the controller? Are the application
parameters in the controller matching those in the application within EcoStruxure Machine Expert?
Appropriate messages indicate mismatches and offer some ways to continue in this case. Also you
have the possibility to delete the application in the controller. Refer to the description of the Login
command (see page 254) for more details.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 243
Program Components
244 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Task Configuration
EIO0000002854 06/2019
Chapter 8
Task Configuration
Task Configuration
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 245
Task Configuration
Task Configuration
Overview
The Task Configuration defines 1 or several tasks for controlling the processing of an application
program.
It is a resource object for an application (see page 243). It has to be inserted in the Applications
tree below an application node. A task can call an application-specific program POU, which is only
available in the Applications tree below the application. It can also call a program which is managed
in the Global node of the Applications tree. In the latter case, the program that is available globally
will be instantiated by the application.
You can edit a task configuration in the Task Configuration editor (see page 465).
In online mode, the Task Configuration editor provides a monitoring view that presents information
on cycles, cycle times, and task status.
As an additional functionality of the task configuration, if supported by the device, the monitoring
view allows a dynamic analysis of the POUs which are controlled by a task. It supplies information
about the cycle times, the quantity of function block calls and the unused code lines.
246 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Task Configuration
Adding Tasks
Introduction
You can add tasks to your application via the Applications tree.
Procedure
Step Action
1 In the Applications tree, select the Task Configuration node, click the green plus
button, and execute the command Task....
Alternatively, you can right-click the Task Configuration node, and select Add Object
→ Task... from the context menu.
Result: The Add Task dialog box opens.
2 In the Add Task dialog box, enter a name in the Name: text box.
Note: The name must neither contain any space nor exceed a length of 32
characters.
3 Click Add.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 247
Task Configuration
248 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Managing Applications
EIO0000002854 06/2019
Chapter 9
Managing Applications
Managing Applications
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 249
Managing Applications
Section 9.1
General Information
General Information
Introduction
Introduction
To run an application, you must first connect the PC to the controller, then download the application
to the controller.
NOTE: Due to memory size limitation, some controllers are not able to store the application source
but only a built application that is executed. This means that you are not able to upload the
application source from the controller to a PC.
WARNING
UNINTENDED EQUIPMENT OPERATION
Confirm that you have entered the correct device designation or device address in the
Communication Settings dialog when downloading an application.
Confirm that machine guards and tags are in place such that any potential unintended
machine operation will not result in personal injury or equipment damage.
Read and understand all user documentation of the software and related devices, as well as
the documentation concerning equipment or machine operation.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Preconditions
Verify that your application meets the following conditions before downloading it to the controller:
the active path is set for the correct controller,
the application you want to download is active,
the application is free of compilation errors.
250 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Boot Application
The boot application is the application that is launched on controller start. This application is stored
in the controller memory. To configure the download of the boot application, right-click the
Application node in the Applications tree and select the Properties command.
At the end of a successful download of a new application, a message is displayed asking you if you
want to create the boot application.
You can manually create a boot application in the following ways:
In offline mode: Click Online → Create boot application to save the boot application to a file.
In online mode, with the controller being in STOP mode: Execute the Online → Create boot
application command (see EcoStruxure Machine Expert, Menu Commands, Online Help) to
download the boot application to the controller.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 251
Managing Applications
Section 9.2
Building and Downloading Applications
252 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Building Applications
Overview
EcoStruxure Machine Expert provides different build procedures in the Build menu
(see EcoStruxure Machine Expert, Menu Commands, Online Help). These procedures serve to
handle syntactical checks, either just on the changed objects or on all objects of the active
application.
You can perform an offline code generation in order to check for compilation errors before
downloading the code to the device. For a successful login, the code generation must have been
completed without detecting any errors.
At each download, the compile information, containing the code and a reference ID of the loaded
application, is stored in the project directory in a file <projectname>.<devicename>.<application
ID>.compileinfo. The compileinfo file is deleted when the Clean or Clean all command is executed.
No code generation is performed when the project is compiled by the build commands (by default
in the Build menu). The build process checks the project in order to detect programming errors.
Any detected programming errors are displayed in the Messages view (message category Build).
During code generation, additional errors can be detected and displayed. These errors can only be
detected by the code generator or they are caused by memory allocation.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 253
Managing Applications
Login
Overview
The Online → Login command connects the application to the target device (controller or
simulation target) and thus changes into the online mode.
The default shortcut is Alt + F8.
WARNING
UNINTENDED EQUIPMENT OPERATION
Confirm that you have entered the correct device designation or device address in the
“Communication Settings” dialog when downloading an application.
Confirm that machine guards and tags are in place such that any potential unintended
machine operation will not result in personal injury or equipment damage.
Read and understand all user documentation of the software and related devices, as well as
the documentation concerning equipment or machine operation.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
If there is an online user management (also refer to the chapter Users and Groups (see page 143))
established on the target device, at login you are prompted to enter the appropriate user name and
password. For this purpose, the dialog box Device User Logon opens.
NOTE: The layout of EcoStruxure Machine Expert views can change when you connect to the
target device because the Online perspective (see page 53) is automatically selected when you
switch to online mode.
Selecting the View of the Communication Settings Tab in the Device Editor
Depending on the option selected for Communication page in the Tools → Options → Device
editor dialog box (see EcoStruxure Machine Expert, Menu Commands, Online Help), the
Communication Settings tab of the device editor is displayed in three different modes. Refer to the
description of the different tabs for details:
254 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Login Procedure
The steps of the login procedure are identical. They only differ in the presentation of the
Communication Settings tab.
For a successful login, the code generation must have been completed without detecting errors
(refer to the chapter Build Process Before Login (see page 256)).
Step Action
1
Execute the command Online → Login, or click the Login button from the toolbar, or press
ALT + F8.
Result: Since no target address has been set before, the Communication Settings tab of the
device editor opens in the mode you selected. A message box is displayed indicating that a valid
address has not been defined.
2 If only one controller has been detected by EcoStruxure Machine Expert, this controller is used
as target device.
If several controllers have been detected, double-click the controller you want to log in.
NOTE: In controller selection mode and in classic mode, only those controllers are listed that
have the same Target ID as the selected controller. To display all controllers in the list, set the
Filter criterion to None.
3
Execute the command Online → Login, or click the Login button from the toolbar, or press
ALT + F8.
Result: A message box displays to inform you of potential hazards.
4 Click Cancel to abort the login operation or press ALT + F to confirm the message and to log in
to the selected controller.
Result: If you press ALT + F the connection to the controller is established, and you can
download the application (see page 257).
Unsuccessful Login
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 255
Managing Applications
256 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Downloading an Application
Introduction
To run an application, first connect the PC to the controller, then download the application to the
controller.
Downloading a project allows you to copy the current project from EcoStruxure Machine Expert to
the controller memory.
NOTE: Due to memory size limitation, some controllers are not able to store the application source
but only a built application that is executed. This means that you are not able to upload the
application source from the controller to a PC.
WARNING
UNINTENDED EQUIPMENT OPERATION
Confirm that you have entered the correct device designation or device address in the
Communication Settings dialog when downloading an application.
Confirm that machine guards and tags are in place such that any potential unintended
machine operation will not result in personal injury or equipment damage.
Read and understand all user documentation of the software and related devices, as well as
the documentation concerning equipment or machine operation.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Preconditions
Verify that your application meets the following conditions before downloading it to the controller:
The active path is set for the correct controller.
The application you want to download is active.
The application is free of compilation errors.
Boot Application
The boot application is the application that is launched on controller start. This application is stored
in the controller memory. To configure the download of the boot application, right-click the
Application node in the Devices view and select the Properties command.
At the end of a successful download of a new application, a message is displayed asking you if you
want to create the boot application.
You can manually create a boot application in the following ways:
In offline mode: Click Online → Create boot application to save the boot application to a file.
In online mode, with the application being in STOP mode: Click Online → Create boot
application to download the boot application to the controller.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 257
Managing Applications
Operating Modes
The download method differs depending on the relationship between the loaded application and
the application you want to download. The 3 cases are:
Case 1: The application in the controller is the same as the one you want to load. In this case,
no download occurs, you just connect EcoStruxure Machine Expert to the controller.
Case 2: Modifications have been made to the application that is loaded in the controller in
comparison to the application in EcoStruxure Machine Expert. In this case, you can specify if
you want to download all or parts of the modified application or keep the application in the
controller as it is.
Case 3: A different or a new version of application is already available on the controller. In this
case, you are asked whether this application should be replaced.
Case 4: The application is not yet available on the controller. In this case, you are asked to
confirm the download.
Step Action
1 To connect to the controller, select Online → Login to ’Application[YourApplicationName; Plc Logic]’.
2 You are connected to the controller.
258 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Step Action
1 To connect to the controller, select Online → Login to ’Application[YourApplicationName; Plc Logic]’.
2 In case you modified your application, and you want to reload it into the controller, the following message
appears:
Login with online change Only the modified parts of an already running project is reloaded to the
controller.
Login with download The whole modified application is reloaded to the controller.
Login without any change The modifications are not loaded.
NOTE: If you select the option Login without any change, the changes you perform in the EcoStruxure
Machine Expert application are not downloaded to the controller. In this case, the information and status
bar in EcoStruxure Machine Expert will show RUNNING as operational state and will indicate Program
modified (Online change). This differs from the options Login with online change or Login with download,
where the information and status bar indicates Program unchanged.
In this case, monitoring of variables is possible, but the logic flow may be confusing because the values
on function block outputs may not match to the values on the inputs.
Examples
In LD, contact states are monitored based on the affected variables. This may have the effect that a blue
animated contact followed by a blue link (meaning true) is shown, although the coil connected to this
contact shows it as false.In ST logic flow, an IF statement or a loop seems to be executed, but it is actually
not executed because the condition expression is different in the project and on the controller.
3 Select the suitable option and click OK.
NOTE: Consult the Programming Guide specific to your controller for important safety-related
information concerning the downloading of applications.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 259
Managing Applications
Step Action
1 To connect to the controller, select Online → Login to ’Application[YourApplicationName; Plc Logic]’.
2a In case, the controller is not in RUN mode, and you want to load a different application than the one
currently in the controller, the following message appears:
Refer to the hazard messages below before you click Yes to download the new application to the
controller, or No to cancel the operation.
2b In case, the controller is in RUN mode, and you want to load a different application than the one currently
in the controller, the following message appears:
Refer to the build messages below before you click Yes to download the new application to the controller,
or No to cancel the operation.
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that you have the correct application before confirming the download.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
If you click Yes, the application running in your controller will be overwritten.
260 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Step Action
1 To connect to the controller, select Online → Login to ’Application[YourApplicationName; Plc Logic]’.
2 In case the application is not yet available on the controller, you are asked to confirm the download. For
this purpose, a dialog box with the following text displays:
Click Yes to download the application to the controller, or No to cancel the operation.
NOTE: Consult the Programming Guide specific to your controller for important safety-related
information concerning the downloading of applications.
Online Change
The Online Change command modifies the running application program and does not affect a
restart process:
The program code can behave other than after a complete initialization because the machine
keeps its state.
Pointer variables keep their values from the last cycle. If there is a pointer on a variable, which
has changed its size due to an online change, the value will not be correct any longer. Verify
that pointer variables are reassigned in each cycle.
WARNING
UNINTENDED EQUIPMENT OPERATION
Thoroughly test your application code for proper operation before placing your system into
service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
NOTE: Consult the Programming Guide specific to your controller, chapter Controller States
Description for specific information.
If the application project currently running on the controller has been changed in the programming
system since it has been downloaded last, just the modified objects of the project will be loaded to
the controller while the program keeps running.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 261
Managing Applications
In the Online Change Memory Reserve view (see page 201), you configure a memory reserve for
the online change of function blocks. After you have made modifications on a function block and
you perform an online change, it is no longer necessary to copy the instance variables of the
function block to a new memory area.
Element Description
Login with online change This option is selected per default. If you confirm the dialog box by clicking OK,
the modifications will be loaded and immediately displayed in the online view
(monitoring) of the respective object or objects.
Login with download Activate this option to load and initialize the application project completely.
Login without any change Activate this option in order to keep the program running on the controller
unchanged. Afterwards, an explicit download can be performed, thus loading
the complete application project. It is also possible that you are asked again
whether an online change should be performed at the next relogin.
Update boot project This option is by default not selected.
To select this option, activate the option Implicit boot application on Online
Change in the Boot Application tab of the Properties dialog box of the
Application node.
A boot application is then automatically created with an online change.
Details Click this button to obtain the Application Information dialog box (Project name,
Last modification, IDE version, Author, Description) on the current application
within the IDE (Integrated Development Environment, i.e., EcoStruxure
Machine Expert) in comparison to that currently available on the controller.
Refer to the following figure.
262 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
For further information, refer to the Login chapter (see page 254).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 263
Managing Applications
264 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
If the option Download Application Info is activated in the Application Build Options tab of the View
→ Properties dialog box (see EcoStruxure Machine Expert, Menu Commands, Online Help), this
tab shows the following: The content of the application read from the controller is shown in the
column Uploaded code for application <App2> and can be compared to the content of the
application in the programming system. To update the left column Last generated code for
application <App2> with the latest version of the application active in the programming system,
click the button Application not up to date. Generate code now?. The contents of the applications
are compared and different objects are marked with colors as they are in the Project → Compare
function (see EcoStruxure Machine Expert, Menu Commands, Online Help). This more granular
information can help you to evaluate the effects downloading the new application.
If the online change will affect considerable changes in download code, like for example possible
moves of pointer addresses or necessary redirections of interface references (see page 185)
another message box is displayed after you have confirmed the Online change dialog box with OK
before download will be performed. It informs you about the effects you have to consider and
provides the option to abort the online change operation.
NOTE: After having removed implicit check function (such as CheckBounds) from your application,
no Online Change is possible, just a download. An appropriate message will appear.
Click the Details button in this message box to display detailed information, such as the number
and a listing of changed interfaces, POUs, affected variables, and so on.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 265
Managing Applications
266 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 267
Managing Applications
268 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Section 9.3
Running Applications
Running Applications
Running Applications
Introduction
This part shows how to start/stop an application.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 269
Managing Applications
Section 9.4
Maintaining Applications
Maintaining Applications
270 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Monitoring
Overview
In online mode, there are various possibilities to display the current values of the objects in the
controller:
You can see the values of the objects in a program editor screen while online. For details, see
the description of the respective editor.
You can view object values in the online view of the declaration editor. For details, refer to the
description of the declaration editor (see page 425).
You can view objects independently in lists through the command Watch. For details, refer to
the description of the watch view / watch list editor (see page 480). You can insert a variable in
a watch view by selecting it and executing the command Add watchlist from the context menu.
You can view values via trace sampling: recording and displaying of variable values from the
controller. For details, refer to the description of the trace object functionality (see page 518).
You can view object values that are contained in recipes: User-defined set of variables for
writing and watching these variables on the controller. Refer to the description of the recipe
manager (see page 495).
For information on monitoring of properties that are inserted beneath POUs or function blocks,
refer to the chapter Property (see page 183).
For information on monitoring of function calls, refer to the chapter Attribute Monitoring
(see page 691).
NOTE: If a value is not valid (for example, the result of calculating the square root of a negative
number), the result may be displayed as NaN (not a number) or INF (infinite value) depending on
the operation, the object, and the particular controller platform. Consult the Programming Guide
specific to your controller for more information.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 271
Managing Applications
Debugging
Overview
To evaluate potential programming errors, you can use the debugging functionality.
For testing purposes, an application can also run in simulation (see EcoStruxure Machine Expert,
Menu Commands, Online Help) without any required link to an actual target device. While
simulation avoids the need to connect to physical hardware, there are limitations to which you may
need to complete debugging online.
Conditional Breakpoints
The stop at the breakpoint can be dependent on the following conditions:
At the time, a specific boolean expression is TRUE.
Which cycle number is running.
Which task is executing.
When the value of a variable is modified (data breakpoint).
Declaring a specific debug task can help to avoid that several tasks are affected by the error check
(refer to the Breakpoints and Stepping in Applications with Multiple Tasks paragraph
(see page 275)).
Execution Points
In online mode, the Breakpoints dialog box (see EcoStruxure Machine Expert, Menu Commands,
Online Help) allows you to change a breakpoint and data breakpoint in such a way that it becomes
an execution point. Then the program does not stop at the position, but the code processing is
initiated.
272 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Symbols
Symbol Description
Breakpoint enabled.
Breakpoint disabled.
Stop at breakpoint.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 273
Managing Applications
Symbol Description
Data execution point disabled.
274 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Data Breakpoints
Data breakpoints allow you to stop program execution when the value of a variable changes.
This function is not available for all supported controllers. Consult the Programming Guide specific
to your controller.
The number of data breakpoints you can define depends on the number of registers that is
available in the controller you are using. A message is displayed when you attempt to set a data
breakpoint and the maximum number has been reached.
The following options exist for data breakpoints as for normal breakpoints:
Linking the halt at the data breakpoint to an additional condition, refer to Conditional Breakpoints
(see page 272).
Redefining a data breakpoint to a data execution point where the program does not halt, but
processes specific code, refer to Execution Points (see page 272).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 275
Managing Applications
276 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Core Dump
If... Then...
If you created a core dump explicitly by choosing the then an option is automatically available in the
command Create Core Dump, archive configuration.
If you copied the core dump from the controller, then you can add it to a project archive only by
choosing the function Additional files.
NOTE: A project archive with a core dump must include the download information; otherwise the
dump is unusable.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 277
Managing Applications
Step Action
1 Load the core dump from the controller by executing the command Debug → Load Core Dump.
Result: An online view of the application is displayed. You see the variable values and call stack
from the time when the error has been detected. This also includes the values of the I/O variables
in the mapping dialog of the device configurator and the task configuration. The message Core
dump loaded is displayed in the status line. The core dump file is copied as
<project_name>.<device_name>.<application_name>.<application-Guid>.core to the local
project directory.
2 Execute the command Debug → Load device log from Core Dump to load the device log from
the time the error has been detected into the project.
Result: The log view opens (as in online mode of the device configurator) displaying the events
at the time the core dump was created.
3 After you have completed the core dump analysis, execute the command Debug → Close Core
Dump.
Result: The core dump view of the application closes and the project returns to its views in
normal offline mode.
Step Action
1 Execute the command Debug → Create Core Dump.
Result: The creation of a new core dump starts. A progress bar appears in the status line
together with a cancel button.
A core dump file is saved to the local project directory as
<project_name>.<device_name>.<application_name>.<application-Guid>.core.
278 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Programming Support
Overview
EcoStruxure Machine Expert offers settings, dialogs and functionalities, which facilitate the input
of program code and indicate detected errors at an early stage.
For further information, refer to the descriptions of the following functions:
Input Assistant (see page 489)
Intelli-sense (see page 718)
Auto Declare... (see EcoStruxure Machine Expert, Menu Commands, Online Help)
Smart Coding (see EcoStruxure Machine Expert, Menu Commands, Online Help)
Static Analysis Light (see page 285)
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 279
Managing Applications
Refactoring
Overview
Generally refactoring is the process of restructuring and improving existing software code without
changing its behavior.
Refactoring in EcoStruxure Machine Expert provides functionalities for renaming object names and
variable names. It allows you to show all usage locations of changed objects and variables and to
get renamed all those at once, or only individual ones. You can configure whether and at which
locations you should get asked for performing refactoring. Explicitly you can use the command
Refactoring → Rename.
For further information, also refer to Options, Refactoring (see EcoStruxure Machine Expert, Menu
Commands, Online Help).
Command Rename
The command Refactoring → Rename is used for a global, project wide renaming of object names,
and variable names.
It is available in the context menu if you set the cursor on a variable name in the declaration or if
you right-click one of the following objects in a navigator:
Functions
POUs
GVLs
Methods
Properties
Devices
The command is also available if you select variables and unit conversions within the editor for unit
conversions.
The command is not available in online mode.
Process of Renaming
After you have executed the Refactoring → Rename command, a dialog is displayed. It shows the
locations where the concerned name is used: In the right part of the window the particular
locations, in the left part the navigation tree where the concerned object is marked.
You can select the following commands for each location individually:
Reject/accept this change: Reject/accept single changes in the right window.
Reject/accept this object: Reject/accept all changes in the concerned object.
Reject/accept whole project: Reject/accept all changes in the project.
Accepted changes are displayed with a yellow background, rejected changes with gray
background.
280 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Option Description
Add inputs with placeholder Select this option to insert the standard placeholder text _REFACTOR_
text whenever the new variable occurs in the implementation code. You can
search for this standard text later in order to identify the affected locations.
Add inputs with the following Select this option to insert an initialization value whenever the new variable
value occurs in the implementation code. Enter the initialization value in the text box
on the right-hand side of the option Add inputs with the following value.
In order to accept or reject changes, right-click the changed locations or execute the commands in
the left or right part of the dialog box, as described in the Process of Renaming paragraph in this
chapter.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 281
Managing Applications
Example 2:
By refactoring, the fun block receives a new input variable input3 with the placeholder text
_REFACTOR_:
Before refactoring:
inst(input1 := a + b, input2 := 3, inputx := TRUE);
fun(a + b, 3, TRUE);
After refactoring:
inst(input1 := a + b, input2 := 3, input3 := _REFACTOR_, inputx := TRUE
);
fun(a + b, 3, input3:=_REFACTOR_, TRUE);
282 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Step Action
1 Right-click the declaration part and execute the command Refactoring → Reorder Variables.
Result: The Reorder dialog box opens with a list of VAR_INPUT variables.
2 Drag the invar1 : INT; entry to the position before the invar2. entry.
Result: The invar1 declaration is at the top position.
3 Click OK to close the dialog box.
Result: The Refactoring dialog box opens. The affected elements are marked in yellow.
4 Click OK to accept the new order of parameters of the function block. Have in mind that the
modified order of the parameters will be reflected also at the call usages of the POUs.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 283
Managing Applications
6 Execute the command Edit → Auto Declare.... As an alternative, use the shortcut Shift
+ F2.
Result: The Auto Declare dialog box
opens. The settings of the variable iA
are displayed.
7 Edit the Name and change iA into iCounter_A. Result: The Refactoring - Renaming
from iA to iCounterA dialog box opens.
The POUs where the variable is used
are highlighted in the tree structure.
8 Click OK to apply the renaming and to close the dialog –
box.
284 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Overview
The static analysis function checks the source code of a project for deviations from certain coding
directives before the project is downloaded to the target system. This follows the basic idea of the
lint analysis tool.
You define the desired set of rules in the Project Settings → Static Analysis Light dialog box
(see EcoStruxure Machine Expert, Menu Commands, Online Help).
NOTE: The check is automatically performed at each code generation.
Deviations from the rules are displayed as messages of category Build in the Messages view. The
error numbers are displayed as SA<number>.
NOTE: The analysis is only done on the application code in the current project. Libraries are not
regarded.
NOTE: For GVL variables: If there are several applications in the project, then only objects below
the currently active application are checked. If there is only one application in the project, then also
any objects in the POUs pool are checked.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 285
Managing Applications
Example
Rule 24 gets disabled for two lines (that means that it is not necessary here to write, for example,
nTest:=DINT#99), and afterwards re-enabled:
{analysis -24}
nTest := 99;
iVar := INT#2;
{analysis +24}
Specifying multiple rules:
{analysis -10, -24, -18}
286 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Managing Applications
Overview
Creating an archive in your controller allows you to have the complete project in your controller
which is useful for maintenance tasks. The following procedure describes how to create a project
archive automatically with the download procedure.
You can manually create a project archive be executing the File → Source download... command
as described in the Menu Commands online help (see EcoStruxure Machine Expert, Menu
Commands, Online Help).
Step Action
1 Execute the command Project → Project Settings.
2 In the Project Settings dialog box, select Source Download → Additional Files...
The following options can be selected:
Option to connect with the uploaded project:
Download information files
Options which are needed to connect with another EcoStruxure Machine Expert version:
Download information files
Library profile
Referenced devices
Referenced libraries
Visualization Profile
For further information, refer to the Project Settings - Source Download description
(see EcoStruxure Machine Expert, Menu Commands, Online Help).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 287
Managing Applications
3.) Upload the project (sources) from the controller by executing the Online → Source Upload...
command (see EcoStruxure Machine Expert, Menu Commands, Online Help).
288 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Logic Editors
EIO0000002854 06/2019
Part IV
Logic Editors
Logic Editors
Chapter 10
Common Features of Graphic Editors
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 291
Common Features of Graphic Editors
4 Zooming tool The zoom button opens a submenu where you can select one of the
given zoom factors for the chart. To specify another value, click the ...
button to open an edit dialog box. The current zoom factor is displayed
to the left of the button.
To zoom by mouse wheel, press the Ctrl key while scrolling the mouse wheel. The current zoom
level is increased or decreased in steps of 10 percent.
292 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
FBD/LD/IL Editor
EIO0000002854 06/2019
Chapter 11
FBD/LD/IL Editor
FBD/LD/IL Editor
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 293
FBD/LD/IL Editor
Section 11.1
Information on the FBD/LD/IL Editor
294 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
FBD/LD/IL Editor
Overview
A combined editor is available for editing POUs in the languages FBD (function block diagram
(see page 296)), LD (ladder diagram (see page 297)), and IL (instruction list (see page 298)).
Activate the IL implementation language for EcoStruxure Machine Expert in the Tools → Options
dialog box, category FBD, LD and IL editor, tab (see EcoStruxure Machine Expert, Menu
Commands, Online Help) IL.
Therefore, a common set of commands and elements is used and an automatic internal conversion
between the three languages is done. In offline mode, the programmer can switch between editor
views (View).
Keep in mind that there are some special elements which cannot be converted and thus will only
be displayed in the appropriate language. Also, there are some constructs which cannot be
converted unambiguously between IL and FBD and therefore will be normalized at a conversion
back to FBD; specifically, negation of expressions and explicit/implicit output assignments.
You can define the behavior, look, and menus of the FBD/LD/IL editor in the Customize and
Options dialog boxes. You also have options to define the display of comments and addresses.
The editor opens in a bipartite window. When you edit an object programmed in FBD/LD/IL, the
upper part contains a declaration editor (see page 426), the lower part contains a coding area.
The programming language for a new object is specified when you create the object.
For further information refer to:
Working in the FBD and LD Editor View (see page 305)
Working in the IL Editor View (see page 310)
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 295
FBD/LD/IL Editor
Overview
The Function Block Diagram is a graphically oriented programming language. It works with a list
of networks. Each network contains a graphical structure of boxes and connection lines which
represents either a logical or arithmetic expression, the call of a function block, a jump, or a return
instruction.
FBD networks
296 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Overview
The Ladder Diagram is a graphics-oriented programming language which resembles the structure
of an electric circuit.
On the one hand, the Ladder Diagram is suitable for constructing logical switches, on the other
hand it also allows you to create networks as in FBD. Therefore, the LD is useful for controlling the
call of other POUs.
The Ladder Diagram consists of a series of networks, each being limited by a vertical current line
(power rail) on the left. A network contains a circuit diagram made up of contacts, coils, optionally
additional POUs (boxes), and connecting lines.
On the left side, there is 1 or a series of contacts passing from left to right the condition ON or OFF
which corresponds to the boolean values TRUE and FALSE. To each contact a boolean variable
is assigned. If this variable is TRUE, the condition will be passed from left to right along the
connecting line. Otherwise, OFF will be passed. Thus, the coil or coils, which is/are placed in the
right part of the network, receive an ON or OFF coming from left. Correspondingly the value TRUE
or FALSE will be written to an assigned boolean variable.
Ladder Diagram network.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 297
FBD/LD/IL Editor
Overview
The instruction list (IL)is an assembler-like IEC 61131-3 conformal programming language.
This language supports programming based on an accumulator. The IEC 61131-3 operators are
supported as well as multiple inputs / multiple outputs, negations, comments, set / reset of outputs
and unconditional / conditional jumps.
Each instruction is primarily based on the loading of values into the accumulator by using the
LD operator. After that the operation is executed with the first parameter taken out of the
accumulator. The result of the operation is available in the accumulator, from where you should
store it with the ST instruction.
In order to program conditional executions or loops, IL supports both comparing operators such as
EQ, GT, LT, GE, LE, NE and jumps. The latter can be unconditional (JMP) or conditional (JMPC /
JMPCN). For conditional jumps, the value of the accumulator is referenced for TRUE or FALSE.
Syntax
An instruction list (IL) consists of a series of instructions. Each instruction begins in a new line and
contains an operator and, depending on the type of operation, 1 or more operands separated by
commas. You can extend the operator by a modifier.
In a line before an instruction, there can be an identification mark (label) followed by a colon (:)
(ml: in the example shown below). A label can be the target of a jump instruction (JMPC m1 in the
example shown below).
Place a comment as last element of a line.
You can insert empty lines between instructions.
298 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Example
LD BVar1
ST tonInst1.IN
CAL tonInst1(
PT:=t1,
ET=>tOut2)
LD toninst1.Q
JMPC mark1
ST tonInst2.IN
___________________________________________________________
markl:
LD iVar2
ADD 230
For further information, refer to:
Working in the IL Editor View (see page 310)
Modifiers and operators in IL (see page 300)
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 299
FBD/LD/IL Editor
Modifiers
You can use the following modifiers in Instruction List (see page 298).
C with JMP, CAL, RET: The instruction will only be executed if the result of the preceding
expression is TRUE.
N with JMPC, CALC, RETC: The instruction will only be executed if the result of the preceding
expression is FALSE.
N with operators according to the Negation of the operand (not of the accumulator).
Operators table below (N in
Modifiers column)
( with operators according to the To be used for complex operands. For details, refer to the list of
Operators table below (( (left use cases for complex operands (see page 302).
parenthesis) in Modifiers column)
NOTE: Generally, it is not good practice to use the statement CALC (/RETC/JMPC) directly after
an STN, S or R operator, as those instructions arbitrarily modify the value of the accumulator and
thus could lead to difficult-to-find programming errors.
Operators
The table shows which operators can be used in combination with the specified modifiers.
The accumulator stores the current value, resulting from the preceding operation.
300 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
RET C, CN Unconditional (conditional) return of the POU and jump back to RET
the calling POU
RET = unconditional return
RETC = conditional return if accumulator is TRUE
RETCN = conditional return if accumulator is FALSE
See also IEC operators (see page 767) and Work in IL editor (see page 310) for how to use and
handle multiple operands, complex operands, function / method / function block / program / action
calls and jumps.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 301
FBD/LD/IL Editor
Example
Example IL program using some modifiers:
LD TRUE load TRUE to accumulator
ANDN bVar1 execute AND with negative value of bVar1
JMPC m1 if accum. is TRUE, jump to label "m1"
LDN bVar2 store negated value of bVar2...
ST bRes ... in bRes
___________________________________________________________
m1:
LD bVar2 store value of bVar2...
ST bRes ... in bRes
Using Operands
The table lists use cases for operands:
302 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Column 2:
Parameter value followed by a
comma , if followed by further
parameters.
Enter the right parenthesis )
after the last parameter.
According to the IEC standard
complex expressions are not
allowed here. Assign such
constructs to the function block or
the program before it is called.
Function call Row 1: LD X7
Column 1: GeomAverage 25
LD ST Ave
Column 2:
Input variable
Row 2:
Column 1:
Function name
Column 2:
Further input parameters,
separated by commas
The return value is written to the
accumulator.
Row 3:
Column 1:
ST
Column 2:
Variable to which the return
value is written
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 303
FBD/LD/IL Editor
Conditional jump:
The execution of the jump
depends on the loaded value.
304 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Overview
Networks are the basic entities in FBD and LD programming. Each network contains a structure
that displays a logical or an arithmetical expression, a POU (function, program, function block call,
and so on), a jump, a return instruction.
When you create a new object, the editor window automatically contains 1 empty network.
Refer to the general editor settings in the Options dialog box, category FBD/LD/IL for potential
editor display options.
Tooltip
Tooltips contain information on variables or box parameters.
The cursor being placed on the name of a variable or box parameter will prompt a tooltip. It shows
the respective type. In case of function block instances the scope, name, datatype, initial value,
and comment will be displayed. For IEC operators SEL, LIMIT, and MUX a short description on
the inputs will display. If defined, the address and the symbol comment will be shown as well as
the operand comment (in quotation marks in a second line).
Example: Tooltip on a POU output
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 305
FBD/LD/IL Editor
If you drag a function block, an operator, or a network from the ToolBox (see page 328) onto
the up arrow or down arrow on the left-hand side of the editor, a new network is automatically
created above or below the existing element.
To replace an element by another one, draw an appropriate other element on its position.
To reposition an input connection or an output connection of a box, select the connection pin
directly at the box and put it to the desired other position at the box via drag and drop.
Insert positions in LD editor
You can use the cut, copy, paste, and delete commands, available in the Edit menu, to arrange
elements. You can also copy an element by drag and drop: select the element within a network
by a mouse-click, press the CTRL key and while keeping the mouse button and the key
pressed, drag the element to the target position. As soon as that is reached (green position
marker), a plus-symbol will be added to the cursor symbol. Then, release the mouse-button to
insert the element.
For possible cursor positions, refer to Cursor Positions in FBD, LD, and IL (see page 316).
Inserting of EN/ENO boxes is handled diversely in the FBD and LD editor.
Refer to the description of the Insert Box command for further information (Inserting of EN/ENO
boxes is not supported in the IL editor).
306 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Selecting
You can select an element, also a network, via taking the respective cursor position by a mouse-
click or using the arrow or tab keys. Selected elements are indicated as red-shaded. Also refer
to Cursor Positions in FBD, LD, and IL (see page 316).
In the LD editor, you can also select the lines between elements in order to execute commands,
for example, for inserting a further element at that position.
Selected line in LD editor
Multi-selection of elements or networks is possible by keeping pressed the CTRL key while
selecting the desired elements one after the other.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 307
FBD/LD/IL Editor
FBD editor
LD editor
308 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 309
FBD/LD/IL Editor
Overview
The IL Instruction List (see page 298) editor is a table editor. The network structure of FBD or LD
programs is also represented in an IL program. Basically, one network (see page 330) is sufficient
in an IL program, but considering switching between FBD, LD and IL you also can use networks
for structuring an IL program.
Activate the IL implementation language for EcoStruxure Machine Expert in the Tools → Options
dialog box, category FBD, LD and IL editor, tab (see EcoStruxure Machine Expert, Menu
Commands, Online Help) IL.
Tooltip
Tooltips contain information on variables or box parameters.
Refer to Working in the FBD and LD Editor View (see page 305).
310 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Each program line is written in a table row, structured in fields by the table columns:
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 311
FBD/LD/IL Editor
312 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Complex Operands
If a complex operand is to be used, enter an opening bracket before, then use the following lines
for the particular operand components. Below them, in a separate line, enter the closing bracket.
Example: Rotating a string by 1 character at each cycle.
Corresponding ST code:
stRotate := CONCAT(RIGHT(stRotate, (LEN(stRotate) -
1)), (LEFT(stRotate, 1)));
LD stRotate
RIGHT( stRotate
LEN
SUB 1
)
CONCAT( stRotate
LEFT 1
)
ST stRotate
Function Calls
Enter the function name in the operator field. Give the (first) input parameter as an operand in a
preceding LD operation. If there are further parameters, give the next one in the same line as the
function name. You can add further parameters in this line, separated by commas, or in
subsequent lines.
The function return value will be stored in the accumulator. The following restriction concerning the
IEC standard applies.
NOTE: A function call with multiple return values is not possible. Only 1 return value can be used
for a succeeding operation.
Example: Function GeomAverage, which has 3 input parameters, is called. The first parameter is
given by X7 in a preceding operation. The second one, 25, is given with the function name. The
third one is given by variable tvar, either in the same line or in the subsequent one. The return
value is assigned to variable Ave.
Corresponding ST code:
Ave := GeomAverage(X7, 25, tvar);
Function call in IL:
LD X7
GeomAverage 25
tvar
ST Ave
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 313
FBD/LD/IL Editor
314 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Action Call
To be performed like a function block or program call, the action name is to be appended to the
instance name or program name.
Example: Call of action ResetAction.
Corresponding ST code:
Inst.ResetAction();
Action call in IL:
CAL Inst.ResetAction()
Method Call
To be performed like a function call, the instance name with appended method name is to be
entered in the first column (operator).
Example: Call of method Home.
Corresponding ST code:
Z := IHome.Home(TRUE, TRUE, TRUE);
Method call in IL:
LD TRUE
IHome.Home TRUE
TRUE
ST Z
Jump
A jump (see page 333) is programmed by JMP in the first column (operator) and a label name in
the second column (operand). The label is to be defined in the target network in the label
(see page 334) field.
The statement list preceding the unconditional jump has to end with one of the following
commands: ST, STN, S, R, CAL, RET, or another JMP.
This is not the case for a conditional jump (see page 333). The execution of the jump depends on
the value loaded.
Example: Conditional jump instruction; in case bCallRestAction is TRUE, the program should
jump to the network labeled with Cont.
Conditional jump instruction in IL:
LDN bCallResetAction
JMPC Cont
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 315
FBD/LD/IL Editor
IL Editor
This is a text editor, structured in form of a table. Each table cell is a possible cursor position. Also
refer to Working in the IL Editor View (see page 310).
In the left image, the possible cursor positions are marked by a red-frame. The right image shows
a box with the cursor being placed in the AND field. Keep in mind the possibility to enter addresses
instead of variable names if configured appropriately in the FBD, LD and IL editor Options dialog
box.
(2) Every input:
316 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
(5) Just before the lined cross above an assignment before a jump or a return instruction:
(6) The right-most cursor position in the network or anywhere else in the network besides the other
cursor positions. This will select the whole network:
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 317
FBD/LD/IL Editor
(11) The connecting line between the contacts and the coils:
318 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
You can add new networks on the left-most side of the editor. The insertion of a new network before
an existing network is only possible before network 1.
(15) Begin or end of a network:
You can add contacts and function blocks at the begin of a network on the field Start here. You can
add the elements return, jump, and coil at the end of a network on the field Add output or jump here.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 319
FBD/LD/IL Editor
FBD/LD/IL Menu
Overview
When the cursor is placed in the FBD/LD/IL Editor (see page 295) window, the FBD/LD/IL menu
is available in the menu bar, providing the commands for programming in the currently set editor
view.
FBD/LD/IL menu in FBD editor view:
For a description of the commands, refer to the chapter FBD/LD/IL Editor Commands.
For configuration of the menu, refer to the description of the Customize Menu.
320 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Overview
In online mode, the FBD/LD/IL editor provides views for Monitoring (see page 321) and for writing
and forcing the values and expressions on the controller.
Debugging functionality (breakpoints, stepping, and so on) is available, see Breakpoint or Halt
Positions (see page 325).
For information on how to open objects in online mode, refer to the chapter User Interface in
Online Mode (see page 55).
Keep in mind that the editor window of an FBD, LD, or IL object also includes the Declaration
Editor in the upper part. Also refer to the chapter Declaration Editor in Online Mode
(see page 432).
Monitoring
If the inline monitoring is not explicitly deactivated in the Options dialog box, it will be supplemented
in FBD or LD editor by small monitoring windows behind each variable or by an additional
monitoring column showing the actual values (inline monitoring). This is even the case for
unassigned function block inputs and outputs.
The inline monitoring window of a variable shows a little red triangle in the upper left corner if the
variable is currently forced (see page 324), a blue triangle in the lower left corner if the variable is
currently prepared for writing or forcing. In LD, for contacts and coils the currently prepared value
(TRUE or FALSE) will be displayed down right below the element.
Example for a variable which is currently forced and prepared for releasing the force
Example for a contact variable which is currently prepared to get written or forced with value TRUE
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 321
FBD/LD/IL Editor
322 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Open a function by double-click or execute the command Browse - Go To Definition from the
context menu. Refer to the description of the User Interface in Online Mode (see page 55) for
further information.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 323
FBD/LD/IL Editor
Forcing/Writing of Variables
In online mode, you can prepare a value for forcing or writing a variable either in the declaration
editor (see page 432) or within the editor. Double-click a variable in the editor to open the following
dialog box:
Dialog box Prepare Value
You find the name of the variable completed by its path within the device tree (Expression), its type,
and current value. By activating the corresponding item, you can do the following:
Preparing a new value which has to be entered in the edit field.
Removing a prepared value.
Releasing the forced variable.
Releasing the forced variable and resetting it to the value it was assigned to just before forcing.
The selected action will be carried out on executing the menu command Force values (in the
Online menu) or by pressing F7.
For information on how the current state of a variable (forced, prepared value) is indicated at the
respective element in the network, refer to the section Monitoring (see page 321).
324 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
1 breakpoint set
2 breakpoint reached
As soon as a breakpoint position is reached during stepping or program processing, a yellow arrow
will be displayed in the breakpoint symbol and the red shaded area will change to yellow.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 325
FBD/LD/IL Editor
NOTE: A breakpoint will be set automatically in all methods which may be called. If an interface-
managed method is called, breakpoints will be set in all methods of function blocks implementing
that interface and in all derivative function blocks subscribing the method. If a method is called via
a pointer on a function block, breakpoints will be set in the method of the function block and in all
derivative function blocks which are subscribing to the method.
326 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Section 11.2
FBD/LD/IL Elements
FBD/LD/IL Elements
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 327
FBD/LD/IL Editor
FBD/LD/IL Toolbox
Overview
The FBD/LD/IL Editor (see page 295) provides a toolbox which offers the programming elements
for being inserted in the editor window by drag and drop. Open the toolbox by executing the
command ToolBox which is in the View menu.
It depends on the currently active editor view which elements are available for inserting (see the
respective description of the insert commands).
The elements are sorted in categories: General (general elements such as Network, Assignment
and so on), Boolean operators, Math operators, Other operators (for example,
SEL, MUX, LIMIT, and MOVE), Function blocks (for example,
R_TRIG, F_TRIG, RS, SR, TON, TOF, CTD, CTU), Ladder elements, and POUs (user-
defined).
The POUs category lists all POUs which have been defined below the same application as the
FBD/LD/IL object which is open in the editor. If a POU has been assigned a bitmap in its properties,
then this will be displayed before the POU name. Otherwise, the standard icon for indicating the
POU type will be used. The list will be updated automatically when POUs are added or removed
from the application.
The category Other operators contains among SEL, MUX, LIMIT, and MOVE operators a
conversion placeholder element. You can drag and drop this element to the appropriate position
of the network. The conversion type is set automatically, dependent on the required type of the
insert position. In some situations however the required conversion type cannot be determined
automatically. Change the element manually in this case.
To unfold the category folders, click the button showing the respective category name. See in the
following image: The category General is unfolded, the others are folded. The image shows an
example for inserting an Assignment element by drag and drop from the toolbox.
328 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
To insert an element in the editor, select it in the toolbox by a mouse-click and bring it to the editor
window by drag and drop. The possible insert positions will be indicated by position markers, which
appear as long as the element is drawn - keeping the mouse button pressed - across the editor
window. The nearest possible position will light up green. When you release the mouse button, the
element will be inserted at the green position.
If you drag a box element on an existing box element, the new one replaces the old one. If inputs
and outputs already have been assigned, those will remain as defined, but they will not be
connected to the new element box.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 329
FBD/LD/IL Editor
Network in FBD/LD/IL
Overview
A network is the basic entity of an FBD (see page 296) or LD (see page 297) program. In the
FBD/LD editor, the networks are arranged in a vertical list. Each network is designated on the left
side by a serial network number and has a structure consisting of either a logical or an arithmetic
expression, a program, function or function block call, and possibly jump or return instructions.
The IL Editor (see page 298), due to the common editor base with the FBD and LD editors, also
uses the network element. If an object initially was programmed in FBD or LD and then is converted
to IL, the networks will be still present in the IL program. Vice versa, if you start programming an
object in IL, you need at least 1 network element which might contain all instructions, but you can
also use further networks to structure the program.
A network optionally can get assigned a title, a comment and a label (see page 334).
You can switch the visibility of the title, the comment fields, and the network separator on and off
in the FBD, LD and IL editor options dialog box. If the option is activated, click in the network
directly below the upper border to open an edit field for the title. For entering a comment,
correspondingly open an edit field directly below the title field. The comment can be multi-lined.
Press ENTER to insert line breaks. Press CTRL + ENTER to terminate the input of the comment
text.
Whether and how a network comment is displayed in the editor, is defined in the FBD, LD, and
IL editor options dialog box.
To add a label (see page 334), which then can be addressed by a jump (see page 333), use the
command Insert label . If a label is defined, it will be displayed below the title and comment field or
- if those are not available - directly below the upper border of the network.
Comments and label in a network
330 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
You can set a network in comment state. This indicates that the network is not processed but
displayed and handled as a comment. To achieve this, use the command Toggle network
comment state.
On a currently selected network (cursor position 6 (see page 316)), you can apply the default
commands for copying, cutting, inserting, and deleting.
NOTE: Right-clicking (cursor position 6 (see page 316)) titles, comments, or labels will select this
entry only instead of the whole network. So the execution of the default commands does not affect
the network.
To insert a network, use command Insert Network or drag it from the toolbox (see page 328). A
network with all belonging elements can also be copied or moved (see page 305) by drag and drop
within the editor.
You can also create subnetworks (see page 337) by inserting branches.
RET Network
In online mode, an additional empty network will be displayed below the existing networks. Instead
of a network number, it is identified by RET.
It represents the position at which the execution will return to the calling POU and provides a
possible halt position (see page 321).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 331
FBD/LD/IL Editor
Assignment in FBD/LD/IL
Overview
Depending on the selected cursor position (see page 316) in FBD or LD, an assignment will be
inserted directly in front of the selected input (cursor position 2 (see page 316)), directly after the
selected output (cursor position 4 (see page 316)) or at the end of the network (cursor position 6
(see page 316)). In an LD network, an assignment will be displayed as a coil (see page 350).
Alternatively, drag the assignment element from the toolbox (see page 328) or copy or move
(see page 305) it by drag and drop within the editor view.
After insertion, the text string ??? can be replaced by the name of the variable that is to be
assigned. For this, use the ... button to open the Input Assistant.
In IL (see page 298), an assignment is programmed via LD and ST instructions. Refer to Modifiers
and Operators in IL (see page 300).
332 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Jump in FBD/LD/IL
Overview
Depending on the selected cursor position (see page 316) in FBD (see page 296) or LD
(see page 297), a jump will be inserted directly in front of the selected input (cursor position 2),
directly after the selected output (cursor position 4) or at the end of the network (cursor position 6).
Alternatively, drag the jump element from the toolbox (see page 328) or copy or move
(see page 305) it by drag and drop within the editor.
After insertion, you can replace the automatically entered ??? by the label to which the jump should
be assigned.
In IL (see page 298), a jump is inserted via a JMP instruction. See in this context the description
of the operators and modifiers in IL (see page 300).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 333
FBD/LD/IL Editor
Label in FBD/LD/IL
Overview
Below the network comment field each FBD (see page 296), LD (see page 297) or IL network have
a text input field for defining a label. The label is an optional identifier for the network and can be
addressed when defining a jump (see page 333). It can consist of any sequence of characters.
Position of a label in a network
See the Tools → Options → FBD, LD and IL editor dialog box for defining the display of comment
and title.
334 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Boxes in FBD/LD/IL
Overview
A box, insertable in an FBD (see page 296), LD (see page 297), or IL (see page 298) network, is
a complex element and can represent additional functions like timers, counters, arithmetic
operations, or also programs, IEC functions and IEC function blocks.
A box can have one or more inputs and outputs and can be provided by a library or can be
programmed by the user.
You can group the inputs and outputs of a function block in its declaration via the
attribute pingroup. In the display of the function block in an FBD or LD editor, the groups can
then be faded out and in. For further information, refer to the Attribute pingroup chapter
(see page 705).
If provided with the respective module and if the option Show box icon is activated, an icon is
displayed within the box.
Use in FBD, LD
You can position a box in a LD network or in an FBD network by using the command Insert Box,
Insert Empty Box. Alternatively, you can insert it from the toolbox (see page 328) or copy or move
it within the editor via drag and drop. For further information, refer to the description of the Insert
Box command.
Use in IL
In an IL (see page 298) program, a CAL (see page 300) instruction with parameters will be inserted
in order to represent a box element.
You can update the box parameters (inputs, outputs) - in case the box interface has been modified
- with the current implementation without having to reinsert the box by executing the Update
parameters command.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 335
FBD/LD/IL Editor
Overview
With a RETURN instruction, the FBD (see page 296), LD (see page 297) or IL (see page 298) POU
can be exited.
In an FBD or LD network, you can place it in parallel or at the end of the previous elements. If the
input of a RETURN is TRUE, the processing of the POU will immediately be exited.
Execute the command Insert Return to insert a RETURN instruction. Alternatively, drag the element
from the toolbox (see page 328) or copy or move (see page 305) it from another position within the
editor.
RETURN element
In IL, the RET (see page 300) instruction is used for the same purpose.
336 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Overview
In a Function Block Diagram (see page 296) or Ladder Diagram (see page 297) network, a branch
or a hanging coil splits up the processing line as from the current cursor position. The processing
line will continue in 2 subnetworks which will be executed 1 after each other from top to bottom.
Each subnetwork can get a further branch, such allowing multiple branching within a network.
Each subnetwork gets an own marker (an upright rectangle symbol). You can select it (cursor
position 11 (see page 316)) in order to perform actions on this arm of the branch.
Branch markers
In FBD, insert a branch via command Insert branch. Alternatively, drag the element from the
toolbox (see page 328). For the possible insert positions, refer to the description of the Insert
branch command.
NOTE: Cut and paste is not implemented for subnetworks.
A branch has been inserted at the SUB box output in the example shown below. This created 2
subnetworks, each selectable by their subnet marker. After that, an ADD box was added in each
subnetwork.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 337
FBD/LD/IL Editor
To delete a subnetwork, first remove all elements of the subnetwork, that is all elements which are
positioned to the right of the marker of the subnetwork. Then select the marker and execute the
standard Delete command or press the DEL key.
In the following image, the 3-input-OR element has to be deleted before you can select and delete
the marker of the lower subnetwork.
Delete branch or subnetwork
338 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
IL (Instruction List)
The IL (see page 298) does not support networks with branches. They will stay in the original
representation.
Parallel Branches
You can use parallel branches for setting up parallel branch (see page 340) evaluation in ladder
networks.
In contrast to the open branch (without the junction point), the parallel branches are closed. They
have common split and junction points.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 339
FBD/LD/IL Editor
Parallel Branch
Overview
A parallel branch allows you to implement a parallel evaluation of logical elements. This is
accomplished via a methodology described as Short Circuit Evaluation (SCE). SCE allows you to
by-pass the execution of a function block with a boolean output if certain parallel conditions are
evaluated to be TRUE. The condition can be represented in the LD editor by a parallel branch to
the function block branch. The SCE condition is defined by 1 or several contacts within this branch,
connected parallel or sequentially.
The vertical connections of short circuit evaluation branches executed in parallel are represented
by a double line in order to differentiate them from OR constructs that are represented by a single
line (see the figure Parallel branch for SCE in a ladder network).
NOTE: The term branch is also used for another element that splits off a signal flow. This branch
(see page 337) as opposed to the parallel branch has no junction point.
The parallel branch works as follows: first it will be parsed for the branches not containing a function
block. If 1 of such branches is evaluated to be TRUE, then the function block in the parallel branch
will not be called and the value at the input of the function block branch will be passed to the output.
If the SCE condition is evaluated to be FALSE, then the function block will be called and the
boolean result of the function block execution call will be passed on.
If all branches contain function blocks, then they will be evaluated in top-to-bottom order and the
outputs of them will be combined with logical OR operations. If there are no branches containing a
function block call, then the normal OR operation will be performed.
To insert a parallel branch with SCE function, select the function block box and execute the
command Insert Contact Parallel above or Insert Contact Parallel below. This is only possible if the
first input and the main output of the function block are of type BOOL.
Below is an example of the generated language model for the given network.
340 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
1 The double vertical connection lines indicate a construct that is subject to an SCE.
2 The single vertical connection line indicates an OR construct.
The processing is as shown in the following, whereby P_IN and P_OUT represent the boolean
value at the input (split point) and output (junction point) of the parallel branch, respectively.
P_IN := b1 AND b2;
IF ((P_IN AND cond1) AND (cond2 OR cond3)) THEN
P_OUT := P_IN;
ELSE
x1(IN := P_IN, PT := {p 10}t#2s);
tElapsed := x1.ET;
P_OUT := x1.Q;
END_IF
bRes := P_OUT AND b3;
The following images show the dataflow (blue) in case the function block is executed (condition
resulting from cond1, cond2 and cond3 is FALSE) or bypassed (condition is TRUE).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 341
FBD/LD/IL Editor
342 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Overview
The branch start / end element is an LD element.
It allows you to define the start / end point of a branch. If there is no start point defined, you can
use the element to define it. Is the start point already defined the element determines the end point.
For further information, refer to the chapter Parallel Branch (see page 340).
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 343
FBD/LD/IL Editor
Set/Reset in FBD/LD/IL
FBD and LD
A boolean output in FBD (see page 296) or correspondingly an LD (see page 297) coil can be set
or reset. To change between the set states, use the respective command Set/Reset from the
context menu when the output is selected. The output or coil will be marked by an S or an R.
Set If value TRUE arrives at a set output or coil, this output/coil will become TRUE
and remain TRUE. This value cannot be overwritten at this position as long as
the application is running.
Reset If value TRUE arrives at a reset output or coil, this output/coil will become FALSE
and remain FALSE. This value cannot be overwritten at this position as long as
the application is running.
In the LD editor, you can insert set and reset coils by drag and drop. To perform this action, use
either the ToolBox, category Ladder elements, or the S and R elements from the tool bar.
Example:
Set coil, reset coil
IL
In an Instruction List, use the S and R (see page 300) operators to set or reset an operand.
344 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Set/Reset Coil
Overview
Coils (see page 350) can also be defined as set or reset coils.
You can recognize a set coil by the S in the coil symbol: (S). A set coil will not overwrite the value
TRUE in the appropriate boolean variable. That is, the variable once set to TRUE remains TRUE.
You can recognize a reset coil by the R in the coil symbol: (R). A reset coil will not overwrite the
value FALSE in the appropriate boolean variable. That is, the variable once set to FALSE will
remain FALSE.
In the LD editor, you can insert set coils and reset coils directly via drag and drop from the ToolBox,
category Ladder elements. In doing so, you can also replace already inserted coil elements by
others.
Set coil, reset coil
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 345
FBD/LD/IL Editor
Execute
Overview
The Execute element is a block with EN/ENO that you can insert in an FBD or LD network and
that you can fill with ST code. The ST code is executed when the block is activated for processing
with a TRUE signal at the EN input.
Drag the Execute element from the toolbox (see page 328) into the network or execute the
FBD/LD/IL → Execute command (see EcoStruxure Machine Expert, Menu Commands, Online
Help) to insert the element.
Entering ST Code
Online Mode
In online mode, you can open the ST editor by clicking the plus sign under the EN input on the
function block. The usual online functionalities (monitoring, debugging) are available in the editor.
346 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Example
Examples for an Execute block in the FBD network.
Offline mode, ST program inserted
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 347
FBD/LD/IL Editor
Section 11.3
LD Elements
LD Elements
348 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
FBD/LD/IL Editor
Contact
Overview
This is an LD element.
In LD (see page 297) in its left part, each network contains 1 or several contacts. Contacts are
represented by 2 vertical, parallel lines.
Contacts pass on condition ON (TRUE) or OFF (FALSE) from left to right. A boolean variable is
assigned to each contact. If this variable is TRUE, the condition is passed from left to right and
finally to a coil in the right part of the network. Otherwise the right connection receives the value
FALSE.
You can connect multiple contacts in series as well as in parallel. Contacts in parallel represent a
logical 'OR' condition such that only one of them need be TRUE to have the parallel branch transmit
the value TRUE. Conversely, contacts in series represent a logical 'AND' condition whereas all the
contacts must be TRUE to have the final contact transmit TRUE.
Therefore, the contact arrangement corresponds to either an electric parallel or a series circuit.
A contact can also be negated. This is indicated by the slash in the contact symbol.
A negated contact passes on the incoming condition (TRUE or FALSE) only if the assigned
boolean variable is FALSE.
You can insert a contact in an LD network via one of the commands Insert Contact or Insert
Contact (right) Insert Contact Parallel (above), Insert Contact Parallel (below), Insert Rising Edge
Contact, or Insert Falling Edge Contact which are part of the LD menu. Alternatively, you can insert
the element via drag and drop from the ToolBox (see page 328) or from another position within the
editor (drag and drop).
You can replace an already inserted contact by a new contact or a negated contact. For this
purpose, drag a contact or a negated contact from the toolbox (see page 328) onto an existing
contact and drop it there.
FBD and IL
If you are working in FBD (see page 296) or IL (see page 298) view, the command will not be
available. But contacts and coils inserted in an LD network will be represented by corresponding
FBD elements or IL instructions.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 349
FBD/LD/IL Editor
Coil
Overview
This is an LD element.
On the right side of an LD network, there can be any number of coils which are represented by
parentheses.
They can only be arranged in parallel. A coil transmits the value of the connections from left to right
and copies it to an appropriate boolean variable. At the entry line, the value ON (TRUE) or the value
OFF (FALSE) can be present.
Coils can also be negated. This is indicated by the slash in the coil symbol.
In this case the negated value of the incoming signal will be copied to the appropriate boolean
variable.
You can insert a coil in a network via one of the commands Insert Coil, Insert Set Coil, Insert Reset
Coil, or Insert Negated Coil in the LD menu. Alternatively, you can insert the element via drag and
drop from the ToolBox (Ladder elements) or via drag and drop from another position within the
editor. Also refer to Set and Reset Coils (see page 345).
FBD and IL
If you are working in FBD (see page 296) or IL (see page 298) view, the command will not be
available. But contacts and coils inserted in an LD network will be represented by corresponding
FBD elements or IL instructions.
350 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
EcoStruxure Machine Expert
Continuous Function Chart (CFC) Editor
EIO0000002854 06/2019
Chapter 12
Continuous Function Chart (CFC) Editor
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 351
Continuous Function Chart (CFC) Editor
Overview
The Continuous Function Chart is an extension to the IEC 61131-3 standard, and is a graphical
programming language based on the Function Block Diagram (FBD) language (see page 296).
However, in contrast to the FBD language, there are no networks. CFC allows the free positioning
of graphic elements, which in turn allows for feedback loops.
For creating CFC programming objects in EcoStruxure Machine Expert, see the description of the
CFC editor (see page 353).
352 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Continuous Function Chart (CFC) Editor
CFC Editor
Overview
The CFC editor is a graphical editor available for programming objects in the continuous function
chart (CFC) programming language (see page 352), which is an extension to the IEC 61131-3
programming languages. Choose the language when you add a new program organization unit
(POU) object to your project. For large projects, consider using the page-oriented version
(see page 369).
The editor will be available in the lower part of the window which opens when opening a CFC POU
object. This window also includes the declaration editor (see page 426) in its upper part.
CFC editor
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 353
Continuous Function Chart (CFC) Editor
The CFC editor in contrast to the FBD / LD editor allows free positioning (see page 363) of the
elements, which allows direct insertion of feedback paths. The sequence of processing is
determined by a list which contains all currently inserted elements and can be modified.
The following elements are available in a toolbox (see page 357) and can be inserted via drag and
drop:
box (operators, functions, function blocks, and programs)
input
output
jump
label
return
composer
selector
connection marks
comments
You can connect the input and output pins of the elements by drawing a line with the mouse. The
path of the connecting line will be created automatically and will follow the shortest possible route.
The connecting lines are automatically adjusted as soon as the elements are moved. For further
information, refer to the description of inserting and arranging elements (see page 363). For
complex charts, you can use connection marks (see page 358) instead of lines. You may also
consider the possibility of modifying the routing.
It may happen that elements get positioned in a way that they cover already routed connections.
These collisions are indicated by red connection lines. If there are any collisions in the chart, the
button in the upper right corner of the editor view gets a red outline: . To edit the collisions step
by step, click this button and execute the command Show next collision. Then the next found
concerned connection will be selected.
For complex charts, you can use connection marks (see page 358) instead of lines. You may also
wish to use the page-oriented version of the CFC editor.
A zoom function allows you to change the dimension of the editor window: Use the button in
the lower right corner of the window and choose between the listed zoom factors. Alternatively, you
can select the entry ... to open a dialog box where you can type in any arbitrary factor.
You can call the commands for working in the CFC editor from the context menu or from the CFC
menu which is available as soon as the CFC editor is active.
354 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Continuous Function Chart (CFC) Editor
Overview
Cursor positions in a CFC program are indicated by a gray background when hovering over the
programming element.
When you click one of these shadowed areas, before releasing the mouse-button, the background
color will change to red. As soon as you release the mouse-button, this will become the current
cursor position, with the respective element or text being selected and displayed as red-colored.
There are 3 categories of cursor positions. See the possible positions indicated by a gray shaded
area as shown in the illustrations of the following paragraphs.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 355
Continuous Function Chart (CFC) Editor
356 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Continuous Function Chart (CFC) Editor
Overview
The graphical elements available for programming in the CFC editor (see page 353) window are
provided by a toolbox. Open the toolbox in a view window by executing the command ToolBox in
the View menu.
Select the desired element in the toolbox and insert (see page 363) it in the editor window via drag
and drop.
Besides the programming elements, there is an entry , at the top of the toolbox list. As
long as this entry is selected, the cursor has the shape of an arrow and you can select elements in
the editor window for positioning and editing.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 357
Continuous Function Chart (CFC) Editor
CFC Elements
input You can select the text offered by ??? and replace it by a variable
or constant. The input assistance serves to select a valid
identifier.
output
358 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Continuous Function Chart (CFC) Editor
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 359
Continuous Function Chart (CFC) Editor
output pin – Depending on the box type, you can add an additional output. For
this purpose, select the box element in the CFC network and draw
the output pin element on the box.
You can drag an input or output connection to another position at
the box while keeping pressed the Ctrl key.
Example of a Composer
A CFC program cfc_prog handles an instance of function block fublo1, which has an input
variable struvar of type structure. Use the composer element to access the structure
components.
Structure definition stru1 :
TYPE stru1 :
STRUCT
ivar:INT;
strvar:STRING:='hallo';
END_STRUCT
END_TYPE
Declaration and implementation of function block fublo1:
FUNCTION_BLOCK fublo1
VAR_INPUT
struvar:STRU1;
END_VAR
VAR_OUTPUT
fbout_i:INT;
fbout_str:STRING;
END_VAR
VAR
fbvar:STRING:='world';
END_VAR
fbout_i:=struvar.ivar+2;
fbout_str:=CONCAT (struvar.strvar,fbvar);
360 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Continuous Function Chart (CFC) Editor
1 composer
2 function block with input variable struvar of type structure stru1
Example of a Selector
A CFC program cfc_prog handles an instance of function block fublo2, which has an output
variable fbout of type structure stru1. Use the selector element to access the structure
components.
Structure definition stru1:
TYPE stru1 :
STRUCT
ivar:INT;
strvar:STRING:='hallo';
END_STRUCT
END_TYPE
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 361
Continuous Function Chart (CFC) Editor
362 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Continuous Function Chart (CFC) Editor
Overview
The elements available for programming in the CFC editor are provided in the ToolBox
(see page 357) which by default is available in a window as soon as the CFC editor is opened.
The Tools → Options → CFC editor defines general settings for working within the editor.
Inserting
To insert an element, select it in the ToolBox (see page 357) by a mouse-click, keep the mouse-
button pressed and drag the element to the desired position in the editor window. During dragging,
the cursor will be displayed as an arrow plus a rectangle and a plus-sign. When you release the
mouse-button, the element will be inserted.
Selecting
To select an inserted element for further actions such as editing or rearranging, click an element
body to select the element. It will be displayed by default as red-shaded. By additionally pressing
the SHIFT key, you can click and select further elements. You can also press the left mouse-button
and draw a dotted rectangle around all elements which you want to select. As soon as you release
the button the selection will be indicated. By command Select all , all elements are selected at
once.
By using the arrow keys you can shift the selection mark to the next possible cursor position. The
sequence depends on the execution order or the elements, which is indicated by element numbers
(see page 365).
When an input pin is selected and you press CTRL + LEFT ARROW, the corresponding output will
be selected. When an output pin is selected and you press CTRL + LEFT ARROW, the
corresponding outputs will be selected.
Replacing Boxes
To replace an existing box element, replace the currently inserted identifier by that of the desired
new element. The number of input and output pins will be adapted if necessary due to the definition
of the POUs and thus some existing assignments could be removed.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 363
Continuous Function Chart (CFC) Editor
Moving
To move an element, select the element by clicking the element body (see possible cursor
positions (see page 355)) and drag it, while keeping the mouse-button pressed, to the desired
position. Then release the mouse-button to place the element. You also can use the Cut and Paste
commands for this purpose.
Connecting
You can connect the input and output pins of 2 elements by a connection line or via connection
marks.
Connection line: You can either select a valid point of connection that is an input or output pin of
an element (refer to Cursor Positions in CFC (see page 355)), and then draw a line to another point
of connection with the mouse. Or you can select 2 points of connection and execute the command
Select connected pins. A selected possible point of connection is indicated by a red filled square.
When you draw a line from such a point to the target element, you can identify the possible target
point of connection. When you then position the cursor over a valid connection point, an arrow
symbol is added to the cursor when moving over that point, indicating the possible connection.
The following figure provides an example: After a mouse-click on the input pin of the var1 element,
the red rectangle is displayed showing that this is a selected connection point. By keeping the
mouse button pressed, move the cursor to the output pin of the ADD box until the cursor symbol
appears as shown in the figure. Now release the mouse button to establish the connection line.
The shortest possible connection is created taking into account the other elements and
connections.
You can drag an input or output connection to another position at the box while keeping pressed
the Ctrl key.
Connection marks: you could as well use connection marks instead of connection lines in order to
simplify complex charts. Refer to the description of connection marks (see page 358).
Copying
To copy an element, select it and use the Copy and Paste commands.
Editing
After you have inserted an element, by default the text part is represented by ???. To replace this
by the desired text (POU name, label name, instance name, comment, and so on), click the text to
obtain an edit field. Also the button ... will be available to open the Input Assistant.
364 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. EIO0000002854 06/2019
Continuous Function Chart (CFC) Editor
Deleting
You can delete a selected element or connection line by executing the command Delete, which is
available in the context menu or press the DEL key.
EIO0000002854 06/2019 EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers. 365
Continuous Function Chart (CFC) Edit