0% found this document useful (0 votes)
365 views818 pages

EcoStruxure Machine Expert Programming Guide

Uploaded by

alexanlourenco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
365 views818 pages

EcoStruxure Machine Expert Programming Guide

Uploaded by

alexanlourenco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

EcoStruxure Machine Expert

Programming Guide

EIO0000002854.06
12/2023

www.se.com
Legal Information
The information provided in this document contains general descriptions, technical
characteristics and/or recommendations related to products/solutions.
This document is not intended as a substitute for a detailed study or operational and
site-specific development or schematic plan. It is not to be used for determining
suitability or reliability of the products/solutions for specific user applications. It is the
duty of any such user to perform or have any professional expert of its choice
(integrator, specifier or the like) perform the appropriate and comprehensive risk
analysis, evaluation and testing of the products/solutions with respect to the relevant
specific application or use thereof.
The Schneider Electric brand and any trademarks of Schneider Electric SE and its
subsidiaries referred to in this document are the property of Schneider Electric SE or
its subsidiaries. All other brands may be trademarks of their respective owner.
This document and its content are protected under applicable copyright laws and
provided for informative use only. No part of this document may be reproduced or
transmitted in any form or by any means (electronic, mechanical, photocopying,
recording, or otherwise), for any purpose, without the prior written permission of
Schneider Electric.
Schneider Electric does not grant any right or license for commercial use of the
document or its content, except for a non-exclusive and personal license to consult it
on an "as is" basis.
Schneider Electric reserves the right to make changes or updates with respect to or in
the content of this document or the format thereof, at any time without notice.
To the extent permitted by applicable law, no responsibility or liability is
assumed by Schneider Electric and its subsidiaries for any errors or omissions
in the informational content of this document, as well as any non-intended use
or misuse of the content thereof.
Table of Contents
Safety Information ....................................................................................17
About the Book.........................................................................................18
Introduction ................................................................................................23
General Introduction to the EcoStruxure Machine Expert Logic
Builder .....................................................................................................24
What is the EcoStruxure Machine Expert Logic Builder? ........................24
Tasks Performed by the EcoStruxure Machine Expert Logic
Builder ...............................................................................................24
EcoStruxure Machine Expert Logic Builder User Interface ...........................26
Elements of the EcoStruxure Machine Expert Logic Builder
Screen ...............................................................................................26
Multi-Tabbed Navigators ....................................................................31
Functional tree..................................................................................36
Multi-Tabbed Catalog View .................................................................39
Customizing the User Interface ............................................................40
User Interface in Online Mode..............................................................44
Menus and Commands .......................................................................45
Basic Concepts ........................................................................................46
Introduction and Basic Concepts ..........................................................46
Configuration .............................................................................................48
Installing Devices .....................................................................................49
Integration of Sercos Devices from Third-Party Vendors ........................49
Managing Devices ....................................................................................51
Adding Devices through the Hardware Catalog ....................................51
Adding Devices by Drag and Drop ..................................................51
Adding Devices by Contextual Menu or Plus Button...............................53
Adding a Controller........................................................................53
Adding Expansion Devices ............................................................53
Adding Communication Managers ..................................................54
Adding Devices to a Communication Manager.................................56
Adding Devices from Template .......................................................57
Updating Devices................................................................................58
Updating Devices ..........................................................................58
Converting Devices.............................................................................59
Converting Devices .......................................................................59
Converting Projects.............................................................................60
Converting SoMachine Basic and Twido Projects ............................60
Common Device Editor Dialogs .................................................................76
Device Configuration...........................................................................76
General Information About Device Editors.......................................76
Communication Settings in Controller Selection Mode .....................77
Communication Settings in Simple Mode ........................................97
Communication Settings in Classic Mode...................................... 103
Configuration .............................................................................. 107
Parameters................................................................................ 108
Applications ................................................................................ 108
Synchronized Files...................................................................... 109
Files ........................................................................................... 110

EIO0000002854.06 3
Log ............................................................................................ 111
PLC Settings............................................................................... 114
IEC Objects ............................................................................... 116
Users and Groups ....................................................................... 118
Access Rights ............................................................................. 124
Symbol Rights........................................................................... 129
Task Deployment ........................................................................ 130
Status ........................................................................................ 131
Information ................................................................................. 131
Emulation Settings.................................................................... 131
I/O Mapping...................................................................................... 132
I/O Mapping ................................................................................ 132
Working with the I/O Mapping Dialog Box...................................... 135
Mapping a Device and a Function Block Instance .......................... 140
I/O Mapping in Online Mode......................................................... 141
Implicit Variables for Forcing I/Os ................................................. 141
Select Function Block Dialog Box .............................................. 142
Cybersecurity........................................................................................... 144
General Information ................................................................................ 145
Access Protection with Device User Management ............................... 145
Firewall Settings ............................................................................... 145
Using Certificates.............................................................................. 145
Digital Signature Verification.................................................................... 146
Digital Signature Verification .............................................................. 146
Connecting to the Controller .................................................................... 148
First Login to the Controller with User Rights Management
Activated .......................................................................................... 148
Logoff Current Device User ..................................................................... 149
Logoff / Change Device User ............................................................. 149
Security for the Project and the Application ............................................... 150
Protecting and Saving a Project ......................................................... 150
Protecting and Saving Applications .................................................... 151
Security for the Runtime System / Controller............................................. 152
Encrypting Communication ................................................................ 152
Handling of Device User Management................................................ 152
Visualization........................................................................................... 155
Visualization ..................................................................................... 155
FAQ....................................................................................................... 156
Frequently Asked Questions (FAQ) .................................................... 156
Program .................................................................................................... 157
Program Components............................................................................. 158
Program Organization Unit (POU) ...................................................... 158
POU........................................................................................... 158
Adding and Calling POU Objects .................................................. 159
Program ..................................................................................... 162
Function ..................................................................................... 164
Method....................................................................................... 165
Property ..................................................................................... 169
Interface ..................................................................................... 170
Action......................................................................................... 173
Transition ................................................................................... 175
4 EIO0000002854.06
POUs for Implicit Checks ............................................................. 175
Function Block.................................................................................. 177
General Information..................................................................... 177
Function Block Instance............................................................... 179
Calling a Function Block .............................................................. 180
Configuring a Memory Reserve for the Online Change of Function
Blocks ........................................................................................ 181
Extension of a Function Block ...................................................... 183
Implementing Interfaces .............................................................. 184
Method Invocation....................................................................... 186
SUPER Pointer............................................................................. 187
THIS Pointer............................................................................... 188
Application Objects ........................................................................... 190
Data Type Unit (DUT) ................................................................. 190
Global Variable List - GVL ............................................................ 191
Network Variable List (Receiver)................................................... 192
Persistent Variables..................................................................... 197
External File ............................................................................... 199
Text List ..................................................................................... 200
Image Pool ................................................................................. 205
Application ....................................................................................... 208
Application.................................................................................. 208
Task Configuration.................................................................................. 210
Task Configuration ........................................................................... 210
Adding Tasks .................................................................................... 210
Managing Applications ............................................................................ 211
General Information .......................................................................... 211
Introduction ................................................................................ 211
Building and Downloading Applications .............................................. 212
Building Applications ................................................................... 212
Login.......................................................................................... 213
Build Process at Changed Applications ......................................... 214
Downloading an Application ......................................................... 215
Managing Expired Certificates...................................................... 225
Running Applications ........................................................................ 226
Running Applications................................................................... 226
Maintaining Applications.................................................................... 226
Monitoring .................................................................................. 226
Debugging.................................................................................. 227
Core Dump ................................................................................. 231
Programming Support ................................................................. 232
Refactoring ................................................................................. 233
Static Analysis Light .................................................................... 236
Creating an Archive in Your Controller on Download ...................... 238
Logic Editors ............................................................................................ 239
Common Features of Graphic Editors ...................................................... 240
Common Features of Graphic Editors................................................. 240
FBD/LD/IL Editor .................................................................................... 242
Information on the FBD/LD/IL Editor ................................................... 242
FBD/LD/IL Editor......................................................................... 242
Function Block Diagram (FBD) Language ..................................... 242

EIO0000002854.06 5
Ladder Diagram (LD) Language ................................................... 243
Instruction List (IL) Language ....................................................... 243
Modifiers and Operators in IL ....................................................... 244
Working in the FBD and LD Editor ................................................ 248
Working in the IL Editor................................................................ 252
Cursor Positions in FBD, LD, and IL.............................................. 256
FBD/LD/IL Menu ......................................................................... 259
FBD/LD/IL Editor in Online Mode.................................................. 260
FBD/LD/IL Elements ......................................................................... 264
FBD/LD/IL Toolbox ...................................................................... 264
Network in FBD/LD/IL .................................................................. 265
Assignment in FBD/LD/IL ............................................................ 266
Jump in FBD/LD/IL ...................................................................... 267
Label in FBD/LD/IL ...................................................................... 267
Boxes in FBD/LD/IL..................................................................... 267
RETURN Instruction in FBD/LD/IL ................................................. 268
Branch / Hanging Coil in FBD/LD/IL .............................................. 268
Parallel Branch ........................................................................... 270
Branch Start / End ....................................................................... 272
Set/Reset in FBD/LD/IL ............................................................... 272
Set/Reset Coil............................................................................. 273
Execute ...................................................................................... 273
LD Elements..................................................................................... 274
Contact ...................................................................................... 274
Coil ............................................................................................ 275
Continuous Function Chart (CFC) Editor .................................................. 276
Continuous Function Chart (CFC) Language....................................... 276
CFC Editor ....................................................................................... 276
Cursor Positions in CFC .................................................................... 278
CFC Elements / ToolBox.................................................................... 279
Working in the CFC Editor ................................................................. 283
Execution Order in CFC .................................................................... 286
CFC Editor in Online Mode ................................................................ 289
CFC Editor Page-Oriented................................................................. 291
Sequential Function Chart (SFC) Editor.................................................... 293
SFC Editor ....................................................................................... 293
SFC - Sequential Function Chart Language ........................................ 294
Cursor Positions in SFC .................................................................... 295
Working in the SFC Editor ................................................................. 296
SFC Element Properties ................................................................... 298
SFC Elements / ToolBox.................................................................... 299
Qualifier for Actions in SFC................................................................ 308
Implicit Variables - SFC Flags ............................................................ 309
Sequence of Processing in SFC......................................................... 315
SFC Editor in Online Mode ................................................................ 316
Structured Text (ST) Editor ...................................................................... 318
Information on the ST Editor .............................................................. 318
ST Editor .................................................................................... 318
ST Editor in Online Mode ............................................................. 319
Structured Text ST ............................................................................ 322
Structured Text ST ...................................................................... 322

6 EIO0000002854.06
Expressions................................................................................ 322
Instructions ................................................................................. 324
Object Editors .......................................................................................... 334
Declaration Editors ................................................................................. 335
Textual Declaration Editor.................................................................. 335
Tabular Declaration Editor ................................................................. 336
Declaration Editor in Online Mode ..................................................... 340
Device Type Manager (DTM) Editor ......................................................... 342
DTM Editor....................................................................................... 342
Data Unit Type (DUT) Editor .................................................................... 343
Data Unit Type Editor ........................................................................ 343
Global Variables List (GVL) Editor ............................................................ 344
GVL Editor ....................................................................................... 344
Motion Design Object Editor .................................................................... 345
Motion Design Object Editor .............................................................. 345
Network Variables List (NVL) Editor ......................................................... 348
Information on the NVL Editor ............................................................ 348
Network Variables List Editor........................................................ 348
General Information on Network Variables .......................................... 349
Introduction to Network Variables List (NVL).................................. 349
Configuring the Network Variables Exchange ................................ 351
Network Variables List (NVL) Rules .............................................. 355
Operating State of the Sender and the Receiver ............................ 357
Example ..................................................................................... 357
Compatibility............................................................................... 360
Task Editor ............................................................................................. 364
Information on the Task Configuration................................................. 364
Properties Tab ................................................................................. 365
System Events Tab.......................................................................... 365
Monitor Tab ..................................................................................... 367
Variable Usage Tab.......................................................................... 368
Configuration of a Specific Task ......................................................... 369
Task Processing in Online Mode ........................................................ 371
Watch List Editor .................................................................................... 373
Watch View / Watch List Editor........................................................... 373
Creating a Watch List ........................................................................ 373
Watch List in Online Mode ................................................................. 374
Tools Within Logic Editors ....................................................................... 376
Function and Function Block Finder.................................................... 376
Input Assistant.................................................................................. 378
Tools.......................................................................................................... 381
Data Logging.......................................................................................... 382
Introduction to Data Logging .............................................................. 382
Recipe Manager ..................................................................................... 384
Recipe Manager .............................................................................. 385
Recipe Definition .............................................................................. 389
RecipeManCommands...................................................................... 392
Loading Recipe Values from the Controller ......................................... 401
Memory Usage by Recipes ................................................................ 402
Trace Editor ........................................................................................... 403
Trace Object..................................................................................... 403
EIO0000002854.06 7
Trace Basics............................................................................... 403
Creating a Trace or a Device Trace Object .................................... 404
Trace Configuration........................................................................... 408
Trace Configuration - Tree Views ............................................... 408
Variable Settings ......................................................................... 410
Record Settings .......................................................................... 412
Display Mode............................................................................. 415
Advanced Trace Settings ............................................................. 417
Trace Editor in Online Mode............................................................... 418
Trace Editor in Online Mode ........................................................ 418
Keyboard Operations for Trace Diagrams ........................................... 419
Keyboard Shortcuts..................................................................... 419
Trend Recording..................................................................................... 421
Trend Recording Objects................................................................... 421
Trend Recording Overview........................................................... 421
Trend Recording Objects ............................................................. 422
Trend Recording Configuration .......................................................... 423
Trend Recording Editor ............................................................. 423
Record Settings .......................................................................... 423
Variable Settings ......................................................................... 425
Steps for Trend Recording Configuration....................................... 427
Recording Trend Data ....................................................................... 428
Start the Recording Process ........................................................ 428
Alarm Configuration ................................................................................ 430
General Information .......................................................................... 430
Alarm Management ..................................................................... 430
Defining Alarms .......................................................................... 431
Configuration of the Alarm Management ............................................. 432
Creating an Alarm Configuration............................................... 432
Configuring an Alarm Class.......................................................... 432
Configuring an Alarm Storage ...................................................... 433
Configuring an Alarm Group......................................................... 434
Calling Event Alarms in the Program .................................................. 435
Defining an Event Alarm in the Alarm Group ................................. 435
Program Call for Triggering the Event Alarm ................................. 435
Alarm Management Objects .............................................................. 436
Alarm Configuration..................................................................... 436
Alarm Class ................................................................................ 436
Alarm Group ............................................................................... 440
Alarm Storage............................................................................. 443
Unit Conversion...................................................................................... 446
Unit Conversion Configuration ........................................................... 446
Usage in IEC Editors ......................................................................... 448
Symbol Configuration Editor .................................................................... 450
Symbol Configuration Editor .............................................................. 450
Symbol Configuration ....................................................................... 456
Adding a Symbol Configuration .......................................................... 457
Data Exchange: Controller - HMIs, OPC DA and UA Server ....................... 462
EcoStruxure Machine Expert Single Variable Definition........................ 462
Publishing Variables in the Controller.................................................. 465
Selecting Variables in the HMI............................................................ 466

8 EIO0000002854.06
Publishing Variables in the HMI of Vijeo-Designer................................ 466
Parameterization of the Physical Media .............................................. 468
Data Exchange Performance Between Controller and HMI
Configured with Vijeo-Designer .......................................................... 469
Indications for HMI Connections with Vijeo-Designer ........................... 471
Cam Motion Editor .................................................................................. 472
Cam Motion Editor - General Information ............................................ 472
General Information..................................................................... 472
Adding a Cam Object .................................................................. 472
Opening the Motion Editor of a Cam Object ................................. 472
Generating IEC Program Code from Cam Data ................................... 473
Using Cam Data for Function Blocks............................................. 473
Copying the Source Code of the Cam Diagram.............................. 475
Online View and Functions of the Cam Motion Editor ........................... 475
Online View and Functions of the Cam Motion Editor ..................... 475
Discontinuous Courses of the Positions .............................................. 476
Discontinuous Courses of the Positions ........................................ 476
Dialog Boxes .................................................................................... 477
Motion Editor .............................................................................. 477
Generating IEC Source Code....................................................... 484
Configuration .............................................................................. 484
Script Hook Manager ............................................................................ 486
Script Hook Manager ...................................................................... 486
Programming Reference........................................................................ 489
Variables Declaration .............................................................................. 490
Declaration....................................................................................... 490
General Information..................................................................... 490
Best Practices for the Naming of Identifiers ................................... 492
Shadowing Rules ........................................................................ 496
Variables Initialization .................................................................. 499
Declaration ................................................................................. 500
Shortcut Mode ............................................................................ 500
AT Declaration ............................................................................ 501
Keywords ................................................................................... 502
Variable Types .................................................................................. 504
Variable Types ............................................................................ 504
Attribute Keywords for Variable Types........................................... 508
VAR_CONFIG - Configuration Variables......................................... 515
Method Types................................................................................... 516
FB_Init, FB_Reinit, and FB_Exit Methods...................................... 516
Pragma Instructions .......................................................................... 520
Pragma Instructions .................................................................... 520
Message Pragmas ...................................................................... 522
Conditional Pragmas ................................................................... 524
Region Pragmas ......................................................................... 534
Attribute Pragmas ............................................................................. 534
Attribute Pragmas ....................................................................... 534
User-Defined Attributes ............................................................... 534
Attribute call_after_global_init_slot ......................... 535
Attribute call_after_init ................................................. 536
Attribute call_after_online_change_slot ..................... 536

EIO0000002854.06 9
Attribute call_before_global_exit_slot ....................... 537
Attribute call_on_type_change ..................................................... 537
Attribute conditionalshow ................................................. 538
Attribute conditionalshow_all_locals ........................... 539
Attribute const_replaced, Attribute const_non_
replaced .................................................................................. 539
Attribute 'dataflow' ........................................................... 540
Attribute displaymode ......................................................... 541
Attribute enable_dynamic_creation ................................. 541
Attribute estimated-stack-usage ..................................... 542
Attribute ExpandFully ......................................................... 542
Attribute global_init_slot ............................................... 543
Attribute hide ....................................................................... 545
Attribute hide_all_locals ................................................. 546
Attribute initialize_on_call ........................................... 547
Attribute init_namespace ................................................... 547
Attribute init_On_Onlchange ............................................. 548
Attribute instance-path ..................................................... 548
Attributes io_function_block, io_function_block_
mapping .................................................................................... 549
Attribute is_connected ....................................................... 550
Attribute linkalways ........................................................... 550
Attribute monitoring ........................................................... 551
Attribute monitoring_display ........................................... 553
Attribute monitoring_encoding ......................................... 554
Attribute namespace ............................................................. 555
Attributes no_assign, no_assign_warning ...................... 556
Attribute no_check ............................................................... 557
Attribute no_copy ................................................................. 558
Attribute no-exit ................................................................. 558
Attribute no_init ................................................................. 559
Attribute no_instance_in_retain ..................................... 559
Attribute no_virtual_actions ........................................... 559
Attribute pingroup ............................................................... 561
Attribute pin_presentation_order_inputs/
outputs .................................................................................... 562
Attribute obsolete ............................................................... 563
Attribute pack_mode ............................................................. 564
Attribute ProcessValue ....................................................... 565
Attribute qualified_only ................................................... 565
Attribute reflection ........................................................... 566
Attribute subsequent ........................................................... 566
Attribute symbol ................................................................... 567
Attribute to_string ............................................................. 568
Attribute warning disable .................................................. 569
The Smart Coding Functionality ......................................................... 569
Smart Coding.............................................................................. 569
Data Types............................................................................................. 571
General Information .......................................................................... 571
Data Types ................................................................................. 571
Standard Data Types ........................................................................ 571

10 EIO0000002854.06
Standard Data Types................................................................... 571
UTF-8 Encoding.......................................................................... 578
Extensions to IEC Standard ............................................................... 581
UNION ....................................................................................... 581
BIT............................................................................................. 581
References ................................................................................. 581
Pointers...................................................................................... 583
User-Defined Data Types .................................................................. 586
Defined Data Types..................................................................... 586
Arrays ........................................................................................ 586
Vector ........................................................................................ 590
Structures................................................................................... 597
Enumerations ............................................................................. 599
Implicit Enumerations .................................................................. 601
Subrange Types.......................................................................... 602
Alias........................................................................................... 604
Programming Guidelines......................................................................... 606
Naming Conventions......................................................................... 606
General Information..................................................................... 606
Prefixes............................................................................................ 607
Prefix Parts................................................................................. 607
Order of Prefixes ......................................................................... 607
Scope Prefix ............................................................................... 608
Data Type Prefix ......................................................................... 608
Property Prefix ............................................................................ 610
POU Prefix ................................................................................. 610
Namespace Prefix....................................................................... 611
SmartTag Functions .......................................................................... 612
SmartTag Function ...................................................................... 612
Operators .............................................................................................. 613
Arithmetic Operators ......................................................................... 613
ADD ............................................................................................ 614
MUL ............................................................................................ 616
SUB ............................................................................................ 617
DIV ............................................................................................ 618
MOD ............................................................................................ 620
MOVE .......................................................................................... 621
SIZEOF ...................................................................................... 622
XSIZEOF .................................................................................... 623
Bitstring Operators ............................................................................ 623
AND ............................................................................................ 624
OR .............................................................................................. 624
XOR ............................................................................................ 625
NOT ............................................................................................ 626
Bit-Shift Operators ............................................................................ 626
SHL ............................................................................................ 626
SHR ............................................................................................ 627
ROL ............................................................................................ 628
ROR ............................................................................................ 629
Selection Operators .......................................................................... 630
SEL ............................................................................................ 630

EIO0000002854.06 11
MAX ............................................................................................ 632
MIN ............................................................................................ 632
LIMIT ........................................................................................ 633
MUX ............................................................................................ 633
Comparison Operators ...................................................................... 634
GT .............................................................................................. 634
LT .............................................................................................. 635
LE .............................................................................................. 635
GE .............................................................................................. 636
EQ .............................................................................................. 636
NE .............................................................................................. 637
Address Operators............................................................................ 638
ADR ............................................................................................ 638
Content Operator ........................................................................ 639
BITADR ...................................................................................... 639
Calling Operator ............................................................................... 640
CAL ............................................................................................ 640
Type Conversion Operators ............................................................... 641
Type Conversion Functions.......................................................... 641
Overloaded Conversions ............................................................. 642
BOOL_TO Conversions............................................................... 643
TO_BOOL Conversions............................................................... 644
Conversion Between Integral Number Types ................................. 646
REAL_TO / LREAL_TO Conversions............................................ 646
TIME_TO/TIME_OF_DAY Conversions ........................................ 648
DATE_TO/DT_TO Conversions.................................................... 649
STRING_TO Conversions ........................................................... 650
TRUNC ........................................................................................ 652
TRUNC_INT ............................................................................... 652
ANY_..._TO Conversions........................................................... 653
TO_<xxx> Conversions............................................................... 653
Numeric Functions ............................................................................ 654
ABS ............................................................................................ 654
SQRT .......................................................................................... 655
LN .............................................................................................. 655
LOG ............................................................................................ 656
EXP ............................................................................................ 656
SIN ............................................................................................ 657
COS ............................................................................................ 657
TAN ............................................................................................ 658
ASIN .......................................................................................... 658
ACOS .......................................................................................... 659
ATAN .......................................................................................... 659
EXPT .......................................................................................... 660
IEC Extending Operators................................................................... 660
IEC Extending Operators ............................................................. 660
__DELETE .................................................................................. 661
__ISVALIDREF .......................................................................... 662
__NEW ........................................................................................ 663
__QUERYINTERFACE .................................................................. 665
__QUERYPOINTER ...................................................................... 666

12 EIO0000002854.06
AND_THEN .................................................................................. 667
OR_ELSE .................................................................................... 667
__TRY, __CATCH, __FINALLY, __ENDTRY ............................... 668
__VARINFO................................................................................ 670
‘__POSITION’ .......................................................................... 672
‘__POUNAME’ ............................................................................ 672
__POOL ...................................................................................... 673
Scope Operators......................................................................... 673
Initialization Operator ........................................................................ 676
INI Operator................................................................................ 676
Multicore Operators .......................................................................... 676
__CURRENTTASK ........................................................................ 677
__COMPARE_AND_SWAP .............................................................. 677
__XADD ...................................................................................... 678
TEST_AND_SET .......................................................................... 679
Operands............................................................................................... 681
Constants......................................................................................... 681
BOOL Constants......................................................................... 681
TIME/LTIME Constants................................................................ 681
DATE Constants ......................................................................... 682
LDATE Constants........................................................................ 682
DATE_AND_TIME Constants....................................................... 683
LDATE_AND_TIME Constants ..................................................... 683
TIME_OF_DAY Constants ........................................................... 684
LTIME_OF_DAY Constants.......................................................... 685
Number Constants ...................................................................... 685
REAL/LREAL Constants .............................................................. 686
String Constants ......................................................................... 686
Character Constant UCHAR ........................................................ 688
Typed Constants / Typed Literals.................................................. 688
Variables .......................................................................................... 689
Variables .................................................................................... 689
Addressing Bits in Variables ......................................................... 690
Addresses ........................................................................................ 692
Direct Addresses......................................................................... 692
Functions ......................................................................................... 693
Functions ................................................................................... 693
EcoStruxure Machine Expert Templates ............................................. 695
General Information about Templates....................................................... 696
EcoStruxure Machine Expert Templates ............................................. 696
General Information About EcoStruxure Machine Expert
Templates................................................................................... 696
Administration of EcoStruxure Machine Expert Templates .............. 697
Managing Device Templates.................................................................... 703
Managing Device Templates .............................................................. 703
Facts of Device Templates ........................................................... 703
Adding Devices from Template ..................................................... 703
Creating a Device Template on the Basis of Field Devices or I/O
Modules ..................................................................................... 706
Visualizations Suitable for Creating Device Templates ................... 706

EIO0000002854.06 13
Further Information on Integrating Control Logic into Device
Templates................................................................................... 707
Steps to Create a Device Template ............................................... 709
Managing Function Templates ................................................................. 712
Managing Function Templates ........................................................... 712
Facts of Function Templates ........................................................ 712
Adding Functions from Template .................................................. 713
Application Functions as Basis for Function Templates................... 717
Steps to Create a Function Template ............................................ 718
Troubleshooting and FAQ ...................................................................... 723
Generic - Troubleshooting and FAQ ......................................................... 724
Troubleshooting................................................................................ 724
Log File ...................................................................................... 724
Frequently Asked Questions .............................................................. 724
How Can I Enable and Configure Analog Inputs on
CANopen?.................................................................................. 724
Why is EcoStruxure Machine Expert Startup Performance
Sometimes Slower? .................................................................... 725
How Can I Manage Shortcuts and Menus?.................................... 726
How Can I Increase the Build-Time Performance of EcoStruxure
Machine Expert? ......................................................................... 727
What Can I Do in Case of Issues with Modbus IOScanner on
Serial Line? ................................................................................ 727
What Can I Do If My Network Variables List (NVL)
Communication Has Been Suspended?........................................ 728
Accessing Controllers - Troubleshooting and FAQ..................................... 729
Troubleshooting: Accessing New Controllers ...................................... 729
Accessing New Controllers .......................................................... 729
Connecting via IP Address and Address Information ...................... 730
FAQ - What Can I Do in Case of Connection Problems With the
Controller? ....................................................................................... 732
FAQ - Why is a Connection to the Controller not Possible? ............ 732
FAQ - Why has the Communication Between PC and Controller
been Interrupted?........................................................................ 735
Appendices .............................................................................................. 736
Network Communication ......................................................................... 737
Network Topology ............................................................................. 737
Addressing and Routing .................................................................... 737
Structure of Addresses ...................................................................... 739
Python Script Language .......................................................................... 742
General Information .......................................................................... 742
Introduction ................................................................................ 742
Accessing the Python Interpreter in EcoStruxure Machine
Expert ........................................................................................ 744
Using the Logic Builder Shell........................................................ 746
Using the Logic Builder Scripting Immediate View ....................... 752
Keyboard Commands in the Logic Builder Shell and the
Scripting Immediate View ......................................................... 754
Explore EcoStruxure Machine Expert Python API (with dir()
and inspectapi) ...................................................................... 755
Executing Scripts ........................................................................ 759
14 EIO0000002854.06
Best Practices............................................................................. 760
EcoStruxure Machine Expert Python API ...................................... 762
EcoStruxure Machine Expert Scripting - Python API ...................... 763
Calling Scripts Via Toolbar Icons .................................................. 767
Schneider Electric Script Engine Examples......................................... 769
New Projects .............................................................................. 769
Device Parameters...................................................................... 770
Compiler Version......................................................................... 771
Visualization Profile ..................................................................... 772
Update Project ............................................................................ 772
Update Libraries.......................................................................... 773
Clean and Build Application ......................................................... 774
Communication Settings .............................................................. 774
Start ETEST ............................................................................... 775
Reset Diagnostic Messages......................................................... 776
Reboot the Controller .................................................................. 777
Convert Device ........................................................................... 777
Comparing Projects..................................................................... 779
Advanced Library Management Functions .................................... 780
Accessing POUs ......................................................................... 781
CODESYS Script Engine Examples ................................................... 782
Project........................................................................................ 782
Online Application ....................................................................... 788
Objects....................................................................................... 790
Devices ...................................................................................... 791
System / User Interface (UI) ......................................................... 794
Reading Values........................................................................... 797
Reading Values From Recipe and Send an Email .......................... 798
Determine Device Tree of the Open Project................................... 799
Script Example 4: Import a Device in PLCOpenXML From
Subversion ................................................................................. 799
Script Example 5: Creating and Editing POUs ............................... 800
Script Example 6: User Interface / Interaction with the User ............ 801
Script Example 7: Manipulation of the Project information
Object ........................................................................................ 803
Advanced Example: Checkout a Library from SVN and
Installation in EcoStruxure Machine Expert ................................... 803
Managing Device User Rights Using the Scripting API ......................... 804
Managing Device User Rights Using the Scripting API .................. 804
Controller Feature Sets for Migration........................................................ 806
Controller Feature Sets for Migration .................................................. 806
Glossary ................................................................................................... 809
Index ......................................................................................................... 812

