EcoStruxure Machine Expert Programming Guide
EcoStruxure Machine Expert Programming Guide
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
Validity Note
This document has been updated for the release of EcoStruxure™ Machine Expert
V2.2.
18 EIO0000002854.06
About the Book
Related Documents
Document title Reference
Cybersecurity Best Practices CS-Best-Practices-2019-340
EIO0000002837 (FRE);
EIO0000002838 (GER);
EIO0000002840 (SPA);
EIO0000002839 (ITA);
EIO0000002841 (CHS)
EIO0000002844 (GER);
EIO0000002846 (SPA);
EIO0000002845 (ITA);
EIO0000002847 (CHS)
EIO0000002831 (GER);
EIO0000002833 (SPA);
EIO0000002832 (ITA);
EIO0000002834 (CHS)
EIO0000001673 (GER);
EIO0000001675 (SPA);
EIO0000001674 (ITA);
EIO0000001676 (CHS)
EIO0000003049 (GER);
EIO0000003051 (SPA);
EIO0000003050 (ITA);
EIO0000003052 (CHS)
EIO0000002854.06 19
About the Book
EIO0000001694 (GER);
EIO0000001696 (SPA);
EIO0000001695 (ITA);
EIO0000001697 (CHS)
EIO0000002976 (GER);
EIO0000002978 (SPA);
EIO0000002977 (ITA);
EIO0000002979 (CHS)
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.
EIO0000002854.06 21
About the Book
Standard Description
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
In addition, terms used in the present document may tangentially be used as they
are derived from other standards such as:
Standard Description
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
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
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
26 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface
1 2 3 4
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
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
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.
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.
Information bar of the Provides information messages, for example on the license
Messages view status.
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.
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
Ch Number of characters.
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
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
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.
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.
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.
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
32 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface
1 Root node
2 Programmable device (with applications)
EIO0000002854.06 33
EcoStruxure Machine Expert Logic Builder User Interface
◦ Device is running in demo mode for 30 minutes. After this time, the
demo mode expires and the fieldbus stops exchanging data.
34 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface
EIO0000002854.06 35
EcoStruxure Machine Expert Logic Builder User Interface
Functional tree
Overview
The Functional tree is available for controllers that have a Functional Model
node in the Devices tree. It allows you to group multiple objects, such as IEC
code or devices, and link them to a function. Once this function is created, you can
reuse it. By creating this modularity, 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
Selecting Controllers
Select controllers for the Functional tree as follows:
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
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.
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.
38 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface
If you export and import the functional model Then the attached objects are not recreated.
only,
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.
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.
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.
40 EIO0000002854.06
EcoStruxure Machine Expert Logic Builder User Interface
View is placed here: the view currently placed at this position and the
new one are arranged as icons.
EIO0000002854.06 41
EcoStruxure Machine Expert Logic Builder User Interface
When you release the mouse-button, the view is placed at the new position.
Views with an Auto Hide button can be placed as independent windows (floating)
anywhere on the screen by moving them and not dragging them on one of the
arrow symbols. In this case, the view looses the Auto Hide button. As an
alternative, execute the commands Dock and Float from the Window menu.
Hiding views: You can hide views with Auto Hide buttons at the border of the
EcoStruxure Machine Expert window. Click the Auto Hide down button in the
upper right corner of the view. The view will be displayed as a tab at the nearest
border of the frame window. The content of the view is only visible as long as the
cursor is moved on this tab. The tab displays the icon and the name of the view.
This state of the view is indicated by the docking button changed to Auto Hide.
Unhiding views: To unhide a view, click the Auto Hide button.
An alternative way of hiding and unhiding a view is provided by the Auto Hide
command that is by default available in the Window menu.
It is not possible to reposition the information and status bar on the lower border of
the user interface, 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
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)
Step Action
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.
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.
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.
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
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:
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
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
Step Action
3 Select the file type SERCOS III I/O device descriptions (*.xml) and browse your file
system for the SDDML file to open.
Result: The SDDML file is converted and imported into a compatible file format for
EcoStruxure Machine Expert.
NOTE: If the selected SDDML file is not compatible or if the Sercos device of
the third-party vendor is not using a compatible FSP (Function Specific Profile)
type, then a corresponding diagnostic message is indicated in the Messages
view (see EcoStruxure Machine Expert, Menu Commands, Online Help).
EIO0000002854.06 49
Installing Devices
Step Action
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 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.
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.
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.
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.
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.
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.
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.
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 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.
2 In the Add Device dialog box, select Schneider Electric from the list box Vendor.
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
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.
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.
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.
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
54 EIO0000002854.06
Managing Devices
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).
Modbus TCP Slave Device Ethernet Modbus TCP manager for controllers with Ethernet
port.
Industrial Ethernet Network Ethernet For configuring EtherNet/IP and Modbus TCP
scanner services on M241 / M251 controllers with
Ethernet port.
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.
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.
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.
EIO0000002854.06 55
Managing Devices
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.
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.
Naming the device meaningfully may ease the organization of your project.
56 EIO0000002854.06
Managing Devices
WARNING
UNINTENDED EQUIPMENT OPERATION
• Use the g_aNetDiagnosis data structure within the application to monitor
CAN slave responses to configuration commands.
• Verify that the application does not start up or put the machine or process in
an operational state in the event of receiving SDO abort messages from any
of the CAN slaves.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
After adding the CanConfig Extern library to your application, use the Net
Diagnostic definition within your application to test for SDO abort messages from
the CAN slaves.
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.
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.
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.
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.
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.
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.
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.
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:
4 Select the programming language in which the logic will be converted from the Implementation Language list.
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.
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
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.
EIO0000002854.06 63
Managing Devices
In EcoStruxure Machine Expert, there is only the memory word area for memory
objects:
The graphic provides an overview of the different layouts of %MD and %MF
addresses in SoMachine Basic / Twido and EcoStruxure Machine Expert.
%MW Mapped to the same %MW For each %MW object, a global
address variable of type INT is created.
Example
%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.
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.
Counters %C FB_Counter
PID FB_PID
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
MC_MotionTask_PTO
EIO0000002854.06 65
Managing Devices
%DATALOG
66 EIO0000002854.06
Managing Devices
%S21 , %S22 Are only written. Reading is not supported for these variables.
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
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.
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.
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:
EIO0000002854.06 69
Managing Devices
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.
70 EIO0000002854.06
Managing Devices
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.
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.
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.
TM2DAI8DT TM3DI8A –
TM2DDO8UT TM3DQ8U –
TM2DDO8TT TM3DQ8T –
TM2DRA8RT TM3DQ8R –
EIO0000002854.06 71
Managing Devices
TM2DDI16DK TM3DI16K –
TM2DRA16RT TM3DQ16R –
TM2DDO16UK TM3DQ16UK –
TM2DDO16TK TM3DQ16TK –
TM2DDI32DK TM3DI32K –
TM2DDO32UK TM3DQ32UK –
TM2DDO32TK TM3DQ32TK –
TM2DMM8DRT TM3DM8R –
TM2DMM24DRF TM3DM24R –
TM2AMI2HT TM3AI2H –
TM2AMM3HT TM3TM3 –
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
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.
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:
EIO0000002854.06 73
Managing Devices
Access to all local inputs and outputs. Access only to fast inputs and outputs.
READ_IMM_IN updates the input object (%I0. GetImmediateFastInput only returns the
x). read value but does not update the input
channel.
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
EIO0000002854.06 75
Common Device Editor Dialogs
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.
Tab Description
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.
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.
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.
EIO0000002854.06 77
Common Device Editor Dialogs
LMC_PacDrive
Parameters Communication Settings PLC Settings Files Visualization profile Applications Users and Grou...
TM262M25MESS8T TM262M25MESS8T
78 EIO0000002854.06
Common Device Editor Dialogs
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.
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.
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.
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
Step Action
Result: The Edit communication settings dialog box opens with the settings of 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
EIO0000002854.06 83
Common Device Editor Dialogs
The following scenarios are possible when you attempt to log into a controller
using encrypted communication:
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.
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
Step Action
1 Right-click the controller in the list and execute the command Change device
name... from the contextual menu.
2 In the Change device name dialog box, enter a unique device name in the box New.
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.
EIO0000002854.06 85
Common Device Editor Dialogs
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>.
86 EIO0000002854.06
Common Device Editor Dialogs
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
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
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
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
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
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
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
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.
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
98 EIO0000002854.06
Common Device Editor Dialogs
Element Description
Scan network... button Opens the Select Device dialog box that lists
the configured gateways and their associated
devices.
Gateway list –
Add new gateway... Opens the Gateway dialog box for adding a
new gateway (see EcoStruxure Machine Expert,
Menu Commands, Online Help).
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.
EIO0000002854.06 99
Common Device Editor Dialogs
Element Description
100 EIO0000002854.06
Common Device Editor Dialogs
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
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).
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.
EIO0000002854.06 101
Common Device Editor Dialogs
Element Description
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.
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.
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.
102 EIO0000002854.06
Common Device Editor Dialogs
EIO0000002854.06 103
Common Device Editor Dialogs
Color Description
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
EIO0000002854.06 105
Common Device Editor Dialogs
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.
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).
Edit Gateway... This command opens the Gateway dialog box for editing the
settings of the selected gateway.
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.
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.
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.
Send echo service EcoStruxure Machine Expert implements the echo service that
is similar to the ping tool.
106 EIO0000002854.06
Common Device Editor Dialogs
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.
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.
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
EIO0000002854.06 107
Common Device Editor Dialogs
Element Description
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
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.
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.
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).
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.
Refresh List Click this button to scan the controller for applications. The list
will be updated accordingly.
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.
File name Name of the file below the application, or direct archive.prj
name of the implicitly transferred file (for
example, archive.prj).
Time interval Time interval for updating the file on the After download /
controller. online change of the
application.
Files
Overview
The Files view of the device editor serves to transfer files between the host and
the controller. You can choose any file from a directory of the local network to copy
it to the file directory of the currently connected runtime system, or vice versa.
This view is divided in two parts:
• The left part shows the files on the Host.
• The right part shows the files on the Runtime system.
Element Description
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.
For the directories in the file trees there are the following variants:
Element Description
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.
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
Column Description
112 EIO0000002854.06
Common Device Editor Dialogs
Element Description
EIO0000002854.06 113
Common Device Editor Dialogs
Element Description
Status Bar
The message Auto-Scrolling: on the status bar indicates whether the automatic
scrolling function is enabled (ON) or disabled (OFF).
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
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.
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 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.
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.
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.
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.
Element Description
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.
EIO0000002854.06 117
Common Device Editor Dialogs
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.
EIO0000002854.06 119
Common Device Editor Dialogs
Element Description
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
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.
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.
EIO0000002854.06 121
Common Device Editor Dialogs
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.
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.
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:
1 Double-click the controller node in the Devices Result: The device editor opens.
tree.
2 Select the Users and Groups view. –
4 Click Yes to confirm the dialog box and to Result: The Device user login
activate device Users and Groups dialog box opens.
management.
122 EIO0000002854.06
Common Device Editor Dialogs
1 Double-click the controller node in the Devices Result: The device editor opens.
tree.
2 Select the Users and Groups view. –
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.
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.
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.
button is activated,
modifications made in the editor are
automatically transferred to the
controller.
EIO0000002854.06 123
Common Device Editor Dialogs
Access Rights
Overview
In the Access Rights view of the device editor, define the device access rights of
device users to objects in the controller.
In order for the Access Rights view to be available in the device editor of
controllers, activate the Show access rights page option in the Tools > Options
> Device Editor dialog box (see EcoStruxure Machine Expert, Menu Commands,
Online Help). Furthermore, Users and Groups management must be set up in
the controller.
Example of an Access Rights view of the device editor
124 EIO0000002854.06
Common Device Editor Dialogs
1 Double-click the controller node in the Devices Result: The device editor opens.
tree.
2 Select the Access Rights view. –
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.
EIO0000002854.06 125
Common Device Editor Dialogs
Element Description
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
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
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 .
EIO0000002854.06 127
Common Device Editor Dialogs
Object Description
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.
128 EIO0000002854.06
Common Device Editor Dialogs
Login – – – X
Create 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
Start / Stop – X – –
Reset – X – –
Restore retain – X – –
variables
Save retain variables – – – X
(X) The access right must be set explicitly.
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.
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.
• : Access granted.
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
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
EIO0000002854.06 133
Common Device Editor Dialogs
Element Description
Mapping area
Module-wise Select this option to create a variable for each module, not for
the individual bits.
Naming Rule area
134 EIO0000002854.06
Common Device Editor Dialogs
EIO0000002854.06 135
Common Device Editor Dialogs
Element Description
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
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
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
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.
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
Procedure
To map a device and a function block instance, proceed as follows:
140 EIO0000002854.06
Common Device Editor Dialogs
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.
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.
142 EIO0000002854.06
Common Device Editor Dialogs
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
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
Verification Level
The following verification levels are defined and can be configured via command
line argument:
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
EIO0000002854.06 147
Connecting to the Controller
Step Action
4 Click OK to confirm.
Result: You are requested to enter the new credentials for accessing the controller.
148 EIO0000002854.06
Logoff Current Device User
EIO0000002854.06 149
Security for the Project and the Application
150 EIO0000002854.06
Security for the Project and the Application
EIO0000002854.06 151
Security for the Runtime System / Controller
Encrypting Communication
Overview
Communication with the controller connected in the project should be protected
against unauthorized access.
152 EIO0000002854.06
Security for the Runtime System / Controller
EIO0000002854.06 153
Security for the Runtime System / Controller
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
Step Action
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.
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
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
EIO0000002854.06 159
Program Components
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.
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
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.
2 In the tab Categories of the Input Assistant dialog box, select Programs.
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
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.
EIO0000002854.06 163
Program Components
Function
Overview
A function is a POU which yields exactly one data element (which can consist of
several elements, such as fields or structures) when it is processed. Its call in
textual languages can occur as an operator in expressions.
Adding a Function
To assign the function to an existing application, select the application node in the
Applications tree, click the green plus button, and execute the command POU....
As an alternative, right-click the Application node, and execute the command
Add Object > POU from the contextual menu. To add an application-independent
POU, select the Global node of the Applications tree, and execute the same
commands.
In the Add POU dialog box, select the Function option. Enter a Name (<function
name>) and a Return Data Type (<data type>) for the new function and select the
desired implementation language. To choose the return data type, click the button
... to open the Input Assistant dialog box. Click Open to confirm. The editor view
for the new function opens and you can start editing.
Declaring a Function
Syntax:
FUNCTION <function name> : <data type>
This is followed by the variable declarations of input and function variables.
Assign a result to the function. 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:
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
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.
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
');
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.
Properties, page 169 and interface properties, page 172 each consist of a Set
and/or a Get accessor method.
168 EIO0000002854.06
Program Components
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
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.
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
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
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
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
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.
EIO0000002854.06 175
Program Components
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
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.
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.
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
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
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.
180 EIO0000002854.06
Program Components
EIO0000002854.06 181
Program Components
1 Execute the command View > Online Change Result: The Online Change
Memory Reserve Settings Memory Reserve view opens.
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.
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
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();
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
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
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;
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;
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.
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;
PROGRAM PLC_PRG
VAR
MyfbB: fbB;
END_VAR
Example 2
Function call that needs a reference to its own instance.
FUNCTION funA
VAR_INPUT
pFB: fbA;
END_VAR
...;
FUNCTION_BLOCK fbA
VAR_INPUT
iVarA: INT;
END_VAR
...;
PROGRAM PLC_PRG
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.
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
EIO0000002854.06 191
Program Components
Select the library in the upper part of the Library Manager to get the module tree.
Select Param in order to open the tab Library Parameters showing the
declarations. Select the cell in column Value (editable) and use the empty space
to open an edit field. Enter the desired new value for g_c_Arraysize. It will be
applied to the current, local scope of the library after having closed the edit field.
192 EIO0000002854.06
Program Components
EIO0000002854.06 193
Program Components
NOTE: Only arrays whose bounds are defined by a literal or a constant are
transferred to the remote application. Constant expressions in this case are
not allowed for bounds definition. Example: arrVar : ARRAY[0..g_
iArraySize-1] OF INT ; is not transferred arrVar : ARRAY[0..10] OF
INT ; is transferred
For further information, refer to the Network Communication chapter, page
737.
194 EIO0000002854.06
Program Components
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.
Step 2: Define the network properties of the network variable list (sender):
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.
EIO0000002854.06 195
Program Components
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:
Step 2: View and / or modify the network settings of the network variable list
(receiver):
1 In the Devices tree, right-click the GNVL_Receiver node The Properties - GNVL_Receiver dialog box is displayed.
and select the command Properties....
196 EIO0000002854.06
Program Components
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
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.
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:
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
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.
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
EIO0000002854.06 201
Program Components
Example of a GlobalTextList
Create Global Text List
NOTICE
UNINTENDED MODIFICATION OF IDENTIFIERS
Do not modify the identifiers when editing the exported list.
Failure to follow these instructions can result in equipment damage.
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:
EIO0000002854.06 203
Program Components
Formatting of Texts
The texts can contain formatting definitions (%s,%d,…), which allow to include the
present values of variables in a text. For the possible formatting strings, see the
Visualization part of the EcoStruxure Machine Expert online help.
When using text with formatting strings, the replacement is done in the following
order:
• The actual text string to be used is searched via list name and ID.
• If the text contains formatting definitions, these are replaced by the value of
the respective variable.
204 EIO0000002854.06
Program Components
Image Pool
Overview
Image pools are tables defining the file path, a preview, and a string ID for each
image. By specifying the ID and (for unique accessing) additionally the image file
name, the image can be referenced, for example, when being inserted in a
visualization (configuration of the properties of an image element, refer to Using
Images Which are Managed in Image Pools, 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
Element Description
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.
206 EIO0000002854.06
Program Components
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
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.
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.
EIO0000002854.06 207
Program Components
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.
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
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:
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.
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.
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.
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
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.
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.
EIO0000002854.06 217
Managing Applications
Step Action
1 To connect to the controller, select Online > Login to ’Application[YourApplicationName; Plc Logic]’.
2a
In case, the controller is not in RUN mode, and you want to load a different application than the one currently in the
controller, the following message appears:
Refer to the hazard messages below before you click Yes to download the new application to the controller, or No to cancel
the operation.
2b
In case, the controller is in RUN mode, and you want to load a different application than the one currently in the controller,
the following message appears:
Refer to the build messages below before you click Yes to download the new application to the controller, or No to cancel
the operation.
WARNING
UNINTENDED EQUIPMENT OPERATION
Verify that you have the correct application before confirming the download.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
If you click Yes, the application running in your controller will be overwritten.
218 EIO0000002854.06
Managing Applications
Step Action
1 To connect to the controller, select Online > Login to ’Application[YourApplicationName; Plc Logic]’.
2
In case the application is not yet available on the controller, you are asked to confirm the download. For this purpose, a
dialog box with the following text displays:
Click Yes to download the application to the controller, or No to cancel the operation.
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.
EIO0000002854.06 219
Managing Applications
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.
220 EIO0000002854.06
Managing Applications
EIO0000002854.06 221
Managing Applications
222 EIO0000002854.06
Managing Applications
EIO0000002854.06 223
Managing Applications
224 EIO0000002854.06
Managing Applications
EIO0000002854.06 225
Managing Applications
Running Applications
Running Applications
Introduction
This part defines how to start/stop an application.
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.
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
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.
Stop at breakpoint.
228 EIO0000002854.06
Managing Applications
Symbol Description
EIO0000002854.06 229
Managing Applications
Data Breakpoints
Data breakpoints allow you to stop program execution when the value of a
variable changes.
This function is not available for all supported controllers. Consult the
Programming Guide specific to your controller.
The number of data breakpoints you can define depends on the 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.
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.
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.
Step Action
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
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.
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.
234 EIO0000002854.06
Managing Applications
Step Action
1 Right-click the declaration part and execute the command Refactoring > Reorder
Variables.
Result: The Reorder dialog box opens with a list of VAR_INPUT variables.
2 Drag the invar1 : INT; entry to the position before the invar2. entry.
EIO0000002854.06 235
Managing Applications
Step Action
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.
1 Execute the command Tools > Options.... Result: The Options dialog box
opens.
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.
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.
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.
EIO0000002854.06 237
Managing Applications
Step Action
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
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
242 EIO0000002854.06
FBD/LD/IL Editor
FBD networks
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
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
( 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.
EIO0000002854.06 245
FBD/LD/IL Editor
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:
246 EIO0000002854.06
FBD/LD/IL Editor
LEN
Enter the right parenthesis in SUB 1