EIO0000002854.06 15
Safety Information

Safety Information
Important Information
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.

The addition of this symbol to a “Danger” or “Warning” safety label indicates that an
electrical hazard exists which will result in personal injury if the instructions are not
followed.

This is the safety alert symbol. It is used to alert you to potential personal injury
hazards. Obey all safety messages that follow this symbol to avoid possible injury or
death.

! DANGER
DANGER indicates a hazardous situation which, if not avoided, will result in death or serious
injury.

! WARNING
WARNING indicates a hazardous situation which, if not avoided, could result in death or
serious injury.

! CAUTION
CAUTION indicates a hazardous situation which, if not avoided, could result in minor or
moderate injury.

NOTICE
NOTICE is used to address practices not related to physical injury.

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.

EIO0000002854.06 17
About the Book

About the Book


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 EcoStruxure™ Machine Expert
V2.2.

Available Languages of this Document


This document is available in these languages:
• English (EIO0000002854)
• French (EIO0000002855)
• German (EIO0000002856)
• Italian (EIO0000002857)
• Spanish (EIO0000002858)
• Chinese (EIO0000002859)

18 EIO0000002854.06
About the Book

Related Documents
Document title Reference
Cybersecurity Best Practices CS-Best-Practices-2019-340

Cybersecurity Guidelines for EcoStruxure EIO0000004242


Machine Expert, Modicon and PacDrive
Controllers and Associated Equipment

EcoStruxure Machine Expert Introduction EIO0000002836 (ENG);

EIO0000002837 (FRE);

EIO0000002838 (GER);

EIO0000002840 (SPA);

EIO0000002839 (ITA);

EIO0000002841 (CHS)

EcoStruxure Machine Expert Compatibility and EIO0000002842 (ENG);


Migration User Guide
EIO0000002843 (FRE);

EIO0000002844 (GER);

EIO0000002846 (SPA);

EIO0000002845 (ITA);

EIO0000002847 (CHS)

EcoStruxure Machine Expert Functions and EIO0000002829 (ENG);


Libraries User Guide
EIO0000002830 (FRE);

EIO0000002831 (GER);

EIO0000002833 (SPA);

EIO0000002832 (ITA);

EIO0000002834 (CHS)

EcoStruxure Machine Expert Controller EIO0000001671 (ENG);


Assistant User Guide
EIO0000001672 (FRE);

EIO0000001673 (GER);

EIO0000001675 (SPA);

EIO0000001674 (ITA);

EIO0000001676 (CHS)

EcoStruxure Machine Expert Device Type EIO0000003047 (ENG);


Manager (DTM) User Guide
EIO0000003048 (FRE);

EIO0000003049 (GER);

EIO0000003051 (SPA);

EIO0000003050 (ITA);

EIO0000003052 (CHS)

EIO0000002854.06 19
About the Book

Document title Reference

EcoStruxure Machine Expert EIO0000001692 (ENG);


TwidoEmulationSupport 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)

To find documents online, visit the Schneider Electric download center


(www.se.com/ww/en/download/).

Product Related Information

WARNING
LOSS OF CONTROL
• Perform a Failure Mode and Effects Analysis (FMEA), or equivalent risk
analysis, of your application, and apply preventive and detective controls
before implementation.
• Provide a fallback state for undesired control events or sequences.
• Provide separate or redundant control paths wherever required.
• Supply appropriate parameters, particularly for limits.
• Review the implications of transmission delays and take actions to mitigate
them.
• Review the implications of communication link interruptions and take actions
to mitigate them.
• Provide independent paths for control functions (for example, emergency
stop, over-limit conditions, and error conditions) according to your risk
assessment, and applicable codes and regulations.
• Apply local accident prevention and safety regulations and guidelines.1
• Test each implementation of a system for proper operation before placing it
into service.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.

1 For 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.

20 EIO0000002854.06
About the Book

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.

For reasons of Internet security, for those devices that have a native Ethernet
connection, TCP/IP forwarding is disabled by default. Therefore, you must
manually enable TCP/IP forwarding. However, doing so may expose your network
to possible cyberattacks if you do not take additional measures to protect your
enterprise. In addition, you may be subject to laws and regulations concerning
cybersecurity.

WARNING
UNAUTHENTICATED ACCESS AND SUBSEQUENT NETWORK INTRUSION
• Observe and respect any and all pertinent national, regional and local
cybersecurity and/or personal data laws and regulations when enabling
TCP/IP forwarding on an industrial network.
• Isolate your industrial network from other networks inside your company.
• Protect any network against unintended access by using firewalls, VPN, or
other, proven security measures.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.

Consult the Schneider Electric Cybersecurity Best Practices for additional


information.

Information on Non-Inclusive or Insensitive Terminology


As a responsible, inclusive company, Schneider Electric is constantly updating its
communications and products that contain non-inclusive or insensitive
terminology. However, despite these efforts, our content may still contain terms
that are deemed inappropriate by some customers.

Terminology Derived from Standards


The technical terms, terminology, symbols and the corresponding descriptions in
the information contained herein, 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.

EIO0000002854.06 21
About the Book

Among others, these standards include:

Standard Description

IEC 61131-2:2007 Programmable controllers, part 2: Equipment requirements and tests.

ISO 13849-1:2023 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:2021 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:2021 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

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.

22 EIO0000002854.06
Introduction
What’s in This Part
General Introduction to the EcoStruxure Machine Expert Logic Builder...............24
EcoStruxure Machine Expert Logic Builder User Interface .................................26
Basic Concepts ..............................................................................................46

EIO0000002854.06 23
General Introduction to the EcoStruxure Machine Expert
Logic Builder

General Introduction to the EcoStruxure Machine


Expert Logic Builder
What’s in This Chapter
What is the EcoStruxure Machine Expert Logic Builder?...................................24
Tasks Performed by the EcoStruxure Machine Expert Logic Builder ..................24

What is 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.

Tasks Performed by the EcoStruxure Machine Expert


Logic Builder
Configuring and Programming Projects
The Logic Builder allows you to program logic and add devices to EcoStruxure
Machine Expert projects.
To assist you in performing this task, it provides the following functions:
• Separate hardware catalog views for Controller, HMI & iPC, Devices &
Modules, Diverse allow you to add hardware devices to your project by drag
and drop. It also allows you to use device templates and function templates.
• A separate software catalog view for ToolBox allows you to add software
elements by drag and drop.
To display only the relevant views for the task that is being performed,
EcoStruxure Machine Expert provides individual perspectives, page 42 for
hardware configuration, software configuration, and online mode. You are allowed
to adapt these default perspectives to your individual requirements, and to create
your own perspectives with the views you use most frequently.

Building Projects
The Logic Builder provides different ways (such as Generate Code or Generate
Code for all Applications) to build your EcoStruxure Machine Expert project.

24 EIO0000002854.06
General Introduction to the EcoStruxure Machine Expert Logic
Builder

Communication with Controller


The Logic Builder provides scan functions to detect available controllers in the
Ethernet network. It supports different protocols for communication with the
controller.
After communication has been established, applications can be downloaded to or
uploaded from the controller. Applications can be started and stopped on the
controller.

Online Features
The Logic Builder online features allow you to perform the following tasks:
• Online monitoring of values in program code and in Watch views
• Performing online changes
• Online configuration of traces
• Watching traces online
• Interacting with your machine by using built-in visualizations in online mode
for diagnostic and test purposes
• Reading the status of controllers and devices
• Detecting potential programming logic errors by using the debugging function

EIO0000002854.06 25
EcoStruxure Machine Expert Logic Builder User Interface

EcoStruxure Machine Expert Logic Builder User


Interface
What’s in This Chapter
Elements of the EcoStruxure Machine Expert Logic Builder Screen...................26
Multi-Tabbed Navigators ...............................................................................31
Functional tree ............................................................................................36
Multi-Tabbed Catalog View............................................................................39
Customizing the User Interface.......................................................................40
User Interface in Online Mode ........................................................................44
Menus and Commands..................................................................................45

Elements of the EcoStruxure Machine Expert Logic


Builder Screen
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, page 40. 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 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, page 42.

Default Logic Builder Screen


Default positions of menus, bars, and views on the Logic Builder screen

26 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface

1 2 3 4

MyProject.project - Machine Expert Logic Builder - Version X.X (x64)

File Edit View Project ETEST Build Online Debug Tools Window Help

Devices

- MyProject
+ Project Information

+ GlobalTextList

POUs
- MyProject
+ Project Information

GlobalTextList

Library Manager

POU (PRG)

Project Information

Project Settings

Messages – Total 0 error(s), 0 warning(s), 1 message(s)

Licensing 0 error(s) ! 0 warning(s) 1 message(s)

Description Project Object Position


Trial license not activated – EcoStruxure Code Analysis: Please use the `manage licenses` dialog of the help menu to .. ...

Messages – Total 0 error(s), 0 warning(s), 1 message(s) Watch 1 Call Stack

Last build: 0 ! 0 Precompile Digital Signatures Verification Project user: (nobody)

5 6 7

1 Menu bar
2 Buttons for navigation within editors
3 Toolbar
4 Multi-tabbed Navigators: Devices tree, Tools tree, Applications tree,
Functional tree
5 Messages view
6 Information bar
7 Status bar

EIO0000002854.06 27
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.

Buttons for navigation within Three buttons for navigating within editor views:
editors
• Navigate backward: Allows you to jump to the last cursor
position within an editor view. As a history of last cursor
positions is stored, click the button again to move to
previous positions.
• Navigate forward: Allows you to move forward in the
history of cursor positions within editor views.
• Navigate to: Click to open the list of last visited editor
views. If supported by the editor, position data (such as line
and column in the declaration or implementation part of a
logic editor) is provided. Select an entry to open the editor
with the cursor being placed at the position that is
indicated. Editors that do not support position data, open at
a random cursor position.

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
For further information, refer to the chapter Multi-Tabbed
Navigators, page 31.

Messages view Provides messages on precompile, compile, build, download


operations. Refer to the description of the Messages view
commands for details (see EcoStruxure Machine Expert, Menu
Commands, Online Help).

Information bar of the Provides information messages, for example on the license
Messages view status.

Status bar Provides the following information:


• Information about the user account.
• Information about the editing mode and position if an editor
is open.
For further information, refer to the Status Bar paragraph in this
chapter.

Multi-tabbed Catalog view The Catalog view consists of different tabs where the available
hardware and software objects are listed:
• Hardware Catalog
◦ Controller
◦ HMI & iPC
◦ Devices & Modules
◦ Diverse
• Software Catalog
◦ ToolBox
For further information, refer to the chapter Multi-Tabbed Catalog
Views, page 39.

Multi-tabbed editor view 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 view in offline or online mode by
executing the Edit Object command.

28 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface

Status Bar
The bar at the lower border of the Logic Builder screen provides various types of
information:
• Information on the logged-in user.
• If you are working in an editor view: the position of the cursor and the status of
editing mode.
• In offline mode: the status of the program.
• In online mode: the status of the program.
Information on the logged-in user
Each project has a user and access management setting (refer to the Project >
User Management > Permissions... command (see EcoStruxure Machine
Expert, Menu Commands, Online Help)). The logged-in user name is displayed in
the status bar.
Cursor positions in editor views
The cursor position is counted from the left or upper margin of the editor view.

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 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

Double-click this field to toggle the setting.


The status of the active application is indicated in offline mode by an icon and a
tooltip:

Icon Tooltips Description

No reference code generated Application not downloaded.

Code unchanged Application not modified. A connection to the controller can be established without
download.
Online change possible Application modified, can be downloaded by an online change.

Code download necessary Application modified, cannot be downloaded by an online change. A full download is
required.

EIO0000002854.06 29
EcoStruxure Machine Expert Logic Builder User Interface

The following status of the program is indicated in online mode:

Text Description

Program unchanged Program on device matches the active application in the programming
system.

Program modified Program on device differs from the active application in the
(Online Change) programming system, online change required.

Program modified (Full Program on device differs from the active application in the
download) programming system, full download required.

Online mode information


Status of the application on the device:

Text Background Color Description

RUN Green Program running.

STOP Red Program stopped.

HALT ON BP Red Program halted on a breakpoint.

The following status field is only available if the controller, depending on a setting in the device description, supports cycle-independent
monitoring.

IN CYCLE White Indicates that the values of the monitored expressions are read
within one cycle.

OUT OF CYCLE Red Indicates that the retrieval of the values of the monitored
variables cannot be performed within one cycle.

Operating mode information


The icon Debug, Locked or Operational indicates the present operating mode.
For further information, refer to the chapter Operating Modes in the Menu
Commands Online Help.

Watch Windows and Online Views of Editors


Watch windows and online editor views display a monitoring view of a POU or a
user-defined list of watch expressions.

Windows, Views, and Editors


There are two different types of windows in the Logic Builder:
• Some can be docked to any margin of the EcoStruxure Machine Expert
window or can be positioned on the screen as undocked windows
independently from the EcoStruxure Machine Expert window. Additionally
they can be hidden by being represented as a tab in the EcoStruxure
Machine Expert window frame (refer to the Customizing the User Interface
chapter, page 40). These windows display information which is not dependent
on a single object of the project (for example Messages view or Devices
tree). You can access them via the View menu (see EcoStruxure Machine
Expert, Menu Commands, Online Help). Most views include a non-
configurable toolbar with buttons for sorting, viewing, searching within the
window.
• Other windows open when you are viewing or editing a specific project object
in the respective editor. They are displayed in the multi-tabbed editor view.
You cannot hide or undock them from the EcoStruxure Machine Expert
window. You can access them via the Window menu.

30 EIO0000002854.06
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.

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.

Adding Elements to the Navigators


The root node of a navigator represents a programmable device. You can insert
further elements below this root node.
To add elements to a node of a Navigator, select a device or object in the
hardware or software catalog on the right-hand side of the Logic Builder screen
and drag it to the Navigator (for example, the Devices tree). The node or nodes
where the selected device or object fits are automatically expanded and displayed
in bold. The other nodes where the selected device or object cannot be inserted
are grayed. Drop the device or object on the suitable node and it is inserted
automatically. If any further elements are required for the device or object, such as
communication managers, they are inserted automatically.
Alternatively, you can select a node in the tree. If it is possible to add an object to
the selected device or object, a green plus button is displayed. Click this plus
button to open a menu providing the elements available for insertion.
It is also possible to add an object or a device, by right-clicking a node in a
Navigator and executing the command Add Object or Add Device. The device
type which can be inserted depends on the selected object within the Navigator.
For example, modules for a PROFIBUS DP slave cannot be inserted without
having inserted an appropriate slave device before. Note that only devices
correctly installed on the local system and matching the present position in the
tree are available for insertion.

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.

EIO0000002854.06 31
EcoStruxure Machine Expert Logic Builder User Interface

Updating the Version of a Device


A device that is already inserted in the Navigators can be updated to another
version or converted to another device.
Refer to the description of the separate commands:
• Update Device command, page 58
• Convert Device command, page 59

32 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface

Description of the Devices Tree


Each device object in the Devices tree represents a specific (target) hardware
object.
Examples: controller, fieldbus node, bus coupler, drive, I/O module
Devices and subdevices are managed in the Devices tree. Other objects which
are needed to run an application on a controller are grouped in the other
Navigators.

• The root node of the tree is a symbolic node entry: <projectname>


• The controller configuration is defined by the topological arrangement of the
devices in the Devices tree. The configuration of the particular device or task
parameters is performed in corresponding editor dialogs. Also refer to the
chapter Task Configuration, page 210.
Thus the hardware structure is mapped and represented within the Devices
tree by the corresponding arrangement of device objects, allowing you to set
up a complex heterogeneous system of networked controllers and underlying
fieldbusses.
• To add devices configured with DTMs (Device Type Managers) to your
project, activate the check box Use DTM Connection in the lower part of the
Devices tree. This has the effect that a node FdtConnections is added
below the root node of the tree. Below the FdtConnections node, a
communication manager node is inserted automatically. You can add the
suitable DTM device to this node.
For further information, refer to the Device Type Manager (DTM) User Guide.
• To acknowledge diagnostic messages of an individual device with or without
the subordinate devices, execute the command Acknowledge Diagnosis or
Acknowledge Diagnosis for Subtrees in the contextual menu of a device
object.
Device objects are marked when diagnostic messages are available:
◦ A red exclamation mark indicates that the detected error is still valid.
◦ A gray exclamation mark indicates that the detected error is no longer
valid.
Example of a Devices tree:

1 Root node
2 Programmable device (with applications)

EIO0000002854.06 33
EcoStruxure Machine Expert Logic Builder User Interface

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 box (device editor). To open the device editor, double-click
the device node in the Devices tree (refer to the description of the device
editor, page 76).
• 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, page 114 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, page 114 is
disabled.
◦ Device is not exchanging data, bus error detected, not configured or
simulation mode (refer to the description of the Simulation command).

◦ Device is running in demo mode for 30 minutes. After this time, the
demo mode expires and the fieldbus stops exchanging data.

◦ 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 device is running, but a subordinate device is not running or a


diagnostic message has been issued. The subordinate device is not
visible because the Devices tree is collapsed.

◦ A diagnostic was pending. The issue that caused the error is no


longer valid or has been solved. This symbol can be displayed in
connection with various other symbols in this list.
◦ The device is not running or a diagnostic is pending. The issue that
caused the error is still valid. This symbol can be displayed in connection
with various other symbols in this list.
• 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, page 131.
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

34 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface

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.
For information on the conversion of device references when opening projects,
refer to the Compatibility and Migration User Guide.

Arranging and Configuring Objects in the Devices Tree


Adding devices / objects:
To add devices or objects to the Devices tree, select a device or object in the
hardware catalog on the right-hand side of the Logic Builder screen and drag it to
the Devices tree. The node or nodes where the selected device or object fits is
expanded and is displayed in bold. The other nodes where the selected device or
object cannot be inserted are grayed. Drop the device or object on the suitable
node and it is inserted automatically.
Alternatively, you can select a node in the tree. If it is possible to add an object to
the selected device or object, a green plus button is displayed. Click the plus
button to open a menu providing the elements available for insertion.
Alternatively, you can add an object or a device, by right-clicking a node in the
Devices tree and executing the command Add Object or Add Device. The
device type which can be inserted depends on the selected object within the
Devices tree. For example, modules for a PROFIBUS DP slave cannot be
inserted without having inserted an appropriate slave device before. No
applications can be inserted below non-programmable devices.
Note that only devices correctly installed on the local system and matching the
present position in the tree are available for insertion.
Repositioning objects:
To reposition objects, use the clipboard commands (Cut, Copy, Paste, Delete)
from the Edit menu. Alternatively, you can draw the selected object with the
mouse while the mouse-button (plus CTRL key for copying) is pressed. Consider
for the Paste command: In case the object to be pasted can be inserted below or
above the selected entry, the Select Paste Position dialog box opens. It allows
you to define the insert position. When you add devices using the copy and paste
function, the new device gets the same name followed by an incrementing
number.
Updating the version of a device:
A device that is already inserted in the Devices tree can be replaced by another
version of the same device type or by a device of another type (device update). In
doing so, a configuration tree indented below the respective device is maintained
as long as possible.
Adding devices to the root node:
Only devices can be positioned on the level directly below the root node
<projectname>. If you choose another object type from the Add Object dialog
box, such as a Text list object, it is added to the Global node of the Applications
tree.
Subnodes:
A device is inserted as a node in the tree. If defined in the device description file,
subnodes are inserted automatically. A subnode can be another programmable
device.
Inserting devices below a device object:
You can insert further devices below a device object. If they are installed on the
local system, they are available in the hardware catalog or in the Add Object or
Add Device dialog box. The device objects are sorted within the tree from top to
bottom: On a particular tree level first the programmable devices are arranged,
followed by any further devices, sorted alphabetically.

EIO0000002854.06 35
EcoStruxure Machine Expert Logic Builder User Interface

Description of the Applications Tree


The Application objects, task configuration, and task objects are managed in the
Applications tree.
The objects needed for programming the device (applications, text lists, etc.) are
managed in the Applications tree. Devices that are not programmable
(configuration only) cannot be assigned as programming objects. You can edit the
values of the device parameters in the parameter dialog box of the device editor.
Programming objects, like particular POUs or global variable lists can be
managed in 2 different ways in the Applications tree, depending on their
declaration:
• When they are declared as a subnode of the Global node, these objects can
be accessed by any devices.
• When they are declared as a subnode of the Applications node, these
objects can only be accessed by the other devices declared in this
Applications node.
You can insert an Application object only in the Applications tree.
Below each application, you can insert additional programming objects, such as
DUT, GVL, or visualization objects. Insert a task configuration below an
application. In this task configuration, the program calls have to be defined
(instances of POUs from the Global node of the Applications tree or device-
specific POUs). Note that the application is defined in the I/O Mapping view of the
respective device editor, page 132.

Description of the Tools Tree


Libraries are managed in the Tools tree. Devices that are only configured (not
programmed) cannot be assigned the programming objects described above. You
can edit the values of the device parameters in the parameter dialog box of the
device editor.
Programming objects, like the Library Manager,can be managed in 2 different
ways in the Tools tree, depending on their declaration:
• When they are declared as a subnode of the Global node; then these objects
can be accessed by any devices.
• When they are declared as a subnode of the Applications node; then these
objects can only be accessed by the other devices declared in this
Applications node.

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, reuse your developments to improve your
vision of the project. You can export / import the Functional tree and reuse it in
another project.

36 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface

Description of the Functional tree


Example of a Functional tree:

1 Root node: corresponds to the name of the open project


2 Controller node: only those controllers that have a Functional Model node in
the Devices tree are displayed
3 Functional module: nodes for structuring the Functional tree
4 Attached object: object attached to the functional module
5 Child object: child object of the attached object

Selecting Controllers
Select controllers for the Functional tree as follows:

Step Action Result

1 In the Functional tree, right-click the root node, A new subnode Functional Model
and execute the command Select Controllers. is inserted for each selected
controller in the Devices tree.
2 In the Select Controllers dialog box, select the New controller nodes are added to
controllers you want to add to the Functional the Functional tree below the root
tree, and click OK. node for each selected controller.

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.

EIO0000002854.06 37
EcoStruxure Machine Expert Logic Builder User Interface

Node Description How to create

Functional module A functional module is a group of program Select a parent node (for example, the controller
elements intended to perform an application node), and click the green plus button.
function.

Functional module nodes create a hierarchical


structure in the Functional tree. To create a
meaningful structure, edit the default name and
assign a name of your choice to each functional
module.
Attached object Attached objects are nodes of the other navigators Right-click a functional module node, and execute
(Devices tree, Applications tree, Tools tree) that the command Select Objects from the contextual
represent the content of the controller. menu. From the Select Objects dialog box, select
the node you want to attach and click OK.
Note the following:
• One object can only be attached to one
functional module.
• An object can only be attached to a function
module of the same controller.
• You can attach only those objects that are
also allowed in function templates, page 715.

Child object Child objects of the attached objects. Child objects are displayed in the Functional tree.

Deleting Nodes
To delete a node from the Functional tree, right-click on it, and execute the
command Delete from the contextual menu. You are requested 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.

Reusing Functional Modules


If you have created a functional module that you want to reuse in the same or in
another project, use the function templates as they can resolve the dependencies
between the attached objects. The Import/Export commands and the copy/paste
functions can also be used, but they only serve special cases as described in the
following sections.

Reusing Functional Modules by Using Function Templates


You can save a functional module to a function template by right-clicking the node
and executing the command Save as Function Template from the contextual
menu.
To instantiate a functional module from a function template, right-click a node in
the Functional tree, and execute the command Add Function From Template
from the contextual menu.
For further information, refer to the Managing Function Templates chapter, page
712.

38 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface

Reusing Functional Modules by Using the Import/Export


Commands
When you use the Project > Export command and the Project > Import
command (see EcoStruxure Machine Expert, Menu Commands, Online Help) for
reusing functional modules, note the following:

If... Then ...


If you export a complete controller device, and Then the functional model is recreated.
then import it in the same or in another project,

If you export and import the functional model Then the attached objects are not recreated.
only,

Reusing Functional Modules by Using the Copy and Paste


Functions
When you use the copy and paste functions for reusing functional modules, note
the following:

If... Then ...


If you copy a complete controller device, and Then the functional model is recreated.
then paste it in the same or in another project,

If you copy and paste one or more functional Then the attached objects are not recreated.
modules only,

It is not possible to copy and paste attached objects in the Functional tree.

Multi-Tabbed Catalog View


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 Software Catalog > ToolBox 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.

EIO0000002854.06 39
EcoStruxure Machine Expert Logic Builder User Interface

You can add the elements from the catalogs to the project by drag and drop as
described in the Adding Devices by Drag and Drop chapter, page 51.

Searching Within Catalogs


Each tab of the catalog view contains a search box. The sublists of the tab are
analyzed for the string you enter in the search box. In open sublists, the identified
entries are marked yellow. Any other items of the list that do not correspond to the
search string are hidden. The number of items found in closed sublists is
displayed in bold in the title bar of each sublist.
By default, the search is executed on the names of the items in the lists. But
EcoStruxure Machine Expert also supports the tagging mechanism. It allows you
to assign search strings of your choice to any item included in the Catalog view.

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.

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, page 703.

Customizing the 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, page 42.

40 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface

Arranging Menu Bars and Toolbars


The menu bar is positioned at the top of the user interface, between the window
title bar and view windows. You can position a toolbar within the same area as the
menu bar (fix) or as an independent window anywhere on the screen.
In view windows, such as the Devices tree, a special toolbar is available. It
provides elements for sorting, viewing, and searching within the window. You
cannot configure this toolbar.

Arranging Windows and Views


Closing a view or editor window: Click the cross button in the upper right corner.
Opening a closed view: you can reopen the views of default components via the
View menu. To open an editor window, execute the command Project > Edit
object or double-click an entry in the Devices tree, Applications tree, or in the
Tools tree.
Resizing a view or window within the frame window: Move the separator lines
between neighboring views. You can resize independent view windows on the
desktop by moving the window borders.
Moving a view to another position on your desk top or within the frame window:
Click the title bar or, in the case of tabbed views, click the tab of the view, keep the
mouse-button pressed, and move the view to the desired place. Arrow symbols
indicate possible target positions. The target position is indicated by a blue-
shadowed area.
Arrow symbols indicating new position

Arrow symbol Description

View is placed above.

View is placed below.

View is placed to the right.

View is placed to the left.

View is placed here: the view currently placed at this position and the
new one are arranged as icons.

EIO0000002854.06 41
EcoStruxure Machine Expert Logic Builder User Interface

Example of navigation by the arrow symbols

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, page 26.

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 the following perspectives for
specific use cases in the Window > Switch Perspective menu or in the
perspective table in the toolbar.

42 EIO0000002854.06
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

Classic Default views. • Devices – • Messages (in Auto


• POUs Hide mode)
• Watch 1
• CallStack
ETest For working within the • Devices – • Messages
ETEST framework. • POUs • Watch 1
• CallStack
• Testruns
Device Configuration For adding / configuring • Devices tree Hardware catalog Messages (in Auto Hide
devices. • Controller mode)

• Devices & Modules


• HMI & iPC
• Diverse
Online For online mode. • Devices tree – • Messages (in Auto
• Applications tree Hide mode)

• Tools tree • Watch 1

Smart Template For working with Smart • Devices – Messages (in Auto Hide
Template modules. • POUs mode)

• Modules
Logic Configuration For adding / creating • Devices tree Hardware catalog Messages (in Auto Hide
logic. • Applications tree • Controller mode)

• Tools tree • Devices & Modules


• 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.

Resetting a perspective to its initial state:


To reset a modified perspective to its initial state, execute the command Reset
current Perspective from the Window menu.
Importing / exporting perspectives:
To be able to exchange perspectives between different EcoStruxure Machine
Expert installations or between different users, the Tools > Options >
Perspectives dialog box (see EcoStruxure Machine Expert, Menu Commands,
Online Help) allows you to export perspectives to an XML file and to import
already available perspective XML files.

EIO0000002854.06 43
EcoStruxure Machine Expert Logic Builder User Interface

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.

User Interface in Online Mode


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, page 42 which means that the
Watch view opens by default.
To open an object in online mode, double-click the node in the Applications tree
or execute the Project > Edit Object command.
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>
is displayed. 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

The Device/Application field contains the device and application to which the
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:

44 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface

• 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, page 26 provides information on the current status of the
application.

Menus and Commands


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
or reorganize the menu structures, use the Tools > Customize dialog box.
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.
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 45
Basic Concepts

Basic Concepts
What’s in This Chapter
Introduction and Basic Concepts ....................................................................46

Introduction and Basic Concepts


Overview
EcoStruxure Machine Expert is a device-independent controller programming
system.
Conforming to the IEC 61131-3 standard, it supports standard programming
languages.

Object Orientation
The object-oriented approach is not only reflected by the availability of
corresponding 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 an 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 to 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. An
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:

Object Type Description

Programming objects (POUs), These are programs, functions, function blocks, methods,
page 158 interfaces, actions, data type, definitions, and so on.

Resource objects (Devices tree) Device objects are only managed in the Devices tree. To insert
objects in the Devices tree, refer to Adding Elements to the
Navigators section, page 35.

Code Generation
Code generation by integrated compilers and the subsequent use of the resulting
machine code provides for short execution times.

46 EIO0000002854.06
Basic Concepts

Data Transfer to the Controller Device


The data transfer between EcoStruxure Machine Expert and the device is
conducted via a gateway (component) to a runtime system. After downloading the
application to the controller it can be monitored and controlled in EcoStruxure
Machine Expert.

Supported Programming Languages


The programming languages mentioned in the standard IEC 61131 are supported
via specially adapted editors:
• FBD/LD/IL editor, page 242 for function block diagram (FBD), ladder logic
diagram (LD), and instruction list (IL)
• SFC editor, page 293 for sequential function chart
• ST editor, page 318 for structured text
Additionally, EcoStruxure Machine Expert provides an editor for programming in
CFC that is not part of the IEC standard:
• CFC editor, page 276 for continuous function chart
CFC is an extension to the standard IEC programming languages.
A CFC - page-oriented editor is also provided. It allows you to arrange the CFC
elements on individual pages.

EIO0000002854.06 47
Configuration
What’s in This Part
Installing Devices ...........................................................................................49
Managing Devices..........................................................................................51
Common Device Editor Dialogs .......................................................................76

48 EIO0000002854.06
Installing Devices

Installing Devices
What’s in This Chapter
Integration of Sercos Devices from Third-Party Vendors ...................................49

Integration of Sercos Devices from Third-Party Vendors


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.

Integrating In EcoStruxure Machine Expert


Proceed as follows to integrate Sercos devices from third-party vendors in your
programming system:

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).

Verifying the Integration


To verify whether a Sercos device with generic I/O profile has been integrated in
your programming system, proceed as follows:

EIO0000002854.06 49
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).

50 EIO0000002854.06
Managing Devices

Managing Devices
What’s in This Chapter
Adding Devices through the Hardware Catalog ..............................................51
Adding Devices by Contextual Menu or Plus Button .........................................53
Updating Devices ..........................................................................................58
Converting Devices .......................................................................................59
Converting Projects .......................................................................................60

Adding Devices through the Hardware Catalog


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.
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.

Adding Controllers
To add a controller to your project, proceed as follows:

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.

Adding Expansion Devices


To add an expansion device to a controller, proceed as follows:

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.

EIO0000002854.06 51
Managing Devices

Step Action

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.

Adding Devices and Modules


To add a field device to a controller, proceed as follows:

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.

Adding Devices from Device Template


To add a device from a device template, proceed as follows:

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, page 703.

52 EIO0000002854.06
Managing Devices

Adding Devices by Contextual Menu or Plus Button


Adding a Controller
Introduction
To add devices to the Devices tree, you can also 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 use 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 controller 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

Adding Expansion Devices


Available Expansion Devices
For a list of expansion devices available for the different controllers, refer to the
Supported Devices chapter of the EcoStruxure Machine Expert Introduction
document.

EIO0000002854.06 53
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.

Adding Expansion Devices


To add expansion devices to your device, proceed as follows:

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

Expansion Device Configuration


For more information about configuration, refer to the Programming Guide of your
expansion device.

Adding Communication Managers


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
Communication managers available in EcoStruxure Machine Expert are listed
below:

54 EIO0000002854.06
Managing Devices

Name Interface Description


type

ASCII Manager Serial line Used to transmit and/or receive data with a simple
device.
Machine Expert-Network • Serial For exchanging data with HMIs.
Manager line
(max.
1)
• Ether-
net
(max.
3)

Modbus IOScanner Serial line Modbus RTU or ASCII protocol manager used to
define implicit exchanges (I/O scanning) with Modbus
slave devices.
Modbus Manager Serial line Used for Modbus RTU or ASCII protocol in master or
slave mode.
CANopen Performance CAN CANopen manager for performance controllers
(M241, M251, M258, and LMC058).

CANopen_Manager CAN CANopen manager for PacDrive controllers.

J1939_Manager CAN For adding J1939 slaves (Electronic Control Units


(ECU)) on M241 / M251 controllers.

Modbus TCP Slave Device Ethernet Modbus TCP manager for controllers with Ethernet
port.

EthernetIP Ethernet EtherNet/IP manager for controllers with Ethernet


port (M251, M258, and LMC058).

Industrial Ethernet Network Ethernet For configuring EtherNet/IP and Modbus TCP
scanner services on M241 / M251 controllers with
Ethernet port.

Adding the Communication Manager


Communication managers are automatically added with the respective device.
To add a communication manager separately, proceed as follows:

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 55
Managing Devices

Adding Devices to a Communication Manager


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.

Access to Diagnostic Information


To get diagnostic information of devices on CANopen, use the CAA_CiA405.
library.

Access to Configuration Diagnostic (for Advanced Users)


You can use the options Abort if error and Jump to line if error in the Service
Data Object tab of the CANopen configurator to manage potential configuration
inconsistencies.
To optimize the CAN master performance, CAN diagnostics are external from the
CAN master in the controller. The CAN diagnostic structure is defined in the
CanConfig Extern library available in the Library Manager.
The structure g_aNetDiagnosis contains the most recent diagnostic information
from the slaves. The structure is updated every time a slave is configured.
This structure can be used within the program to do the following:

56 EIO0000002854.06
Managing Devices

• Monitoring the response of the slaves configured via SDO messages.


• Monitoring the master for abort messages from the slaves before allowing a
machine / application start-up.
This structure must be in place and active within the user application during
testing, debugging and commissioning of the application. When the machine and
its controlling application have been commissioned and validated, then it would be
possible to disable this code from execution to reduce traffic on the CANopen
network.
However, if during the lifecycle of an application and the machine or process that it
controls, slaves are added or replaced in the operational system, then the
diagnostic structure should continue to remain active in the application.

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.
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].udiAbortCode;
(* 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.

Adding Devices from Template


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, page 703.

EIO0000002854.06 57
Managing 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:

Ste- Action
p

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.

Effects after Updating a Device


The subdevices that are located in the Devices tree below the device you
updated are automatically updated as well.
The device configuration settings are not modified if the device type has not been
changed.
If the update procedure causes any mismatch in the existing configuration, this is
detected at the next Build run of the application. Detected mismatches are
indicated by a message. This also concerns implicitly added libraries which will not
be removed automatically at a device update.

58 EIO0000002854.06
Managing Devices

Converting Devices
Converting Devices
Introduction
EcoStruxure Machine Expert allows 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 is 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
• Reload the project.

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 59
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 with 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
NOTE: 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 kept if the related modules are still available. Any modifications or configurations that could not be converted are listed in
the Messages view.

6 Verify 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.

Conversion Information in the Messages View


The following information is displayed in the Messages view for the conversion
process:
• The source devices and the target devices they have been converted to.
• The parameters that have not been transferred to the target.
• The devices that have not been converted.
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).

Converting Projects
Converting SoMachine Basic and Twido 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, page 806. 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).
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

60 EIO0000002854.06
Managing Devices

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.

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.

Converting a SoMachine Basic or a Twido Project


To convert a SoMachine Basic or a Twido project, proceed as follows:

EIO0000002854.06 61
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, page 60).

Result: The Convert SoMachine Basic Project dialog box or Convert Twido Project dialog box opens:

2 Enter a name for the controller in the Device Name field.


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.

62 EIO0000002854.06
Managing Devices

IEC Compatibility of Object and Variable Names


Object names and variable names in EcoStruxure Machine Expert projects have
to comply with the naming conventions defined in the IEC standard. Any names in
your SoMachine Basic or Twido project that do not comply with the standard are
automatically adapted to IEC conventions by the converter.
If you want to preserve names that are not IEC-compatible in the converted
EcoStruxure Machine Expert project, activate the option Allow unicode
characters for identifiers in the Project Settings > Compile options dialog box
(see EcoStruxure Machine Expert, Menu Commands, Online Help).

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 an
EcoStruxure Machine Expert application. The TwidoEmulationSupport library is
automatically integrated in the EcoStruxure Machine Expert project with the
converted controller.

Conversion of the Application Program


In the target EcoStruxure Machine Expert project, separate programs are created
for each SoMachine Basic POU and free POU and for each Twido subroutine and
program section. The programming language that is used for these programs is
determined by the Implementation Language selected in the Convert
SoMachine Basic Project / Convert Twido Project dialog box. An exception is
made for POUs that were programmed in graphical Grafcet. They are converted to
an SFC program. For detailed information, refer to the Grafcet section in this
chapter, page 70.
For each language object (such as memory objects or function blocks) being used
by the application program, one global variable is created. Separate global
variable lists, page 191 for the different object categories (one for memory bits,
one for memory words and so forth) are created.
The following restrictions apply for the conversion of the application program
concerning the program structure:
• In EcoStruxure Machine Expert, it is not possible to jump to a label, page 267
in another program.
• It is not possible to define Grafcet steps in a subprogram.
• It is not possible to activate or deactivate Grafcet steps (per # and D#
instruction) in a subprogram.

Conversion of Memory Objects


The areas provided for memory objects in SoMachine Basic and Twido differ from
EcoStruxure Machine Expert.
In SoMachine Basic and Twido, there are three distinct areas for memory objects:

Area Memory objects included

memory bit area memory bits (%M)

memory word area • memory words (%MW)


• double words (%MD)
• floating point values (%MF)

constant area • constant words (%KW)


• double words (%KD)
• floating point values (%KF)

EIO0000002854.06 63
Managing Devices

In EcoStruxure Machine Expert, there is only the memory word area for memory
objects:

Area Memory objects included

memory word area • memory words (%MW)


• double words (%MD)
• floating point values
There is no specific addressing format for floating point
values. Floating point variables can be mapped on a %MD
address.

The graphic provides an overview of the different layouts of %MD and %MF
addresses in SoMachine Basic / Twido and EcoStruxure Machine Expert.

1 Memory addresses in SoMachine Basic / Twido


2 Memory addresses in EcoStruxure Machine Expert
Memory objects are converted as follows:

Source memory objects Target memory object Further information

%MW Mapped to the same %MW For each %MW object, a global
address variable of type INT is created.

Example

%MW2 is mapped on %MW2.

%MD and %MF with even Mapped such that they are For each %MD object, a global
addresses located on the same %MW variable of type DINT is
address as before. created.

Example For each used %MF object, a


global variable of type REAL is
%MD4 / %MF4 are mapped on % created.
MD2.
%MD and %MF with uneven Cannot be mapped because a A variable is created to help
addresses DINT variable cannot be ensure that the converted
located on an odd word application can be built.
address. However, you need to examine
the effect that such variable
creation has on the overall
functionality of your program.

%M Mapped as a packed bit field to For each %M object, a global


a fix location in the %MW area. variable of type BOOL is
created.
%KW Mapped to consecutive For each used %KW object, a
addresses of the %MW area. global variable of type INT is
created.

64 EIO0000002854.06
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.

Conversion of Function Blocks


For the following function blocks in SoMachine Basic / Twido, the
TwidoEmulationSupport library provides function blocks with compatible functions:

SoMachine Basic / Twido function block TwidoEmulationSupport library function block

Timers %TM FB_Timer

Counters %C FB_Counter

Register %R FB_FiFo / FB_LiFo

Drum %DR FB_Drum

Shift bit register %SBR FB_ShiftBitRegister

Step counter %SC FB_StepCounter

Schedule %SCH FB_ScheduleBlock

PID FB_PID

Exchange / message %MSG FB_EXCH

High-speed counter %HSC / %VFC They are converted as described in the section
Conversion of Fast Counters, High-speed
Fast counter %FC Counters (Twido: Very Fast Counters) and Pulse
Generators, page 68 of this chapter.
PLS pulse generator %PLS

PWM pulse generator %PWM

PTO function blocks %PTO, %MC_xxx_PTO

Frequency generator %FREQGEN

Communication function blocks READ_VAR, FB_ReadVar, FB_WriteVar, FB_


WRITE_VAR, WRITE_READ_VAR , and SEND_ WriteReadVar, and FB_SendRecvMsg
RECV_MSG

SMS function block SEND_RECV_SMS They are not converted.

MC_MotionTask_PTO

EIO0000002854.06 65
Managing Devices

SoMachine Basic / Twido function block TwidoEmulationSupport library function block

Drive function blocks %MC_xxx_ATV

%DATALOG

For the conversion of function blocks, note the following:


• The TwidoEmulationSupport library does not provide any function blocks for
hardware-related functions, such as high-speed counters, fast counters, and
the pulse generators. They must be controlled through function blocks
provided by the platform-specific HSC and PTO_PWM libraries. These
function blocks are not compatible with the source function blocks. In short, a
full conversion is not possible if the source program contains functions based
on controller hardware resources. For further information, refer to the
description Conversion of Fast Counters, High-speed Counters (Twido: Very
Fast Counters) and Pulse Generators, page 68.
• In SoMachine Basic / Twido, the messaging function is provided by the
EXCHx instruction and the %MSGx function block. In the EcoStruxure Machine
Expert application, this function is performed by a single function block FB_
EXCH.
• In SoMachine Basic / Twido, certain function blocks can be configured using
special configuration dialog boxes. This configuration data is provided to the
function blocks of the TwidoEmulationSupport library by dedicated
parameters.
• If a rung contains multiple function blocks, the converter may split the rung
into multiple logic networks.

Conversion of Network Objects


The table indicates the network object types that are supported by the conversion:

Network object Object function Supported

%QWE Input assembly (EtherNet/IP) Yes

%IWE Output assembly (EtherNet/IP) Yes

%QWM Input registers (Modbus TCP) Yes

%IWM Output registers (Modbus Yes


TCP)

%IN Digital inputs (IO scanner) Only Serial IO scanner

%QN Digital outputs (IO scanner) Only Serial IO scanner

%IWN Input registers (IO scanner) Only Serial IO scanner

%QWN Output registers (IO scanner) Only Serial IO scanner

%IWNS (IO scanner Diagnostics) Only Serial IO scanner

Conversion of System Variables


The following system bits and words are converted:

System bit / word Further information

%S0 Is set to 1 in the first cycle after a cold start.


NOTE: It is not possible to trigger a cold start by writing to
this system bit.

%S1 Is set to 1 in the first cycle after a warm start.


NOTE: It is not possible to trigger a warm start by writing to
this system bit.

%S4 Pulse with the time base 10 ms.


%S5 Pulse with the time base 100 ms.

66 EIO0000002854.06
Managing Devices

System bit / word Further information

%S6 Pulse with the time base 1 s.


%S7 Pulse with the time base 1 min.
%S13 Is set to 1 in the first cycle after the controller was started.

%S18 Is set to 1 if an arithmetic overflow occurs.


NOTE: This flag is provided by the TwidoEmulationSupport
library and is only set by functions provided by this library.

%S21 , %S22 Are only written. Reading is not supported for these variables.

%S113 Stops the Modbus Serial IOScanner on serial line 1.

%S114 Stops the Modbus Serial IOScanner on serial line 2.

%SW63...65 Error code of the MSG blocks 1...3.


%SW114 Enable flags for the schedule blocks.

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).

Conversion of Retain Behavior


The variables and function blocks in SoMachine Basic / Twido are retain variables.
This means, they keep their values and states even after an unanticipated
shutdown of the controller as well as after a normal power cycle of the controller.
This retain behavior is not conserved during conversion. In EcoStruxure Machine
Expert, the converted variables and function blocks are regular, which means that
they are initialized during unanticipated shutdown and power cycle of the
controller. If you need retain variables in your EcoStruxure Machine Expert
application, you have to declare this attribute keyword, page 510 manually.

Conversion of Animation Tables


Management of animation tables differs in the source and target applications:
• SoMachine Basic / Twido allow you to define multiple animation lists identified
by name. Each animation list can contain multiple entries for objects to be
animated. For each variable, you can select the option Trace.
• In EcoStruxure Machine Expert, there are 4 predefined watchlists, page 373
(Watch 1...Watch 4). Each watchlist can contain multiple variables to be
animated. One watchlist can contain variables from different controllers.
For those variables that have the option Trace selected in SoMachine Basic /
Twido, EcoStruxure Machine Expert creates a trace object. You can view
these variables in the trace editor, page 403.
During the conversion process, the entries of the source animation tables are
added at the end of watchlist Watch 1.

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:

EIO0000002854.06 67
Managing Devices

If... Then ...


a symbol name does not comply with the the name of the symbol is modified.
naming rules of EcoStruxure Machine Expert,

a symbol name is equal to a keyword of the name of the symbol is modified.


EcoStruxure Machine Expert,

no variable is created for a language object, the name of the symbol is discarded.

a symbol is not used anywhere in the application the name of the symbol may be discarded.
program,

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 Take this into account in the wiring of the
high-speed counters and pulse generators may converted controller.
differ from 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 Regarding 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.
The following restrictions apply:

68 EIO0000002854.06
Managing Devices

Restriction Solution

The access to function block parameters is If the source application accesses parameters
performed differently in SoMachine Basic and of the function block, you have to extend the
EcoStruxure Machine Expert. converted 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]
Function block %PWM:
• Parameter R [Duty Cycle]
Function block %HSC:
• Output parameter U [Counting Direction]

Constraints Regarding 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 Regarding the Conversion of Frequency Generator Function
Block %FREQGEN
The frequency generator function block %FREQGEN is converted without
restrictions for both M241 and HMISCU controllers.

Conversion of Loop Elements (FOR / ENDFOR)


The destination languages for the conversion do not support loops. For that
reason, a FOR loop is broken up into a functionally equivalent sequence of logical
networks using label and jump elements.

EIO0000002854.06 69
Managing Devices

Conversion of Conditional Elements (IF / ELSE / ENDIF)


The destination languages for the conversion do not support conditional
statements (except EN / ENO, which are already used for other purposes). For
that reason, an IF structure is broken up into a functionally equivalent sequence of
logical networks using label and jump elements.

Conversion of a Grafcet Program


You can write a Grafcet program in a textual or in a graphical way.

Grafcet type Description Supported by

Textual Various IL and LD programming • TwidoSoft/TwidoSuite


elements are available for the
• SoMachine Basic
definition, activation, and deactivation
of Grafcet states.
Graphical Allows you to draw the layout of steps, Only SoMachine Basic V1.4 and later
transitions, and branches in a versions.
graphical manner.

Conversion of Textual Grafcet


The programming languages of EcoStruxure Machine Expert do not support the
programming with Grafcet.
For that reason, a converted Grafcet application contains additional language
elements that implement the Grafcet management.

Additional element Description

folder Grafcet This folder contains the following language elements used
for the management of the Grafcet state machine.

data structure GRAFCET_STATES This data structure has one bit element for each allowed
Grafcet state.

If it is an initial state, the element is initialized to TRUE,


otherwise it is FALSE.
global variable list This global variable list contains the following variables:
GrafcetVariables
• 1 variable STATES that contains 1 bit for each Grafcet
state. Each bit represents the present value of the
corresponding Grafcet state (%Xi object).
• 1 variable ACTIVATE_STATES that contains 1 bit for
each Grafcet state. If the bit is TRUE, the Grafcet state
is activated in the next cycle.
• 1 variable DEACTIVATE_STATES that contains 1 bit for
each Grafcet state. If the bit is TRUE, the Grafcet state
is deactivated in the next cycle.

program Grafcet This program implements the Grafcet state machine. It


contains the logic for the activation and deactivation of
Grafcet steps.

The program contains the following actions:


• Init initializes the Grafcet steps to their initial states. It
is executed when the system bit %S21 is set by the
application program.
• Reset resets the Grafcet steps to FALSE. It is
executed when the system bit %S22 is set by the
application program.

The Grafcet instructions in the application program are converted as follows:


• The beginning of each Grafcet step is marked by a label with the name of the
step.
The first statement within the Grafcet step checks if the step is active. If not, it
jumps to the label of the next Grafcet step.
• The access to the %Xi is converted to an access to the STATES.Xi variable.

70 EIO0000002854.06
Managing Devices

• A Grafcet activation instruction #i is converted to setting the activation bit of


state i and the deactivation bit of the present state.
• A Grafcet deactivation instruction #Di is converted to setting the deactivation
bit of state i and the deactivation bit of the present state.
You can extend the converted Grafcet program if you consider the information
given in this section.
Conversion of graphical Grafcet
Graphical Grafcet is similar to the programming language SFC provided by
EcoStruxure Machine Expert. For this reason, a graphical Grafcet POU is
converted to an SFC program, as much as possible.
There are the following differences between graphical Grafcet and SFC:

Graphical Grafcet SFC Further information

Can have an arbitrary number Must have exactly one initial If the graphical Grafcet POU
of initial steps. step. has several initial steps, then
the converter creates several
initial steps in SFC. This has
the effect, that the converted
application cannot be built
without errors being detected.

Adapt the converted program.

Activation of multiple steps of Only one step of an alternative Verify that the converted
an alternative branch is branch can be activated. program is working as
allowed. expected.

The output transitions of a step The transitions of the SFC Verify that the converted
are evaluated right after the program are evaluated after program is working as
step has been executed. the execution of the active expected.
steps.

The layout of steps, transitions, The layout of steps, transitions, The graphical layout is
and branches is relatively free. and branches is more converted to SFC as far as
restricted. possible. The incompatibilities
encountered during the
conversion are reported in the
Messages view.

The step actions and transition


sections are fully converted.

Complete the created SFC as


necessary.

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.

Conversion of TM2 Expansion Modules to TM3 Expansion Modules


Twido controllers only use TM2 expansion modules. Even though M221 and M241
Logic Controllers can handle TM2 as well as TM3 modules, it is a good practice to
use TM3 modules. To convert the TM2 modules used in your Twido project into
TM3 modules for the EcoStruxure Machine Expert project, the option Upgrade
TM2 Modules to TM3 is by default selected.
The TM2 expansion modules are converted into TM3 expansion modules as listed
in the table:

Source TM2 expansion Target TM3 expansion Further information


module module
TM2DDI8DT TM3DI8 –

TM2DAI8DT TM3DI8A –

TM2DDO8UT TM3DQ8U –

TM2DDO8TT TM3DQ8T –

TM2DRA8RT TM3DQ8R –

EIO0000002854.06 71
Managing Devices

Source TM2 expansion Target TM3 expansion Further information


module module
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. Verify the converted
module.
TM2AMI8HT TM3AI8 –

TM2ARI8HT – This TM2 module is 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. Verify the converted
module.
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. Verify the converted
module.
TM2AMM6HT TM3AM6 –

TM2ARI8LRJ – This TM2 module is not


converted because there is no
corresponding TM3 expansion
module. You can replace this
module by two TM3TI4
modules.
TM2ARI8LT – This TM2 module is 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 detected
as a Build error in the Messages view.

72 EIO0000002854.06
Managing Devices

Conversion of Modbus Serial IOScanner


Due to the differences between controller platforms, and especially for connected
controller equipment that depend on the proper functioning of the converted
program, you must verify the results of the conversion process. Whether or not
errors or alerts are detected during the conversion, it is imperative that you
thoroughly test and validate your entire system within your machine or process.

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.

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.

IOScanner Status Further information


Device Status (%IWNSx) Both SoMachine Basic and EcoStruxure Machine Expert provide
status information for a slave device, but the status values are
different. The status logic is partly converted.

Channel Status (%IWNSx.y) EcoStruxure Machine Expert does not provide status information
for single channels. The channel status is converted to the device
status.
System words and bits:

%S110/%S111 (IOScanner They are not converted.


reset)

%S113/%S114 (IOScanner They are converted.


stop)

%SW210/%SW211 (IOScanner They are not converted.


status)

Conversion of Modbus TCP IO Scanner


The configuration of the Modbus TCP IO Scanner is not converted.

EIO0000002854.06 73
Managing Devices

Immediate I/O Access


The instructions READ_IMM_IN and WRITE_IMM_OUT of SoMachine Basic for
immediate access to digital local I/O channels are not converted.
For M241 controllers, you can use the functions GetImmediateFastInput and
PhysicalWriteFastOutputs provided by the PLCSystem library, but consider
the following differences:

READ_IMM_IN and WRITE_IMM_OUT GetImmediateFastInput and


instructions (M221 controllers) PhysicalWriteFastOutputs functions
(M241 controllers)

Access to all local inputs and outputs. Access only to fast inputs and outputs.

WRITE_IMM_OUT writes a single bit (similar to PhysicalWriteFastOutputs writes fast


the read function). outputs at the same time.

WRITE_IMM_OUT returns an error code. PhysicalWriteFastOutputs only returns


the information on which outputs have actually
been written.
The error codes of READ_IMM_IN and GetImmediateFastInput differ.

READ_IMM_IN updates the input object (%I0. GetImmediateFastInput only returns the
x). read value but does not update the input
channel.

NOTE: For HMISCU controllers, no equivalent function exists.

Twido Communication Features


The following communication features of Twido are not converted:
• AS Interface
• CANopen
• remote link
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.

Detected Errors and Alerts Indicated in the Messages View


If errors or alerts are detected during the conversion process, a message box is
displayed, indicating the number of errors and alerts detected. For further
information, consult the category Project Conversion of the Messages view (see
EcoStruxure Machine Expert, Menu Commands, Online Help). Verify each entry
carefully to see whether you have to adapt your application.

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.

74 EIO0000002854.06
Managing Devices

• A warning message indicates an advisory 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).

EIO0000002854.06 75
Common Device Editor Dialogs

Common Device Editor Dialogs


What’s in This Chapter
Device Configuration .....................................................................................76
I/O Mapping ................................................................................................ 132

Device Configuration
General Information About Device Editors
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, page 107.
This chapter describes the main device editor dialogs. Bus-specific configuration
dialogs are described separately.

Main Device Editor Dialogs


The title of the main dialog consists of the device name, for example MyPlc.
Depending on the device type, the device editor can provide the following tabs:

Tab Description

Communication Settings in Configuration of the connection between programming


Controller selection mode, page 77 system and a programmable device (controller). The tab that
is displayed depends on the mode selected with the
Communication Settings in Simple parameter Communication page in the Tools > Options >
mode, page 97 Device editor dialog box (see EcoStruxure Machine Expert,
Menu Commands, Online Help).
Communication Settings in Classic
mode, page 103

Configuration, page 107 Display or configuration of the device parameters.

Parameter, page 108 Display or configuration of the device parameters of PacDrive


controllers.
Applications, page 108 List of applications running on the controller. Refer to the
description in the Program chapter, page 157.

Synchronized Files, page 109 List of files that are downloaded to the controller with an
application download.

Files, page 110 Configuration of a file transfer between host and controller.

Log, page 111 Display of the controller log file.

PLC Settings, page 114 Configuration of:


• Application for I/O handling
• I/O behavior in stop status
• Bus cycle options

Services Lets you configure the online services of the controller (RTC,
device identification).

76 EIO0000002854.06
Common Device Editor Dialogs

Tab Description

Users and Groups, page 118 User management concerning device access during runtime.

Access Rights, page 124 Configuration of the access rights on runtime objects and files
for the particular user groups.

Symbol Rights, page 129 Access rights of individual user groups to symbols (symbol
sets) on the device.

Task Deployment, page 130 Display of inputs and outputs assigned to the defined task -
used for troubleshooting.

Ethernet Services Ethernet_1 and Ethernet_2 tabs summarize the Ethernet


connections.

The IP Routing tab allows you to configure the routes and


the cross network transparency through IP Forwarding
options.

The Ethernet Resources tab allows you to calculate the


number of connections and channels configured.

Status, page 131 Device-specific status and diagnostic messages.

Diagnostic Table Displays the errors detected by the controller. The data can
be accessed using the syntax
NameOfControllerInDeviceTree.NameofParameter. Example:
MyController.SA_NbPowerOn.

Information, page 131 General information on the device (for example: name,
provider, version).

I/O Mapping, page 132 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.
This function is not available for all controllers. Consult the
Programming Guide specific to your controller.

Communication Settings in Controller Selection Mode


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, page 729.

EIO0000002854.06 77
Common Device Editor Dialogs

Communication Settings tab in controller selection mode

LMC_PacDrive

Parameters Communication Settings PLC Settings Files Visualization profile Applications Users and Grou...

Connecti... Controller ProjectName IP_Address IP_SubNetMask NodeName Projec

TM262M25MESS8T TM262M25MESS8T

TM241CEC24T_U Not Available 01h 49m 32s TM241CEC24T_... Not A.

Encrypted communication Connection Mode: Nodename:

Confirmed online mode Nodename !

The Communication Settings tab provides the following elements:


• Buttons in the toolbar
• List providing information on the available controllers
• Option, list, and box at the bottom of the tab

78 EIO0000002854.06
Common Device Editor Dialogs

Description of the Buttons in the Toolbar


The following buttons are available in the toolbar:

Button Description

Change Runtime Security Click this button to open the Change Runtime Security
Policy... Policy dialog box, page 101 that allows you to configure the
Communication, Code Signing and Device User
Management policy.

Security Settings... Opens the Device Security Settings dialog box that displays
the security settings of the connected device. It allows you to
modify the OpenSSL, user management and app settings in
the Value column. Click OK to write them to the device.
Optical Click this button to cause the selected controller to indicate an
optical signal: It flashes a control LED. This can help you to
identify one controller if several 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. This can help you to identify one controller if
several 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 updated 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.

EIO0000002854.06 79
Common Device Editor Dialogs

Button Description

Remove inactive controllers Controllers that do not respond to a network scan are marked
from list. as inactive 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.
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.

80 EIO0000002854.06
Common Device Editor Dialogs

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.

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.

EIO0000002854.06 81
Common Device Editor Dialogs

Configuring Communication Settings


To set the parameters for communication between the programming system and a
controller, proceed as follows:

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.

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.

82 EIO0000002854.06
Common Device Editor Dialogs

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.

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

Encrypted communication Option


When the Encrypted communication option is selected under the
Communication Settings tab, communication to the controller will be encrypted.
NOTE: The following prerequisites must be fulfilled to perform encrypted
communication with a controller:
• The controller must support TLS (Transport Layer Security).
• A certificate must be available on the controller.
Consult the Programming Guide specific to your controller for information on the
support of TLS.

EIO0000002854.06 83
Common Device Editor Dialogs

The following scenarios are possible when you attempt to log into a controller
using encrypted communication:

If... Then ... Comment


If the controller does not support TLS Then a message will be displayed when you The login is denied.
(prerequisite 1 is not fulfilled) attempt to log into the controller, indicating
that the controller does not support TLS.

If a certificate is not available on the Then a message will be displayed when you The login is denied.
controller (prerequisite 2 is not fulfilled) attempt to log into the controller, indicating
that encrypted communication could not be
initialized successfully.

If both prerequisites are fulfilled Then a message will be displayed when you If you confirm with OK:
attempt to log into the controller for the first
• The login will be successful given that
time, requesting you to install the
the user password, if required, is
(untrusted) controller certificate to the local
provided as well.
Controller Certificates store of the PC
running EcoStruxure Machine Expert. • Communication to the controller will
be encrypted.
• The message will not be displayed
again.
If you click Cancel:
• The login will be denied.
• The message will be displayed with
every new attempt to log in.

For further information, refer to the document How To Manage Certificates on the
Controller.

Confirmed online mode Option


The Confirmed online mode option causes EcoStruxure Machine Expert to
display a message requiring confirmation when one of the following online
commands is selected: Force values, Login, Multiple download, Release force
list, Single cycle, Start, Stop, Write values. To disable the Confirmed online
mode option and thereby delete the display of this message, clear this option.

Specifying Unique Device Names (NodeNames)


The term NodeName is used as a synonym for the term device name. Since
nodenames are also used to identify a controller after a network scan, manage
them as carefully as IP addresses and verify that each nodename is unique in
your network. Having multiple devices assigned the same nodename can cause
unpredictable operation of your network and associated equipment.

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.

84 EIO0000002854.06
Common Device Editor Dialogs

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.
You can also assign a unique device name (NodeName) as follows:

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.

Specifying the Connection Mode


The Connection Mode list at the lower left of the Communication Settings tab
allows you to select a format for the connection address you have to enter in the
Address field.
The following formats are supported:
• Automatic, page 86
• Nodename, page 86
• IP Address, page 86
• IP Address (Fast TCP), page 87
• Nodename via NAT (Remote TCP), page 87 (NAT = network address
translation)
• IP Address via NAT (Remote TCP), page 89
• Nodename via Gateway, page 91
• IP Address via Gateway, page 94
• Nodename via MODEM, page 97
• IP Address (PacDriveM only), page 87 (only available in service tools like
Controller Assistant)
NOTE: After you have changed the Connection Mode, it may be required to
perform the login procedure twice to gain access to the selected controller.

EIO0000002854.06 85
Common Device Editor Dialogs

Connection Mode Automatic


If you select the option Automatic from the Connection Mode list, you can enter
the nodename, the IP address, or the connection URL (uniform resource locator)
to specify the Address.
NOTE: Do not use spaces at the beginning or end of the Address.
If you have selected another Connection Mode and you have specified an
Address for this mode, the address you specified will still be available in the
Address box if you switch to Connection Mode > Automatic.
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>.

Connection Mode > Nodename


If you select the option Nodename from the Connection Mode list, you can enter
the nodename of a controller to specify the Address. The text box is filled
automatically if you double-click a controller in the list of controllers.
Example: Nodename: MyM238 (10.128.158.106)
If the controller you selected does not provide a nodename, the Connection
Mode automatically changes to IP Address, and the IP address from the list is
entered in the Address box.

Connection Mode > IP Address


If you select the option IP Address from the Connection Mode list, you can enter
the IP address of a controller to specify the Address. The box is filled
automatically if you double-click a controller in the list of controllers.
Example: IP Address: 190.201.100.100
If the controller you selected does not provide an IP address, the Connection
Mode automatically changes to Nodename, and the nodename from the list is
entered in the Address box.
NOTE: Enter the IP address according to the format <Number>.<Number>.
<Number>.<Number>

86 EIO0000002854.06
Common Device Editor Dialogs

Connection Mode > IP Address (Fast TCP)


If you select the option IP Address (Fast TCP) from the Connection Mode list,
you can connect to a controller using the TCP protocol. Enter the Target IP
address/Port of the controller in the respective field. You can adapt the default
setting 11740 for the Port if you are using network address translation (NAT).
Example: IP Address: 190.201.100.100
NOTE: Enter the IP address according to the format <Number>.<Number>.
<Number>.<Number>
If the controller is not listed in the list of controllers, 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 TCP being
displayed in the first column.
NOTE: This function is not available for all controllers. Consult the
Programming Guide specific to your controller to find out whether it supports
the IP Address (Fast TCP) connection mode.

Connection Mode > IP Address (PacDriveM only)


If you select the option IP Address (PacDriveM only) from the Connection Mode
list, you can enter the IP address of a controller to specify the Address. The box is
filled automatically if you double-click a PacDrive M controller in the list of
controllers.
Example: IP Address: 190.201.100.100
NOTE: Enter the IP address according to the format <Number>.<Number>.
<Number>.<Number>

Connection Mode > Nodename via NAT (Remote TCP)


If you select the option Nodename via NAT (Remote TCP) from the Connection
Mode list, you can specify the address of a controller that resides behind a NAT
router in the network. Enter the nodename of the controller, and the IP address or
host name and port of the NAT router.

1 PC
2 NAT router
3 Target device
Example: NAT Address/Port: 10.128.158.106/1105 Target Nodename:
MyM238 (10.128.158.106)
NOTE: Enter a valid IP address (format <Number>.<Number>.<Number>.
<Number>) or a valid host name for the NAT Address.
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.

EIO0000002854.06 87
Common Device Editor Dialogs

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

88 EIO0000002854.06
Common Device Editor Dialogs

Connection Mode > IP Address via NAT (Remote TCP)


If you select the option IP Address via NAT (Remote TCP) (NAT = network
address translation) from the Connection Mode list, you can specify the address
of a controller that resides behind a NAT router in the network. Enter the IP
address of the controller, and the IP address or host name and port of the NAT
router.

1 PC
2 NAT router
3 Target device
Example: NAT Address/Port: 10.128.154.206/1105 Target IP Address:
192.168.1.55
NOTE: Enter a valid IP address (format <Number>.<Number>.<Number>.
<Number>) or a valid host name for the NAT Address.
Enter the port of the NAT router to be used. Otherwise, the default port 1105 is
used.
Enter a valid IP address (format <Number>.<Number>.<Number>.
<Number>) for the Target IP Address.
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. The IP address is searched in the
nodename (such as MyController (10.128.154.207)).
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

EIO0000002854.06 89
Common Device Editor Dialogs

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

90 EIO0000002854.06
Common Device Editor Dialogs

Connection Mode > Nodename via Gateway


If you select the option Nodename via Gateway from the Connection Mode list,
you can specify the address of a controller that resides behind or close to an
EcoStruxure Machine Expert gateway router in the network. Enter the nodename
of the controller, and the IP address or host name and port of the EcoStruxure
Machine Expert gateway router.

1 PC / HMI
2 PC / HMI / devices with installed EcoStruxure Machine Expert gateway
3 Target device
Example: Gateway Address/Port: 10.128.156.28/1217Target Nodename:
MyPLC
NOTE: Enter a valid IP address (format <Number>.<Number>.<Number>.
<Number>) or a valid host name for the Gateway Address/Port:.
Enter the port of the gateway router to be used. Otherwise, the default
EcoStruxure Machine Expert gateway port 1217 is used.
Do not use spaces at the beginning or end and do not use commas in the
Target Nodename box.
The information you enter is interpreted as a URL. The gateway is scanned for a
device with the given nodename that is directly connected to this gateway. Directly
connected means in the EcoStruxure Machine Expert gateway topology it is the
root node itself or a child node of the root node.
NOTE: The EcoStruxure Machine Expert gateway can be located on an HMI,
destination PC, or the local PC, making it possible to connect to a device that
has no unique nodename but resides in a subnet behind an EcoStruxure
Machine Expert network.

EIO0000002854.06 91
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 an 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

92 EIO0000002854.06
Common Device Editor Dialogs

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.

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
You can connect to the listed devices using the gateway.

EIO0000002854.06 93
Common Device Editor Dialogs

Connection Mode > IP Address via Gateway


If you select the option IP Address via Gateway from the Connection Mode list,
you can specify the address of a controller that resides behind or close to an
EcoStruxure Machine Expert gateway router in the network. Enter the IP address
of the controller, and the IP address or host name and port of the EcoStruxure
Machine Expert gateway router.

1 PC / HMI
2 PC / HMI / devices with installed EcoStruxure Machine Expert gateway
3 Target device
Example: Gateway Address/Port: 10.128.156.28/1217Target IP Address:
10.128.156.222
NOTE: Enter a valid IP address (format <Number>.<Number>.<Number>.
<Number>) or a valid host name for the Gateway Address/Port:.
Enter the port of the gateway router to be used. Otherwise, the default
EcoStruxure Machine Expert gateway port 1217 is used.
Enter a valid IP address (format <Number>.<Number>.<Number>.
<Number>) for the Target IP Address.
The information you enter is interpreted as a URL. The gateway is scanned for a
device with the given IP address. The IP address is searched in the nodename
(such as MyController (10.128.154.207)).
NOTE: The EcoStruxure Machine Expert gateway can be located on an HMI,
destination PC, or the local PC. It is therefore possible to connect to a device
that has no unique nodename but resides in a subnet behind an EcoStruxure
Machine Expert network.

94 EIO0000002854.06
Common Device Editor Dialogs

The graphic shows an example that allows a connection from hop PC2 (item 5 in
the graphic) that must have an 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

EIO0000002854.06 95
Common Device Editor Dialogs

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.

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
You can connect to the listed devices using the gateway.

96 EIO0000002854.06
Common Device Editor Dialogs

Connection Mode > Nodename via MODEM


If you select the option Nodename via MODEM from the Connection Mode list,
you can specify a controller that resides behind a modem line.

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.

Communication Settings in Simple Mode


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.

EIO0000002854.06 97
Common Device Editor Dialogs

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.

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.

98 EIO0000002854.06
Common Device Editor Dialogs

Description of the Elements


Elements of the Communication Settings tab in simple mode:

Element Description

Scan network... button Opens the Select Device dialog box that lists
the configured gateways and their associated
devices.

If Filter Network Scans by Target ID is


selected, only the devices that have the same
target ID as the devices configured in the project
are displayed.

If Filter Network Scans by Target ID is not


selected, all devices detected in the network are
displayed.

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 Adds the defined device to the list of favorite
to favorites devices.
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 Opens a dialog box for renaming the device.
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 If this option is activated, EcoStruxure Machine
communication Expert can automatically restore the
settings in project communication settings, even if you are going to
open the project on another computer.
NOTE: If you use the project on another
computer, you must reset the active path.
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.
NOTE: If you use SVN, make sure to
deactivate this option for the device object
not to be blocked.

EIO0000002854.06 99
Common Device Editor Dialogs

Element Description

Confirmed online If this option is activated, EcoStruxure Machine


mode 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 If this option is activated, the list is reduced to


by target ID those devices which have the same target ID as
the device configured in the project.

Encrypted If this option is activated, the communication to


Communication this controller is encrypted. A certificate is
required to log in to the controller. If the
certificate is not available, an error message is
displayed requesting to display and install the
certificate.

This option is not available if the option Security


level > Enforce encrypted communication is
selected in the Security Screen editor (see
EcoStruxure Machine Expert, Menu
Commands, Online Help).

Change Runtime Opens the Change Runtime Security Policy


Security Policy dialog box for modifying the controller settings
for the encryption of communication.

Change Runtime Click this button to open the Change Runtime


Password Policy Password Policy dialog box, page 102 that
allows you to modify the controller settings
regarding the password policy that is being
used.
Security Settings Opens the Device Security Settings dialog box
that displays the security settings of the
connected device. It allows you to modify the
settings in the Value column. Click OK to write
them to the device.

100 EIO0000002854.06
Common Device Editor Dialogs

Change Runtime Security Policy Dialog Box


If you select a new communication policy in the Change Runtime Security
Policy dialog box, the configuration on the controller is modified:

Element Description

Communication
Current Policy Displays the selected policy for the encryption
of communication.
New Policy Contains a list to select the new policy for
encryption:
• No encryption. The controller does not
support encrypted communication.
• Optional encryption: The controller
supports encrypted and unencrypted
communication.
• Enforced encryption: The controller
supports encrypted communication only.

Code Signing

Current Policy Displays the selected policy for code signing.

New Policy Contains a list to select the new policy for code
signing:
• All: All types of application code are
accepted.
• Enforced signing: Signed application
code is accepted (helping to prevent
loading an application from untrusted
sources).

Device User Management

Current Policy Displays the selected policy for user


management.

New Policy Contains a list to select the new policy for user
management:
• Optional user management: The user
management on the device is disabled or
can be disabled manually.
• Enforced user management: The user
management on the device is enabled
and cannot be disabled manually.

Allow anonymous login If this option is activated, registered


components (for example, OPC UA) can
connect to the controller without providing
credentials. However, the device user
management configured for the controller
remains active.

EIO0000002854.06 101
Common Device Editor Dialogs

Change Runtime Password Policy Dialog Box


If you select a new password policy in the Change Runtime Security Policy
dialog box, the configuration on the controller is modified:

Element Description

Password policy is active If this option is activated, a password policy is


active for passwords of user accounts defined in
the device user management.

Password settings area

Minimum length Defines the minimum length of the password.

Default value: 8
Number of unique characters Defines the number of unique characters a
password must contain.

Default value: 4
Requires lowercase letter If this option is activated, the password must
contain at least one lowercase letter.
Requires uppercase letter If this option is activated, the password must
contain at least one uppercase letter.

Requires digit If this option is activated, the password must


contain at least one digit character.

Requires special character If this option is activated, the password must


contain at least one special character (such as #
or !).

Must not contain username If this option is activated, the password must not
contain the username of the logged in user.

Login lock is active If this option is activated, users are locked after
several unsuccessful login attempts according
to the parameters configured in the Login lock
settings area.

Login lock settings area

Scope Select the type of users to be considered by the


locking mechanism:
• ADMINS (default value)
• NONADMINS
• ALL
Maximal Retries Select the maximum number of unsuccessful
login attempts before the user accounts gets
locked for the time defined with Timeout [s].

If you select the value 0, the number of


unsuccessful login attempts is not restricted.
The user account is not locked.

Default value: 10
Lock duration [s] Select the time (in seconds) the user account is
locked after the maximum number of
unsuccessful login attempts (defined with
Maximal Retries) have been performed.

To unlock a locked user, an administrator or a


member of a user group with write permission
for the user group of the locked user can assign
a new password for the user.

Default value: 600

102 EIO0000002854.06
Common Device Editor Dialogs

Communication Settings in Classic Mode


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:

This tab is divided in 2 parts:


• The left part shows the configured gateway channels in a tree structure.
• The right part shows the corresponding data and information.

EIO0000002854.06 103
Common Device Editor Dialogs

Description of the Tree Structure


When you create the first project on your local system, the local Gateway is
already available as a node in the tree. This gateway is started automatically
during system start.
The settings of this gateway are displayed when you click the Add gateway...
button:
Example:
Device Name: Gateway-1
Port: 1217
IP-Address: 127.0.0.1
Driver: TCP/IP
A status bullet at the bottom right of the gateway symbol indicates the status of the
connection:

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.

104 EIO0000002854.06
Common Device Editor Dialogs

Filter and Sorting Function


You can filter and sort the gateway and device nodes displayed in the tree by the
selection boxes in the right part of the tab:
• Filter: Allows you to reduce the entries of the tree structure to those devices
with a Target ID matching that of the device configured in the project.
• Sorting order: Allows you to sort the entries of the tree structure according to
the Name or Node Address in alphabetical or ascending order.

EIO0000002854.06 105
Common Device Editor Dialogs

Description of the Buttons / Commands


For changing the communication configuration, the following buttons or
commands are available:

Button / Command Description

Set active path This command sets the selected communication channel as
the active path to the controller. See the description of the Set
Active Path command. Double-clicking the node in the tree
structure has the same effect.
Add gateway... This command opens the Gateway dialog box where you can
define a gateway to be added to the configuration.

See the description of the Add Gateway command (see


EcoStruxure Machine Expert, Menu Commands, Online Help).

Add device... This command opens the Add Device dialog box where you
can manually define a device to be added to the selected
gateway entry (Consider the Scan network functionality).

See the description for adding devices, page 53.

Edit Gateway... This command opens the Gateway dialog box for editing the
settings of the selected gateway.

See the description of the Edit Gateway... command (see


EcoStruxure Machine Expert, Menu Commands, Online Help).

Delete selected Device This command removes the selected device from the
configuration tree.

Scan for device by address This command scans the network for devices which have the
address specified here in the configuration tree. Those which
are found will then be represented in the gateway with the
specified node address and their name. The scan refers to
devices below that gateway under which an entry is selected.

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).

Scan for device by name This command scans the network for devices which have the
names specified here in the configuration tree (case-sensitive
search). Those which are found will then be represented in the
gateway with the specified name and their unique node
address. The scan refers to devices below that gateway under
which an entry is selected.

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).

Scan for device by IP address This command scans the network for devices which have the
IP address specified here in the configuration tree. Those
which are found will then be represented in the gateway with
the specified node address and their name. The scan refers to
devices below that gateway under which an entry is selected.

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).

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.

106 EIO0000002854.06
Common Device Editor Dialogs

Button / Command Description

Configure the local gateway This command opens a dialog box for the configuration of a
local gateway and therefore provides an alternative to manual
editing the file Gateway.cfg.

See the description of the Configure the local gateway...


command (see EcoStruxure Machine Expert, Menu
Commands, Online Help).

Scan network This command starts a search for available devices in your
local network. The configuration tree of the concerned
gateway will be updated accordingly.

Description of the Options


Two options are available below the tree structure:

Option Description

Don't store communication Activate this option if the network path definition should not be
settings in project stored in the 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.
NOTE: If you are using SVN, activate this option to help
prevent a lock on the device object.

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.

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

The view contains the following elements:

EIO0000002854.06 107
Common Device Editor Dialogs

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

Parameters
Overview
The Parameters 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.

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.

Description of the Elements


The Applications view provides the following elements:

108 EIO0000002854.06
Common Device Editor Dialogs

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, page 97 for a connection, a
message is displayed.

Remove Click these buttons to remove the application currently


selected in the list or all applications from the controller.
Remove All
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.

Verifications Before Loading an Application to the Controller


The following verifications are performed before an application is loaded to the
controller:
• The list of applications on the controller is compared with those available in
the project. If inconsistencies are detected, a dialog box is displayed for either
loading the applications not yet available on the controller, or for removing
other applications from the controller.
• POUs externally implemented in the application to be loaded are verified as to
whether they are also available on the controller. If they are not available on
the controller, a message (unresolved reference(s)) will be generated in a
message box as well as in the Messages view if the option Download is
selected.
• The parameters (variables) of the POUs of the application to be loaded are
compared with those of the same-named POUs of the application already
available on the controller (validation of signatures). In case any
inconsistencies are detected, a message (signature mismatch(es)) will be
generated in a message box as well as in the Messages view if the option
Download is selected.
NOTE: If in the View > Properties > Application build options the option
Download Application Info is activated, additional information on the content
of the application will be loaded to the controller. See the description of the
Content button in the previous table.

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.

EIO0000002854.06 109
Common Device Editor Dialogs

• 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.

Description of the Elements


The Synchronized Files view provides the following elements:

Element Description Example

File name Name of the file below the application, or direct archive.prj
name of the implicitly transferred file (for
example, archive.prj).

Double-click the file name to open the file.

Host path Storage location or original location of the file. D:\Proj1\Files

Double-click the path to open the directory in


the Windows Explorer.

Time interval Time interval for updating the file on the After download /
controller. online change of the
application.

Information Additional information, depending on the Object: external file


object.

Origin Type of origin of the file. External file objects,


Source code
download provider

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.

Description of the Elements


The Files view provides the following elements:

Element Description

Updates the Runtime list.

Creates a new folder in which you can copy the files.

Removes the selected files or folders from the list.

110 EIO0000002854.06
Common Device Editor Dialogs

Element Description

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.

Placeholder file directory, defined in the configuration of the


runtime system of the controller.

Implicitly created placeholder file directory of the runtime


system of the controller.

File Transfer Between EcoStruxure Machine Expert and Controller


Step Action Comment

1 Select the files to be copied in the file Multiple selection is possible. You can
system tree. even select a folder in order to copy the
files contained within.
2 Click the button >> or << to transfer the To transfer in this context means to copy.
selected files to the directory set in the So, if a file is not yet available in the
runtime system. runtime directory, it will be created there.
However, if it already exists, it will be
overwritten.

If a file with the given name is already


available and is write-protected, a
corresponding message is generated.

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

EIO0000002854.06 111
Common Device Editor Dialogs

Description of the Elements


The Log view provides the following columns:

Column Description

Severity The events of the log are grouped in five categories:


• warning
• error
• exception
• information
• debug
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 Runtime component where the reported event was


detected.

112 EIO0000002854.06
Common Device Editor Dialogs

The Log view provides the following buttons and controls:

Element Description

Updates the list.

Components 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.

Loads the next page with newer log messages.

Loads the previous page with older log messages.

Loads the page with the newest log messages and


enables automatic scrolling.

This is also indicated in the status bar by the message


Auto-Scroll: ON.

When a new log event is detected while the automatic


scrolling function is set to OFF, a green asterisk is

appended to the button:

Loads the page with the oldest log messages.

Filters logs of type Warning and indicates the total


number.

A blue frame around the button indicates that logs of


this type are displayed.

Filters logs of type Error and indicates the total


number.

A blue frame around the button indicates that logs of


this type are displayed.

Filters logs of type Exception and indicates the total


number.

A blue frame around the button indicates that logs of


this type are displayed.

Filters logs of type Information and indicates the total


number.

A blue frame around the button indicates that logs of


this type are displayed.

Filters logs of type Debug and indicates the total


number.

A blue frame around the button indicates that logs of


this type are displayed.

Search in messages Enter search text. Strings matching the search


characters are highlighted in yellow.

Jumps to the next strings matching the search


characters.

Jumps to the previous strings matching the search


characters.

EIO0000002854.06 113
Common Device Editor Dialogs

Element Description

PlcLog Select a logger from the list to display the events it


recorded.

This list is only available if supported by the device.


Consult the Programming Guide specific to your
controller for further information.
UTC Time Activate this option to display the time stamp of the
runtime system as it is (without conversion). If
deactivated, the time stamp of the local time of the
computer is displayed (according to the time zone of
the operating system).
NOTE: In order to display the time stamp in UTC
(Universal Time Coordinated), you must set the
time of the controller to UTC time beforehand
(also refer to the Services tab of your controller
configuration).

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.

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.

Status Bar
The message Auto-Scrolling: on the status bar indicates whether the automatic
scrolling function is enabled (ON) or disabled (OFF).

Click the button to activate the automatic scrolling function.


• ON: The Log view is refreshed when a new log event is detected.
• OFF: When a new log event is detected, the event message is displayed on

the status bar and a green asterisk is appended to the button .

Troubleshooting
In case an error is detected and displays the text *SOURCEPOSITION*, you can
open the function by double-clicking 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.

PLC Settings
Overview
The PLC settings view of the device editor is used to configure general settings
for the controller.

114 EIO0000002854.06
Common Device Editor Dialogs

Description of the Elements


The PLC settings view provides the following elements:

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): 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.
You can set this option separately for each device in the I/O
Mapping dialog, page 138.

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.

EIO0000002854.06 115
Common Device Editor Dialogs

Additional Settings
Element Description

Generate force variables for IO This setting is only available if supported by the device.
mapping: Consult the 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, two
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, page 132.

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 function block 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 detected as
errors.
Enable symbolic access for I/ This option is only available if supported by the device.
Os Consult the Programming Guide specific to your controller for
further information.

If this option is activated, input and output variables (VAR_


INPUT and VAR_OUTPUT) are automatically created for the
input/output channels of the device. For this purpose, an
extended function block is created based on the existing
function block for each child device. In the application code,
direct access to this automatically generated function block is
available.

This symbolic access works in parallel to the I/O mapping that


you configure manually.

If this option is not activated, access to I/O channels is not


supported. Set up a mapping manually and assign new or
existing variables per I/O channel.

IEC Objects
Overview
The IEC Objects view of the device editor lists objects that allow access to the
device from the application. In online mode, it serves as monitoring view.
If a function block instance has been created implicitly for a device, at least this
instance is listed as an object in the table. This instance can be used, for example,
to restart a bus or to poll information from the application. It depends on the device
whether this kind of device instance is available and which access options are
provided. Consult the Programming Guide specific to your controller for details.
The table also contains instances of function blocks that are linked to inputs or
outputs of the device. The mapping of a function block to a channel is defined in
the I/O Mapping view, page 132. This view contains the Go to Instance button
that provides a direct link to the corresponding object in this IEC Objects
table.
You can add objects to this table that are not yet linked with a device channel.

116 EIO0000002854.06
Common Device Editor Dialogs

In online mode, you can use the IEC Objects table as a monitoring view. It
indicates the value, the address and the comment for the function block variable at
the channel. It also allows you to write and force values.

Description of the Elements


The IEC Objects view provides the following elements:

Element Description

Opens the Select Function Block dialog box


Add for creating a new instance or for editing the
instance selected in the table.

Edit
Deletes the selected entry.
Delete
Provides a direct link from the selected entry to
Go to Instance the corresponding mapping in the I/O Mapping
view, page 132.

Variable The object name consists of the device name


and the function block name, for example
EL2004_Relay.

Changes to the device name in the project are


indicated here. The part of the name after the
device name is editable.
Mapping Mapping type, as in the I/O Mapping view,
page 132.

Type Data type, which is the name of the function


block in this case.
Value Only available in online mode:

Prepared value Indicates the present value, the address, and


the comment for the variable at the channel.
Address You can enter a value for writing or forcing the
variable.
Comment

EIO0000002854.06 117
Common Device Editor Dialogs

Users and Groups


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, page 124.
For managing Users and Groups, you have to login as a user with administrative
rights.
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.

118 EIO0000002854.06
Common Device Editor Dialogs

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 measures 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.
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.

EIO0000002854.06 119
Common Device Editor Dialogs

Toolbar of the Users and Groups View


The toolbar provides the following elements:

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 NOTE: EcoStruxure Machine Expert V2.0 and later versions no
longer support Device user management files of type *.dum. The
import of a file of type *.dum2 overwrites the user management
on the device. Afterwards you will be requested to log in to the
device as a user using the authentication data of the new user
management.
When you click the Import from disk button, a dialog box opens
requesting you to select a file of type *.dum2 from your hard disk. After
you have selected the file, the Enter Password dialog box opens
requesting you to enter the password that was assigned when the file
was exported. The user management is enabled.

The Import from disk is available when you are in offline mode or
Synchronization is deactivated.

Export to disk When you click the Export to disk button, an Enter Password dialog
box opens requesting you to enter a password for the device user
management file.
NOTE: The password assigned here will be requested during the
Import from disk procedure.
After you have assigned a password, the dialog box for saving a file is
displayed. With EcoStruxure Machine Expert V2.0 and later versions,
only files of type *.dum2 are supported.

Device user Name of the user who is logged into the controller.

120 EIO0000002854.06
Common Device Editor Dialogs

Users and Groups Management


The handling of the Users and Groups is similar to that of the project user
management.
Example of a Users and Groups view of the device editor:

This view is divided in 2 parts:


• The upper part is dedicated to access management of Users.
• The lower part is dedicated to access management of Groups.
Elements of the Users section:

Element Description

The tree structure on the left-hand side lists the defined users and indicates the user groups to
which they are assigned as sub nodes.

Add button Opens the Add User dialog box for creating a new user account.

For further information, refer to the section Setting up a New User in


the Users and Groups Management of the Controller, page 123.

Import button Opens the Import Users dialog box. It lists the user accounts defined
in the project user management.

Select the entries of your choice (by pressing the Shift key for
selecting more than one) and click OK to import them in the device
user management.
NOTE: For each user to be imported the Enter Password dialog
box is displayed requesting you to enter the password of the
project user account. This password will then also be used for the
corresponding device user account.

Edit button Opens the Edit User <user name> dialog box. It allows you to modify
the settings of the user account.

Delete button Deletes the account of the selected user.

EIO0000002854.06 121
Common Device Editor Dialogs

Elements of the Groups section:

Element Description

The tree structure on the left-hand side lists the defined groups and indicates the assigned users as
sub nodes.
Add button Opens the Add Group dialog box for creating a new user group.
1. Enter a name for the group.
2. From the list of users, select the users to assign to the new
group.
3. Click the OK button to confirm and the new group will be
displayed in the tree structure.

Import button Opens the Import Groups dialog box. It displays the user groups
defined in the project user management.

As a prerequisite for importing groups, you must have imported all


users that are members of this group into the device user
management beforehand.

Select the group entries of your choice and click OK to import them in
the device user management.
NOTE: The default group Everyone cannot be imported in the
device user management.
NOTE: After you have successfully imported a group, assign
access rights either:
• By adding the new group to an existing group, or
• By explicitly assigning access rights to the new group.
For further information, refer to Access Rights, page 124.

Edit button Opens the Edit Group <group name> dialog box. It allows you to
modify the definition of the group.

Delete button Deletes the selected group.

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:

Step Action Comment

1 Double-click the controller node in the Devices Result: The device editor opens.
tree.
2 Select the Users and Groups view. –

3 Result: A dialog box opens


Click the Synchronization button . prompting you to decide whether
the device Users and Groups
management should be activated.

4 Click Yes to confirm the dialog box and to Result: The Device user login
activate device Users and Groups dialog box opens.
management.

5 Enter a new user name. –

6 Enter your individual Password.


NOTE: The password must
comply with the password
policy configured in the
Change Runtime Password
Policy dialog box, page 102.

7 Re-enter your individual Password. –

6 Click OK to confirm. Result: You are requested to enter


the new credentials for accessing
the controller. They are assigned
the highest user rights level and
allow you to manage access rights
for users or user groups.

122 EIO0000002854.06
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:

Step Action Comment

1 Double-click the controller node in the Devices Result: The device editor opens.
tree.
2 Select the Users and Groups view. –

3 If you are not logged in to the


Click the Synchronization button to load controller yet, then the dialog box
the Users and Groups management Device User Login opens. It allows
configuration from the controller to the editor. you to enter the user name and the
password.

Result: The Users and Groups


management configuration of the
controller is displayed in the editor.

4 Click the Add button in the Users part of the Result: The Add User dialog box
Users and Groups view. opens.

5 Enter a Name for the new user and select a You can assign the user to other
Default group for the user from the list. groups later.

6 Enter a new password, confirm the password,


NOTE: The password must
and specify whether the user can change the comply with the password
password and whether the user has to change
policy configured in the
the password at the first login. Change Runtime Password
Policy dialog box, page 102.

7 Click OK to confirm and to close the Add User Result: The new user is displayed
dialog box. in the Users part as a new node
and in the Groups part as a new
subnode of the selected default
group.

Loading a Users and Groups Management From a *.dum File, Modifying it,
and Later Downloading it to the Controller
Step Action Comment

1 Double-click the controller node in the Devices Result: The device editor opens.
tree.
2 Select the Users and Groups view. –

3 Click the Edit button, browse to the *.dum file Result: The users and groups
that contains the saved Users and Groups settings that are saved in the file are
management, and click Open to confirm. displayed in the editor.

4 Adapt the settings according to your –


requirements.

5 A dialog box is displayed, prompting


Click the Synchronization button to you to select an operation.
transfer the Users and Groups management
configuration to the controller.

6 Select the option Download the editor content Result: The Device user login
to the device and overwrite the user dialog box is displayed.
management there.

7 Enter login data in order to log in to the controller. After successful login, the
modifications are transferred to the
controller.

As long as the Synchronization

button is activated,
modifications made in the editor are
automatically transferred to the
controller.

EIO0000002854.06 123
Common Device Editor Dialogs

Printing the Users and Groups Management Configuration


To print the settings of the Users and Groups view, execute the command Print
from the File menu or the command Document from the Project menu.

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.
Example of an Access Rights view of the device editor

NOTE: Detailed information on the concept and use of device user


management is provided in Handling of Device User Management in the
Security chapter, page 152.

124 EIO0000002854.06
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:

Step Action Comment

1 Double-click the controller node in the Devices Result: The device editor opens.
tree.
2 Select the Access Rights view. –

3 If you are not logged in to the


Click the Synchronization button to load controller yet, then the dialog box
the Access Rights management configuration Device User Login opens. It allows
from the controller to the editor. you to enter the user name and the
password.

Result: The Access Rights


management configuration of the
controller is displayed in the editor.

4 In the Objects tree structure on the left-hand Result: In the Rights area on the
side, select the object. right-hand side, the access rights of
the selected object are displayed in
a table for the configured user
groups.

5 In the Rights table, double-click the access right If the selected object has child
you want to modify. objects, a dialog box is displayed,
prompting you whether you want to
modify the access rights for the
child objects at the same time.

6 Click Yes or No to modify the access rights of the Result: The access rights are
child objects and to close the dialog box. switched from allowed to not
allowed or vice versa.

The symbol in the table cell is


modified accordingly.

Rights that are set explicitly are


displayed in the table by green or
red symbols.

Rights that are inherited from a


parent object are displayed in the
table by gray symbols.

EIO0000002854.06 125
Common Device Editor Dialogs

Toolbar of the Access Rights View


The toolbar provides the following elements:

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.

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 When you click the Load from disk button in the Access Rights view,
the file type is by default set to Device rights management files (*.drm).
The existing configuration will be overwritten by the imported file.

Save to disk When you click the Save to disk button in the Access Rights view,
the file type is by default set to Device rights management files (*.drm).
For this file, a password does not have to be assigned before saving.

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:
• Runtime objects
• File 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
A description of the objects is provided in the paragraph Overview of the Objects,
page 128.

126 EIO0000002854.06
Common Device Editor Dialogs

Rights Area
In general, access rights are inherited from the root node (Device or / ) to the
subnodes. If a permission of a user group is denied or explicitly granted to a
parent object, then this is also applied to the child objects.
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
The symbols represent the access rights:

Icon Description

Access (action) is permitted explicitly.

Access (action) is denied 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

No icon Several objects with different access rights are selected.

To modify an access right, click the symbol.

Example
The Logger node in the Access Rights tab is created by the logger component
and controls its access rights. It is located directly below the Runtime objects >
Device node.
For this object, you can only grant View access rights.
By default, each object is assigned read access. Thus, every user can read the
logger of a controller.
To deny this access right for a single user group (Service, for example), set the
View right for the Logger object to .

Printing the Access Rights Definition


To print the settings of the Access Rights view, execute the command Print from
the File menu or the command Document from the Project menu.

EIO0000002854.06 127
Common Device Editor Dialogs

Overview of the Objects


The following table provides an overview of general runtime objects. Consult the
Programming Guide specific to your controller for controller-specific objects.

Object Description

Runtime objects > Device


Logger Online access to the logger is read only. Therefore, only the View
access right can be granted or denied.

PlcLogic Applications are inserted as child objects during download. If


applications are deleted, the child object subnodes are also removed
here. This allows for dedicated control of online access to the
application.

The PlcLogic object allows you to assign access rights at a central


place for all applications:
• The Administrator and Developer user groups have full access
to the applications.
• The Service and Watch user groups have read access (for
example, for read-only monitoring of values).
Also refer to the table in the Access Rights for IEC Applications
paragraph, page 129.

RemoteConnections The RemoteConnections object allows you to configure additional


external connections to the controller, such as access to the OPC UA
server.
Settings Online access to the configuration settings of a controller.

By default, the access right Modify is granted to the administrator


exclusively.

UserManagement Online access to the user management of a controller.

By default, the access right Modify is granted to the administrator


exclusively.

X509 Online access to the X.509 certificates:


• Read (View)
• Write (Modify)
Each operation is inserted as a child object below X509 and one of the
two access rights is assigned. This allows you to specify the access
per operation.

FTP Allows you to configure the access rights to the FTP server on the
controller.
OPC Allows you to configure the access rights to the controller via OPC UA.

USB Allows you to configure the access rights to files on a USB storage
device connected to the controller.
USBExecCmd Allows you to configure the access rights for executing scripts located
on a USB storage device connected to the controller.

WEB Allows you to configure the access rights to the webserver on the
controller.

File system objects >/


– The folders of the execution path of the controller are inserted below
the / file system object. This allows you to grant specific rights to each
folder of the file system.

128 EIO0000002854.06
Common Device Editor Dialogs

Access Rights for Applications


The table indicates which action is affected when a specific access right is granted
for an Application:

Operation Access rights

Add/ Remove Execute Modify View

Login – – – X

Create X – – –

Create child object X – – –

Delete X – – –

Download / online X – – –
change

Create boot X – – –
application

Read variable – – – X
Write variable – – X X
Force variable – – X X
Set and delete – X X –
breakpoint

Set next statement – X X –

Read call stack – – – X


Single cycle – X – –

Switch on flow control – X X –

Start / Stop – X – –

Reset – X – –

Restore retain – X – –
variables
Save retain variables – – – X
(X) The access right must be set explicitly.

(–) The access right is not relevant.

Symbol Rights
Overview
The Symbol Rights view of the device editor is used to configure the access
rights of different user groups (clients) to the individual symbol sets, page 459
available on the controller.
The following prerequisites must be fulfilled:
• User management must be enabled and configured on the controller.
• An application has been downloaded to the controller for which symbol sets
were defined in the EcoStruxure Machine Expert project.
• You have the required login data to gain access to the controller.

Description of the Views


The following views are available:

EIO0000002854.06 129
Common Device Editor Dialogs

View Description

Symbol Sets The Application node contains the symbol sets whose
definition was downloaded with the application to the
controller.
Rights The table contains the user groups defined in the user
management of the controller.

When a symbol set is selected, the access rights of the


corresponding user group to the symbols of this set are
indicated:

• : Access granted.

• : Access not granted. You can change the


access rights by double-clicking the symbol.

Click the Save to disk button to save the access configuration to an XML file of
type Device symbol management with the extension *.dsm.
Click the Load from disk button to load a *.dsm file from the hard drive.

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

Files Log PLC settings Users and Groups Access Rights Licenses Task deployment Statu
I/O deployment for tasks:
I/O channels Main Task (0) Bus Task (1)
BK5120
usiBK5120Out AT %QB0
usiBK5120In AT %IB0
Generic_XN_16DO
usiGenericOut1 AT %QB1
usiGenericOut2 AT %QB2
Generic_XN_16DI
usiGenericIn1 AT %IB1
usiGenericIn2 AT %IB2
Osicoder
udiOsicoderIn AT %ID1
ILB_CO_24_DI16_DO16
PhoenixOut1 AT %QB3
%QB4
%IB8
= Bus cycle task

The table shows the tasks sorted by their task priority. Click the column heading
(Main Task) 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. Writing output references in more than
one task makes the program difficult to debug and may lead to unintended results
in the operation of your machine or process.

130 EIO0000002854.06
Common Device Editor Dialogs

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.

Status
Overview
The Status view of the device editor shows status information (for example,
Running, Stopped) and specific diagnostic messages from the device; also on
the card and the internal bus system.

Information
Overview
The Information view of the device editor shows some general information on the
device selected in the Devices tree: Name, Vendor, Type, Version number,
Order Number, Description, Image.

Emulation Settings
Overview
The Emulation Settings view of the device editor is available for PacDrive LMC
controllers. It is used to configure the emulation via EcoStruxure Machine Expert
Twin running in the background and the communication between EcoStruxure
Machine Expert Twin and the controller.
For further information, refer to the How to Emulate User Guide.

EIO0000002854.06 131
Common Device Editor Dialogs

Description of the Elements


Element Description

Machine Expert Twin

Open User Interface • If this option is activated, the user interface of


EcoStruxure Machine Expert Twin opens when an
emulation is started. After the session has been
established, the configured object, for example, one
multi carrier track or one robot, is visible in the
EcoStruxure Machine Expert Twin user interface. The
Emulation tab of the Multicarrier Configuration editor
returns to its initial state.
• If this option is not activated, the EcoStruxure Machine
Expert Twin opens in the background when an
emulation is started. After the session has been
established, the configured object is only visible in the
tool you are using, for example, the Emulation tab of the
Multicarrier Configuration editor.

OPCUA Server on Controller


IP Address from Controller • If this option is activated, the field IP is disabled and the
IP address of the OPC UA server is retrieved from the
controller configuration.
NOTE: To use this option, the Connection Mode >
IP Address must be selected in the
Communication Settings tab of the device editor,
page 86.
• If this option is not activated, enter the IP address of the
OPC UA server in the field IP.
Anonymous Login • If this option is activated, user name and password are
not required to establish a connection to the OPC UA
server.
NOTE: Activate this option only in case the option
Disable anonymous login was not activated in the
General Settings tab of the OPC UA Server
Configuration of the PacDrive LMC controller.
• If this option is not activated, you are requested to enter
user name and password when you start the emulation
to establish a connection to the OPC UA server.
NOTE: The credentials are retained until the
EcoStruxure Machine Expert project is closed.

I/O Mapping
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. Therefore, 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,
page 114.
See the following chapters:
• Working with the I/O Mapping Dialog, page 135
• I/O Mapping in Online Mode, page 141
• Implicit Variables for Forcing I/Os, page 141

132 EIO0000002854.06
Common Device Editor Dialogs

General Information on Mapping I/Os on Variables


Whether an I/O mapping can be configured for the present device depends on the
device. It can be that the view is only used to show the implicitly created device
instance. See description of the IEC objects, page 116.
Basically, note the following for the mapping of I/Os to variables:
• Variables requiring an input cannot be accessed by writing.
• An existing variable can only be mapped to one input.
• Instead of using the I/O Mapping view, you can also assign an address to a
variable via the AT declaration, page 501.
However, consider the following:
◦ You can use AT declarations only with local or global variables; not
however, with input and output variables of POUs.
◦ The possibility of generating force variables for I/Os (refer to Implicit
Variables for Forcing I/Os, page 141) will not be available for AT
declarations.
◦ If AT declarations are used with structure or function block members, all
instances will access the same memory location. This memory location
corresponds to static variables in classic programming languages such as
C.
• The memory layout of structures is determined by the target device.
• For each variable which is assigned to an I/O channel in the I/O Mapping
view, force variables can be created during a build run of the application (see
EcoStruxure Machine Expert, Menu Commands, Online Help). You can use
them for forcing the input or output value during the commissioning of a
machine, for example, via a visualization. Refer to the chapter Implicit
Variables for Forcing I/Os, page 141.

EIO0000002854.06 133
Common Device Editor Dialogs

Automatic I/O Mapping


The automatic I/O mapping function automatically creates IEC variables as soon
as a device or module with I/O modules is added to the Devices Tree and maps
them on each input and/or output. By default, the function is activated.
You can deactivate and configure the function in the Project > Project Settings >
Automatic I/O mapping dialog box.
The dialog box provides the following elements:

Element Description

Create variable on I/Os By default, the option is activated.


mapping
Select this option to activate the automatic I/O mapping
function and to assign names of your choice to the inputs and
outputs.

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 data type of
the variable in the variable name. The prefixes that are
used for the different data types are listed in the Best
Practices for the Naming of Identifiers chapter, page 492.
• 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.

134 EIO0000002854.06
Common Device Editor Dialogs

Working with the I/O Mapping Dialog Box


Overview
The following is an illustration of the I/O Mapping tab of the device editor:

EIO0000002854.06 135
Common Device Editor Dialogs

Description of the Elements in the Channels Area


The I/O Mapping tab provides the following elements in the Channels area if
provided by the device:

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 61131–3
standard. It is indicated as IEC type in the device description.
Otherwise, the entry of the table will be empty.

Default value 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, page 114.

Default value that is assigned to the channel when the controller is set
to STOP mode.

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.
NOTE: You can modify the default value using an online change.
The new value will be applied when executing a Reset cold or
Reset warm.
Unit Unit of the parameter value, for example: ms for milliseconds

Description Short description of the parameter

Current Value This column is available only in online mode.

Present value of the parameter.

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.

WARNING
UNINTENDED EQUIPMENT OPERATION
Do not map other user variables in the I/O Mapping tab if you are using libraries
for fieldbus communications that are reading/writing from/to direct addresses (%
I, %Q).
Failure to follow these instructions can result in death, serious injury, or
equipment damage.

Consult the documentation of your fieldbus library to see if direct addresses are
used.

136 EIO0000002854.06
Common Device Editor Dialogs

Modifying and Locking Addresses


This function is not available for all supported controllers. Consult the
Programming Guide specific to your controller for further information.
You can modify and lock the displayed address of an output or input here in this
tab. Use this to adapt the addressing to a given hardware configuration or to keep
the address value even if the order of the modules is changed. By default, this
would cause an automatic adaptation of the address values.
Consider that depending on the device description, you can only modify the
address of the input or output, however, not that of its subelements (bit channels).
Therefore, if an input or output is represented here in the mapping table with a
subtree, you can edit only the address field of the uppermost entry (see the figure
below: only the address field in the first line can be opened).
In order to fix the address value, select the entry in the Address column and press
the SPACE bar to open the edit field. Either modify the value or leave it unmodified
and close the edit field via the RETURN key. The address field is marked by an M
symbol which indicates that the value has been modified.
If the value has been modified, the subsequent addresses (up to the next address) will be adapted
correspondingly:

If you want to revert the modification 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.

EIO0000002854.06 137
Common Device Editor Dialogs

Configuration of the I/O Mapping


Perform the I/O mapping by assigning the corresponding project variables to the
device input and output channels each in the Variable column.
• The type of the channel is already indicated in the Variable column by a
symbol: for input, for output. In this line, enter the name or path of the
variable to which the channel should be mapped. You can either map on an
existing project variable or define a new variable, which then will
automatically be declared as a global variable.
• When mapping structured variables to outputs, the editor will prevent that
both the structure variable (for example, on %QB0) and particular structure
elements (for example, in this case on %QB0.1 and QB0.2 ) can be entered.
This means: When there is a main output entry with a subtree of bit channel
entries in the mapping table, then either in the line of the main entry a variable
can be entered or in those of the subelements (bit channels) never in both.
• For mapping on an existing variable, specify the complete path. For example:
<application name>.<pou path>.<variable name>';
Example: app1.plc_prg.ivar
For this purpose, it can be helpful to open the input assistant via the ... button.
In the Mapping column, the symbol will be displayed and the address
value will be crossed out. This does not mean that this memory address does
not exist any longer. However, it is not used directly because the value of the
existing variable is managed on another memory location, and, especially in
case of outputs, no other already existing variable should be stored to this
address (%Qxx in the I/O mapping) in order to avoid ambiguities during writing
the values.
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
box 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 box.
NOTE: If a UNION is represented by I/O channels in the mapping dialog box,
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 box, 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

138 EIO0000002854.06
Common Device Editor Dialogs

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.

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, page 114. 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.

Bus Cycle Options


This configuration option is available for devices with cyclic calls before and after
reading inputs or outputs. It allows you to set a device-specific bus cycle task,
page 114.
Per default, the parent bus cycle setting will be valid (Use parent bus cycle
setting). Therefore, the Devices Tree will be searched for the next valid bus cycle
task definition.
To assign a specific bus cycle task, select the desired one from the selection list.
The list provides the tasks currently defined in the application task configuration.

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.

EIO0000002854.06 139
Common Device Editor Dialogs

Mapping a Device and a Function Block Instance


Overview
If supported by the device, you can map function blocks to an input or output
channel. This allows you, for example, to count the frequency of signal changes or
scale a channel value for maintenance purposes.
The following code example maps a device output channel to a function block.
The function block scales the channel output value.
The following prerequisites must apply:
• A device with an analog output of type INT that supports function block
mapping is available in the project.
• A function block Scale_Output_Int with the following implementation is
available.
Consider the attributes of the function block itself and the attributes preceding the
output parameter for processing the channel output.
{attribute 'io_function_block'}
FUNCTION_BLOCK Scale_Output_Int
VAR_INPUT
iInput : INT;
iNumerator : INT;
iDenominator : INT :=1;
iOffset : INT := 0;
END_VAR
VAR_OUTPUT
{attribute 'io_function_block_mapping'}
iOutput : INT;
END_VAR
VAR
END_VAR
IF iDenominator <> 0 THEN
iOutput := TO_INT(TO_DINT(iInput) * TO_DINT(iNumerator)
/ TO_DINT(iDenominator)) + iOffset;

Procedure
To map a device and a function block instance, proceed as follows:

Step Action Comment

1 Open the <device name> I/O Mapping tab of –


the device editor.
2 Select the output you want to map to the function –
block.
3 Result: The Select Function Block
Click the plus button . dialog box opens. The left-hand
side displays at least the function
block Scale_Output_int below the
Application node.

Libraries available in the project that


contain the corresponding function
blocks are also displayed for
selection.

140 EIO0000002854.06
Common Device Editor Dialogs

Step Action Comment

4 Select the function block Scale_Output_int and Result: The path of the function
click OK. block parameter iOutput is entered
in the column Variable of the I/O
mapping table.

5 Result: The focus switches to the


Select the channel and click the Go to <device name> IEC Objects view,
Instance button. page 116 and to the new entry.

The IEC Objects view in online


mode displays the function block.
You can write (see EcoStruxure
Machine Expert, Menu Commands,
Online Help) and force (see
EcoStruxure Machine Expert, Menu
Commands, Online Help) the value
in this monitoring view.

I/O Mapping in Online Mode


I/O Mapping in Online Mode
If a structure variable is mapped on the root element of the address (the
uppermost in the tree of the respective address in the mapping dialog box), then in
online mode no value will be displayed in this line. If, however, for example, a
DWORD variable is mapped to this address, then in the root line, as well as in the
bit channel lines indented below, the respective values will be monitored.
Basically, the field in the root line stays empty if the value is composed of multiple
subelements.

Implicit Variables for Forcing I/Os


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. 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 are available in the input assistant in category Variables >
IoConfig_Globals_Force_Variables. They can be used in 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 defined 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.

EIO0000002854.06 141
Common Device Editor Dialogs

Example
If the mapping is completed as shown in figure I/O Mapping tab of the device
editor, page 135, then at a build (F11) of the application, the following variables
are generated and 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;

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 one) 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 box). 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.

Select Function Block Dialog Box


Overview
The Select Function Block dialog box allows you to select a function block for I/O
mapping. If the function block is mapped to the I/O channel selected in the I/O
Mapping or the IEC Objects view, click the plus button to open the dialog box.
The dialog box lists the function blocks of the active application and the libraries
included in the project that meet the following requirements:
• The attribute {attribute 'io_function_block'} is assigned to the
function block.
• The attribute {attribute 'io_function_block_mapping'} is assigned
to input or output parameters of the function block that match the channel
type (input, output, data type).
When you select a function block that contains more than one matching
parameters, the first parameter is mapped to the channel. To assign further
parameters manually, open the I/O Mapping tab.
After a function block has been mapped, the parameter of the function block
instance is added to the Variable column of the mapping table. The path consists
of the following elements:
<application name>.<device channel name>_<FB name>_
<continuous FB instance number>. <FB parameter name>
Example:

142 EIO0000002854.06
Common Device Editor Dialogs

App1.Out_4_Int_myScale_Output_Int_1.iOutput for the parameter


iOutput of the first inserted instance of the function block myScale_Output.
Elements of the Select Function Block dialog box:

Element Description

Find Text field for entering function block name to search for.

Type Function blocks in the tree structure that match the channel type. The
following nodes are available: application, library name(s).

Documentation Displays the documentation available for the library or the function block of the
library selected in the tree structure.

EIO0000002854.06 143
Cybersecurity
What’s in This Part
General Information...................................................................................... 145
Digital Signature Verification ......................................................................... 146
Connecting to the Controller.......................................................................... 148
Logoff Current Device User ........................................................................... 149
Security for the Project and the Application..................................................... 150
Security for the Runtime System / Controller................................................... 152
Visualization ................................................................................................ 155
FAQ ............................................................................................................ 156

Overview
Cybersecurity best practices and solutions are in constant evolution as a function
of the latest information available. As a design criteria, Schneider Electric
incorporates up-to-date knowledge and techniques to help make products more
resilient to cyberattacks. The security by design approach results in the
implementation of mechanisms to mitigate threats, reduce exploitable
weaknesses, and defend against avoidable data breaches and cyberattacks.
NOTE:
To help keep your Schneider Electric products secure and protected, it is in
your best interest that you implement the cybersecurity best practices as
indicated in the Cybersecurity Best Practices document provided on the
Schneider Electric website.
Due to the rapid rise of networking machines and plants, potential threats are also
quickly rising. Therefore, you must carefully consider all possible security
measures.
Security measures are necessary to help protect data and communication
channels from unauthorized access.
For general information about cybersecurity topics related to Schneider Electric
products, refer to the Cybersecurity Guidelines for Machine Solutions.
This part provides information about the cybersecurity mechanisms provided by
EcoStruxure Machine Expert and the controllers.

144 EIO0000002854.06
General Information

General Information
What’s in This Chapter
Access Protection with Device User Management ......................................... 145
Firewall Settings.......................................................................................... 145
Using Certificates ........................................................................................ 145

Access Protection with Device User Management


Introduction
In order to meet constantly evolving cybersecurity requirements, EcoStruxure
Machine Expert activates the user rights management for EcoStruxure Machine
Expert controllers by default. Therefore, every EcoStruxure Machine Expert
controller equipped with the latest firmware prompts you for user credentials
whenever you attempt to gain access to it.
For general information regarding device user management, refer to the chapter
describing the Users and Groups view of the device editor, page 118.

Firewall Settings
Firewall Settings on the Controller for Communication Services
Most of the communication services like FTP or OPC UA access the controller by
using the settings of the user rights management. Therefore, make sure that the
firewall settings on the controller allow the services to access the controller file
system. For further information, refer to “How to Configure the Firewall...” for your
specific controller.

Using Certificates
Overview
A certificate is a digital representation of information which contains the following:
• Identifies the certification authority issuing it.
• Names or identifies the subscriber.
• Contains the public key of the subscriber.
• Identifies its operational period.
• Is digitally signed by the certification authority issuing it.
Optionally, a certificate can be created for a specific usage. For example, you
cannot use a controller certificate for protecting a project and vice versa.
The certificate consists of two parts / files:
• Public X.509 certificate (can be issued to anyone).
• Private key that matches the certificate or its public key only (must be kept
secret).

EIO0000002854.06 145
Digital Signature Verification

Digital Signature Verification


What’s in This Chapter
Digital Signature Verification......................................................................... 146

Digital Signature Verification


Verifying the Integrity of Your Software
When your software (such as EcoStruxure Machine Expert) is started, each
loaded dynamic-link library (DLL) is scanned to verify whether or not it is trusted.
This is a built-in security feature against cyberattacks and to help increase the
trust level.

Reporting Untrusted Components


If untrusted DLLs are detected, you will be informed depending on the verification
level:
• Via status bar.
• Via dialog box Integrity Verification.
• Via console, such as Logic Builder Shell.
The result of the verification is documented in the log file of your software.

Verification Level
The following verification levels are defined and can be configured via command
line argument:

Verification Level Process in your software Process via console

Error (default) The dialog box Integrity Verification is The error message is written to the standard
displayed (blocking start-up of your console, such as Logic Builder Shell.
software).
The process is terminated.
You have the choice to continue or
terminate the process.

Warning A notification is displayed via status bar and A notification is written to the standard
is documented in the log file of your console, such as Logic Builder Shell.
software.
The process continues.
The process continues.

Silent The notification is only documented in the The notification is only documented in the
log file of your software. log file of your software.

The verification level is applied per process and is not set globally. Once the
verification level is set, it cannot be changed for a running software process.
Use the command line argument
"--SignatureVerificationWarningLevel=[Error|Warning|Silent]"
to configure the verification level for the running process.
To specify the verification level argument, run your software from console or adapt
the Start menu shortcut.

146 EIO0000002854.06
Digital Signature Verification

Verification Log Information


The digital signature verification results are written to the Verification Log (see
dialog box Integrity Verification).
Untrusted digital signature verification results are written to:
• the Windows EventLog (Source: "Schneider Electric Software").
• the log file of your software, such as EcoStruxure Machine Expert (see the
\TEMP\ directory).

How to Proceed Depending on the Verification Level


Verification level = Error:
If the verification level Error applies, the dialog box Integrity Verification is
displayed when your software is started. It provides the following options:
• The Export Verification Log... button allows you to save the log information
to an XML file. Consult this file to get more information about the DLLs that
were detected as untrusted.
• The Exit button allows you to exit the software promptly.
• To continue using your software, select the check box indicating that you have
taken the notification about untrusted components into account and click the
button Continue. Note that the notification will appear with every start of your
software.
Verification level = Warning:
If the verification level Warning applies, the startup process of your software
continues and a notification is displayed in the statusbar. Clicking this notification
opens the Integrity Verification dialog box which allows you to consult the
Verification Log for more information about the DLLs that were detected as
untrusted.
Analyze each notification carefully before you continue to work. As there are
multiple reasons for untrusted components there are also different ways to
continue:
• If an expected reason is reported you can continue to work.
• If an unexpected reason triggered by an installed 3rd party product on the
same PC is reported you can continue to work.
• If, however, an untrusted component is reported for an unexpected reason
and for which you do not recognize the component, analyze the Verification
Log carefully and find out why a DLL was detected as untrusted before you
continue to work with the software.

EIO0000002854.06 147
Connecting to the Controller

Connecting to the Controller


What’s in This Chapter
First Login to the Controller with User Rights Management Activated .............. 148

First Login to the Controller with User Rights Management


Activated
Procedure
The following login procedure applies to controllers running firmware released with
EcoStruxure Machine Expert V2.0 and later versions. For the procedure
applicable to EcoStruxure Machine Expert V1.2.• versions, refer to the
corresponding Release Notes.
NOTE: The following procedure is only allowed for users with access rights for
Administrator and Program.

Step Action

1 Enter a new user name.


2 Enter your individual Password.
NOTE: The password must comply with the password policy configured in the
Change Runtime Password Policy dialog box, page 102.

3 Re-enter your individual Password.

4 Click OK to confirm.

Result: You are requested to enter the new credentials for accessing the controller.

NOTE: For future login, the new Password will be required.

148 EIO0000002854.06
Logoff Current Device User

Logoff Current Device User


What’s in This Chapter
Logoff / Change Device User........................................................................ 149

Logoff / Change Device User


Procedure
After successful login to the controller, you can perform further online actions on
the controller with EcoStruxure Machine Expert. As long as your project remains
open, you will not be prompted to enter your credentials again.
In order to log off or change the present user from the controller, execute the
Online > Security > Logoff current device user command (see EcoStruxure
Machine Expert, Menu Commands, Online Help).
After that you will be prompted for your credentials when you attempt to perform
another online command on the controller.

EIO0000002854.06 149
Security for the Project and the Application

Security for the Project and the Application


What’s in This Chapter
Protecting and Saving a Project.................................................................... 150
Protecting and Saving Applications............................................................... 151

Protecting and Saving a Project


Overview
EcoStruxure Machine Expert allows you to apply access protection to projects,
libraries, as well as individual applications. In addition to write-protecting a project,
it is a good practice to implement a user management (credentials, access rights)
and encryption using certificates.
• The user management offers protection for the end user against accidental
changes to the protected objects. The Project Settings > Users and Groups
dialog box (see EcoStruxure Machine Expert, Menu Commands, Online Help)
is used to manage user accounts and user access rights groups and the
associated access rights. This allows you to control the access on
EcoStruxure Machine Expert projects.
• The Project > User Management > Permissions... command (see
EcoStruxure Machine Expert, Menu Commands, Online Help) opens the
Permissions dialog box for configuring the rights to work on objects to
execute commands in the open project or to modify the user management
configuration.
• The user management does not serve as an Intellectual Property Protection
(IPP) of the function blocks. Both EcoStruxure Machine Expert itself, as well
as plug-ins and persons with knowledge of the project file format can view or
change function blocks.
NOTE: Intellectual Property Protection of libraries can be enhanced when
libraries are delivered as compiled libraries. Therefore, execute the File >
Save Project As Compiled Library command (see EcoStruxure
Machine Expert, Menu Commands, Online Help) to save a library in
encoded format. This library no longer contains source code. Only the
compiler is able to interpret these data; other EcoStruxure Machine
Expert components are denied this information.
• Intellectual Property Protection of projects can be greatly enhanced by
encrypting the project file. To achieve this, activate the option Enable project
file encryption in the Project Settings > Security dialog box (see
EcoStruxure Machine Expert, Menu Commands, Online Help), and select the
encryption option that suits your needs:
◦ Protection via Password (see EcoStruxure Machine Expert, Menu
Commands, Online Help)
◦ Protection via Dongle (see EcoStruxure Machine Expert, Menu
Commands, Online Help)
◦ Protection via Certificates (see How To Help Protect Your Source Code,
User Guide)
NOTE: Losing a project password leads to the project being unable to
open.
• The option Integrity check in the Project settings > Security dialog box
(see EcoStruxure Machine Expert, Menu Commands, Online Help) saves the
project file in a proprietary format. The integrity of the file is verified each time
the project is opened.
NOTE: The project file is not encrypted. To help protect your project from
unauthorized access, select the option Encryption in the dialog box as
indicated above.

150 EIO0000002854.06
Security for the Project and the Application

Protecting and Saving Applications


Overview
• For protection of boot applications, refer to Encrypting Boot Applications with
Certificates in the Menu Commands online help.
• For signing a boot application, refer to Signing a Boot Application in the Menu
Commands online help.

EIO0000002854.06 151
Security for the Runtime System / Controller

Security for the Runtime System / Controller


What’s in This Chapter
Encrypting Communication .......................................................................... 152
Handling of Device User Management .......................................................... 152

Encrypting Communication
Overview
Communication with the controller connected in the project should be protected
against unauthorized access.

Consideration for HMISCU Controllers


NOTE:
Encrypted communication is not available for HMISCU controllers.

Enforcing Encrypted Communication


For further information, refer to the following sections in the EcoStruxure Machine
Expert online help:
• Encrypting communication to the controller, page 83
• Changing security settings to add, edit, and remove a user in the online user
management of the target device where you are logged in (see EcoStruxure
Machine Expert, Menu Commands, Online Help).
• Managing certificates which should be used for secured TCP communication
at application level. For detailed information, refer to the user guide How To
Manage Certificates on the Controller.
• Managing certificates which are applied by the OPC UA client provided by the
controller. For detailed information, refer to the user guide How to Manage
Certificates for OPC UA Client.
• Managing certificates which are expired, page 225.
NOTE: If the CODESYS Security Agent is installed, refer to the Software >
Programming and Configuring > CODESYS Security Agent part of the
EcoStruxure Machine Expert online help.

Handling of Device User Management


Overview
For general information on device user management, refer to the sections Users
and Groups, page 118 and Access Rights, page 124 in this Programming Guide.
User rights management is activated by default in the controllers.

152 EIO0000002854.06
Security for the Runtime System / Controller

Controller - HMI Communication with User Rights Management


Activated
With user rights management activated in the controllers, the connection between
an HMI programmed with Vijeo-Designer and the controller will not be established.
The following solutions are available to solve this issue:
• In Vijeo-Designer, open the Network Equipment Settings dialog box of the I/
O Manager and enter the Username and the Password to access the
controller.
• Reset the device user rights of the controller (see EcoStruxure Machine
Expert, Menu Commands, Online Help)

Managing Device User Rights


For further information, refer to the following sections in the EcoStruxure Machine
Expert online help:
• Editing or Viewing the Users and Groups Management Before any Users and
Groups Have Been Established, page 122
• Setting up a New User in the Users and Groups Management of the
Controller, page 123
• Loading a Users and Groups Management From a *.dum File, Modifying it,
and Later Downloading it to the Controller, page 123
• Modifying Access Rights to Controller Objects in the Users and Groups
Management of the Controller, page 125
• Managing device user rights by using the Controller Assistant (see
EcoStruxure Machine Expert, Controller Assistant, User Guide)
• Managing device user rights using the Scripting API, page 804

Resetting Device User Rights


For further information, refer to the following sections in the EcoStruxure Machine
Expert online help:
• Reset user rights management to default (see EcoStruxure Machine Expert,
Menu Commands, Online Help)
• Reset origin device (see EcoStruxure Machine Expert, Menu Commands,
Online Help)
• Reset via controller Web server (see Modicon M251 Logic Controller,
Programming Guide): MAINTENANCE > USER MANAGEMENT > USER
ACCOUNTS MANAGEMENT > RESET TO DEFAULT
• Reset via Controller Assistant (see EcoStruxure Machine Expert, Controller
Assistant, User Guide)
• Reset without credentials via Controller Assistant (see EcoStruxure Machine
Expert, Controller Assistant, User Guide)

Disabling/Deactivating Device User Rights


For further information, refer to the following sections in the EcoStruxure Machine
Expert online help:
• Disable user rights management on device (see EcoStruxure Machine
Expert, Menu Commands, Online Help)
• Deactivating via controller web server (see the Programming Guide specific
to your controller for compatibility): MAINTENANCE > USER
MANAGEMENT > USER ACCOUNTS MANAGEMENT > DEACTIVATE

EIO0000002854.06 153
Security for the Runtime System / Controller

• Deactivating user rights for the simulation device in EcoStruxure Machine


Expert Logic Builder (see EcoStruxure Machine Expert, Menu Commands,
Online Help)

Including Device User Rights While Cloning the SD Card


The Modicon M241 Logic Controller, Modicon M251 Logic Controller, and the
Modicon M262 Logic/Motion Controller provide a clone function that allows you to
write the image of the controller to an SD card. Consult the Programming Guide
specific to your controller, such as the Cloning a Controller section for Modicon
M262 Logic/Motion Controller (see Modicon M262 Logic/Motion Controller,
Programming Guide) or the SD Card section for Modicon M251 Logic Controller
(see Modicon M251 Logic Controller, Programming Guide).
This function is also provided by the Controller Assistant (see Device User Rights
Management in the EcoStruxure Machine Expert, Controller Assistant, User
Guide).

Including Device User Rights While Cloning the USB Memory Key
The Modicon M258 Logic Controller, and the Modicon LMC058 Motion Controller
provide a clone function that allows you to write the image of the controller to a
USB memory key. Consult the Programming Guide specific to your controller.

154 EIO0000002854.06
Visualization

Visualization
What’s in This Chapter
Visualization ............................................................................................... 155

Visualization
User Management
Visualizations can be protected as described in the Software > Programming
and Configuring > CODESYS Visualization > Setting Up User Management
part of the EcoStruxure Machine Expert online help.

Encrypted Communication
For communication between an Internet browser and a Modicon M262 Logic/
Motion Controller running a WebVisu, an HTTPS connection with encryption is
available which helps to protect the integrity of the displayed data. For details,
refer to Firewall Script Commands in the Modicon M262 Logic/Motion Controller
Programming Guide.

EIO0000002854.06 155
FAQ

FAQ
What’s in This Chapter
Frequently Asked Questions (FAQ)............................................................... 156

Frequently Asked Questions (FAQ)


Disabling Encryption for Communications
NOTE: It is a good practice to enable encrypted communication, especially in
combination with user management enabled, to help protect user credentials.
To disable the encryption of communication to the controller, proceed as follows:

Step Action

1 If the communication policy for encrypted communication is set to Enforced


encryption, set it back to Optional encryption in the Change Runtime Security
Policy dialog box, page 101.

2 In the Communication Settings tab of the device editor, disable the option Encrypted
communication in the Device menu.

As an alternative, you can modify the setting in the Security Screen if the CODESYS
Security Agent is installed.

Result: EcoStruxure Machine Expert establishes unencrypted communication to the


controller. Other clients can also communicate encryption.

New Certificate While the Existing Certificate is Still Valid


It is a good practice to provide a new certificate before the existing certificate
expires to help provide seamless encrypted communication. For further
information, refer to the chapter Managing Expired Certificates, page 225.

156 EIO0000002854.06
Program
What’s in This Part
Program Components .................................................................................. 158
Task Configuration ....................................................................................... 210
Managing Applications.................................................................................. 211

EIO0000002854.06 157
Program Components

Program Components
What’s in This Chapter
Program Organization Unit (POU) ................................................................ 158
Function Block ............................................................................................ 177
Application Objects...................................................................................... 190
Application.................................................................................................. 208

Program Organization Unit (POU)


POU
Overview
The term Program Organizational Unit (POU) refers to the programming objects
(programs, function blocks, functions, etc.) 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 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. Here, 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 or 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, page 160.
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.

158 EIO0000002854.06
Program Components

Adding and Calling POU Objects


Introduction
You can add Program Organization Unit (POU) objects to your application 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.

EIO0000002854.06 159
Program Components

Adding POU Objects to an Application


To add a POU object to the application of the controller, proceed as follows:

Step Action

1 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.

160 EIO0000002854.06
Program Components

Step Action

3 Select the type of POU object you want:


• Program
• Function Block:
1. 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.
2. Click the OK button.
3. 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.
The methods which are defined with the interface are created with the POU.
4. Click the OK button.
5. To help prevent deriving access from your function block, activate the option
Final. The function block cannot be extended by another one. Enables
optimized code generation.
6. Activate the option Abstract to indicate that the function block has a an
incomplete or no implementation and cannot be instantiated. The function
block is exclusively used as base function block and the implementation is
typically performed in a derived function block.
7. 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:
1. Click the browse button to select the Return type you want in the Input
Assistant.
2. 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.

Assigning Programs to a Task


At least one program has to be assigned to a task. To add a program to a task,
proceed as follows:

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.

EIO0000002854.06 161
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, page 674 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, page 175.

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, page 505, output, page 505,
and program variables. Access variables are available as options as well.

162 EIO0000002854.06
Program Components

Example of a program

Calling a Program
A program can be called by another POU. However, a program call in a Function,
page 164 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, page 499 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.

Example for Program Calls


Program in IL:
CAL PRGexample (
in_var:= 33 )
LD PRGexample.out_var
ST erg
Example with assigning the parameters (Input Assistant using the option Insert
with arguments):
Program in IL with arguments:
CAL PRGexample (
in_var:= 33 ,
out_var=> erg )
Example in ST
PRGexample(in_var:= 33);
erg := PRGexample.out_var;
Example with assigning the parameters (Input Assistant using the option Insert
with arguments as described previously):

EIO0000002854.06 163
Program Components

PRGexample (in_var:=33, out_var=>erg );


Example in FBD
Program in FBD:

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. Therefore, 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.

164 EIO0000002854.06
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 of Function Calls in IL


Function calls in IL;
LD 5
Fct 3 ,
22
ST result

Example of Function Calls in ST


result := fct1(5,3,22);

Example of Function Calls in FBD


Function calls in FBD:

Example:
fun(formal1 := actual1, actual2); // -> error message
fun(formal2 := actual2, formal1 := actual1); // same
semantics as the following:
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);

Method
Overview
A method is a language element similar to a function that can be used in a context
of a function block, page 177. It can be regarded as a function which contains an

EIO0000002854.06 165
Program Components

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, page
170 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 corresponding
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). If the method
does not have an implementation and the implementation is provided by the
derived function block, select the option Abstract. 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).
Click Open to confirm. The method editor view opens.

Input Assistance when Creating Inheriting Function Blocks


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.

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, page 170.

166 EIO0000002854.06
Program Components

Calling a Method
Method calls are also named virtual function calls. For further information, refer to
the chapter Method Invocation, page 186.
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). Therefore, the variables and function blocks
declared in a method are reinitialized at each call of the method.
• Methods defined in an interface, page 170 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, page 186.
• The declared access specifier defines how the method can be called:
◦ INTERNAL: The method can be called within its own namespace.
◦ PROTECTED: The method can be called within its own POU and its
derivatives.
◦ PRIVATE: The method can be called within its own POU.
◦ PUBLIC: No restrictions apply for calling the method.
NOTE: If no return value is defined for the method, the value of the first output
is returned. If no output is available for the method, a compiler error message
is generated.

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, page 188 which always points on the
present instance.
• VAR_TEMP variables of the function block cannot be accessed in a method.
• A method can call itself recursively.

Calling a Method
Use the following syntax for calling a method:
<return value variable> := <POU name> . <method name> (
<method input name> := <variable name> (, <further method
input name> := <variable name> )* );
Declaration example:
METHOD PUBLIC DoIt : BOOL
VAR_INPUT
iInput_1 : DWORD;
iInput_2 : DWORD;
sInput_3 : STRING(12);
END_VAR
Call example:
bFinishedMethod := fbInstance.DoIt(sInput_3 :='Hello World
', iInput_2 := 16#FFFF,iInput_1 := 16);
NOTE: When the method is called, the return value of the method is assigned,
for example, to variables declared locally. When you omit the names of the
input variables, make sure to obey the declaration order.
Declaration example:
METHOD PUBLIC DoIt : BOOL
VAR_INPUT
iInput_1 : DWORD;

EIO0000002854.06 167
Program Components

iInput_2 : DWORD;
sInput_3 : STRING(12);
END_VAR
Call example:
bFinishedMethod := fbInstance.DoIt( 16, 16#FFFF,'Hello World
');

Recursive Method Call


Within the implementation, a method can call itself, either directly by using the
THIS pointer, or by using a local variable for the assigned function block.
• THIS^. <method name> ( <parameter transfer of all input and
output variables>)
Direct call of the relevant function block instance with the THIS pointer.
• VAR fb_Temp : <function block name>; END_VAR
Call by using a local variable of the method that temporarily instantiates the
relevant function block.
A recursive call results in a compiler message. The compiler message will not be
issued if the method is provided with the pragma {attribute 'estimated-
stackusage : '<estimated_stack_size_in_bytes>'}. Refer to the
Attribute estimated-stack-usage chapter, page 542 for an
implementation example.
Thus, specifying the method name is insufficient for recursive method calls. In this
case, the following compiler message is issued:
Program name, function or function block instance expected
instead of
NOTE: Recursive calls are inherently difficult to implement and debug, and
may lead to unwanted side effects such as memory issues and watchdog
timeouts.

NOTICE
UNINTENDED APPLICATION ISSUES
• Only implement recursive algorithms where necessary.
• Be sure to have a solid understanding of recursive implementation
techniques, and document well the supporting code.
Failure to follow these instructions can result in equipment damage.

Special Methods for a Function Block


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, page 516.

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, page 516.

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, page 517.

Properties, page 169 and interface properties, page 172 each consist of a Set
and/or a Get accessor method.

168 EIO0000002854.06
Program Components

Method Call Also When Application Is Stopped


In the device description file, it can be defined that a certain method should always
be called task-cyclically by a certain function block instance (of a library module).
If this method has the following input parameters, it is processed also when the
active application is not running.
Example
VAR_INPUT
pTaskInfo : POINTER TO DWORD;
pApplicationInfo: POINTER TO _IMPLICIT_APPLICATION_INFO;
END_VAR
The programmer can check the application status via pApplicationInfo, and
can define what should happen.
IF pApplicationInfo^.state = RUNNING THEN <instructions>
END_IF

Property
Overview
A property in extension to the IEC 61131-3 standard 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, page 162, a function block,
page 177, a GVL, page 191, or an interface, page 170 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 following access specifiers are available as for methods, page 166:
• PUBLIC
• PRIVATE
• PROTECTED
• INTERNAL
• ABSTRACT
NOTE: Properties can also be declared within interfaces.
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 169
Program Components

Get and Set Accessors of a Property


Two special methods, page 165, named accessor, are inserted automatically in
the Applications tree below the property object. You can delete one of them if the
property should only be used for writing or only for reading. An accessor, like a
property (see previous paragraph), can get assigned an access modifier in the
declaration part, or via the Add Object dialog box, when explicitly adding the
accessor.
• The Set accessor is called when the property is written.
• The Get accessor is called when the property is read.
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, page 164 or method, page 165 - 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,
page 319 or with help of a watch list, page 373. The precondition for monitoring a
property is the addition of the pragma {attribute 'monitoring' :=
'variable'} (refer to the chapter Attribute Monitoring, page 551).

Interface
Overview
The use of interfaces is a means of object-oriented programming. An interface
POU defines a set of methods, page 165 and properties, page 169 without an
implementation. An interface can be described as an empty shell of a function
block, page 177. It must be implemented, page 184 in the declaration of the

170 EIO0000002854.06
Program Components

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.

Example of Interface Definition and Usage in a Function Block


An interface IFT is inserted below an application. It contains 2 methods Method1
and Method2. Neither the interface nor the methods contain any implementation
code. Just the declaration part of the methods is to be filled with the desired
variable declarations:
Interface with 2 methods:

1 or multiple function blocks can now be inserted, implementing the above defined
interface ITF.
Creating a function block implementing an interface

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.

EIO0000002854.06 171
Program Components

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, page 173) 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, page 169. 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.

Considerations
Consider the following:
• It is not allowed to declare variables within an interface. An interface has no
body (implementation 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, 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, page 183 of another interface.

172 EIO0000002854.06
Program Components

Example for Extending an Interface


If ITF1 extends ITF_base, all methods described by ITF_base will be
automatically available in ITF1.
Extending an interface

Click Add to confirm the settings. The editor view for the new interface opens.

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

Adding the Desired Collection of Methods


To complete the definition of the interface, add the desired collection of methods.
For this purpose, select the interface node in the Applications tree and execute
the command Interface method.... The Add Interface Method dialog box opens
for defining a method to be part of the interface. Alternatively, select the interface
node in the Applications tree, click the green plus button and select Interface
Method. Add as many methods as desired and remember that these methods are
only allowed to have input variables, output variables, and input/output variables,
but no body (implementation part).

Action
Overview
You can define actions and assign them to function blocks, page 177 and
programs, page 162. 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.

EIO0000002854.06 173
Program Components

Example of an Action of a Function Block


The following illustration shows an action in FB

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.

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

174 EIO0000002854.06
Program Components

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.

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, page 300.
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.

POUs for Implicit Checks


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.

EIO0000002854.06 175
Program Components

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:

Category Added functions

Bound Checks CheckBounds (for arrays), page 586

Division Checks • CheckDivDInt, page 618


• CheckDivLInt, page 618
• CheckDivReal, page 618
• CheckDivLreal, page 618

Range Checks • CheckRangeSigned, page 602


• CheckRangeUnsigned, page 602

LRange Checks • CheckLRangeSigned, page 602


• CheckLRangeUnsigned, page 602

Pointer Checks CheckPointer, page 584

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.

CAUTION
INCORRECT 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. A
corresponding message is displayed.

176 EIO0000002854.06
Program Components

Function Block
General Information
Overview
A function block is a POU, page 158 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,
page 183 of other function blocks. They can include interface, page 184
definitions concerning Method invocation, page 186. Therefore, inheritance can
be used when programming with function blocks.
A function block always is called via an instance, page 179, which is a
reproduction (copy) of the function block.

EIO0000002854.06 177
Program Components

Adding a Function Block


To add a function block to an existing application, select the respective node in the
Applications tree, click the green plus button and select POU.... Alternatively you
can right-click the node and execute the command Add Object > POU. To create
a function block that is independent of an application, select the Global node of
the Applications tree.
In the Add Object dialog box, select the option Function Block, enter a function
block Name (<identifier>) and choose the desired Implementation Language.
Additionally, you can set the following options:

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, page 183.

Implements Enter the names of interfaces, page 170 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, page 184.

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
language property 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.

Declaring a Function Block


Syntax
FUNCTION_BLOCK <access specifier> <function block name> | EXTENDS
<function block name> | IMPLEMENTS <comma-separated list of interface
names>
This is followed by the declaration of the variables. You can also group the inputs
and outputs for quick fading out and in when the function block is used in an FBD
or LD editor. Also refer to the chapter Attribute Pingroup, page 561.

178 EIO0000002854.06
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

Function Block Instance


Overview
Function blocks are called, page 180 through an instance which is a reproduction
(copy) of a function block, page 177.
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.

Syntax for Declaring a Function Block Instance


<identifier>:<function block name>;

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.

EIO0000002854.06 179
Program Components

Calling a Function Block


Overview
Function blocks, page 177 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, page 179 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, page 158 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.

Examples for Accessing Function Block Variables


Assume: Function block fb has an input variable in1 of the type INT. See here
the call of this variable from within program prog. See declaration and
implementation in ST:
PROGRAM prog
VAR
inst1:fb;
END_VAR
inst1.in1:=22; (* fb is called and input variable in1 gets
assigned value 22 *)
inst1(); (* fb is called, this is needed for the following
access on the output variable *)
res:=inst1.outl; (* output variable of fb is read *)
Example of a function block call in FBD:

180 EIO0000002854.06
Program Components

Assigning Parameters at Call


In the text languages IL and ST, you can set input and/or output parameters
immediately when calling the function block. The values can be assigned to the
parameters in parentheses after the instance name of the function block. For input
parameters, this assignment takes place using := as with the initialization of
variables, page 499 at the declaration position. For output parameters, => is to be
used.

Example of a Call with Assignments


In this example, a timer function block (instance CMD_TMR) is called with
assignments for the parameters IN and PT. Then the result variable Q is assigned
to the variable A. The result variable is addressed with the name of the function
block instance, a following point, and the name of the variable:
CMD_TMR(IN := %IX5, PT := T#100MS);
A:=CMD_TMR.Q;

Example of Inserting Via Input Assistant with Arguments


If the instance is inserted via Input Assistant with the option With arguments in
the implementation view of an ST or IL POU, it is displayed automatically
according to the syntax showed in the following example with all of its parameters,
though it is not necessarily required to assign these parameters.
For the previously mentioned example, the call would be displayed as follows.
CMD_TMR(in:=, pt:=, q=>)
-> fill in, e.g.:
CMD_TMR(in:=bvar, pt:=t#200ms, q=>bres);

Configuring a Memory Reserve for the Online Change of Function


Blocks
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 181
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).

Step Action Comment

1 Execute the command View > Online Change Result: The Online Change
Memory Reserve Settings Memory Reserve view opens.

2 From the list of applications, select the suitable –


application.

3 Execute the Generate Code command from the –


Build menu.
4 Click the button Scan Application. –

5 From the Function Blocks area, select the entry Result: The function blocks of the
All. application are displayed in the
middle of the Online Change
Memory Reserve view.

6 Select the function block for which you want to If the application has not been
configure a memory reserve. downloaded to the controller yet,
then the input field Memory
reserve (in bytes) is editable.

If the application is already available


on the controller, then click the Edit
button in the Enable editing area.
NOTE: If you modify the
memory reserve of an
application that is already
available on the controller, then
the instances of all affected
function blocks must be
copied.

7 Enter a value for the Memory reserve (in Result: The value you entered is
bytes), and click the Apply for selection button. displayed in the Memory Reserve
cell of the table.
8 Execute the Generate Code command from the –
Build menu.
9 Click the button Scan Application. Result: The values of the cells Size,
Instance Count, Additional
memory for all instances and
Remaining size of memory
reserve Memory Reserve are
updated in the list for the configured
function block.

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.

182 EIO0000002854.06
Program Components

Extension of a Function Block


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, page
166, a property, page 169, an action, page 174, or a transition, page 175.

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
...

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, page 187 (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

EIO0000002854.06 183
Program Components

VAR_OUTPUT
iCnt : INT;
END_VAR
VAR
END_VAR
THIS^.METH_DoIt();
THIS^.METH_DoAlso();

METHOD METH_DoIt : BOOL


VAR
END_VAR
iCnt := -1;
METH_DoIt := TRUE;

METHOD METH_DoAlso : BOOL


VAR
END_VAR
METH_DoAlso := TRUE;
FUNCTION_BLOCK FB_1 EXTENDS FB_Base
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
END_VAR
// Calls the method defined under FB_1
THIS^.METH_DoIt();
THIS^.METH_DoAlso();
// Calls the method defined under FB_Base
SUPER^.METH_DoIt();
SUPER^.METH_DoAlso();
METHOD METH_DoIt : BOOL
VAR
END_VAR
iCnt := 1111;
METH_DoIt := TRUE;
PROGRAM PLC_PRG
VAR
Myfb_1: FB_1;
iFB: INT;
iBase: INT;
END_VAR
Myfb_1();
iBase := Myfb_1.iCnt_Base;
iFB := Myfb_1.iCnt_THIS;

Implementing Interfaces
Overview
In order to support object-oriented programming, a function block can implement
several interfaces, page 170 which allows you to use methods, page 165.

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, page 172) defined by this interface. This includes
name, inputs, and the output of the particular method or property which must be
exactly the same.

184 EIO0000002854.06
Program Components

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).

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, page 183 by using
the keyword EXTENDS in the declaration.

EIO0000002854.06 185
Program Components

Method Invocation
Overview
Object-oriented programming with function blocks is - besides of the possibility of
extension, page 183 via EXTENDS - supported by the possible use of interfaces,
page 184 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, page 165 for further information on methods.
• THIS Pointer, page 188 for using THIS pointer.
• SUPER Pointer, page 187 for using SUPER pointer.

Calling Methods
According to the IEC 61131-3 standard, methods such as normal functions, page
164 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.

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

186 EIO0000002854.06
Program Components

pInst^.method1(); (* If b is true, fubbase.


method1 is called, else fub1.method1 is called *)
instRef.method1(); (* If b is true, fub1.
method1 is called, 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, page 188.

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

SUPER Call in Different Implementation Languages


Implementation Language Example

ST SUPER^.METH_DoIt();

FBD/CFC/LD

NOTE: The functionality of SUPER is not yet implemented for Instruction List.

Example
Use of SUPER and THIS pointers.
FUNCTION_BLOCK FB_Base
VAR_OUTPUT
iCnt : INT;
END_VAR
METHOD METH_DoIt : BOOL
iCnt := -1;

METHOD METH_DoAlso : BOOL


METH_DoAlso := TRUE;

FUNCTION_BLOCK FB_1 EXTENDS FB_Base


VAR_OUTPUT

EIO0000002854.06 187
Program Components

iBase: INT;
END_VAR
// Calls the method defined under FB_1
THIS^.METH_DoIt();
THIS^.METH_DoAlso();
// Calls the method defined under FB_Base
SUPER^.METH_DoIt();
SUPER^.METH_DoAlso();
iBase := SUPER^.iCnt;

METHOD METH_DoIt : BOOL


iCnt := 1111;
METH_DoIt := TRUE;

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;

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.
THIS may only be used in methods/properties/actions/transitions and in the
associated function block implementation.
THIS must be written in capital letters. Other spellings are not accepted.
Because THIS is a pointer to the function block, you have to dereference it to
access an element of the function block: THIS^.METHDoIt.

THIS Call in Different Implementation Languages


Implementation Language Example

ST THIS^.METH_DoIt();

FBD/CFC/LD

NOTE: The functionality of THIS is not yet implemented for Instruction List.

188 EIO0000002854.06
Program Components

Example 1
Local variable iVarB shadows the function block variable iVarB.
FUNCTION_BLOCK fbA
VAR_INPUT
iVarA: INT;
END_VAR
iVarA := 1;

FUNCTION_BLOCK fbB EXTENDS fbA


VAR_INPUT
iVarB: INT := 0;
END_VAR
iVarA := 11;
iVarB := 2;

METHOD DoIt : BOOL


VAR_INPUT
END_VAR
VAR
iVarB: INT;
END_VAR
iVarB := 22; // Here the local iVarB is set.
THIS^.iVarB := 222; // Here the function block variable
iVarB is set, although iVarB is overloaded.

PROGRAM PLC_PRG
VAR
MyfbB: fbB;
END_VAR

MyfbB(iVarA:=0 , iVarB:= 0);


MyfbB.DoIt();

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
...;

FUNCTION_BLOCK fbB EXTENDS fbA


VAR_INPUT
iVarB: INT := 0;
END_VAR
iVarA := 11;
iVarB := 2;

METHOD DoIt : BOOL


VAR_INPUT
END_VAR
VAR
iVarB: INT;
END_VAR
iVarB := 22; //Here the local iVarB is set.
funA(pFB := THIS^); //Here funA is called with THIS^.

PROGRAM PLC_PRG

EIO0000002854.06 189
Program Components

VAR
MyfbB: fbB;
END_VAR
MyfbB(iVarA:=0 , iVarB:= 0);
MyfbB.DoIt();

Application Objects
Data Type Unit (DUT)
Overview
Along with the standard data types, you can define your own data types. You can
create structures, page 597, enumeration types, page 599, and references, page
581 as data type units (DUTs) in a DUT editor, page 343.
For a description of the particular standard and the user-defined data types, refer
to the description of the data types, page 571.

Adding a DUT Object


To add a DUT object to an existing application, select the application node in the
Applications tree, click the green plus button, and select DUT.... Or right-click the
respective node and execute the command Add Object > DUT. To create an
application-independent DUT object, select the Global node in the Applications
tree. In the Add DUT dialog box, enter a Name for the new data type unit, and
choose the desired type Structure, Enumeration, Alias, or Union.
To DUT objects of type Enumeration you can add text list support. For further
information, refer to the description of the Add text list support command (see
EcoStruxure Machine Expert, Menu Commands, Online Help).
In case of type Structure, you can use the principle of inheritance, thus
supporting object-oriented programming. Optionally, you can specify that the DUT
extends another DUT which is already defined within the project. Therefore, the
definitions of the extended DUT will be automatically valid within the current one.
For this purpose, activate the option Extends: and enter the name of the other
DUT.
Click Add to confirm the settings. The editor view for the new DUT opens and you
can start editing.

Declaring a DUT Object


Syntax
TYPE <identifier> : <DUT components declaration>END_TYPE
The DUT component declaration depends on the type of DUT, for example, a
structure, page 597, or an enumeration, page 599.

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;

190 EIO0000002854.06
Program Components

END_STRUCT
END_TYPE
TYPE struct2 EXTENDS struct1 :
STRUCT
c:DWORD;
d:STRING;
END_STRUCT
END_TYPE

Global Variable List - GVL


Overview
A global variables list (GVL) is used to declare global variables, page 507. If a
GVL is placed in 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
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, page 344 to edit a global variable list.
The variables contained in a GVL can be defined to be available as network
variables, page 737 for a broadcast data exchange with other devices in the
network. For this purpose, configure 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.

GVL for Configurable Constants (Parameter List) in Libraries


The value of a global constant provided via a library can be replaced by a value
defined by the application. For this purpose, the constant has to be declared in a
parameter list in the library. Then, when the library is included in the application, its
value can be edited in the Parameter List tab of the Library Manager of the
application. See the following example for a description on how to do in detail.

Parameter List Handling


A library lib1.library provides an array variable g_Array. The size of the
array variable is defined by a global constant g_c_Arraysize. The library is
included in various applications, each needing a different array size. Therefore,
you want to overwrite the global constant of the library by an application-specific
value.
Proceed as follows: When creating lib1.library, define the global constant g_
c_Arraysize within a special type of global variable list (GVL), the so-called
parameter list. For this purpose, execute the command Add Object and add a
parameter list object, in the current example named Param. In the editor of this
object, which equals that of a standard GVL, insert the declaration of variable g_
c_Arraysize.

EIO0000002854.06 191
Program Components

Parameter list Param in library Lib1.library

Edit parameter g_c_Arraysize in the Library Manager of a project

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.

Network Variable List (Receiver)


Overview
A network variable list (receiver) is added to 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.
Therefore, each network variable list (receiver) corresponds exactly to one
network variable list (sender) in another device.

192 EIO0000002854.06
Program Components

Dialog box Add Network Variable List (Receiver)

Description of the Elements


When adding the network variable list (receiver), besides a Name, also define a
Task, responsible for the handling of the network variables.
Alternatively to directly choosing a network variable list (sender) from another
device, you can specify a network variable list (sender) export file *.GVL with the
option Import from file. This network variable list (sender) file has been
generated previously from the network variable list (sender) via View >
Properties > Link To File dialog box (see EcoStruxure Machine Expert, Menu
Commands, Online Help). In any case this is necessary if the desired network
variable list (sender) is defined within another project. For this purpose, select the
option Import from file in the Sender selection list and enter the file path in the
Import from file text field (or click the ... button to open the dialog for browsing in
the file system).
You can modify the settings at a later time via the View > Properties > Network
Settings dialog box (see EcoStruxure Machine Expert, Menu Commands, Online
Help).
A network variable list (receiver) is displayed by the NVL editor, page 348, but it
cannot be modified. It displays the content of the corresponding network variable
list (sender). If you modify the basic network variable list (sender), the network
variable list (receiver) is updated accordingly.
A comment is added automatically at top of the declaration part of a network
variable list (receiver), providing information on the sender (device path), the
network variable list (sender) name, and the protocol type.

EIO0000002854.06 193
Program Components

Network Variable List Example


Network variable list

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, page
737.

Example of a Simple Network Variable Exchange


In the following example, a simple network variable exchange is established. In
the sender controller, a network variable list (sender) is created. In the receiver
controller, the corresponding network variable list (receiver) is created.
Perform the following preparations in a default project, where a sender controller
Dev_Sender and a receiver controller Dev_Receiver are available in the Devices
tree:
• Create a POU (program) prog_sender below the Application node of Dev_
Sender.
• Under the Task Configuration node of this application, add the task Task_S
that calls prog_sender.
• Create a POU (program) prog_rec below the Application node of Dev_
Receiver.
• Under the Task Configuration node of this application, add the task Task_R
that calls prog_rec.
NOTE: The 2 controllers must be configured in the same subnet of the
Ethernet network.

Defining the Network Variable List (Sender)


Step 1: Define a global variable list in the sender controller:

194 EIO0000002854.06
Program Components

Step Action Comment

1 In the Applications tree, select the Application node of the The Properties dialog box of the network variable list
controller Dev_Sender and click the green plus button. (sender) is displayed.
Execute the command Add other objects > Network
Variable List (Sender).

2 Enter the Name GVL_Sender and click Add to create a new The GVL_Sender node appears below the Application
global variable list. node in the Applications tree and the editor opens on the
middle of the EcoStruxure Machine Expert screen.

3 In the editor, enter the following variable definitions: –


VAR_GLOBAL
iglobvar:INT;
bglobvar:BOOL;
strglobvar:STRING;
END_VAR

Step 2: Define the network properties of the network variable list (sender):

Step Action Comment

1 In the Applications tree, select the GVL_Sender node, The Properties - GVL_Sender dialog box is displayed.
click the green plus button, and execute the command
Properties...

2 –
Open the Network properties tab and configure the
parameters as indicated in the graphic:

3 Click OK. The dialog box is closed and the network variable list
(sender) network properties are set.

Defining the Network Variable List (Receiver)


Step 1: Define a global network variable list in the receiver controller:

EIO0000002854.06 195
Program Components

Step Action Comment

1 In the Applications tree, select the Application node of the The Add Global Network Variable List dialog box is
controller Dev_Receiver, click the green plus button, and displayed.
execute the command Global Network Variable List....
2 This global network variable list is the counterpart of the
Configure the parameters as indicated in the graphic. network variable list (sender) defined for the sender
controller.

3 Click Open.
The dialog box is closed and the GNVL_Receiver appears
below the Application node of the Dev_Receiver controller:

This network variable list (receiver) automatically contains


the same variable declarations as the GVL_Sender.

Step 2: View and / or modify the network settings of the network variable list
(receiver):

Step Action Comment

1 In the Devices tree, right-click the GNVL_Receiver node The Properties - GNVL_Receiver dialog box is displayed.
and select the command Properties....

2 Open the Network settings tab. –

Step 3: Test the network variable exchange in online mode:

196 EIO0000002854.06
Program Components

Step Action Comment

1 Under the Application node of the controller Dev_Sender, The editor for prog_sender opens on the right-hand side.
double-click the POU prog_sender.

2 –
Enter the following code for the variable iglobvar:

3 Under the Application node of the controller Dev_ The editor for prog_rec opens on the right-hand side.
Receiver, double-click the POU prog_rec.

4 –
Enter the following code for the variable ivar_local:

5 Log on with sender and receiver applications within the The variable ivar_local in the receiver gets the values of
same network and start the applications. iglobvar as currently displayed in the sender.

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....
Consult the Programming Guide specific to your controller for information on the
behavior of remanent 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.

EIO0000002854.06 197
Program Components

Persistent variable list

For further information, refer to the description of remanent variables, page 509.
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, page 344. The VAR_GLOBAL PERSISTENT RETAIN is already preset
in the first line.

Adding and Declaring Remanent Variables


When you add variables to an application, you can declare some of the variables
as remanent variables. Remanent variables can retain their values in the event of
power outages, reboots, resets, and application program downloads. There are
multiple types of remanent variables, declared individually as retain or persistent,
or in combination as retain-persistent.
Consult the Programming Guide specific to your controller for information on the
memory size reserved for retain and persistent variables in the different
controllers.
To add a global variable list called Persistent Variables to your application,
proceed as follows:

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.

198 EIO0000002854.06
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....
An external file inserted in the Global node of the Applications tree is not
downloaded to the controller.
An external file inserted in the Devices tree is downloaded to the controller when
an online change or a download is performed.
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 File Handling 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 A copy of the file will be stored internally in the project but also
embed into project the link to the 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 199
Program Components

Description of the Change Tracking 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 A dialog box pops up as soon as the file has been changed
file 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.

Description of the Buttons


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 (also refer to the Menu
Commands Online Help (see EcoStruxure Machine Expert,
Menu Commands, Online Help)).

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.

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, page 201 and dynamic, page 202 texts and
tooltips in visualizations and in the alarm handling
• Dynamic text exchange
Text lists can be exported and (re-) imported, page 204. Export is necessary, if a
language file in XML format has to be provided for a target visualization, but is
also useful for translations, page 204.
Possible formats of text lists:
• Text
• XML
You can activate support of Unicode, page 204.
Each text list is uniquely defined by its namespace. It contains text strings which
are uniquely referenced within the list by an identifier (ID, consisting of any
sequence of characters) and a language identifier. The text list to be used is
specified when configuring the text for a visualization element.
Depending on the language which is set in the visualization, the corresponding
text string is displayed in online mode. The language used in a visualization is
changed by a Change the language input. This is accomplished by a mouse
action that you have configured on the given visualization element. Each text list
must at least contain a default language, and optionally in other languages that
you choose to define. If no entry is found which matches the language currently

200 EIO0000002854.06
Program Components

set in EcoStruxure Machine Expert, the default language entry of the text list is
used. Each text can contain formatting definitions, page 204.
Basic structure of a text list

Identifier Default <Language 1> <Language 2> .... <Language n>


(Index)

<unique <text abc in default <text abc in <text abc in ...


string of language> language 1> language 2>
characters>
<unique <text xyz in default <text xyz in <text xyz in ...
string of language> language 1> language 2>
characters>

Text List Types


There are two types of text usable in visualization elements and correspondingly
there are two types of list:
• GlobalTextList for static texts
• Textlist for dynamic texts

GlobalTextList for Static Texts


GlobalTextList is a special text list where the identifiers for the particular text
entries are handled implicitly and are not editable. The list can be exported, edited
externally and then reimported.
Static texts in a visualization, in contrast to dynamic texts, are not exchanged by a
variable in online mode. The only option to exchange the language of a
visualization element is via a Change the language input. A static text is
assigned to a visualization element via property Text or Tooltip in category Texts.
When the first static text is defined in a project, a text list object named
GlobalTextList is added to the Global node of the Applications Tree. It contains
the defined text string found in the column Default, and an automatically assigned
integer number as the text identifier. For each static text that is created thereafter,
the identifier number is incremented and assigned to the visualization element.
If a static text is entered into a visualization element (for example, if in a rectangle
with property category of Texts, the string Text Example is specified), this text is
looked up in the GlobalTextList.
• If the text is found (for example, ID 4711, Text Example), the element value
4711 of TextId will be assigned to an internal variable. This establishes the
relationship between the element and the corresponding line in the
GlobalTextList.
• If the text is not found, a new line is inserted in the GlobalTextList (for
example, ID 4712, Text Example). In the element, the value 4712 is assigned
to the internal variable.
NOTE: If it does not yet exist - you can create a global text list explicitly by the
command Create Global Text List.
If you have exported, edited and reimported the GlobalTextList, it is validated as
to whether the identifiers are still matching those which are used in the
configuration of the respective visualization elements. If necessary, an implicit
update of the identifiers used in the configuration will be implemented.
To update the ID numbers of the texts that are defined for a visualization, you can
remove the GlobalTextList by right-clicking the node and executing the Delete
command. Then open a visualization and execute the command Visualization >
Create Global Text List. A new GlobalTextList node is created in the
Applications tree with the static texts of the visualizations available in the project.
NOTE: In case your GlobalTextList contains translated strings, they will not
be regenerated when the command Create Global Text List is executed.

EIO0000002854.06 201
Program Components

Example of a GlobalTextList
Create Global Text List

Textlist for Dynamic Texts


Dynamic texts can be modified dynamically in online mode. The text index (ID),
which is a string of characters, must be unique within the text list. In contrast to
GlobalTextLists, you have to define it. Also in contrast to the GlobalTextList,
create text lists for dynamic texts explicitly by selecting the Global node, clicking
the green plus button, and executing the command Add other objects > Text
List....
The available dynamic text lists are offered when configuring a visualization
element via property Dynamic texts / Text list. If you specify a text list name
combined with the text index (ID) - which can be entered directly or by entering a
project variable which defines the ID string - the text can be modified in online
mode.
A dynamic text list must be exported if it is needed as a language file for language
switching in a target visualization. Specify the file path in the Visualization
Options. Such as GlobalTextList, a dynamic text list can also be exported for
external editing and reimported. In contrast to GlobalTextList, when you import
dynamic text lists, there is no automatic check and update of the identifiers.

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.

Example of a Dynamic Text List Named ErrorList


Example ErrorList

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.

202 EIO0000002854.06
Program Components

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.
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:

Creating a Text List


• To create a text list for dynamic texts, page 202, add a Text List object to the
project in the Applications Tree. To create an application-specific text list,
select an application node. To create a global text list, select the Global node.
Then click the green plus button of the selected node, and execute the
command Add other objects > Text List.... When you have specified a list
name and confirmed the Add Textlist dialog box, the new list is inserted
below the selected node, and a text list editor view opens.
• To get a text list for static texts, page 201 (GlobalTextList), either assign a
text in property Text in category Texts of a visualization object to get the list
created automatically, or generate it explicitly by command Create Global
Text List.
• To open an existing text list for editing, select the list object in the
Applications Tree or Global node of the Applications Tree. Right-click the
text list node and execute the command Edit Object, or double-click the text
list node. Refer to the table Basic structure of a text list for how a text list is
structured.
• For adding a new default text in a text list, either use the command Insert
Text, or edit the respective field in the empty line of the list. To edit a field in a
text list, click the field to select it and then click the field again or press SPACE
to get an edit frame. Enter the desired characters and close the edit frame
with RETURN.

EIO0000002854.06 203
Program Components

Support of Unicode Format


To use Unicode format, activate the respective option in the Visualization
Manager. Further on, set a special compilation directive for the application: select
the application in the Devices Tree, open the Properties dialog box, Build tab. In
the Compiler defines field, enter VISU_USEWSTRING.
Dialog box with compiler definition

Export and Import of Text Lists


Static and dynamic text lists can be exported as files in CSV format. Exported files
can also be used for adding texts externally, for example by an external translator.
However, only files available in text format (*.csv) can be reimported.
See the description of the respective text list commands (see EcoStruxure
Machine Expert, Menu Commands, Online Help).
Specify the folder in which the export files should be saved in the dialog box File >
Project Settings > Visualization.

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.

Subsequent Delivery of Translated Texts


By inserting GlobalTextList.csv in the directory which is used for loading text files,
a subsequent integration of translated texts is possible. When the bootproject is
started up, the firmware detects that an additional file is available. The text is
compared with that in the existing textlist files. New and modified texts are then
applied to the textlist files. The updated textlist files will then be applied at the next
startup.

204 EIO0000002854.06
Program Components

List Components for Text Input


Via the dialog box Tools > Options > Visualization, you can specify a text
template file. All texts of column Default of this file will be copied to a list, which
will be used for the List Components functionality. A template file can be used
which has been created before via the Export command.

Multiple User Operations


By use of the source control, it is possible that multiple users work simultaneously
on the same project. If a static text is modified in visualization elements by more
than one user, it will cause modifications to the GlobalTextList (refer to
GlobalTextList, page 201). In this case, the Text-Ids may no longer be coherent
with the visualization elements. Use the following error detection and correction
methods:
• Use the command Check Visualization Text Ids, such errors may be
detected in the visualizations.
• Use the command Update Visualization Text Ids, these errors may be
resolved automatically. The affected visualizations as well as the
GlobalTextList must have write permission.

Use of Textlists for Changing Language in Visualizations


If an appropriate textlist is available, that is, a textlist defining several language
versions for a text, then the language used for the texts in a visualization can be
switched in online mode by an input on a visualization element. The Dynamic
Texts properties of the element must specify the textlist to be used, and an
OnMouse.. input action, Change the language, must be configured specifying
the language which should be used after the mouse action has been performed.
NOTE: The language must be specified with exactly this string which is
displayed in the column header of the respective textlist.

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, page 207 ).
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.

EIO0000002854.06 205
Program Components

Structure of an Image Pool


Example of an image pool:

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, page 206.

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.

Creating and Editing an Image Pool


A project can contain several image pools. The automatically generated
GlobalImagePool, as well as manually generated image pools.
GlobalImagePool
Add an image, which is not yet part of an image pool of the project, to a
visualization. In doing so, enter in the element properties a static ID for the image.
This results in the automatic creation of a GlobalImagePool which contains an
entry for the respective image file. The Link type is Link to file.
Manually creating an empty image pool:
You can insert an image pool object below an application node or below the
Global node of the Applications tree by clicking the green plus button and
executing the commands Add other objects > Image Pool.... In the Add Image
Pool dialog box, define a Name for the pool.
Adding an image file to an image pool

206 EIO0000002854.06
Program Components

Adding an image file to an image pool Actions to be performed

By executing the command Insert Image 1. Put the focus into the image pool editor.
2. Execute the Insert Image command (see
EcoStruxure Machine Expert, Menu
Commands, Online Help) from the
contextual menu.
Result: A unique ID is entered
automatically, which is editable.
3. Double-click the field File name in the
new line to specify the path of the image
file.
4. For this purpose, you can open the dialog

box Select Image by clicking the


button. The edit fields and options of this
dialog box are explained below this table.
NOTE: If you do not use the dialog box
Select Image, but enter the image file path
directly, then automatically the link type
setting Remember the link is used.

By directly entering the file name In the editor of the image pool, double-click the
field File name of the first empty line. Enter - as
described above for the first option (executing
the command Insert Image) - the path of the
desired image file.

Result: The file name is automatically entered


as ID.
By drag&drop from the file system In the local file system browser, select the
desired image file and drag it into the image
pool editor. Multiple selection is possible.

Result: The file name is automatically entered


as ID.

The link type setting Remember the link is


used automatically.

Elements of the Select Image dialog box:

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.

File Handling Choose a link type:


• 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 in the
Change Tracking section:
• Reload the file automatically.
• Prompt whether to reload the file.
• Do nothing.

Using Images Which Are Managed in Image Pools


If the ID of the image to be used is specified in multiple image pools:

EIO0000002854.06 207
Program Components

• search order: If you choose an image managed in the GlobalImagePool, you


do not need to specify the pool name. The search order for images
corresponds to that for global variables:
1. GlobalImagePool
2. image pools assigned to the currently active application
3. image pools in Global node of the Applications tree besides
GlobalImagePool
4. image pools in libraries
• unique accessing: You can directly call the desired image by adding the
image pool name before the ID according to syntax: <pool name>.<image
ID> (For an example, see imagepool1.drive_icon in the previous
graphic.)

Using an Image in a Visualization Element of Type Image


When inserting an image element in a visualization, you can define it to be a static
image or a dynamic image. The dynamic image can be changed in online mode
according to the value of a project variable:
Static images:
In the configuration of the element (property Static ID), enter the image ID or the
image pool name + image ID. Consider in this context the remarks on search
order and unique accessing in the previous paragraph.
Dynamic images:
In the configuration of the element (property Bitmap ID variable), enter the
variable which defines the ID, for example, PLC_PRG.imagevar.

Using an Image for the Visualization Background


In the background definition of a visualization, you can define an image to be
displayed as visualization background. The image file can be specified as
described previously for a visualization element by the name of the image pool
and the image file name.

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

208 EIO0000002854.06
Program Components

be used by the particular application and children. For the rules, refer to the
description of arranging and configuring objects in the Devices tree, page 35.

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? Corresponding 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, page 213 for more details.

EIO0000002854.06 209
Task Configuration

Task Configuration
What’s in This Chapter
Task Configuration ...................................................................................... 210
Adding Tasks .............................................................................................. 210

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, page 208. 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, page 364.
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.

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 contextual 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.

210 EIO0000002854.06
Managing Applications

Managing Applications
What’s in This Chapter
General Information..................................................................................... 211
Building and Downloading Applications ......................................................... 212
Running Applications................................................................................... 226
Maintaining Applications .............................................................................. 226

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. Therefore,
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,
• the Online > Operating Mode is set to Debug. For further information, refer
to the Operating Modes chapter in the Menu Commands Online Help.

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.

EIO0000002854.06 211
Managing Applications

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.

Building and Downloading 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.

Code Generation, Compile Information


Machine code is generated in the following cases:
• When the Application, page 208 project is downloaded to the target device
(controller, simulation target).
• When the Build > Generate code command is executed.
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.

Messages at Code Generation


At each code generation, additional information on the code and data size (in
Bytes), on the content of the allocated memory areas, and on the highest used
address (Byte) is displayed in the Messages > Build view.
It depends on the controller, in which memory areas the various types of data and
the code are stored. For the addresses %I, %M, %Q memory is allocated, even if no
variable is assigned to an address. After a Clean of the application, the memory is
completely reallocated.

212 EIO0000002854.06
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, page 118) established on the target device, at login you are prompted to
enter the user name and password. For this purpose, the dialog box Device User
Logon opens.
NOTE: If a password has expired, you are prompted to configure a new
password.
NOTE: After several attempts to log in with incorrect credentials, your account
may get locked for a time configured in the Change Runtime Password
Policy dialog box, page 102.
NOTE: The layout of EcoStruxure Machine Expert views can change when
you connect to the target device because the Online perspective, page 42 is
automatically selected when you switch to online mode.
NOTE: If the communication with the controller is encrypted or secured using
user management functions, refer to the How to Manage Certificates on the
Controller User Guide for further information.

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:

Mode Communication page setting Dialog of the device editor

1 Controller selection mode (default Communication Settings tab in


setting) controller selection mode, page 77

2 Simple mode Communication Settings tab in simple


mode, page 97

3 Classic mode Communication Settings tab in classic


mode, page 103

EIO0000002854.06 213
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, page 214).

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, page 215.

Unsuccessful Login
If... Then ... Comment
If an error is detected during Then the operation is aborted In the error message, you can
login to the controller, and an error message is display the error details.
displayed.

If an exception has occurred Then you can execute the This command opens the
containing the text command Show source code function in the editor with the
SOURCEPOSITION in the log in editor. cursor at the position where
message, the error was detected.

Build Process at Changed Applications


Build Process Before Login
Before Login and if the current affected application project has not been compiled
since having been opened or since the last modification, it will be compiled.
Therefore, the project will be built correspondingly to a Build run in offline mode
and compilation code for the controller will be generated.
If errors are detected during compilation, a message box opens with the following
text: There are compile errors. Do you want to login without download? You
can choose to correct the detected errors first, or to login nevertheless. In the
latter case, you are logged in to that version of the application which is possibly
already available on the controller.
The detected errors are listed in the Messages view (category Build).

214 EIO0000002854.06
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. Therefore,
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.
• The Online > Operating Mode is set to Debug. For further information, refer
to the Operating Modes chapter in the Menu Commands Online Help.

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 215
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.

Downloading Your Application to the Controller: 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.

Step Action

1 To connect to the controller, select Online > Login to ’Application[YourApplicationName; Plc Logic]’.
2 You are connected to the controller.

216 EIO0000002854.06
Managing Applications

Downloading Your Application 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.

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 217
Managing Applications

Downloading Your Application to the Controller: Case 3


A different or a new version of application is already available on the controller.

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.

218 EIO0000002854.06
Managing Applications

Downloading Your Application to the Controller: Case 4


The application is not yet available on the controller.

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.
In the Online Change Memory Reserve view, page 181, 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.
NOTE: With EcoStruxure Machine Expert V2.2 and later versions, only one
instance is allowed to log in to an application of a controller. An error message
is displayed when a login attempt is made by a second instance.

EIO0000002854.06 219
Managing Applications

Implicit Online Change


When you try to log in again with a modified application (checked via the
COMPILEINFO, which has been stored in the project folder during the last
download), you are asked whether you want to make an online change, a
download, or login without changing.
Login dialog box:

Description of the elements:

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.

220 EIO0000002854.06
Managing Applications

Application Information dialog box

For further information, refer to the Login chapter, page 213.

EIO0000002854.06 221
Managing Applications

Application Content tab of the Application Information dialog box:

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, page 170 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.

222 EIO0000002854.06
Managing Applications

NOTE: After having removed implicit check function (such as CheckBounds)


from your application, no Online Change is possible, just a download. A
corresponding 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.
Detailed Online Change Information dialog box

Explicit Online Change


Execute the command Online Change (by default in the Online menu) to
explicitly perform an online change operation on a particular application.
An Online Change of a modified project is no longer possible after a Clean
operation (Build > Clean all, Build > Clean). In this case, the information on
which objects have been changed since the last download will be deleted.
Therefore, only the complete project can be downloaded.
NOTE: Consider the following before executing the Online Change
command:
• Verify that the changed code is free from logical errors.
• Pointer variables keep their value from the last cycle. If you point to a
variable which now has been deplaced, the value will no longer be
correct. For this reason, reassign pointer variables in each cycle.

EIO0000002854.06 223
Managing Applications

Information on the Download Process


When the project is loaded to the controller completely at Login or partially at
Online Change, then the Messages view will show information on the generated
code size, the size of global data, the needed memory space on the controller and
in case of online change also on the affected POUs.
NOTE: In online mode, it is not possible to modify the settings of devices or
modules. To change parameters of the devices, the application must be
logged out. Depending on the bus system, there can be some special
parameters which are allowed to be changed in online mode.

Boot Application (Boot Project)


At each successful download, the active application is automatically stored in a file
<application name>.app in the controller system folder, thus making it available as
a boot application. The boot application is started automatically when the
controller is started (booted). To make the download of the active application the
boot application, you must execute the command Create boot application
(available in the Online menu).
You can also create the boot application while in offline mode, page 215.
If you want to connect to the same controller from the programming system on
different PC, or, retrieve the active application from a different PC, without the
need of an online change or download, follow the steps described in the
Transferring Projects to Other Systems paragraph.

224 EIO0000002854.06
Managing Applications

Transferring Projects to Other Systems


For transferring a project to another computer, use a project archive (see
EcoStruxure Machine Expert, Menu Commands, Online Help).
You can transfer a project, which is already running on a controller xy, from the
programming system on PC1 to that on PC2. To be able to reconnect from PC2 to
the same controller xy without the need of an online change or download, verify
the following project settings before creating a project archive.
Perform the following steps:
1. Verify that only libraries with definitive versions are included in the project,
except for the pure interface libraries. (Open the Library Manager and check
entries with an asterisk (*) instead of a fix version (see EcoStruxure Machine
Expert, Functions and Libraries User Guide).)
2. Ensure that a definitive compiler version is set in the Project Settings >
Compile options dialog box (see EcoStruxure Machine Expert, Menu
Commands, Online Help).
3. Make sure that a definite visualization profile is set in the Project Settings >
Visualization Profile dialog box (for more information, refer to the
Visualization part of the EcoStruxure Machine Expert online help).
4. Verify that the application currently opened is the same as that already
available on the controller. That is, the boot project (refer to the Online >
Create boot application command (see EcoStruxure Machine Expert, Menu
Commands, Online Help)) must be identical to the project in the programming
system. If there is an asterisk behind the project title in the title bar of the
programming system window, the project has been modified but not yet
saved. In this case, it can differ from the boot project. If necessary, before
transferring the project to another PC, create a (new) bootproject - for some
controllers this is done automatically at a download - and then download and
start the project on the controller.
5. Create the project archive with the following information: Download
information files, Referenced devices, Referenced libraries,
Visualization Profile.
6. Log out. If necessary, stop and restart controller xy before reconnecting from
PC2.
7. Extract the project archive on PC2 with the same information options
activated as listed in step 5.
NOTE: For login without online change, make sure that you use the
EcoStruxure Machine Expert version that was used to create and download
the application in the controller.

Managing Expired Certificates


Overview
Certificates have a limited validity and therefore need to be updated at regular
intervals.
If the certificate of the controller for encrypted communication has expired (refer to
the validity information not before until not after), a message is displayed when
you attempt to access the controller. To login anyway, you can accept the expired
certificate and connect to the controller. The message will be displayed every time
you attempt to login until you install a valid certificate.
If a new certificate is available on the controller (generated or imported), it will be
presented during next login for you to accept.
NOTE: Encrypted communication with other clients (for example,
PLCHandler) will not be established as they typically do not accept an expired
certificate.

EIO0000002854.06 225
Managing Applications

Renewing a Certificate (While the Present Certificate is Still Valid)


It is a good practice to provide a new certificate before the present certificate
expires to help provide seamless encrypted communication.
As soon as you attempt to login to a controller where a new certificate is available
in parallel to the certificate that is being used, you are prompted to accept this new
certificate. After you have accepted the new certificate, it is being used for
encrypted communication with this controller.

Running Applications
Running Applications
Introduction
This part defines how to start/stop an application.

RUN/STOP with EcoStruxure Machine Expert


The controller can be started and stopped using EcoStruxure Machine Expert run
on a PC connected to the controller.
Click Online > Start ‘Application [ApplicationName: Plc logic]’ or F5 key or the
Start ’Application [ApplicationName: Plc logic]’ button in the menu bar to start
the application.
Click Online > Stop ‘Application [ApplicationName: Plc logic]’ or Shift + F8
keys or the Stop ’Application [ApplicationName: Plc logic]’ button in the menu
bar to stop the application.

RUN/STOP Input for Controllers


This function is not available for all supported controllers. Consult the
Programming Guide specific to your controller (for example, Run/Stop chapter
(see Modicon M251 Logic Controller, Hardware Guide)).

RUN/STOP Switch for Controllers


This function is not available for all supported controllers. Consult the
Programming Guide specific to your controller (for example, Run/Stop chapter
(see Modicon M251 Logic Controller, Hardware Guide)).

Maintaining 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.

226 EIO0000002854.06
Managing Applications

• You can view object values in the online view of the declaration editor. For
details, refer to the description of the declaration editor, page 335.
• You can view objects independently in lists through the command Watch. For
details, refer to the description of the watch view / watch list editor, page 373.
You can insert a variable in a watch view by selecting it and executing the
command Add watchlist from the contextual 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, page 403.
• 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, page 384.
For information on monitoring of properties that are inserted beneath POUs or
function blocks, refer to the chapter Property, page 169.
For information on monitoring of function calls, refer to the chapter Attribute
Monitoring, page 551.
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.

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.

Breakpoints for Forcing Execution Stops


A breakpoint that is set in an application program stops program execution. The
variable values can then be seen at the current execution point. The current
position can be determined more precisely using the Call Stack (see EcoStruxure
Machine Expert, Menu Commands, Online Help).
Only the debug task that has just reached the breakpoint is stopped. The other
tasks continue to execute. The possible breakpoint positions depend on the
respective program editor. In each case, there is a breakpoint at the end of a POU.
NOTE: The inputs / outputs handled by the debug task are not updated when
stopped at a breakpoint. This applies even if the option Update IO while in
stop is enabled in the PLC settings [GENERAL] tab of the device editor,
page 114.
Refer to the chapter Breakpoints Commands for a description of the commands
concerning breakpoints. The Breakpoints dialog box (see EcoStruxure Machine
Expert, Menu Commands, Online Help) provides an overview on all breakpoints,
allowing you to add, remove, and modify breakpoints.

Conditional Breakpoints
The stop at the breakpoint can be dependent on the following conditions:
• At the time, a specific boolean expression is TRUE.

EIO0000002854.06 227
Managing Applications

• 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, page 230).

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.

Symbols
Symbol Description

Breakpoint enabled.

Breakpoint disabled.

The breakpoint is set in another instance of the function


block that is open in the editor.

Stop at breakpoint.

Conditional breakpoint enabled.

Conditional breakpoint disabled.

Execution point enabled.

Execution point disabled.

Conditional execution point enabled.

Conditional execution point disabled.

Current step position.

Indicated by a yellow arrow before the respective line


and a yellow shadow behind the concerned operation.

Data breakpoint enabled.

Data breakpoint disabled.

Stop at data breakpoint.

Data execution point enabled.

Data execution point disabled.

228 EIO0000002854.06
Managing Applications

Symbol Description

Stop at data execution point.

Conditional data execution point enabled.

Conditional data breakpoint enabled.

Stepping Through the Program


Stepping allows a controlled execution of an application program in online mode,
for debugging purposes. Before you can use stepping commands, the program
must be stopped at a defined program step, for example by setting a breakpoint.
Basically, you step from one instruction to the next by step into an instruction, step
over the next instruction or step out of an instruction. Refer to the chapter
Breakpoint-Related Commands (see EcoStruxure Machine Expert, Menu
Commands, Online Help) for a description of the stepping commands.
EcoStruxure Machine Expert provides the following stepping functions:
• Step into command (see EcoStruxure Machine Expert, Menu Commands,
Online Help): Execution of a single step; this also applies to POUs called
within a step.
• Step over command (see EcoStruxure Machine Expert, Menu Commands,
Online Help): Execution of a single step; POUs are executed completely
within a step.
• Step out command (see EcoStruxure Machine Expert, Menu Commands,
Online Help): If the application program does not contain any calls, a jump
back to the start of the application is executed.
• Run to Cursor command (see EcoStruxure Machine Expert, Menu
Commands, Online Help): Execution of the program up to a temporary
definable position.
• Set next statement command (see EcoStruxure Machine Expert, Menu
Commands, Online Help): Definition of the next instruction (statement) to be
executed.
• Show next statement command (see EcoStruxure Machine Expert, Menu
Commands, Online Help): Jump to the instruction (statement) to be executed
in the next step.
• Call Stack view (see EcoStruxure Machine Expert, Menu Commands, Online
Help): This view indicates the currently reached step position with the
complete call path.
The possible stop positions when stepping through an application program
depend on the editor type. The current position is indicated by the yellow arrow.
The Call Tree view (see EcoStruxure Machine Expert, Menu Commands, Online
Help) shows the location of the function block in the call structure of an application
program even before compiling the application.

Example of a Step Into Operation


Starting from the breakpoint you can execute each single command line with the
stepping command.

EIO0000002854.06 229
Managing Applications

Step Into, example

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 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, page 227.
• Redefining a data breakpoint to a data execution point where the program
does not halt, but processes specific code, refer to Execution Points, page
228.

Breakpoints and Stepping in Applications with Multiple Tasks


Debugging cannot be performed on multiple tasks at the same time. While you are
working on a task with breakpoints or stepping, breakpoints are ignored in other
tasks.
If a breakpoint can be hit by multiple tasks, because the POU is used by multiple
tasks, only the task that executes first will be halted. Consider this in case of single
stepping or if you continue debugging after a halt. If only one certain task should
be concerned (debug task), you can specify it in the breakpoint condition
properties (Breakpoints > New Breakpoint dialog box, tab Condition).

Flow Control for Displaying Exact Values When Processing


You can activate flow control to track parts of the application that have already run.
As opposed to standard monitoring, which displays only the variable value
between two cycles, the flow control yields the value for each processing step at
the moment it is rendered. Also refer to the Flow Control description in the Menu
Commands Online Help (see EcoStruxure Machine Expert, Menu Commands,
Online Help).

Variable Values at Execution Stop


At every execution stop, EcoStruxure Machine Expert displays the values of
variables in the current cycle (monitoring). To determine the current position, you
can display the call stack of a variable. Also refer to the Call Stack description in
the Menu Commands Online Help (see EcoStruxure Machine Expert, Menu
Commands, Online Help).

230 EIO0000002854.06
Managing Applications

Core Dump
Core Dump for Exceptions
A core dump is a memory snapshot of the application data. When supported by
the runtime system, a core dump is automatically saved to a file <application_
name>.core in the application directory on the controller when an exception is
detected.
In online mode, you can also generate a core dump explicitly if the application is
currently stopped at breakpoint or if an exception has been detected. In this case,
the core dump file is saved only in the project directory and not on the controller.
In offline mode, you can load the core dump of the application from the controller
to the EcoStruxure Machine Expert project. Then the application is displayed in its
online view with the data and values at the time when the exception was detected
and the core dump was created.
In addition, the log file of the controller can be displayed from the time the core
dump was created in the project.
NOTE: The firmware must support the functionality in order to display the
variable values in the core dump view correctly. In the online view of the
application that is created by loading the core dump into the project, menu
commands are displayed as available but do not have any effect in this status.
When choosing one of these commands, a message is displayed.
Refer to your controller programming manual to verify whether it supports the
core dump functionality.
NOTE: Exception handling in the runtime system may overwrite parts of the
variable values in the call stack. As a result, original values may be lost and
important information may no longer be displayed when monitoring for
variables in functions and methods.
Consider the following, for creating a project archive:

If... Then...
If you created a core dump explicitly by choosing then an option is automatically available in the
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.

Using the Core Dump to Analyze Exceptions


Prerequisites:
• A project is open with an application that has produced an exception on the
controller.
• The runtime system is able to create core dumps.
• The application in the project is in offline mode.

EIO0000002854.06 231
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.

Manually Creating a Core Dump of the Running Application


Prerequisites:
• An application is in online mode.
• The runtime system supports core dump functionality.

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.

Programmed Error Handling for Exceptions


As an IEC 61131-3 extension, EcoStruxure Machine Expert supports specific
operators (__TRY, __CATCH, __FINALLY, __ENDTRY) to catch exceptions. You
can program statements that will be executed in case an error is detected instead
of stopping the program. For further information, refer to the description of these
operators, page 668.
This function is not available for all supported controllers. Consult the
Programming Guide specific to your controller for further information.

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, page 378
• Intelli-sense, page 569
• Auto Declare... (see EcoStruxure Machine Expert, Menu Commands, Online
Help)
• Smart Coding (see EcoStruxure Machine Expert, Menu Commands, Online
Help)

232 EIO0000002854.06
Managing Applications

• Static Analysis Light, page 236

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 contextual 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.

Command Add <variable>


The command Refactoring > Add <variable> allows you to declare variables in a
POU and performs an automatic update at its different points of use.

EIO0000002854.06 233
Managing Applications

It is available in the contextual menu or in the Edit > Refactoring menu if the
cursor is placed in a declaration editor. The Auto Declare dialog box, page 500
opens.
After you have confirmed the Auto Declare dialog box by clicking OK, the
Refactoring dialog box opens. It consists of the tree structure of the project on the
left-hand side. The POUs where the new variable is used are highlighted in the
tree. You can double-click a POU to open the detailed view on the right-hand side
of the dialog box. In this declaration section and implementation of the POU on the
right-hand side, new declarations are highlighted in yellow.
Before you decide which changes you want to accept at which location, select the
suitable option from the list above the declaration section and implementation of
the POU on the right-hand side:

Option Description

Add inputs with Select this option to insert the standard placeholder text _REFACTOR_
placeholder 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 Select this option to insert an initialization value whenever the new
following value variable 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.

Examples for Adding a Variable


Example 1:
By refactoring, the fun block receives a new input variable input3 with the
initialization value 1. The change has the following effect:
Before refactoring:
fun(a + b, 3, TRUE);
fun(input1:= a + b , input2 :=3 , inputx := TRUE);
After refactoring:
fun(a + b, 3, input3:=1, TRUE);
fun(input1:= a + b , input2 :=3 , input3:=_REFACTOR_,inputx
:= TRUE);
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);

Command Remove <variable>


The command Refactoring > Remove <variable> allows you to remove an input
or output variable from a POU. It is removed automatically from the POU at its
different points of use.
The command is available in the contextual menu or in the Edit > Refactoring
menu if the cursor is placed in the declaration editor on the identifier of the

234 EIO0000002854.06
Managing Applications

variable to be removed. A dialog box opens that provides information on the


removal. If you confirm the message, the Refactoring dialog box opens.
When you accept the changes proposed in the Refactoring dialog box, the
respective input or output variables are removed automatically from the respective
POU at its different points of use.
NOTE: In CFC, only the connection is removed between the removed input or
output and the block. The input or output itself remains in the chart.

Example for Removing a Variable in ST


In a POU, refactoring removes the input4 input variable. It is automatically
removed from the respective POU at its different points of use:
Before removal:
inst(input1 := a + b, input2 := 3, input4 := 1, input5 :=
TRUE);
fun(a + b, 3, 1, TRUE);
After removal:
inst(input1 := a + b, input2 := 3, input5 := TRUE);
fun(a + b, 3, TRUE);

Command Update Referenced Pins


The command Refactoring > Update Referenced Pins only takes effect on the
CFC editor and the FBD/LD/IL editor. It corresponds to the commands Reset Pins
and Update parameters.
The command Refactoring > Update Referenced Pins updates the input and
output pins of the POU, at its different points of use, according to the current POU
declaration.
It is available in the contextual menu or in the Edit > Refactoring menu if the
cursor is placed in the POU name, in the first line of the POU declaration or in the
device editor.

Command Reorder Variables


The command Refactoring > Reorder Variables allows you to change the order
of variable declarations within the scopes VAR_INPUT, VAR_OUTPUT, or VAR_
IN_OUT.
Example:
VAR_INPUT
invar2 : INT;
invar1 : INT;
in : DUT;
bvar : BOOL;
invar3 : INT;
Proceed as follows to change the order of declarations:

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.

EIO0000002854.06 235
Managing Applications

Step Action

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.

Modifying a Variable Declaration and Applying Refactoring Automatically


Refactoring can help you in renaming variables (using Auto Declare) as indicated
in the following example.
As a prerequisite for this example, a function block fb_A with an input iA must be
available.

Step Action Comment

1 Execute the command Tools > Options.... Result: The Options dialog box
opens.

2 Select the category Refactoring on the left-hand –


side.
3 In the Auto Declare section, select the options –
On adding or removing variables, or on
changing the scope and On renaming
variables.
4 Double-click the function block fb_A. –

5 Select a variable in the declaration of fb_A, for As an alternative, you can place the
example, iA. cursor before or in the variable.

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.

Static Analysis Light


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.

236 EIO0000002854.06
Managing Applications

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.

Pragma and Attribute for Static Analysis Light


With the help of pragma instructions, you can exclude parts of the code from the
check.
Precondition: The rules must be activated in the Project Settings.
NOTE: Rule SA0004: Multiple write access on output, cannot be deactivated
via pragma.

Pragma {analysis ...}


You can use the pragma {analysis ...} to disable particular coding rules for
the subsequent code lines. For this purpose, place it in the line above the
concerned code (disabling) and in the line below the concerned code (re-
enabling); the number(s) of the rule or rules to be disabled must be specified
preceded by a minus sign (–) for disabling or by a plus sign (+) for re-enabling.
Depending on the rule, the pragma can be used in the declaration part or in the
implementation part of a programming object.
Syntax
{analysis <sign><rule number>|,<other combinations of signs
and rules, comma-separated>}
• -<rule number>: Deactivate the rule SA<rule number>.
• +<rule number>: Activate the rule SA<rule number>.
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}

Attribute {attribute 'analysis' := '...'}


You can use the attribute {attribute 'analysis' := '<sign><rule
number>'} in the declaration part for enabling or disabling particular rules for a
complete programming object:
Syntax
{attribute 'analysis' := '<sign><rule number>|,<further rule
numbers separated by commas>'}
Example
Rules SA0033 and SA0031 get disabled for the complete structure:
{attribute 'analysis' := '-33, -31'}
TYPE My_Structure :
STRUCT
iLocal : INT;
uiLocal : UINT;
udiLocal : UDINT;
END_STRUCT
END_TYPE
Rule SA0100 is disabled for the array:

EIO0000002854.06 237
Managing Applications

{attribute 'analysis' := '-100'}


big: ARRAY[1..10000] OF DWORD;

Creating an Archive in Your Controller on Download


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).

Creating an Archive on Your Controller


To create an archive on your controller with the download procedure, perform the
following three main tasks.
1.) Configure the sources to be downloaded.
To define the elements to add to the archive, proceed as follows:

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
• 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).
2.) Download the project (sources) to the controller.
To archive your project in your controller, proceed as follows:

Step Action Comment

1 Execute the command Online > Login to A message is displayed.


connect to the controller, page 213.

2 Select Online > Source download to The project is archived and


connected device. downloaded to the controller.

3.) Upload the project (sources) from the controller by executing the Online >
Source Upload... command (see EcoStruxure Machine Expert, Menu
Commands, Online Help).

238 EIO0000002854.06
Logic Editors
What’s in This Part
Common Features of Graphic Editors ............................................................ 240
FBD/LD/IL Editor .......................................................................................... 242
Continuous Function Chart (CFC) Editor ........................................................ 276
Sequential Function Chart (SFC) Editor ......................................................... 293
Structured Text (ST) Editor............................................................................ 318

EIO0000002854.06 239
Common Features of Graphic Editors

Common Features of Graphic Editors


What’s in This Chapter
Common Features of Graphic Editors ........................................................... 240

Common Features of Graphic Editors


Zooming, Panning, Magnifier Tools
The following zooming, panning, magnifier tools are available in the editors of all
graphic programming languages.
The graphical editors for FBD, LD, CFC, and SFC provide a toolbar in the lower
right corner of the editor window:

Item Name Description


number
1 Back to standard editing mode The pointer gets the usual shape of an arrow and you get back into the normal
editing mode, in which you can select and edit elements in the editor window.

2 Panning tool The pointer gets the shape of crossed arrows. You can click somewhere in the editor
window and - while keeping the mouse-button pressed - shift the visible area of the
chart within the window.
3 Magnifier tool This function is useful when you have zoomed down the displayed chart to less than
100%. It opens a subwindow in the lower right corner of the editor window. As long as
you move the pointer over your chart, this subwindow shows the respective part of
the chart in 100% size.

If you now click the window, the subwindow closes and that segment of the chart
which was shown in the subwindow, is displayed in 100% size. So, if you want to
keep the previously set zoom factor, use the Back to standard editing mode button
to get back to the normal editing mode.

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.

240 EIO0000002854.06
Common Features of Graphic Editors

You can drag function block declarations from the declaration part in the FBD and
LD graphical editors to the editor view. To do this, select the full declaration
(variable name and data type) and drag it to a suitable position in the editor view.
In the ladder diagram, you can also drag Boolean declarations to the editor and
insert them as contacts.

EIO0000002854.06 241
FBD/LD/IL Editor

FBD/LD/IL Editor
What’s in This Chapter
Information on the FBD/LD/IL Editor ............................................................. 242
FBD/LD/IL Elements.................................................................................... 264
LD Elements ............................................................................................... 274

Information on the FBD/LD/IL Editor


FBD/LD/IL Editor
Overview
A combined editor is available for editing POUs in the languages FBD (function
block diagram, page 242), LD (ladder diagram, page 243), and IL (instruction list,
page 243).
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, page 335, 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, page 248
• Working in the IL Editor View, page 252

Function Block Diagram (FBD) Language


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.

242 EIO0000002854.06
FBD/LD/IL Editor

FBD networks

Ladder Diagram (LD) Language


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.

Instruction List (IL) Language


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.

EIO0000002854.06 243
FBD/LD/IL Editor

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.

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, page 252
• Modifiers and operators in IL, page 244

Modifiers and Operators in IL


Modifiers
You can use the following modifiers in Instruction List, page 243.

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.

244 EIO0000002854.06
FBD/LD/IL Editor

N with operators according to Negation of the operand (not of the accumulator).


the Operators table below (N
in Modifiers column)

( with operators according to To be used for complex operands. For details, refer to the
the Operators table below (( list of use cases for complex operands, page 246.
(left 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.

Operator Modifiers Meaning Example

LD N Loads the (negated) value of the operand into LD iVar


the accumulator.
ST N Stores the (negated) content of the accumulator ST iErg
into the operand variable.

S – Sets the operand (type BOOL) to TRUE when S bVar1


the content of the accumulator is TRUE.
R – Sets the operand (type BOOL) to FALSE when R bVar1
the content of the accumulator is TRUE.
AND N,( Bitwise AND of the accumulator and the AND bVar2
(negated) operand.

OR N,( Bitwise OR of the accumulator and the OR xVar


(negated) operand.

XOR N,( Bitwise exclusive OR of the accumulator and the XOR N,


(negated) operand. (bVar1,
bVar2)

NOT – Bitwise negation of the content of the –


accumulator.
ADD ( Addition of accumulator and operand, result is ADD iVar1
copied to the accumulator.

SUB ( Subtraction of accumulator and operand, result SUB iVar2


is copied to the accumulator.

MUL ( Multiplication of accumulator and operand, MUL iVar2


result is copied to the accumulator.

DIV ( Division of accumulator and operand, result is DIV 44


copied to the accumulator.

GT ( Verifies if accumulator is greater than the GT 23


operand, result (BOOL) is copied into the
accumulator; >

GE ( Verifies if accumulator is greater than or equal to GE iVar2


the operand, result (BOOL) is copied into the
accumulator; >=

EQ ( Verifies if accumulator is equal to the operand, EQ iVar2


result (BOOL) is copied into the accumulator; =

NE ( Verifies if accumulator is not equal to the NE iVar1


operand, result (BOOL) is copied into the
accumulator; <>

LE ( Verifies if accumulator is less than or equal to LE 5


the operand, result (BOOL) is copied into the
accumulator; <=

EIO0000002854.06 245
FBD/LD/IL Editor

Operator Modifiers Meaning Example

LT ( Verifies if accumulator is less than operand, LT cVar1


result (BOOL) is copied into the accumulator; <

JMP C, CN Unconditional (conditional) jump to the label JMP next


• JMP = unconditional jump
• JMPC = conditional jump if accumulator is
TRUE
• JMPCN = conditional jump if accumulator
is FALSE
CAL C, CN Unconditional (conditional) call of a PROGRAM CAL prog1
or FUNCTION_BLOCK
• CAL = unconditional call
• CALC = conditional call if accumulator is
TRUE
• CALCN = conditional call if accumulator is
FALSE
RET C, CN Unconditional (conditional) return of the POU RET
and jump back to the calling POU
• RET = unconditional return
• RETC = conditional return if accumulator
is TRUE
• RETCN = conditional return if accumulator
is FALSE
) – Evaluate deferred operation –

See also IEC operators, page 613 and Work in IL editor, page 252 for how to use
and handle multiple operands, complex operands, function / method / function
block / program / action calls and jumps.

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:

Use case Description Examples

Several Options • Option 1:


operands for • Enter the operands into LD 2
one operator consecutive rows, ADD 3,
4,
separated by commas in
the 2nd column. 6
ST iVAR
• Repeat the operator in
• Option 2:
consecutive rows.
LD 2
ADD 3
ADD 4
ADD 6
ST iVAR
Complex For a complex operand, enter A string is rotated by one character each
operands the left parenthesis ( in the first cycle:
column. LD stRotate
RIGHT( stRotate

246 EIO0000002854.06
FBD/LD/IL Editor

Use case Description Examples

LEN
Enter the right parenthesis in SUB 1