R911403764 08 PLC Engineering, ApplicationManual en
R911403764 08 PLC Engineering, ApplicationManual en
R911403764, Edition 08
Copyright
All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the
event of applications for industrial property rights.
Disclaimer
The data specified above only serve to describe the product. As our products are constantly being further devel-
oped, no statements concerning a certain condition or suitability for a certain application can be derived from our
information. The information given does not release the user from the obligation of own judgment and verification.
It must be remembered that our products are subject to a natural process of wear and aging.
f94aabf82401d4b20a347e88332cfb34, 2, en_US
ctrlX PLC Engineering 3 / 1158
Table of contents
1 About this documentation 33
1.1 Licensing notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2 Important directions on use 35
2.1 Intended use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.1.2 Areas of use and application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2 Unintended use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3 Safety instructions 37
4 Introduction 39
5 Installation 41
6 Logging in and logging off to/from the control 43
7 Configuring the PLC Engineering 47
7.1 Setting PLC Engineering Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.2 Customizing the user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.2.1 Customizing Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.2.2 Customizing Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.2.3 Customize Command Icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.2.4 Customizing Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.2.5 Changing the Window Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.2.6 Resizing Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.2.7 Auto-Hiding Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.2.8 Switching Between Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8 Creating and configuring a project 53
8.1 What is a project? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.2 Creating a new project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.2.1 Creating a project on the basis of a template for ctrlX CORE Creating
devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.2.2 Project on basis ctrlX CORE Virtual Creating an axis/kin interface . . 55
8.2.3 Creating a standard project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.2.4 Creating an empty project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8.3 Configuring project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8.3.1 Retrieving and editing project information . . . . . . . . . . . . . . . . . . . . 58
8.3.2 Selecting project settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.3.3 Creating a standard project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.3.4 Adding objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8.3.5 Project on basis ctrlX CORE Virtual Creating an axis/kin interface . . 62
8.3.6 Changing the compiler version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.4 Retrieving and editing project information . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
9 Exporting and importing projects 67
9.1 Basic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.2 Exporting and Importing Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.3 Transferring projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
10 Comparing Projects 71
10.1 Compare project – Basic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
10.2 Open detailed compare view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
10.3 Creating compare views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
11 Protecting and saving the project 75
11.1 Write and access protection – Basic information . . . . . . . . . . . . . . . . . . . . . . . 75
11.2 Project encryption with certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
11.3 User administration and password manager . . . . . . . . . . . . . . . . . . . . . . . . . . 76
11.4 Rights management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
11.5 Project repository – Saving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
11.6 Setting up write protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
11.7 Assigning passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
11.8 Protecting projects using a dongle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
11.9 Setting up the user administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
11.10 Protecting Objects in the Project by Access Rights . . . . . . . . . . . . . . . . . . . . . 81
11.11 Logging in via user account and password manager . . . . . . . . . . . . . . . . . . . . 82
11.12 Encrypting the project with a certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
11.13 Saving the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.14 Saving/sending the project archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
11.15 Linking a project to the source control system . . . . . . . . . . . . . . . . . . . . . . . . 88
12 Logging in and logging off to/from the control 89
13 Connection to the ctrlX real-time data system 93
13.1 Configuring DataLayerOwner nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
13.2 Creating a GVL twin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
13.3 Consistency checks and error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
13.4 PLC program download . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
14 Project synchronization 97
14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
14.2 Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
14.3 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
14.4 Synchronization – Online behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
15 Creating and managing templates 101
15.1 Template – CheckFunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
15.2 Template – Motion interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
15.3 Integrating customized templates in ctrlX PLC Engineering . . . . . . . . . . . . . . 102
16 Localizing Projects 107
17 Configuring the I/O connection 111
17.1 Basic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
17.2 Device tree and device editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
17.3 Mapping the hardware structure in the device tree . . . . . . . . . . . . . . . . . . . . . 115
17.4 Configuring Devices and I/O Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
18 Programming the application 129
18.1 Program application – General information . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
18.2 Designating Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
18.3 Configuring the Memory Reserve for an Online Change . . . . . . . . . . . . . . . . . 129
18.4 Function Block — Calling Functions or Methods with External Implementation 130
31 Security 373
31.1 Security – Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
31.2General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
31.3Security for the development system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
31.4Security for the Runtime System / PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
31.5Security for CODESYS WebVisu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
32 Reference, programming 377
32.1 Programming languages and their editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
32.1.1 Programming languages and their editors – General information . . . 377
32.1.2 Declaration Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
32.1.3 Common Functions in Graphical Editors . . . . . . . . . . . . . . . . . . . . . . 378
32.1.4 Structured text and Extended Structured text (ExST) . . . . . . . . . . . . 379
ST Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
ST editor in online mode . . . . . . . . . . . . . . . . . . . . . . . . . 380
ST expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Assignments (ST) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Instructions (ST) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
32.1.5 Sequence language (AS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
SFC (sequential function chart) editor . . . . . . . . . . . . . . 391
SFC Editor in Online Mode . . . . . . . . . . . . . . . . . . . . . . . 391
Processing Order in SFC . . . . . . . . . . . . . . . . . . . . . . . . . 392
Qualifiers for Actions in SFC . . . . . . . . . . . . . . . . . . . . . . 394
Implicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
SFC Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Library "Analyzation" . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Elements (AS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
32.1.6 Continuous function chart/ladder diagram/instruction list
(FUP/LD/IL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
FBD/LD/IL Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
FBD/LD/IL Editor in Online Mode . . . . . . . . . . . . . . . . . . 414
Modifiers and operators in IL . . . . . . . . . . . . . . . . . . . . . 415
Elements (FUP/LD/IL) . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
32.1.7 Continuous Function Chart (CFC) and page-oriented CFC . . . . . . . . 425
Continuous Function Chart – General information . . . . . 425
Continuous Function Chart – Page-oriented . . . . . . . . . . 425
CFC editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
CFC editor, page-oriented . . . . . . . . . . . . . . . . . . . . . . . . 428
Keyboard Shortcuts in the CFC Editors . . . . . . . . . . . . . 429
CFC Editor in Online Mode . . . . . . . . . . . . . . . . . . . . . . . 430
Elements (CFC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
32.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
32.2.1 Variables – General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
32.2.2 Local variables - VAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
32.2.3 Input Variables - VAR_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
32.2.4 Output Variables - VAR_OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
32.2.5 Input/Output Variable (VAR_IN_OUT) . . . . . . . . . . . . . . . . . . . . . . . . . 439
32.2.6 Global Variables - VAR_GLOBAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
32.11.11
2 Compiler Error C0182 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
32.11.11
3 Compiler Error C0183 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
32.11.11
4 Compiler Error C0185 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
32.11.11
5 Compiler Error C0186 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
32.11.11
6 Compiler Error C0188 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
32.11.11
7 Compiler Error C0189 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
32.11.11
8 Compiler Error C0190 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
32.11.11
9 Compiler Error C0191 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
32.11.12
0 Compiler Error C0195 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
32.11.12
1 Compiler Error C0196 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
32.11.12
2 Compiler Error C0197 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
32.11.12
3 Compiler Error C0198 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
32.11.12
4 Compiler Error C0199 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
32.11.12
5 Compiler Error C0201 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
32.11.12
6 Compiler Error C0203 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
32.11.12
7 Compiler Error C0204 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
32.11.12
8 Compiler Error C0205 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
32.11.12
9 Compiler Error C0206 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
32.11.13
0 Compiler Error C0207 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
32.11.13
1 Compiler Error C0208 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
32.11.13
2 Compiler Error C0209 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
32.11.13
3 Compiler Error C0211 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
32.11.13
4 Compiler Error C0212 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
32.11.13
5 Compiler Error C0215 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
32.11.13
6 Compiler Error C0216 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
32.11.13
7 Compiler Error C0217 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
32.11.13
8 Compiler Error C0218 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
32.11.13
9 Compiler Error C0219 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
32.11.14
0 Compiler Error C0221 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
32.11.14
1 Compiler Error C0222 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
32.11.14
2 Compiler Error C0224 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
32.11.14
3 Compiler Error C0225 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
32.11.14
4 Compiler Error C0227 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
32.11.14
5 Compiler Error C0228 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
32.11.14
6 Compiler Error C0230 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
32.11.14
7 Compiler Error C0232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
32.11.14
8 Compiler Error C0233 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
32.11.14
9 Compiler Error C0234 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
32.11.15
0 Compiler Error C0235 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
32.11.15
1 Compiler Error C0236 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
32.11.15
2 Compiler Error C0237 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
32.11.15
3 Compiler Error C0238 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
32.11.15
4 Compiler Error C0239 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
32.11.15
5 Compiler Error C0240 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
32.11.15
6 Compiler Error C0241 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
32.11.15
7 Compiler Error C0242 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
32.11.15
8 Compiler Error C0243 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
32.11.15
9 Compiler Error C0380 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
32.11.16
0 Compiler Error C0509 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
32.11.16
1 Compiler Error C0511 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
32.11.16
2 Compiler Error C0542 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
32.11.16
3 Compiler Error C0543 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
3 Safety instructions
The Safety instructions contained in the available application documentation
feature specific signal words (DANGER, WARNING, CAUTION or NOTICE) and,
where required, a safety alert symbol (in accordance with ANSI Z535.6-2006).
The signal word is meant to draw the reader's attention to the safety instruc-
tion and identifies the hazard severity.
The safety alert symbol (a triangle with an exclamation point), which precedes
the signal words DANGER, WARNING and CAUTION, is used to alert the reader
to personal injury hazards.
The Safety instructions in this documentation are designed as follows:
Safety instructions
In case of non-compliance with this safety instruction,
DANGER
death or serious injury will occur.
In case of non-compliance with this safety instruction,
WARNING
death or serious injury could occur.
In case of non-compliance with this safety instruction,
CAUTION
minor or moderate injury could occur.
In case of non-compliance with this safety instruction,
NOTICE
property damage could occur.
4 Introduction
ctrlX PLC Engineering is an application program for creating PLC projects for
ctrlX devices.
ctrlX PLC Engineering is intended for use on an Engineering PC and is part of
the ctrlX WORKS installation package, see: ⮫ Installation
The installation and use of ctrlX PLC Engineering is free of charge and does not
require a license.
Introduction
Additionally, ctrlX CORE-specific extensions have been added.
Parts of the following documentation refer to CODESYS products, CODESYS
descriptions and documentations.
Supported functions
Topics Documentation
Project configuration with the help of wiz- ⮫ Chapter 8.2 Creating a new
ards project on page 53
Customization options of the interface ⮫ Configuring the PLC Engineering
Creating professional control applications ⮫ Reference, programming
according to IEC 61131-3 with many
standard functions
● Programming in all IEC 61131-3 lan- ⮫ Programming languages and their
guages editors
● Editors for FBD, LD, IL, ST, AS, CFC
and extended CFC
Input assistance for entering and config- ⮫ Chapter 18.5 Using the input
uring different data. assistance on page 131
● Object-oriented programming ⮫ Object-oriented programming
according to IEC 61131-3rd edition in
all IEC 61131-3 languages
● Inheritance of program modules to sim-
ilar application parts to reduce devel-
opment time and errors
Library concept for easy reuse of applica- ⮫ Using libraries
tion code
Debugging and online features to optimize ⮫ Checking the syntax and ana-
application code and speed up testing and lyzing code
commissioning
Security features to secure the source ⮫ Security
code and the operation of the control
5 Installation
ctrlX PLC Engineering is part of the ctrlX WORKS installation package, which is
available in the ctrlX Store, see:
⮫ ctrlX WORKS download in ctrlX Store
The installation and use of ctrlX PLC Engineering is free of charge and royalty
free. Registration is only required for the download.
For further information on the installation, please refer to ctrlX WORKS Applica-
tion Manual, see: ⮫ Web documentation
Installation
Logoff by exiting
When exiting the Engineering system, a logged in device user is automatically
logged off from the control.
Upon a new login, the login data has to be entered again unless the user has
enabled th option to save the login data, see ⮫ Chapter 33.4.3 Dialog “Login -
[Control IP address]” on page 1037.
Adding menus
1. Choose the command “Tools 🠂 Customize”.
🡆 The “Customize” dialog box opens. The “Menu” tab is visible.
2. Scroll to the end of the menu tree.
3. Select the blank symbol ( ).
4. Click “Add Popup Menu”.
🡆 The “Add Popup Menu” dialog box opens.
5. Type a name for the new menu in the “Default text” field.
If localization is unnecessary, then skip to step 9.
6. Click “Add Language”.
🡆 A drop-down list opens with available languages.
7. Choose the required language.
🡆 The language is added to the list of languages.
8. Click into the “Text” field and type the language-specific text.
9. Click “OK”.
🡆 The new menu is added at the bottom of the menu tree.
10. Change the menu order by clicking “Move up” and “Move down”. Click
“OK” to close the “Customize” dialog box.
The new menu is displayed only when it contains a command.
Adding commands
1. Choose the command “Tools 🠂 Customize”.
🡆 The “Customize” dialog box opens. The “Menu” tab is visible.
2. Expand the branch of the menu where the new command should be
added.
3. Select the blank symbol ( ).
4. Click “Add Command”.
🡆 The “Add Command” opens dialog box.
The dialog box lists all commands grouped by category.
5. Select the command to be added. Click “OK”.
🡆 The new command is added to the menu tree.
6. Change the menu order by clicking “Move up” and “Move down”. Click
“Add separator” to add a border between commands. Click OK to close
the “Customize” dialog box.
🡆 The new command is now available in the menu.
See also
● ⮫ Chapter Dialog 'Customize' - 'Menu' on page 1094
● ⮫ Chapter 7.2.2 Customizing Toolbars on page 48
4. Click “Delete”.
🡆 The toolbar or command is deleted.
5. Click “OK”.
🡆 The dialog box closes and the toolbar or command is removed.
Adding toolbars
1. Choose the command “Tools 🠂 Customize”.
🡆 The “Customize” dialog box opens.
Adding commands
1. Choose the command “Tools 🠂 Customize”.
🡆 The “Customize” dialog box opens.
2. Choose the “Toolbars” tab.
3. Expand the tree of the toolbar where the new command should be added.
4. Select the blank symbol ( ).
5. Click “Add Command”.
🡆 The “Add Command” dialog box opens.
The dialog box lists all commands grouped by category.
6. Select the command to be added. Click “OK”.
🡆 The new command is added to the toolbar tree.
7. Change the toolbar order by clicking “Move up” and “Move down”. Click
“Add separator” to add a border between commands. Click “OK” to close
the “Customize” dialog box.
🡆 The new command is available in the toolbar.
See also
● ⮫ Chapter Dialog 'Customize' - 'Toolbars' on page 1094
● ⮫ Chapter 7.2.1 Customizing Menus on page 47
See also
● ⮫ Chapter 7.2.5 Changing the Window Layout on page 50
● ⮫ Chapter 7.2.7 Auto-Hiding Windows on page 51
● ⮫ Chapter 7.2.8 Switching Between Windows on page 51
Showing windows
1. Click the tab of the hidden window.
2. Clear the check box “Window 🠂 Auto Hide”.
Or click the pin symbol ( ) in the upper right corner of the view.
🡆 The window is permanently shown.
See also
● ⮫ Chapter 7.2.5 Changing the Window Layout on page 50
● ⮫ Chapter 7.2.6 Resizing Windows on page 50
● ⮫ Chapter 7.2.8 Switching Between Windows on page 51
Project properties
Apart from the objects, take the following properties into account:
● In den “Project settings” and “Project information”, the basic configuration
and information about the project is contained.
● Each project contains information which PLC Engineering version has been
used to create the project. When opening the project with a different
version, PLC Engineeringprovides information about potential or required
updates with regard to memory format, device and library versions, etc.
2. In the dialog, select the project properties. The following sections are
available in the dialog:
“Categories” Available Categories:
● “Libraries”:
Category to create a library. A library can be
used in other projects.
● “Projects”:
Category to configure a target device.
“Templates” Select a template for implementation. The tem-
plates depend on the category and provide pre-
configured elements.
“Name” Project name
“Location” Directory in the file system in which the project is
stored
Select the category, the template and the file system directory in which
the project is stored.
Assign a name to the project.
Confirm the dialog with “OK”
🡆 Depending on the selected template, the dialog for more project set-
tings is opened.
Related documentation
● ⮫ Chapter 8.3.4 Adding objects on page 61
● ⮫ Chapter 18.7 Using library function blocks on page 136
8.2.1 Creating a project on the basis of a template for ctrlX CORE Cre-
ating devices
PLC Engineering provides released project templates for ctrlX CORE target
devices.
The following example guides through the different steps to create a new
project for the “ctrlX CORE” target system.
Related documentation
● ⮫ Chapter 8.3.4 Adding objects on page 61
Related documentation
● ⮫ Chapter 17.2 Device tree and device editor on page 111
● ⮫ Chapter 8.3.4 Adding objects on page 61
● ⮫ Chapter 18.7 Using library function blocks on page 136
● ⮫ Chapter 'Project settings' dialog - 'Security' on page 1064
Example
Prerequisite: The following property is defined.
3. In the “Device” field, select the target system from the list.
In the “PLC_PRG in” field, specify the programming language for the POU,
e.g. “structured text (ST)”.
Confirm the dialog with “OK”.
🡆 ctrlX PLC Engineering automatically creates the project with the project
node in the device tree:
3. For example, select the “POU” object and in the subsequent dialog
“Add POU”, select the “Program” type with implementation language
“structured text (ST)” and the "prog“ name.
🡆 After clicking on “Add”, PLC Engineering inserts a program object
“prog” in the device tree below the “Application”.
4. Select an object in the tree and select the “Properties” command in the
context menu.
🡆 The “Properties” dialog is displayed with the object-relevant categories.
If you are using a user management, you could, for example, restrict
access to the object here.
5. Select an entry in the tree below which you want to create a folder to
collect specific objects in it. Note: You cannot structure the arrangement
of device nodes and device objects by creating folders yourself.
6. In the context menu select the command “Add folder” and define a name
for the new folder in the dialog that is displayed. Click on “OK”.
🡆 The folder is displayed in the tree.
7. Select an object in the tree and drag it to another position within the tree
(e.g. to the folder) using the mouse.
8. Do not select an object in the device tree. Position the focus on an
available position in the PLC Engineering interface. Select the command
“Project 🠂 Add object” and then subsequently the “text list” object.
🡆 The “Text list” object is inserted in the “POUs” view!
Also refer to
● ⮫ Chapter 8.2.3 Creating a standard project on page 56
● ⮫ Chapter Command ‘Add Folder’ on page 932
● ⮫ Chapter Command 'Properties' on page 899
Example
Prerequisite: The following property is defined.
Exporting Projects
Prerequisite: A project is opened in PLC Engineering.
1. Click “Project 🠂 Export” or “Project 🠂 Export PLCopenXML”.
2. Select the export objects in the “Export” dialog or “Export PLCopenXML”
dialog.
3. Click on “OK”.
4. Specify the file name and location and click on“Save”.
Importing Projects
Prerequisite: A project is opened in PLC Engineering.
1. Click “Project 🠂 Import” or “Project 🠂 Import PLCopenXML”.
2. Select the import objects in the “Import” dialog or “Import PLCopenXML”
dialog.
🡆 A dialog opens and displays a tree structure of objects that can be
inserted in this position.
3. Select the object in the object tree under which the objects to be
imported are to be inserted.
4. Select the objects and click “OK”.
🡆 The objects are added to the existing object tree.
Also refer to
● ⮫ Chapter Command 'Export' on page 922
● ⮫ Chapter 'Import...’ command on page 922
● ⮫ Chapter Command 'Import PLCopenXML' on page 923
● ⮫ Chapter Command 'Export PLCopenXML' on page 923
● ⮫ Chapter Dialog 'Options' - 'PLCopenXML' on page 1085
Also refer to
10 Comparing Projects
10.1 Compare project – Basic information
You can compare the currently open project with another project – a reference
project. The differences in contents, properties, or access rights are detected
and shown in a comparison view.
With the command “Project 🠂 Compare” opens the “Project Compare” dialog
where you can configure and start the comparison. Subsequently, the result is
displayed in the compare view “Compare view - Differences”, where the objects
are lined up side by side in a tree structure. Objects that indicate differences
Comparing Projects
from the respective reference object are identified by colors and symbols. This
is how to detect whether or not the contents, properties, or access rights are
different.
In case of differences in content, you can additionally open the detailed com-
pare view “Project comparison - <Object name> Differences” to zoom into the
object. In the detail compare view, the source code of the object is compared
to that of the reference object. Identified differences are marked. Previously
opened views are not closed. Besides the project compare view, any number of
compare views can be open and read at the object level.
To resolve the determined differences, decide whether the state from the ref-
erence project should be applied to the current project. Applying from the
current project to the reference project is not possible. Enable the transfer in
the active compare view, for example, different lines or blocks of code using
either the , or the command. These positions are highlighted in yellow.
Make sure that any other open compare views are inactive (write-protected,
read-only). therefore, you can activate differences to be accepted in exactly
one comparison view only. If supported by the editor, you can add a third
compare view. This third view shows the result of the resolution actions for the
differences.
When exiting the active compare view, if you confirm that the differences that
are activated for acceptance are actually accepted into the current project, then
the current project is modified.
In order to exit the project comparison completely, close the project compar-
ison view.
Also refer to
● ⮫ Chapter 'Compare’ command on page 917
3. Click again.
🡆 The code line is marked again as modified.
4. Move the mouse pointer to the code line marked as modified and click
“Accept single”.
🡆 The code line from the reference project is activated for acceptance
into the current project.
5. If available, click on to add a third pane.
🡆 Below the two panes that contrast the code of the current object and
the reference object, a third pane is shown. It shows the result of
the actions you have to make to resolve the differences between the
current object and the reference object. For these actions, additional
buttons are available in the taskbar of the detailed compare view. For
further information, see:
⮫ 'Compare’ command
6. Click on .
🡆 The project compare view of the entire project is displayed. It is write-
protected (read-only) to prevent you from activating differences for
acceptance. The link highlighted in yellow above the tree view also
indicates this.
7. Click on the link “The project compare view is read-only because there are
unconfirmed changes in another view. Click here to switch to the modified
view.”.
🡆 The detailed compare view opens again. The unconfirmed changes are
highlighted in yellow.
8. In the view tab, click and confirm that the changes are to be saved.
🡆 The detail project view is closed and the POU is overwritten. Now it
corresponds to the POU of the reference project. The project view is
active again, so you can continue working in the project comparison.
If you do not click on the link and instead close the editor of the project com-
pare view by clicking on , you can also confirm the transfer of the changes to
the current project. The detailed changes are applied and the project compar-
ison is closed.
Also refer to
● ⮫ 'Compare’ command
● ⮫ Creating compare views
Comparing Projects
appears in the middle column.
7. If PLC Engineering has detected changes in the content for an object that
is included in the current project and in the reference project, this is
indicated by red text. Double-click on the object to switch to the detailed
comparison view of the object.
8. Close the comparison view and select whether or not to save the changes
with“Yes”.
🡆 The changes are implemented in the project.
Also refer to
● ⮫ Chapter 'Compare’ command on page 917
● ⮫ Chapter 10.2 Open detailed compare view on page 71
Related topics
⮫ Chapter 11.3 User administration and password manager on page 76
⮫ Chapter 11.8 Protecting projects using a dongle on page 80
⮫ Chapter 11.7 Assigning passwords on page 79
⮫ Chapter 11.10 Protecting Objects in the Project by Access Rights
on page 81
You can also encrypt a project file or an application for download or online
change directly with a certificate:
● User-independent encryption for the current project is configured in the
“Security” category of the “Project settings” dialog.
● User-independent encryption of the application is configured in the
“Properties” dialog of the application object.
When you encrypt a project, an application, or online
NOTICE
code with a certificate, you will always require the certif-
icate with a private key in order to open the object again.
If the add-on product CODESYS Security Agent is installed, the “Security
screen” view provides an additional “Devices” tab. It allows the configuration of
certificates for encrypted communication with controls.
Certificates, Windows Certificate Store
All available certificates are located in the Windows Certificate Store
(“certmgr”) on your computer. There are two types of keys:
● Certificates with private keys
– for file decryption
– for digital signatures
● Certificates with public keys
– for file encryption
– for verifying digital signatures
Usually, the local Windows Certificate Store is filled with certificates by the
computer's IT administrator. Certificates are either created using special tools
or requested from a trusted certification authority (CA).
If you receive a certificate file that you need to install yourself in the Windows
Certificate Store, then double-click the file in the store directory. Depending
on the type (certificate with private or public key only), the appropriate import
wizard will appear.
Also refer to
● ⮫ Chapter 31.2 General information on page 373
● ⮫ Chapter 11.12 Encrypting the project with a certificate on page 84
Initially, the owner can log in with the user name owner and a blank pass-
word.
You can add further users to the group Owner or remove users from it, but
at least one member must be retained. Like Everyone, you cannot delete
the group Owner and it always possesses all access rights. This prevents
a project from being rendered unusable by denying all access rights to all
groups.
You can rename both the group Owner and the user Owner.
● If the programming system or a project is restarted, no user is initially
Related topics
⮫ Chapter 11.10 Protecting Objects in the Project by Access Rights
on page 81
⮫ Chapter 11.11 Logging in via user account and password manager
on page 82
Related topics
⮫ Chapter ‘Options’ dialog - ‘Load and save' on page 1084
⮫ Chapter 11.13 Saving the project on page 85
⮫ Chapter 11.13 Saving the project on page 85
⮫ Chapter 11.14 Saving/sending the project archive on page 87
⮫ Chapter 11.15 Linking a project to the source control system on page 88
Also refer to
● ⮫ Chapter 11.1 Write and access protection – Basic information on page 75
3. Enter a login name, for example 'Dev1', and a password. Leave the option
“Activated” activated. Click on “OK”.
🡆 Upon the first creation of a group, PLC Engineering now prompts you to
authenticate yourself as authorized for this action.
In this case, enter 'Owner' as the “current user”. Do not enter a
“password”, just click “OK”.
The user Dev1 appears in the list and is automatically a member of
the group 'Everyone'.
Prerequisites
● A project is opened
● You have the necessary access data for the project
Also refer to
● ⮫ Chapter 11.3 User administration and password manager on page 76
● ⮫ Chapter Command 'User management' – 'Log in User' on page 924
● ⮫ Chapter 11.9 Setting up the user administration on page 80
Also refer to
● ⮫ Chapter 11.2 Project encryption with certificates on page 75
● ⮫ Chapter 33.4.19 'Certificate selection' dialog on page 1046
● ⮫ Chapter 'Project settings' dialog - 'Security' on page 1064
● ⮫ Chapter 18.13 Encrypting the application on page 153
1. Click the line in the top right corner of the main window that indicates the
write protection.
🡆 The current options with which you can still save the project appear in
a selection menu.
2. Select one of the options offered and perform any necessary actions.
3. Select the command “File 🠂 Save” or “File 🠂 Save as...”
🡆 The project can be saved.
Also refer to
● ⮫ Chapter ‘Options’ dialog - ‘Load and save' on page 1084
7. Click on “Comment”.
🡆 The dialog “Comment” opens.
8. Enter a comment and click “OK”.
9. Click the “Save” button.
10. Select a location and a file name and click “Save”.
🡆 The project archive is saved in the file directory.
Also refer to
● ⮫ Chapter Command 'Save project' on page 870
● ⮫ Chapter Command 'Save project as' on page 871
Logoff by exiting
When exiting the Engineering system, a logged in device user is automatically
logged off from the control.
Upon a new login, the login data has to be entered again unless the user has
enabled th option to save the login data, see ⮫ Chapter 33.4.3 Dialog “Login -
[Control IP address]” on page 1037.
Functional principle
The integration of PLC-specific data as real-time data into the PLC project
is realized via Global Variable Lists (GVL), which contain the data to be
exchanged. From these GVLs, GVL twins are created as I/O nodes below a
so-called DataLayerOwner node is created. The data from the GVL is mapped
as I/O variable.
● If PLC data is to be made known on the Data Layer real-time, the data is to
be mapped to output values (%Q)
● If data from the Data Layer real-time is to be processed in the PLC, they have
to be mapped as input values (%I).
1. Open the context menu of the node “DataLayer_Realtime” in the ctrlX PLC
Engineering device tree
2. Click on “Add 🠂 PLC real-time data”
🡆 The DataLayerOwner node is created below the “DataLayer_Realtime”
node
Since a GVL twin can be either of type output or of type input, this should be
taken into account when assigning the GVL name, since this name is also used
in the Data Layer and the OPC UA Pub/Sub browser, for example for the type
output, the name GVL_RtOut
There are two ways to generate GVL twins. Either via the GVL node below
the application, or via the DataLayerOwner node, in each case via the context
menus in the device tree.
Result
Under the DataLayerOwner node, the GVL twin is created and the source GVL
is assigned the attribute:'Plc2RealtimeDatalayer'
The attribute has a function and determines the direction of data exchange:
● 'Plc2RealtimeDatalayer' = data is transferred from the PLC to the Data
Layer real-time
● 'RealtimeDatalayer2Plc' = data is transferred from the Data Layerreal-
time to the PLC
Note
● If a GVL with a GVL twin attribute is imported, the corresponding GVL twin
is automatically created in the project
● If no variable of the GVL is used in the PLC program, no data exchange takes
place via the I/O exchange
Example
Note
In the [‚info‘] node, information about the GVL twin is displayed. Here under
[type], the value ‚input‘ is specified as from the point of view of the Data Layer
the data originates from outside. For the PLC, it is an ‚output‘.
Before downloading, a final consistency check is performed, which issues a
message in case of discrepancies.
14 Project synchronization
14.1 Introduction
The project synchronization is exclusively available for the ctrlX CORE or ctrlX
CORE Virtual target systems.
The “project synchronization” provides the option to save a project in the file
system of the engineering PC and to synchronize it with the project on the
control by means of definable synchronization settings. The project can also
be opened and edited without being connected to the control. As soon as the
Project synchronization
connection to the control is established again, the two project repositories are
compared.
Another advantage of “project synchronization” is that the project can be read
directly from the control. This is a useful function, in particular if you are not
the owner of the project sources. As the project is downloaded to the control,
you can connect to the current project on the control, edit the project and
upload it to the control again.
If the “project synchronization” is not configured, no project data is stored
on the control but only the data required for the control flow is stored. This
data can be viewed by opening “Manage app data” in the web interface of the
control. The app data is stored in the configuration data in the plc\run… folder.
Status display
In the ctrlX PLC Engineering status bar (lower right), the status of the project
synchronization is visualized via the following icons:
Icon Meaning
The synchronization is enabled
The synchronization is not enabled
Double-click on the icon to open the project synchronization setting dialog.
The project synchronization for the respective project can be enabled or disa-
bled at any time. If the synchronization is deselected and confirmed with “OK”,
a prompt is shown if the current synchronization data should be retained on
the control or if they are to be removed from the control repository.
14.2 Activation
The “Project synchronization” option can be activated via the “Project
synchronization” dialog, see:
⮫ Dialog “Project synchronization”
14.3 Options
In the “Project synchronization” dialog, options to store and synchronize
project data are available. The dialog is divided into the following sections:
Project storage on PC
“Name” Project name
“Location” Filing of the project data in the file system of the Engi-
neering PC
Button Action
“Overwrite project on ctrlX” The project data currently loaded on the con-
trol are overwritten by the project data on the
Engineering PC.
“Apply ctrlX IP address” The IP address of the control is applied to the
project data on the Engineering PC.
“Open project comparison” Via the project comparison, the contents of the
project data can be compared and matched,
see: ⮫ Comparing Projects
“Cancel synchronization” The synchronization is canceled.
Project synchronization
The project data is not synchronized between
the Engineering PC and the control.
The existing data is retained.
“Continue whithout change” The suggested conflict solution is dismissed
(e.g. applying the IP address of the control).
The project data is not synchronized between
the Engineering PC and the control.
The existing data is retained.
If the addressed control is (temporarily) not available, the project data is saved
in a reserved cache ⮫ Chapter Dialog “Project synchronization” on page 1075
in case of enabled synchronization and is updated on the control once the
communication is available again.
If it is detected that the IP address in the project does not match the IP
address of the control when opening a synchronized project, the project
transfer is stopped and the dialog “Project synchronization” is started. Use the
dialog buttons to select whether to apply the IP address of the ctrlX device to
the project or whether to continue without change.
The individual function groups can be selected in the corresponding dialog. The
functions are created below the application in the “CheckFunctions” folder in
the project tree. Function groups already inserted in the project tree are grayed
out in the template dialog.
When creating a new ctrlX CORE project, all function groups are inserted in the
project by default.
Adding check functions results in an application down-
NOTICE
load. An online change is not possible anymore.
16 Localizing Projects
You can display your project in different languages when you create and link
localization files. The localization files correspond to those of the GNU gettext
system. The format of the localization template files is *.pot (Portable Object
Template), from which localization files *.po (Portable Object) are generated
after translation.
The project can be localized in different languages. However, editing is possible
only in the original version.
You configure which categories of text information are localized in the project.
Then you export these texts into a translation template. This template is a file
Localizing Projects
in *.pot format (example: project_1.pot). You produce localization files in
the format *.po (example: de.po, en.po, or es.po), either automatically with
a corresponding external translation tool or manually with a neutral text editor.
You can import the *.po files back into PLC Engineering and use them for
localization.
The commands for using project localization are located in the menu “Project
🠂 Project localization”.
See also
● ⮫ Chapter Command 'Project Localization' - 'Create Localization Template'
on page 928
Example
#: D:\Projects\p1.project\Project_Settings:1
msgid "Project Settings"
msgstr ""
Line 1: Position information displayed as source code reference. Displayed
only if this has been configured when generating the translation file.
Line 2: Untranslated text as entry msgid (example: msgid "Project
settings").
Line 3: Placeholder for the translation: msgstr "". Between the single
straight quotation marks, the translation in the *.po file must be inserted
in the respective language.
Example
"Language: de\n"
#: Content:Names
#: D:\projects\p1.project\Project_Settings:1
msgid "Project Settings"
msgstr "Projekteinstellungen"
Localizing Projects
🡆 Click “Project 🠂 Project Localization 🠂 Toggle Localization” to toggle
the localization between the default localization and original version.
By default, this command is also available with the button on the
toolbar.
See also
● ⮫ Chapter Command 'Project Localization' - 'Manage Localizations'
on page 928
● ⮫ Chapter Command 'Project Localization' - 'Toggle Localization'
on page 927
Device tree
In the “Devices” view, also called "device tree", you can compile applications
based on target devices. Here, it is possible to map the hardware of one or
more control devices or field bus systems, configure the communication with it
and assign several applications to each of them.
The root node of the device tree is a symbolic node entry: “<project name>”
Below that, mount the device objects for one or more control devices, also
called "target systems". Each device object represents a specific hardware
such as a control device, field bus, bus coupler, drive, I/O module or monitor.
When inserting the object, an insertion wizard that always offers the matching
devices from your local device repository provides help.
If you are already connected to a control network, scan the hardware for
existing devices and add them to the current configuration in the device tree.
Certain rules (see below) apply to creating device objects in the device tree,
i.e. the mapping of the hardware environment to be controlled. The hierarchical
arrangement of application objects and device objects defines the scopes of
other objects.
There are programmable devices and purely parameterizable devices. The
device type defines the possible insertion position in the device tree and the
selection of objects you can insert below the device. Programmable devices
automatically receive an additional purely organizational node “PLC logic”
below the device object. Under this node, insert the objects that are needed
for programming the device, i.e. the application(s) and, for example, GVLs or
text lists.
Each device is defined by its device description and has to be installed on
the local system to be available for insertion in the device tree. The device
description file defines the properties of a device with regard to configurability,
programmability and possible connections to other devices.
The “POUs” view contains objects that you can use across the project. Pro-
gramming objects that are only intended for a specific application have to be
inserted below the application object in the “Devices” view (device tree).
Note the possibility of running the active application on a "simulation device",
which is automatically available by default within the programming system.
Currently, this simulation option exists for the target system ctrlX CORE. In sim-
ulation mode, you can also test the online behavior of the application without
hardware. Activate the simulation with the command “Online 🠂 Simulation”.
Furthermore, note the possibility of using the “Online configuration mode”
command for an application to connect to the device without having to load
this application there first. This is useful for initial commissioning of an I/O
system as it allows you to address and test the I/Os in the controller configura-
tion before you have programmed and loaded the actual application.
Example of a device tree:
Device editor
In the Device Editor tabs, select the settings for communication between PLC
Engineering and the target device. Double-click on the device object in the
device tree to open the editor. The editor contains generic and device-specific
tabs. The editor name corresponds to the device name.
Also refer to
● ⮫ Objects
● ⮫ Chapter 17.4 Configuring Devices and I/O Mapping on page 118
In the “Devices” view (device tree), you map the hardware that you control with
your application. To do this, insert device objects representing real devices
in the network into this tree structure until the hierarchy reflects the control
network. Device objects are for example a PLC object, a field bus object or a
logical device.
5. Select one of the provided control devices, for example “CAN bus”, and
click on the “Attach device” button.
🡆 The “CAN bus” object is displayed in the device tree under Device
“(ctrlX CORE”). The “Attach device” dialog remains open. If you now
select the new “CAN bus entry”, it automatically provides the objects
that can be inserted under it.
6. For example, select the“CANopen” device from the “Local Device” cate-
gory.
🡆 “CANopen_Device” is inserted indented under the“CAN bus” in the
device tree.
7. Do you want to mount a different device than the devices that has already
been mounted? Select the device entry and choose “Update device” from
the context menu.
🡆 The “Update device” dialog is displayed. It corresponds to the “Attach
device” dialog used previously. You can select another device, which is
inserted in the tree instead of the previous tree.
Also refer to
● ⮫ Chapter Command 'Attach device' on page 913
● ⮫ Chapter Command 'Update device' on page 914
quently, you can read the parameters of the real application on the control
without the need of a standard login and - in case of missing translation infor-
mation - a new download of this application. You can see the parameters in
the “Configuration” tab of the device editor. The parameter mode prevents
accidental changing of data on the control, the applications are not changed.
Writing the parameters is only possible if the driver supports it.
Set up parameter mode for reading the device parameters:
Prerequisite: The target device already contains one or more applications. The
target device supports the extended online configuration mode. You opened
the project that contains these applications. You want to view the device
parameters without having to log in to the control. The connection to the PLC
of the hardware is configured in the communication settings. The PLC is run-
ning.
1. Select the PLC object in the device tree.
2. Select the “Online configuration operation” command in the context
menu.
🡆 PLC Engineering connects to the control, the PLC object in the tree is
highlighted in green. The “Select configuration mode” dialog displays
the application(s) on the PLC.
3. Select the desired application and click on the “Parameter mode” button.
🡆 PLC Engineering checks whether the application in the project matches
the application on the PLC.
4. If PLC Engineering does not report an error regarding the match of the
applications, open the “Configuration” tab of the PLC Device Editor.
🡆 You can read the device parameters.
Also refer to
● ⮫ Chapter Command 'Online Config Mode' on page 930
● ⮫ Chapter 33.1.19 'Parameters' tab on page 760
3. Observe the “Variable” column with the display of the device input chan-
nels and device output channels , which can still be sorted by organ-
izational nodes , depending on the device. We assume that there is
a device input of the type BYTE. It is displayed with its individual bit
addresses (bit channels) below the BYTE node.
4. Note: When mapping structured variables, the editor prevents you from
entering both the structure variable (example: %QB0) and individual struc-
ture elements (example: %QB0.1 and QB0.2). Therefore, if there is a main
entry with a subtree of bit channel entries in the mapping table, then the
6. Delete the variable assignment again. Click the root of the channel,
the BYTE node. Use the Input Assistant again to select the variable
Application.PLC_PRG.byte_gotodevice.
🡆 The variable is inserted, all bit addresses of the main channel are
struck through and you should not additionally occupy them.
See also
● ⮫ Chapter 33.1.9 Tab '<Device name> I/O mapping' on page 739
Here you will map a device output channel to a function block. In this example,
the block scales the channel output value.
Requirement: A device with a digital output that supports FB mapping is linked
in the project. There is a function block “Scale_Output_Int” with the following
implementation. The attributes of the function block itself and before the
output parameter with which the channel output is processed are important.
{attribute 'io_function_block'}
FUNCTION_BLOCK Scale_Output_Int
VAR_INPUT
machine configuration and to retain the address value even if the layout of
the modules changes. By default, a change of the layout leads to an automatic
adaptation of the address values.
Requirement: Your project has I/O mapping. See the corresponding sections of
the help page above.
1. To open the device editor, double-click the device object in the device
tree, and then the “<device name> I/O Mapping” tab.
2. Click in the mapping table on a channel entry in the “Address” column in
order to open an input field. This is only possible for the 'root' address of
a channel, not for a particular one of its subelements.
Therefore, change the top address entry of a channel in the table, for
example from QB0 to QB1. Exit the input field.
🡆 The address value is changed. The symbol is displayed before the
address. It indicates that the address is fixed. The addresses of the
subelements of the channel are also changed accordingly. If you now
change the position of the device object inside other device objects
with input/output channels in the device tree, PLC Engineering does
not adapt these addresses to the new order as would be the case
without fixing.
3. In order to undo the manual change or fixing, open the input field of the
address value again, delete the address entry and press the Enter key.
🡆 PLC Engineering resets the address and the subsequent addresses
concerned to the values they had before the change and removes the
symbol .
See also
● ⮫ Chapter 33.1.9 Tab '<Device name> I/O mapping' on page 739
● ⮫ Chapter 32.4.13 Addresses on page 552
1. Open the “I/O Mapping” tab of the PLC in the device editor. To open the
editor, double-click the device object in the device tree.
🡆 The mapping table now additionally contains the “Current Value” and
“New Value” columns.
If a structure variable is mapped to the 'root' element of an address1,
PLC Engineering does not display a value in this line in online mode.
If, for example, a DWORD variable is mapped to the address, however,
the respective values are monitored both in the 'root' line and in the
indented bit-channel lines below it.
2. Now select one of the control objects in the device tree and select the
“Edit I/O Mapping” command once again in the context menu.
🡆 The “Edit I/O Mapping” dialog now shows only the I/O table for the I/O
mapping configurations found in and under the selected object.
3. Set a desired “Filter” in the bar above the table or enter a variable name
in the “Search for variable” field in order to see the use of this variable in
the mapping.
🡆 The method of working in this window is the same as that described for
the “<device name> I/O Mapping” tab.
See also
● ⮫ Chapter Command 'Settings of Memory Reserve for Online Change'
on page 911
● ⮫ Chapter "Online change" command on page 943
Input assistant
The dialog provides all programming elements that you can insert in the current
cursor position. Open the “Input assistance” dialog by clicking on “Edit 🠂 Input
assistance” or by pressing [F2].
Also refer to
● ⮫ Dialog 'Input Assistant' - Tab 'Categories' on page 892
“List components”
The "List components" function is an input tool in textual editors to help you
input valid identifiers. Enable the function as follows: Select the command
“Tools 🠂 Options”, and then the “Intelligent coding”category. Enable the option
“List components after a dot (.) was entered”.
● If you enter only a dot . instead of a global variable, a selection list with all
available global variables is displayed. By double-clicking on a variable of the
selection list or pressing the [Enter] key, insert the selected variable after
the dot.
● If you enter a dot instead of a global variable or after a function module
instance variable or a structure variable, PLC Engineering offers all global
variables, all input and output variables of the function module or all struc-
ture components in a selection list accordingly.
By double-clicking on a variable of the selection list or pressing the [Enter]
key, insert the selected variable after the dot.
Note: If you also want to retain the local variables of function block
instances, also enable the option “Show all variables of an instance in the
input help” in the PLC Engineering options for intelligent coding.
● If a component access (with dot) has already been made for a selection list,
the last selected entry is preselected for the next component access.
● When entering any string and then press [Ctrl] + [Space], a selection list
with all available POUs and global variables is displayed. The first element
in this list that starts with the sequence of characters is selected by default
and you can insert it by double-clicking it or by pressing [Enter].
Matches with the entered string are highlighted in yellow in the selection
list.
When the entered string is changed, the displayed selection list is updated.
● In the ST editor you can filter the displayed selection list by area of validity:
Depending on the displayed drop-down list, it can be switched between the
following drop-down lists using the [right arrow] and [left arrow] keys:
– “All items”
– “Keywords”
– “Global declarations”
– “Local declarations”
● PLC Engineering displays a tooltip if you type an opening parenthesis for a
POU parameter when calling a function block, a method, or a function. This
tooltip includes information about the parameters as they are declared in
the POU. The tooltip remains open until you click to close it or you change
the focus away from the current view. If you accidentally close the tooltip,
you can open it again with [Ctrl] + [Shift] + [Spacebar].
You can use the pragma attribute 'hide' for excluding variables from the "List
components" feature.
Examples
Typing structure variables:
list
Calling a function block:
Examples
Example Short Form Resulting declaration
1 A A: BOOL;
2 A B I 2 A, B: INT := 2;
3 ST S 2; A string ST:STRING(2); (* A string *)
4 X %MD12 R 5 Real Number X AT %MD12: REAL := 5.0;(*
Real Number *)
5 B ! B: BOOL;
Also refer to
● ⮫ Programming the application
Examples
{warning 'This is not allowed'}
{attribute 'Test':='TestValue1;
TestValue2;
TestValue3'}
In the “Properties” dialog, “Compile” category, you can specify defines that can
be queried in pragmas.
Scope:
Depending on the type and content of a pragma, a pragma acts on the fol-
lowing:
● the following declarations
● exactly to the following instruction
● on all subsequent instructions until it is canceled again with an appropriate
pragma
● on all subsequent statements until the same pragma is executed with dif-
ferent parameters, or the end of the code is reached. 'Code' in this context
means: Declaration part, implementation portion, global variable list, type
declaration. Thus, a pragma that stands alone in the first line of the declara-
tion part and is not superseded or overridden by another pragma affects the
entire object.
Also refer to
● ⮫ Chapter 18.16.4 Using the 'Declare variable' dialog on page 165
● ⮫ Chapter 32.6.2 Message Pragmas on page 596
● ⮫ Chapter 32.6.3 Conditional pragmas on page 597
Example
Contents of the file Text_lists_exported
GlobalTextList
● PLC Engineering does not create new text list entries for an unknown ID.
● PLC Engineering ignores changes that affect the ID or the source text.
● PLC Engineering accepts changes in the translations.
TextList
● For a new ID, PLC Engineering supplements the corresponding text list with
a text list entry.
● For an existing ID that does not agree in the source text, the source text of
the text list is overwritten with the source text of the file.
Example
Contents of the file Text_lists_corrected.csv
See also
● ⮫ Chapter Command 'Import/Export Text Lists' on page 1022
3. In the “Choose file to compare or to import” input field, click for more
( ) and select the directory and file name of the comparison file
(example: Text_lists_corrected.csv).
4. For “Choose export file”, click and select the directory and file that
contains the comparison result.
5. Select the “Export only text differences” option.
6. Click “OK” to close the dialog.
🡆 PLC Engineering reads the import file and compares the text list entries
that have the same ID. If they do not agree, then PLC Engineering
writes the text list entries of the text list to the export file.
For the global text list, PLC Engineering compares the translations of
the same source texts. If they do not agree, then PLC Engineering
writes the text list entries to the export file.
See also
● ⮫ Chapter Command 'Add Language' on page 1021
● ⮫ Chapter Command 'Import/Export Text Lists' on page 1022
● ⮫ Chapter Command 'Remove Language' on page 1023
● ⮫ Chapter 33.2.24 Object 'Text List' on page 788
Removing the global text list and creating current IDs again
Requirement: A project is open with a visualization. The “GlobalTextList” object
contains the texts that are defined in the project visualizations.
1. Right-click the “GlobalTextList” object in the POUs tree and select the
“Delete” command.
🡆 The object is removed.
2. Open a visualization.
3. Click “Visualization 🠂 Create Global Text List”.
🡆 In the POU view, a new “GlobalTextList” object is created. The global
text list contains the static text from the existing project visualizations.
Example
The global text list contains the following source texts:
GlobalTextList Counter: %i
GlobalTextList Counter: %i
GlobalTextList Information A
GlobalTextList Information a
GlobalTextList Information Aa
GlobalTextList Switch
The replacement file contains the following replacements:
6. Double-click in the blank line at the end of the table below “Default” and
type in more text list entries.
See also
● ⮫ Chapter 33.2.24 Object 'Text List' on page 788
Please note the following when the ID of an image file appears in several image
pools.
● Search order: If you selected an image managed in “GlobalImagePool”, then
you do not have to enter the name of the image pool. The search order for
image files is as follows:
– 1. GlobalImagePool
– 2. Image pools assigned to the currently active application
– 3. Image pools next to the GlobalImagePool in the POU window
– 4. Image pools in libraries
See also
● linktarget doesn't exist but @y.link.required='true'
● ⮫ Chapter Object 'C Implemented Library' on page 819
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
4. If you double-click the new C code file ( ) in the device tree, then it
opens in the editor for modification.
Converting C code files into IEC objects for use as programming objects in
applications
Requirement: A project is open that includes a C code module and C
code files. For example, the C code file contains the following C code: int
adder(int a, int b);
1. Click a C code file with the file extension *.h. In this example, it is
test.h.
2. Click “Build 🠂 C-Integration 🠂 Create IEC Interface”.
🡆 The dialog “Create C Interface” opens and lists the file test.h and its
function adder (int, int). Both are activated for the import.
3. Click “Import”.
4. PLC Engineering generates the “adder (FUN)” function and inserts it as an
object in the “IEC Interface” folder in the device tree.
5. When you double-click the “adder (FUN)” object, it opens in the editor.
🡆 It contains the following declaration part:
6. You can now call the adder function in the implementation part of a POU
(example: adder (diVar1, diVar2);).
Creating C stubs
Requirement: A project is open that includes a C code module. A POU is
added to the C code module and this POU has implemented code.
In the device tree, select the POU below the C code module and click
“C-Integration 🠂 Create Stub Implementation in C”.
🡆 PLC Engineering creates the objects “iec_external.c” and
“iec_external.h” and adds them to the “Extensions” folder in the device
tree.
In the message view (“C Code module” category), you will find a mes-
sage that an m4 file has been successfully created.
When you click “Create Stub Implementation in C”, the application
is compiled automatically. If errors occur in the process, then these
NOTICE The *.dll file must contain the title of the library
project in its name. For example, if the library project is named XYlib, then
the “Object file” must be called: <Name>_XYlib.dll.
7. In the “Device” window, select a device for assignment of the “Object
file”.
8. Click “Select Device”.
🡆 PLC Engineering displays the created device file assignment in the
editor on the tab “Compiled Components”.
9. Save the library project.
See also
● ⮫ Chapter Object 'C Implemented Library' on page 819
18.12 Refactoring
In general, refactoring is a technique for improving the design of existing soft-
ware code without changing the way it functions.
In PLC Engineering, refactoring provides functions for renaming objects and
variables and updating referenced pins. You can display all occurrences of
renamed objects and variables and then rename them all at once or individu-
ally. In “Tools 🠂 Options”, you can also configure where PLC Engineering will
prompt you for refactoring.
Please note that you can also remove variables with refactoring.
VAR_INPUT
invar2 : INT;
invar1 : INT;
in : DUT;
bvar : BOOL;
invar3 : INT;
END_VAR
1. Right-click in this declaration block to access the context menu.
2. Click “Refactoring 🠂 Reorder Variables”.
🡆 The “Reorder” dialog opens with a list of VAR_INPUT variables.
3. Drag the “invar1 : INT;” entry to the position before the “invar2.” entry.
🡆 The invar1 declaration is now at the top position.
4. Click “OK” to close the dialog.
🡆 The “Refactoring” dialog opens. The affected locations are marked in
yellow (see figure above).
5. Click “OK” to accept the new order for the function block.
See also
● ⮫ Chapter Command 'Refactoring' - 'Rename <...>' on page 894
● ⮫ Chapter Command 'Refactoring' - 'Update Referenced Pins' on page 895
● ⮫ Chapter Command 'Refactoring' - 'Add Variable' on page 895
● ⮫ Chapter Command 'Refactoring' - 'Remove <variable>' on page 896
Encrypting the download, the online change and the boot application
Prerequisite: The add-on product CODESYS Security Agent is installed.
The “Security Screen” view provides an additional tab: “Devices”. It allows the
configuration of certificates for encrypted communication with controls. In this
case, refer to the CODESYS Security Agent help.
Option:
If CODESYS Security Agent is not available, you can proceed as follows via the
PLC shell of the device editor:
To use certificates from the control for download, online change, and boot
application encryption, these certificates first have to be generated on the con-
trol, loaded from the control, and installed in the Windows Certificate Store.
Prerequisite: You are connected to the control
1. Double-click on the control in the device tree to open the device editor
and select the“PLC shell” tab.
🡆 The tab is displayed with an empty display window. Below you will find
an input line for a command
2. Type a ? in the input line and press [Enter].
🡆 All commands are listed in the display window.
3. Enter the following command in the input line: cert-getapplist
🡆 All used certificates are listed with information about components and
availability with certificates.
4. If there is no certificate for the CmpApp component, enter the cert-
genselfsigned <Number of the Component in the applist> com-
mand.
5. Select the “Log” tab and click the refresh button .
🡆 It displays whether the certificate was successfully generated.
6. Enter cert-getcertlist and press [Enter].
🡆 The individual certificates that can be used for encryption are listed.
For the next step, the information Number: and Key usage(s) are
important.
Number: Enter the number specified as a parameter in the next step
Key usage(s): Data Encipherment means that it is a certificate of
control for download, online change and boot application.
7. Export the desired certificate with the command cert-export own
0 and press [Enter]. 0 is the Number of the certificate with Key
usage(s):Data encryption.
🡆 The display shows that the certificate has been exported to a cert
folder.
8. Select the “Files” tab of the device editor.
9. In the right dialog section “Runtime”, click on the refresh button .
🡆 The list of the files and directories are updated.
10. In the list, open the “cert” folder and subsequently the “export” subfolder.
11. In the left half of the “Host” dialog, open the directory where the certifi-
cate is to be loaded from the control.
12. In the right half of the dialog, select the certificate you have exported and
click on .
🡆 The certificate is copied to the selected folder.
13. Use your file Explorer, go to the folder where the certificate was copied to
and double-click on the certificate.
🡆 The “Certificate” dialog is displayed and provides information about
this certificate.
14. In the “General” tab, click on the “Install certificate” button.
🡆 The “Certificate import wizard” starts.
15. In the “Certificate import wizard”, in the “Certificate store ” dialog, select
“Save all certificates to the following store ” and select the “Control
certificates” folder.
🡆 The control certificate is imported into the “controller certificates”
folder in the Windows Certificate Store and is now available to encrypt
the download, online change, and boot application.
16. Open the “Security screen” by double-clicking on the in the status bar.
17. If you want to always encrypt the downloads, online changes, and
boot applications, enable the “Enforce encryption of downloads, online
changes, and boot applications” option in the “Security level” section of
the “Users” tab.
18. Open the “Project” tab and double-click on the application in the
“Encryption of boot application, download and online change” section.
🡆 The properties dialog of the application is displayed.
19. Select the “Encryption” tab and select from the drop-down list“with
Encryption technique” “Encryption with certificates” and click on .
Delete the certificate for encrypting the boot application, the download and
online change
Prerequisite: The add-on product CODESYS Security Agent is installed. A certif-
icate with the information "Encrypted application" is already installed on your
computer.
1. In the “Security screen” view, “Project” tab, double-click on the entry for
the application in the lower part of the window.
🡆 The “Properties” dialog, “Encryption” tab for the application is opened.
2. Select “encryption technique” “encryption with certificates”. In the
“Certificates” box, click on .
3. In the “Certificate selection” dialog, delete the certificate as described
above.
4. Exit the “Certificate selection” dialog with “OK”.
🡆 The certificate is no longer displayed in the “Properties ” dialog.
Also refer to
● Help for the additional product CODESYS Security Agent
● ⮫ Chapter Command 'Security Screen' on page 908
Convert and Reverse methods for use as function blocks. Locations where
you access a variable, you can link the variable to a conversion rule. The input
assistant provides conversion rules in the “Function Blocks” and “Instance
Calls” categories. After execution, the result is a converted value according to
the conversion rule.
In a visualization, an IEC variable that is configured in an element property can
also be linked to a conversion rules.
Example
Requirement: The conversion rule is Conv_XtoY.
ST call
PROGRAM A_PRG
VAR
rA : REAL;
rConvertedA : REAL;
rReverseToA : REAL;
END_VAR
rConvertedA := Conv_XtoY.Convert(rA);
rReverseToA := Conv_XtoY.Reverse(rConvertedA);
CFC call
In the CFC editor, define the instance name of the conversion rule via the
block. Select the method in the block.
See also
● ⮫ Chapter 33.2.27 Object 'Unit Conversion' on page 803
● ⮫ Chapter 18.5 Using the input assistance on page 131
Syntax
( <pragma> )*
<scope> ( <type qualifier> )?
<identifier> (AT <address> )? : <data type> ( := <initial
value> )? ;
END_VAR
Declaration Also refer to
● ⮫ Chapter 18.16.3 Using
the Declaration Editor
Example
GVL
{attribute 'qualified_only'}
{attribute 'linkalways'}
VAR_GLOBAL CONSTANT
g_ciMAX_A : INT := 100;
g_ciSPECIAL : INT := g_ciMAX_A - 10;
END_VAR
GVL_CONFIG
METH_Last := iLast;
iLast := iVar;
FUNCTION_BLOCK FB_DoIt
VAR_INPUT
wInput AT %IW0 : WORD; (* Input variable *)
END_VAR
VAR_OUTPUT
wOutput AT %QW0 : WORD; (* Output variable *)
END_VAR
VAR_IN_OUT
aData_A : ARRAY[0..1] OF DATA_A; // Formal variable
END_VAR
VAR_EXTERNAL
GVL.g_ciMAX_A : INT; // Declared in object GVL
END_VAR
VAR_STAT
iNumberFBCalls : INT;
END_VAR
VAR
iCounter: INT;
xLocInput AT %I* : BOOL := TRUE; // VAR_CONFIG
END_VAR
iNumberFBCalls := iNumberFBCalls + 1;
PLC_PRG (PRG)
PROGRAM PLC_PRG
VAR
iLoop: INT;
iTest: INT;
fbDoItNow : FB_DoIt;
iTest_200: INT;
iTest := GVL.g_ciMAX_A;
iTest_200 := 2 * GVL.g_ciMAX_A;
fbDoItNow(aData_A := aData_Now);
FOR iLoop := 0 TO GVL.g_ciSPECIAL DO
;
END_FOR
Examples
VAR
var1:INT := 12; //
initialization value 12
x : INT := 13 + 8; //
initalization value defined by an expression of constants
y : INT := x + fun(4); //
initialization value defined by an expression,
// that
contains a function call; notice the order!
Also refer to
● ⮫ Chapter 32.5.18 Data Type 'ARRAY' on page 569
● ⮫ Declaration and initialization of structure variables on page 584
● ⮫ Chapter Attribute 'global_init_slot' on page 618
See also
● ⮫ Declaration editor in online mode on page 377
● ⮫ Chapter Command 'AutoDeclare' on page 889
● ⮫ Chapter 18.16.4 Using the 'Declare variable' dialog on page 165
● ⮫ Chapter “Edit declaration header” command on page 1012
● ⮫ Dialog 'Input Assistant' - Tab 'Categories' on page 892
10. Select the line of the array element whose initialization value you wish to
modify. Example: Select array component [1, 1, 1].
11. Enter the desired initialization value in the input field below the list and
click button “Use value on selected lines” (example: value 4).
🡆 PLC Engineering displays the changed initialization value of the
selected line.
12. Click “OK”.
🡆 In the “Initialization value” field of the “Declare Variable” dialog, PLC
Engineering displays the initialization values of the array (example:{4,
See also
● ⮫ Chapter Command 'AutoDeclare' on page 889
● ⮫ Chapter 32.5.18 Data Type 'ARRAY' on page 569
2. In the “POUs” view, select the uppermost node with the project name and
select the context menu command “Add Object 🠂 Global Variable List”.
🡆 PLC Engineering inserts the “GVL” in the “POUs” view and opens it in
the editor.
3. Select the menu command “Edit 🠂 Auto Declare”.
🡆 The dialog box “Auto Declare” opens.
4. In the selection list “Scope”, select the entry “VAR_GLOBAL”.
5. In the field “Name”, enter a name for the global variable.
6. Select a data type from the selection list “Type”.
7. If your variable is to have an initialization value other than the standard
initialization value, enter it in the column “Initialization”.
8. Activate one of the “Flags” if necessary.
9. Confirm your entries by clicking on the button “OK”.
🡆 PLC Engineering inserts the declared variable in the GVL.
The global variable is now available in the entire project.
See also
● ⮫ Chapter Command 'AutoDeclare' on page 889
Sample application
(* task-local GVL, object name: "Tasklocals" *)
VAR_GLOBAL
g_diaData : ARRAY [0..99] OF DINT;
END_VAR
PROGRAM ReadData
VAR
diIndex : DINT;
PROGRAM WriteData
VAR
diIndex : DINT;
diCounter : DINT;
END_VAR
diCounter := diCounter + 1;
FOR diCounter := 0 TO 99 DO
Tasklocals.g_diaData[diIndex] := diCounter;
END_FOR
Best practice
Task-local variables are designed for the use case "Single writer - multiple
readers". When you implement a code that is called by different tasks, using
task-local variables is a significant advantage. For example, this is the case for
the sample application appTasklocal as described above when it is extended
by multiple reading tasks that all access the same array and use the same
functions.
Task-local variables are especially useful on multicore systems. On these sys-
tems, you cannot synchronize tasks by priority. Then other synchronization
mechanisms become necessary.
Do not use task-local variables when a reading task always has to work on
the newest copy of the variable. Task-local variables are not suitable for this
purpose.
A similar issue is the "Producer - Consumer" dilemma. This happens when a
task produces data and another task processes the data. Choose another type
of synchronization for this configuration. For example, the producer could use a
flag to notify that a new date exists. Then the consumer can use a second flag
to notify that it has processed its data and is waiting for new input. In this way,
both can work on the same data. This removes the overhead for cyclic copying
of data, and the consumer does not lose any data generated by the producer.
See also
● ⮫ Chapter Command 'AutoDeclare' on page 889
● ⮫ Chapter 18.16.6 Declaring Global Variables on page 167
● ⮫ Chapter 33.2.16 Object 'GVL' - Global Variable List (task-local)
on page 778
Programming block
When creating a programming block, you decide in which implementation lan-
guage you want to program. In addition to the IEC languages, CFC is also
available.
Programming editor
A programming block is opened for editing in the corresponding programming
language editor when double-clicking on the object in the device tree or POUs
tree. The function block is either displayed in the textual ST editor or in one of
the graphical editors for FBD/LD/IL, SFC or CFC. Each editor consists of two
windows: In the upper window you make the declarations, depending on the
setting in textual or tabular form. In the lower window, insert the implementa-
tion code. You can configure the representation and behavior of each editor
across the project in the associated tab of the PLC Engineering options.
Note the possibility to open a programming block even while the application is
online in the offline state of the editor.
Also refer to
● ⮫ Programming languages and their editors
● ⮫ Command 'Edit Object (Offline)'
18.17.2 FBD/LD/IL
FBD/LD/IL – General information
A combined editor enables programming in the languages FBD (function block
diagram), LD (ladder diagram) and IL (instruction list).
The basic unit of the FBD and LD programming is a network. Each network
contains a structure that can represent the following: A logical or arithmetic
expression, the call of a programming function block (function, function block,
program etc.), a jump or a return instruction. IL actually does not require any
networks. However, in PLC Engineering an IL program also consists of at least
one network to support conversion to FBD or LD. Thus, also divide an IL pro-
gram into useful networks.
Also refer to
● ⮫ Chapter FBD/LD/IL Editor on page 410
Here, function blocks are used which are known from Boolean algebra. Func-
tion blocks and variables are linked with connecting lines. The signal flow runs
from left to right in the network. The signal flow in the editor runs from top to
bottom, starting with network 1.
Example
CFC is also a programming language based on the principle of FBD, but with
the following differences:
− The CFC editor is not network-oriented.
− You can freely place the elements in the CFC editor.
− Direct insertion of feedbacks is possible.
− The processing order is determined by a list of currently inserted elements,
which you can change.
Also refer to
● ⮫ Chapter Programming in a function block diagram (FBD) on page 174
● ⮫ Chapter 33.3.1 Menu commands – General information on page 868 (Com-
mands)
● ⮫ Chapter 18.1 Program application – General information on page 129
Programming a network
1. Click inside the automatically inserted empty network in the implementa-
tion part.
🡆 The network is given a yellow background and the area at the left-hand
side with the network number is given a red background.
2. Open the context menu with the right mouse button.
🡆 Among other things, you get the insert commands for the elements that
can be inserted at this point.
3. Insert the elements required for your programming using the menu com-
mands or by dragging in the elements from the toolbox.
Also refer to
● ⮫ Chapter FBD/LD/IL Editor on page 410
Example
2. Click on the “Contact” element, drag it into your network and release the
mouse button at the insertion position “Start here”.
🡆 The contact is added on the left in the network directly against the
vertical line.
3. Click on ??? and enter the identifier of a boolean variable. The input
assistant is also available to you for this.
4. Click on the category “Function Blocks” in the view “ToolBox” and drag
the function block “TON” onto an insertion position on the connecting line
to the right of the inserted contact.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter Closed Branch on page 421
● ⮫ Chapter LD Element 'Contact' on page 423
Each instruction is based primarily on the loading of values into the accumu-
lator (LD instruction). After that the corresponding operation is executed with
the parameter from the accumulator. The result of the operation is written
again into the accumulator, from where you should store it purposefully with
the help of an ST instruction.
The instruction list supports comparison operators (EQ, GT, LT, GE, LE, NE)
and jumps for programming of conditional executions or loops. Jumps can be
unconditional (JMP) or conditional (JMPC / JMPCN). In the case of conditional
jumps, a check is performed as to whether the value in the accumulator is TRUE
or FALSE.
Example
Also refer to
● ⮫ Chapter Programming in Instruction List (IL) on page 178
● ⮫ Chapter Modifiers and operators in IL on page 415
● ⮫ Chapter 33.3.1 Menu commands – General information on page 868
3. Replace the strings ??? with the variable name and the values or variables
for the inputs/outputs of the function block.
4. As an alternative to inserting the function block via the input assistant,
you can directly enter the call in the editor as shown in the picture at step
4.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter Modifiers and operators in IL on page 415
You can graphically program a system by means of a POU in CFC. You insert
elements and position them freely. You insert connections and wire the ele-
ments to a network so that a well-structured function block diagram is created.
You can also insert feedback. You can read function block diagrams like an
circuit diagram or a block diagram.
The execution sequence of a function block diagram is data flow-based. In
addition, a programming block can process several data flows. Then the data
flows do not have any common data. In the editor, multiple networks do not
have any connections to each other.
On the other hand, POUs in FBD, LD, or IL have a network-based execution
order.
Also refer to
● ⮫ Chapter CFC editor on page 425
● ⮫ Chapter CFC editor, page-oriented on page 428
● ⮫ Chapter 33.3.1 Menu commands – General information on page 868
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
Data flow
The chronological sequence of which data is read or written when and how
in which programming objects is generally referred to as data flow. A program-
ming function block can process any number of data flows, which can also be
executed independently of each other.
PROGRAM PrgPositiveFeedback
VAR
iResult: INT;
END_VAR
Also refer to
● ⮫ CFC editor
● ⮫ CFC editor, page-oriented
● ⮫ Menu commands
● ⮫ Dialog 'Properties' - 'CFC Execution Order'
Calling instances
1. Create a new project using the default template and enter, for example,
the name First.
🡆 The First.project is created.
2. Extend the application with the function block FB_DOIt in the implemen-
tation language “ST” with inputs and outputs.
🡆
FUNCTION_BLOCK FB_DoIt
VAR_INPUT
iAlfa : INT;
iBravo: INT;
sCharlie : STRING := 'Charlie';
xItem : BOOL;
END_VAR
VAR_OUTPUT
iResult : INT;
sResult : STRING;
xResult : BOOL;
END_VAR
VAR
END_VAR
fbDoIt_1 : FB_DoIt;
fbDoIt_2 : FB_DoIt;
iOut : INT;
sOut: STRING;
xOut: BOOL;
END_VAR
5. Drag an element “function block” from the “Tools” view into the editor.
6. Click on the ??? field and enter ADD.
🡆 The function block type is ADD. The function block acts as an adder.
7. Click the line number 3 in the declaration editor.
🡆 The declaration line of iCounter is selected.
8. Click in the selection and drag the selected variable into the implementa-
tion and focus an input of the ADD function block.
🡆 An input was created, declared and connected to the block.
9. Click again in the selection and drag the variable to the output of the ADD
function block.
🡆 An output was created, declared and connected to the function block.
10. From the “Tools” view, drag an “input” element into the implementation.
Click on the ??? field and enter 1.
11. Connect input 1 to an input at the ADD function block.
🡆 A network is programmed. During runtime, the network counts the bus
cycles and stores the result in iCounter.
14. Drag the instance fbDoIt_2 into the editor. Interconnect the instances
with each other and with inputs and outputs.
🡆 Example:
PROGRAM PrgFirstInSt
VAR
iCounter: INT;
fbDoIt_1 : FB_DoIt;
fbDoIt_2 : FB_DoIt;
iOut : INT;
sOut: STRING;
xOut: BOOL;
END_VAR
iCounter := iCounter + 1;
fbDoIt_1(iAlfa := 16, iBravo := 32, sCharlie := 'First',
xItem := TRUE, iDelta := 2, iResult => fbDoIt_2.iAlfa,
xResult => fbDoIt_2.xItem);
fbDoIt_2(iBravo := fbDoIt_1.iResult, sCharlie :=
'Second', iDelta := 2, iResult => iOut , sResult=> sOut,
xResult => xOut);
🡆 The connecting line was changed manually and is now blocked for
autorouting. This is indicated by a lock symbol at the end of the con-
nection.
5. Select the connecting line and choose the command “CFC 🠂 Routing
🠂 Create control point”
🡆 A control point is created on the connecting line. The connecting line is
fixed at the control point.
Optionally, you can drag a control point from the “Tools” view onto a
line.
Also refer to
● ⮫ Chapter 32.1.3 Common Functions in Graphical Editors on page 378
● ⮫ Chapter CFC editor on page 425
● ⮫ Chapter CFC editor, page-oriented on page 428
● ⮫ Programming languages and their editors
Also refer to
● ⮫ Chapter ExST Assignment 'R=' on page 383
● ⮫ Chapter ExST Assignment 'S=' on page 382
● ⮫ Chapter ExST - Assignment as expression on page 383
Programming in SFC
Creating a POU in SFC
1. Select an application in the device tree.
2. Click “Project 🠂 Add Object 🠂 POU”.
🡆 The “Add POU” dialog opens.
3. Specify a name and select the “Sequential Function Chart (SFC)” imple-
mentation language.
Click “Add”.
🡆 PLC Engineering adds the POU to the device tree and opens it in the
editor.
Adding a step-transition
1. Select the transition after the initial step.
🡆 The transition is marked in red.
2. Click “SFC 🠂 Insert Step-Transition After”.
🡆 PLC Engineering inserts the “Step0” step and the “Trans0” transition.
3. Select the “Trans0” transition and click “SFC 🠂 Insert Step-Transition”.
🡆 PLC Engineering inserts the “Trans1” transition and the “Step1” step
before the “Trans0” transition.
You can also drag the “Step” and “Transition” elements into the diagram from
the “Toolbox” view.
See also
● ⮫ Chapter SFC Elements 'Step' and 'Transition' on page 400
● ⮫ Chapter Command 'Insert Step-Transition' on page 978
● ⮫ Chapter Command 'Insert Step-Transition After' on page 979
You can define the exit action in the properties of the step in “Exit action”.
Other actions can also be selected there.
See also
● ⮫ Chapter Command 'Add Exit Action' on page 980
● ⮫ 2. Step actions on page 403
Adding an action
1. Double-click the “Step0” step.
🡆 By default, you are prompted to select the duplication mode for the
step actions of the step. See above for adding an entry action. The
“Add Action” dialog opens.
2. Type in the name "Step0_active" and select the “Structured Text (ST)”
implementation language. Click “Add”.
🡆 PLC Engineering inserts the “Step0_active” action below the POU in the
device tree and opens the action in the editor.
In the Step0_active step action, you program statements to be exe-
cuted as long as the step is active.
3. Close the editor of Step0_active.
🡆 The “Step0” step is now marked with a black triangle in the upper right
corner.
You can define the action in the properties of the step in “Step action”. Other
actions can also be selected there.
See also
● ⮫ 2. Step actions on page 403
Adding a jump
1. Select the “Step2” step.
2. Click “SFC 🠂 Insert Jump After”.
🡆 PLC Engineering inserts the “Step” jump after the “Step2” step.
Adding a macro
1. Select the “Step1” step.
2. Click “SFC 🠂 Insert Macro After”.
🡆 PLC Engineering inserts the “Macro0” macro after the “Step1” step.
3. Double-click the “Macro0” element.
🡆 The macro opens in the implementation section of the editor. The name
"Macro0" is displayed in the caption.
4. Click “SFC 🠂 Insert Step-Transition”.
🡆 PLC Engineering inserts a step-transition combination.
5. Click “SFC 🠂 Zoom out of Macro”.
🡆 The implementation section returns to the main diagram.
See also
● ⮫ Chapter SFC Element 'Macro' on page 407
● ⮫ Chapter Command 'Insert Macro' on page 983
● ⮫ Chapter Command 'Insert Macro After' on page 984
Adding an association
1. Select the “Step2” step.
2. Click “SFC 🠂 Insert Action Association”.
🡆 PLC Engineering inserts an association to the right of the “Step2” step.
3. Click in the left field of the association to select the qualifier.
🡆 You can enter the qualifier manually or use the Input Assistant .
Select "P".
See also
● ⮫ 1. IEC actions on page 403
● ⮫ Chapter Qualifiers for Actions in SFC on page 394
● ⮫ Chapter Command 'Insert Action Association' on page 982
● ⮫ Chapter Command 'Insert Action Association After' on page 983
See also
● ⮫ Chapter SFC (sequential function chart) editor on page 391
Example
Define two local I/O variables: the input variable xLocIn and the output vari-
able xLocOut.
FUNCTION_BLOCK locio
VAR
xLocIn AT %I*: BOOL := TRUE;
xLocOut AT %Q*: BOOL;
END_VAR
Example
The locio function block in the example above is used in a program as fol-
lows:
PROGRAM PLC_PRG
VAR
locioVar1: locio;
locioVar2: locio;
END_VAR
A correct variables configuration in a global variable list could then look like
this:
VAR_CONFIG
PLC_PRG.locioVar1.xLocIn AT %IX1.0 : BOOL;
PLC_PRG.locioVar1.xLocOut AT %QX0.0 : BOOL;
PLC_PRG.locioVar2.xLocIn AT %IX1.0 : BOOL;
PLC_PRG.locioVar2.xLocOut AT %QX0.3 : BOOL;
END_VAR
See also
● ⮫ Chapter 32.2.11 Configuration Variables - VAR_CONFIG on page 446
● ⮫ Chapter 18.18.3 AT Declaration on page 200
● ⮫ Chapter 32.4.13 Addresses on page 552
18.18.3 AT Declaration
In the variables declaration, the code AT assigns a project variable to a specific
input address, output address, or memory address of the PLC that is config-
ured in the device tree. You can also define the assignment of variables to an
address in the “I/O Mapping” dialog of the device in the PLC configuration.
Syntax
Example
PROGRAM PLC_PRG
VAR
xVar AT %QW0 : BOOL;
END_VAR
xVar := TRUE;
When the variable xVar is written, the output memory range from QX0.0 to
QX0.7 is affected.
See also
● ⮫ Chapter 18.18.2 Variables Configuration - VAR_CONFIG on page 198
● ⮫ Chapter 32.2.11 Configuration Variables - VAR_CONFIG on page 446
● ⮫ Chapter 32.4.13 Addresses on page 552
Deactivating lines of code in the implementations with pragmas from the static
analysis
By means of the pragma {analysis ...}, you can mark code so that the
specified rules are not checked. As a result, the marked lines of code are not
subjected to static analysis. The marked code is ignored during the check.
Syntax:
{analysis <sign><rule number>|,<other combinations of signs and
rules, comma-separated>}
-<rule number>: Deactivate the rule SA<rule number>.
-<rule number>: Activate the rule SA<rule number>.
Excluding implementation code
Requirement: Rules are activated in the “Project Settings” dialog.
1. Add the pragma {analysis -<number>} above the line of code that con-
tains code not to be checked first of all. For example, for the rule SA0024
🡆 The line of code is the first line of the code snippet that is not checked
with rule 24.
2. Add the pragma {analysis -<number>} below the line of code that con-
tains code not to be checked first of all. For example, for the rule SA0024
🡆 The line of code above is the last line of the code snippet that is not
checked with rule 24.
{analysis -24}
nTest := 99;
iVar := INT#2;
{analysis +24}
The rule “SA0024: Untyped literals only” is deactivated for two lines. An error
is not issued although the code does not correct to: nTest := DINT#99;
However, you cannot deactivate the rule SA0004: “Multiple Write Access on
Output” with a pragma.
Example
See also
● ⮫ Chapter Dialog 'Project Settings' - 'Static Analysis Light' on page 1066
1. Specify a string in the field next to the name, for example the identifier
of the variable for which you want to find the occurrence location in the
project. Example: "iCounter".
For the text search, you can use the asterisk "*" (for any number of
characters) or the question mark "?" (for an exact number of characters)
combined with a substring of a variable identifier.
Use the percent sign "%" to search for IEC addresses. Examples: "%MW8",
"%M*".
2. Click the button to start a text search in the project.
Examples
The following block includes a function block definition (fbinst), a program
call (prog_y()), and a function block call (fbinst.out):
VAR fbinst:fb1; ivar:INT; END_VAR prog_y(); ivar:=prog_y.y;
res1:=fbinst.out;
If the cursor is located at prog_y, then the command opens the program
prog_y in the editor.
If the cursor is located at fbinst, then this command focuses in the declara-
tion section at line fbinst:fb1;
If you set the cursor at out, then this command opens the function block fb1
in its editor.
See also
● ⮫ Chapter Command 'Go to Definition' on page 893
1. Double-click the task object below “Task Configuration” in the device tree.
🡆 The “Configuration” tab of the task object opens.
2. In the “Type” dropdown list., click “Cyclic”.
🡆 The “Interval (e.g. t#200ms)” input field appears.
3. Enter t#300ms in the “Interval (e.g. t#200ms)” input field.
4. Click “Add Call”.
🡆 The Input Assistant opens.
5. In “Input Assistant 🠂 Categories” -> “Programs”, click the desired POU
Periodic jitter
The periodic jitter (Jper) is the deviation of the cycle time of a task (Tper) from
the desired task cycle time (T0).
Jper =Tper -T0
The desired (ideal) cycle timeT0 is specified as an “interval” in the task configu-
ration.
The current value, as well as the maximum and minimum value of the peri-
odic jitter is visualized at runtime in the “Monitoring” tab of the “Task
configuration”.
If the sum of all negative Jper values and the sum of all positive Jpervalues do not
balance, a drift occurs.
Latency
Latency is the delay between calling a task (invocation) and the actual start of
the task execution (release).
Release jitter
The release jitterJr is the difference between the maximum and minimum
latency (L) ever occurred.
Jr =Lmax -Lmin
Also refer to
● ⮫ Chapter 33.2.31 "Task configuration" object on page 860
● ⮫ Chapter “Configuration” tab on page 865
● ⮫ Chapter Tab 'Monitor' on page 863
18.21.4 Multicore
Object: “Task configuration”
More and more of today's controllers have processors with multiple CPU cores.
In order to take advantage of this for the IEC program and improve perform-
ance, PLC Engineering provides options for distributing the IEC tasks over
these CPU cores. In addition, the IEC program is to be divided into several
tasks.
There are two basic different strategies in PLC Engineering for distributing IEC
tasks over CPU cores:
● Fixed linking of an IEC task to a CPU core:
The task is always executed on this specific CPU core. In this case, multiple
tasks can also be bundled to one and the same CPU core if the IEC program
is not yet able to be executed on multiple CPU cores at the same time.
● The IEC task is executed on all CPU cores:
The operating system takes control of distributing the task on the CPU
cores.
When the IEC tasks are distributed over CPU cores,
NOTICE
some changes result in the behavior in the IEC program,
which have to be considered:
− The processing of IEC tasks by priority is no longer a
given. They are processed by priority only if the tasks
are bundled together to one CPU core.
− The cycle consistency of the data in the IEC task with
the highest priority is no longer a given. Therefore,
the data has to be copied locally at the beginning of
the IEC task cycle if the values should not change
during the cycle.
− For consistent counters (incrementer, decre-
menter), the atomic external library function
SysCpuAtomicAdd() should always be used (for
more details, see SysCpuHandling.library).
Data consistency
NOTICE
− Bit accesses (data type BIT) are not processed con-
sistently (atomically) in the IEC program on multi-
core CPUs. For this we recommend that you use the
external library function SysCpuTestAndSetBit()
(for more details, see SysCpuHandling.library).
− Simple data types up to 32-bit width (BYTE, WORD/
INT, DWORD/DINT,. ..) are processed consistently
(atomically) in the IEC program even on multi-core
CPUs
− 64-bit data types (LINT, LWORD, LREAL) are proc-
essed consistently (atomically) in the IEC program
only on 64-bit systems and multi-core systems. You
do not have to take any provisions
− To access complex data types (STRINGs, FBs,
STRUCTs, ARRAYs), you have to make arrangements
yourself for the synchronization/consistency.
− In the task configuration, determine in the “Variable
use” tab whether a variable in an IEC task has read or
write access
− A so-called memory reordering effect can occur
on multi-core systems. For more information, see
__MemoryBarrier() IEC-Operator.
Also refer to
● ⮫ Chapter 33.1.17 “PLC shell” tab on page 756
● ⮫ Chapter 'Variable use' tab on page 864
● ⮫ Chapter 32.3.13 Multicore operators on page 458
Display the Processor Load in the Trace for each Processor Core
for downloading".
Also refer to
● ⮫ Mechanism for downloading on page 215
● ⮫ Chapter "Online change" command on page 943
● ⮫ Chapter Command 'Reset Origin' on page 949
● ⮫ Chapter Command 'Reset Cold' on page 948
● ⮫ Chapter Command 'Load' on page 942
Behavior
Value retained for
It is good practice to clear any gaps in the variable list after a while (command
“Reorder List and Clear Gaps”). After cleaning, however, the list no longer
matches the list on the controller and you have triggered an initialization of all
persistent variables. The persistence of all variables is lost.
For versions before V3.5 SP1, changes in the persistence editor always lead to
reinitialization.
See also
● ⮫ Chapter 32.2.13 Persistent Variable - PERSISTENT on page 447
● ⮫ Chapter Command 'Add all instance paths' on page 1014
Declaration
To declare a retain variable, add the RETAIN keyword to a variable declaration.
Behavior
Value retained for
● Uncontrolled exit
● Call of the “Reset Warm” command
Reinitialization for
● Repeated download of the application
● Call of the “Reset Cold” command (in contrast to persistent variables)
● Call of the “Reset Origin” command
When you restart an application, its variables are usually initialized with an
explicitly preset initial value or with a default value. Variables marked with the
RETAIN keyword are managed in a separate memory area depending on the
target system and retain their value. Then the variables are protected from
power failure, for example. This means that you can apply retain variables to a
parts counter in a production line so that you can continue counting even after
a power failure.
See also
● ⮫ Chapter 32.2.14 Retain variable - RETAIN on page 449
Declaration
A recipe definition consists of a set of variables with values and is created and
edited in the “Recipe Manager” object and saved to a file.
Functionality
● You can include a variable in multiple recipes, each with different values.
● In online mode, you can read in the actual values of the variables from the
controller and save them as recipe values (specified value).
● You can use the Recipe Management library to programmatically implement
the creation and editing of a recipe.
● You can save and backup a recipe as a recipe file.
See also
● ⮫ Chapter 22.2 Changing values with recipes on page 287
● ⮫ Chapter "Save current values to recipe" command on page 1013
● ⮫ Chapter "Rearrange list and clean gaps” command on page 1013
● ⮫ Chapter "Restore values from recipe” command on page 1014
● ⮫ Chapter 33.2.22 Object 'Recipe Manager' on page 784
● ⮫ Chapter 33.2.23 Object 'Recipe Definition' on page 787
See also
● ⮫ Chapter 32.2.13 Persistent Variable - PERSISTENT on page 447
● ⮫ Chapter 32.2.14 Retain variable - RETAIN on page 449
● ⮫ Chapter 33.2.17 Object 'Persistent variable list' on page 778
● ⮫ Chapter Command 'Add all instance paths' on page 1014
8. Click “Add”.
🡆 PLC Engineering adds the POU_Ex function block to the device tree and
opens the editor. The first line contains the text:
FUNCTION_BLOCK POU_Ex EXTENDS POU_1
The function block POU_Ex extends the basic function block POU_1.
See also
● ⮫ Chapter 18.24.3 Implementing Interfaces on page 221
● ⮫ Chapter 18.24.4 Extending Interfaces on page 223
● ⮫ Chapter 32.2.15 SUPER on page 450
● ⮫ Chapter 32.2.16 THIS on page 451
● ⮫ Chapter ‘Function block’ object on page 823
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Property' on page 839
● ⮫ Chapter Object 'Action' on page 843
● ⮫ Chapter Object 'Transition' on page 845
Examples
The I1 interface contains the GetName method.
METHOD GetName : STRING
The functions blocks A and B implements the interface I1:
FUNCTION_BLOCK A IMPLEMENTS I1
FUNCTION_BLOCK B IMPLEMENTS I1
For this reason, both function blocks must include a method named GetName
and the return type STRING. Otherwise the compiler reports an error.
A function includes the declaration of a variable of interface I1 type.
FUNCTION DeliverName : STRING
VAR_INPUT
l_i : I1;
END_VAR
See also
● ⮫ Chapter ‘Function block’ object on page 823
Example
Overloading methods
The function blocks fub1 and fub2 extend the function block fubbase and
implement the interface interface1. The methods method1 and method2
exist.
PROGRAM PLC_PRG
VAR_INPUT
b : BOOL;
IF b THEN
instRef REF= inst1; (* reference to fub1 *)
pInst := ADR(instBase);
ELSE
instRef REF= inst2; (* reference to fub2 *)
pInst := ADR(inst1);
END_IF
pInst^.method1(); (* If b is TRUE, fubbase.method1
will be called, otherwise fub1.method1 is called *)
instRef.method1(); (* If b ist TRUE, fub1.method1 will
be called, otherwise fub2.method1 is called*)
On the assumption that fubbase in the above example contains two methods
method1 and method2, it overwrites fub1 method2, but not method1. The
call of method1 takes place as follows:
pInst^.method1();
If b is TRUE, then PLC Engineering calls fubbase.method1. If not, then
fub1.method1 is called.
Additional outputs
In accordance with the IEC 61131-3 standard, methods can have additional out-
puts declared, like normal functions. With the method call, you assign variables
to the additional outputs.
Detailed information about this can be found in the topic “Function”.
Syntax for the call:
Example
Declaration
Example
VAR_INPUT
pTaskInfo : POINTER TO DWORD;
pApplicationInfo: POINTER TO _IMPLICIT_APPLICATION_INFO;
END_VAR
See also
● ⮫ Chapter Attribute 'estimated-stack-usage' on page 614
● ⮫ Chapter 32.2.16 THIS on page 451
● ⮫ Chapter 32.2.15 SUPER on page 450
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Property' on page 839
Example
proj_xy.PLC1.application.xml
You can also generate the symbol file with the “Generate Code” command. This
is very useful when downloading to the PLC is not possible.
The variables that you export as symbols can be bundled in the symbol config-
uration editor or defined in the variables declaration using the {attribute
'symbol'} pragma. Another option is using the element in the SFC editor,
where you can define the implicitly generated element variables that should be
exported to the symbol configuration.
The name of the symbol is generated in the symbol configuration in the fol-
lowing syntax: <application name>.<POU name>.<variable name>. When
accessing the variable, you must always provide the complete symbol name in
this syntax.
Example
MyApplication.PLC_PRG.a or MyApplication.SymFB.a
As a rule, read-only access applies to symbols for input addresses and for vari-
ables that are mapped to input channels. Write access is possible for testing
purposes in simulation mode only.
The symbol file is downloaded together with the application to the PLC.
Depending on the device description, this file can be generated as an addi-
tional (child) application. This application is then listed on the “Application”
tab of the device editor. Syntax: <application name>._symbols. The symbol
application is regarded as a "normal" application with respect to the maximum
number of applications on the PLC.
If your controller has a user management, then you can assign different access
rights to a symbol to the individual user groups (clients). To do this, place the
same symbol in different symbol sets and allow the individual user groups (cli-
ents) either to access a symbol set or not. An on-site operator or an operating
data record, for example, receives more information and access to the same
symbols as remote maintenance.
See also
● ⮫ Chapter 33.2.25 "Symbol configuration” object on page 788
● ⮫ Chapter Attribute 'symbol' on page 646
● ⮫ Chapter Effects of Pragmas on Symbols on page 648
● ⮫ Chapter SFC Element Properties on page 408
● ⮫ Chapter 33.1.11 Tab 'Applications' on page 748
● ⮫ Chapter Command 'Simulation on page 953
Creating symbol sets with different access rights for different control clients
A symbol set is a defined set of symbols. If supported by the target device,
you can combine different symbol sets from the symbols of the application
in the symbol configuration editor. The information about the symbol sets is
downloaded to the controller. Then you can define the user group that has
access to each symbol set. Rights are assigned on the “Symbol Rights” tab of
the device editor.
As a result, symbol sets allow different client-specific access rights to a symbol
in the controller.
You can download changes to a symbol set definition to the controller in an
online change. When the application is deleted on the controller, the symbol
sets are also deleted. When building the application, you can create and save a
symbol file in XML format for each symbol set.
In the following section, you will see an example of steps for creating symbol
sets and the assignment of rights on the controller:
Requirements: The application has a defined symbol configuration in the
project. The “Enable symbol sets” option is enabled in the settings of the
symbol configuration. The controller has a user management. For the example
here, there should be a user group that has the necessary rights for the serv-
icing of the plant. By default, this type of user group, named "Service", is
already created.
1. Define the connection to the controller in the “Communication Settings”
of the device editor.
2. Click the button in the editor of the “Symbol Configuration” in order to
create a new symbol set. Specify a name of the group ("Startup") in the
“Add New Symbol Set” dialog.
3. Click the button (“Build”) in the toolbar of the dialog in order to display
all symbols available in the project. Select the users who should belong to
the group. Save the project.
4. Click the “Configure Symbol Rights” button.
🡆 The “Symbol Rights” tab of the device editor opens.
5. Click the button (“Synchronization”) to synchronize the display of the
symbol sets with the device.
🡆 If you have not enabled user management on the controller yet, then
you will see a dialog in the “Users and Groups” tab prompting you to do
it.
6. Click “OK” in the dialog and click the “Users and Groups” tab.
Click the button (“Synchronization”). Click “Yes” to confirm that user
management should be enabled.
🡆 The “Device User Logon” dialog opens.
7. Sign in. If this is the first login, use "Administrator" as the user name and
password, and then set a new password in the following dialog.
🡆 After the dialog is closed, the configurations of the device user man-
agement are displayed in the “Users and Groups” and “Access Rights”
tabs.
8. Log in to the controller by clicking “Online 🠂 Login”. Click “Yes” to the
prompt of whether or not the application should be downloaded to the
device.
9. After successful login, click the “Symbol Rights” tab. Click the
“Synchronization” button.
🡆 In “Symbol Sets”, you see all sets that have currently been downloaded
for the application (for this example, at least "startup"). In “Rights”, a
table shows the user groups that are created in the user management
of the controller. In the example, we assume that the default groups
“Administrator” and “Service” have been created. When a symbol set
is selected on the left, you see on the right the access rights of the
individual user groups to this symbol set ( : access granted; : access
not granted). The possible type of access is already defined for each
symbol in the symbol configuration (read, write, execute).
10. On the left, select the “Startup” symbol set and double-click the preset
minus sign for "Administrator" as well as for "Service".
🡆 The symbol changes into a plus sign. The "Administrator" and "Service"
now have access to the symbols in the “Startup” symbol set.
See also
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
network assigned by the parent. In turn, the subnet index is placed in front
of the node address of the parent. The length of the subnet index (in bits) is
thereby determined by the device. The length of the local address, conversely,
is determined by the type of network. A node without a main network is a top
level node with address 0. A node with a main network that contains no parent
is likewise a top level node. It is given the local address of the main network.
See an example of a control network here:
For a node to know its own address it must either know the address of its
parent node or know that it is a top level node. For this purpose the node
dispatches a message during the bootup to all network devices for address
determination. As long as it receives no response to this message, the node
considers itself to be a top level node, but continues to search for a possible
parent. A parent node responds by announcing its address. The node will
thus independently complete its address and will announce it to the subnets.
An address determination can be accomplished during the bootup or at the
request of the PC used for programming.
See also
Node addresses
The node address indicates the absolute address of a node within a control
network and is therefore unique within the whole "network tree". The address
is composed of up to 15 address components, each of which occupies 2
bytes. The lower a node is located within the network hierarchy, the longer
its address.
The complete node address consists of the partial addresses of all preceding
nodes and the partial address of the node itself. Each partial address consists
of one or more address components. The length is therefore always a multiple
of 2 bytes. The partial address of a node is formed from the network address of
the node in its main network and the subnet index of the main network in the
case of the parent node. The bits required for the subindex are determined by
the router of the parent node. Filler bits can be inserted between the subnet
index and the network address in order to ensure that the length of the partial
address is a multiple of 2 bytes.
Special cases:
● A node without a main network: this means that there is neither a subnet
index nor a network address in the main network. In this case the address is
set to 0x0000.
● A node in the main network without a parent: In this case a subnet index
with the length 0 is assumed. The partial address corresponds to the net-
work address, if necessary extended by filler bits.
Broadcast addresses
There are two types of broadcast - global and local. A global broadcast is sent
to all the nodes in a network. The empty node address with a length of 0 is
reserved for this purpose.
Local broadcasts are sent to all the devices in a network area. For this purpose,
all the bits of the network address are set to 1. This is permissible both in
relative and in absolute addresses.
A block driver must be able to process both kinds of broadcast addresses.
This means: empty network addresses as well as network addresses whose bits
were all set to 1 must be interpreted and sent to all devices concerned.
6. In the online views of the editors of both programs, check whether the
values of iglobvar match in the receiver and the sender.
See also
● ⮫ Chapter 33.2.20 Object 'Network Variable List (Sender)' on page 783
● ⮫ Chapter 33.2.21 Object 'Network Variable List (Receiver)' on page 783
The data connection with data source type PLC Engineering ApplicationV3 is
done via the address monitoring. This requires that the address information
between the remote control and the local device match: The runtime system
of the local application requires a valid communication parameters to establish
the connection.
When configuring the data source, the network scan functionality supports the
user.
Disadvantage: If you change the remote application, also update the local appli-
cation, for example, the HMI application.
The advantage is that a symbol configuration is not required in the remote
application.
You can also select all variables. Then the data source is initialized automati-
cally, the data source variables are created below the “DataSources_Objects”
folder, and another data source is added below the data source manager.
If the data is transferred using symbolic monitoring and the symbol file is
stored on your development system, then you can read the variable information
from the symbol file and work offline. The symbol file is stored either as a file
on your development system or as a symbol configuration object as part of your
project (in PLC Engineering).
The initial settings can be changed at any time in the data source editor.
See also
● ⮫ Chapter 33.2.13 Object 'Data Sources Manager' on page 775
See also
● ⮫ Chapter Tab 'Communication' via PLC Engineering Symbolic on page 808
● ⮫ Chapter Tab 'Communication' via PLC Engineering ApplicationV3
on page 812
4. Activate the variables that should be transferred and click “OK” to close
the dialog.
🡆 The data source variables are modified according to the selection. The
declaration of variables and data types is also modified.
The “Variables” tab shows the modified selection. Moreover, the
mapped remote variable is listed in the “Remote variable” column.
Also refer to
● ⮫ Chapter 19 Working with control networks on page 229
● ⮫ Chapter 19.6.8 Updating Data Interfaces on page 252
● ⮫ Chapter Tab 'Variables' on page 805
You need to map a remote variable to a global implicit variable that is created
new. That is the regular procedure for transposing data source to 1:1.
Prerequisite: A project is open A data source manager and a data source below
it are located in the device tree of the local application.
1. Open the editor of the data source.
2. Select the “Variables” tab.
🡆 The data source variables are listed.
3. Select a variable and click the symbol in the “Create or map” column.
4. Specify a name in “Local variable”.
🡆 A variable is declared automatically and it contains the same value as
the mapped remote variable.
First, create a conforming data type and then use it for a variable.
Prerequisite: A data source manager and a data source below it are located
in the device tree of the local application. The remote data that should be
transferred is displayed in the editor of the data source in the “Variable” tab
1. Open the editor of the data source.
2. Select the “Type mappings” tab.
3. Select the data type in the list that you want to edit.
🡆 The elements of the data type are listed in the window below the data
type list
4. Specify a name for the data type. Example: DataType_A. Select the
name for the remote data types to which the local type should conform.
Example: Library1.DataType_A.
5. Modify it in the window below the data type list and remove the elements
that are not necessary for the data transfer.
6. Select the symbol for this data type in the “Create or map” column.
🡆 The data type DataType_A is declared in the “DataSources_Objects”
folder.
7. Select the “Variables” tab.
8. Specify a name in the “Local variable” column. Example: Var_A
9. Select the symbol in the “Create or map” column.
Example
Library SnakeUtil
The example demonstrates how variables of the data source are created. At
this time, new variables are created, data is mapped to existing data types
and their variables, and new data types are created with type-conforming
mapping.
The remote PLC uses POU instances from the SnakeUtil library and the HMI
device displays these POU instances. This is why the HMI application requires
a variable in the user interface that has a data type appropriate for a visualiza-
tion template. As a result, the SnakeUtil library is linked integrated into the
HMI application and the HMI variables instantiate the SnakeUtil.SnakeVisu
visualization function block.
The following library function blocks from the SnakeUtil library are used in
the remote control:
● SnakeUtil.Snake function block: Equipped with a lot of logic and external
function calls.
● DUT SnakeUtil.PositionInfo: 2 values (of the variables x and y)
● DUT: SnakeUtil.DrawingInfo: Image ID
● The SnakeUtil.SnakeVisu visualization function block with transfer
parameter SnakeUtil.Snake displays the Snake function block.
The following settings are entered in the editor of the “Type Mappings” tab:
the original data type directly. Instead, first modify the original data type and
remove the unnecessary elements. Then create the new data type Snake by
selecting the symbol in the “Create or map” column.
Example
The variable ivar is activated and deactivated by means of methods from the
Datasources library so that its value is transferred. Furthermore, you can
configure that the variable is updated only over a defined duration in order to
save transfer capacity.
5. In the “Datasource” dialog, specify the URI of the started OPC UA Server
and select the “Information Model Source”. When you select “Online” as
the “Information Model Source”, the OPC UA Client connects to the OPC
UA Server and reads the information about which variables and types
exist. When you select “Offline”, the client reads the same information
from an installed information model and does not require a running OPC
UA Server to do this.
6. For “Message Security Mode”, select “Sign and Encrypt”.
Note: You should use “Message Security Mode” = “None” only in closed
6. Define the access data for the device administrator: “Name” and
“password”. Enable the “Password can be changed by user” option.
Installing a control certificate for encrypted communication via the PLC shell of
the device editor
Choose this less convenient method when the CODESYS Security Agent is
unavailable to you. In this case, you can set up a certificate with a more long-
term validity period for communication encryption on the “PLC Shell” tab of
the device editor.
Prerequisite: You are connected to the control.
1. At first, check whether a qualified certificate is already on the control. If
no certificate is available, then you create a new certificate.
Double-click on the control in the device tree to open the device editor
and select the “PLC shell” tab.
🡆 The tab is displayed with an empty display window. Below that is a
command line.
2. Enter the following command in the input line: cert-getapplist
🡆 All used certificates are listed. The list includes information about the
runtime component and whether or not the certificate is available.
3. If a certificate still does not exist for the component CmpSecureChannel,
type the following command in the input line:
cert-genselfsigned <number of the component in the applist>
4. Select the “Log” tab and click the refresh button .
🡆 It displays whether the certificate was successfully generated.
5. Change back again to the “PLC Shell” tab and type the command cert-
getapplist.
🡆 The new certificate for the component CmpSecureChannel is dis-
played.
6. In the next two steps, activate encrypted communication in the security
screen of PLC Engineering.
7. Open the “Security screen” by double-clicking on the in the status bar.
8. On the “User” tab, select the “Enforce encrypted communication” option
in the “Security Level” group.
🡆 The communication with all control is encrypted. If there is no certifi-
cate on a control, you cannot log in to that control.
The connecting line between the development system, the gateway, and
the control is displayed in yellow on the “Communication Settings” tab
of the device editor of the control.
Also refer to
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
● ⮫ Chapter 18.13 Encrypting the application on page 153
● ⮫ Chapter 11.2 Project encryption with certificates on page 75
The objects are organized in a tree structure. There are two root objects for the
two types of objects:
● “Runtime objects 🠂 Device”: In these objects, all objects with online access
to the control are managed, as they have to control the access rights
● “File system objects 🠂 /”: In these objects, the rights to folders of the
current execution directory of the control can be assigned
The access rights are inherited from the root object (i.e. “Device” or“"/”") to
the child objects. If you reject or explicitly assign a right to a user group on a
4. Select the object whose access right you want to change to the left in the
object tree.
🡆 In the “Rights” view, a table shows the access rights to this object for
all configured user groups.
5. Double-click the right in the table that you want to change.
🡆 If the object has child objects, a dialog prompts whether you want to
modify the rights for the child objects.
Also refer to
● ⮫ Chapter 33.1.10 Tab 'Access Rights' on page 743
● ⮫ Chapter 'Options' dialog - 'Device editor' on page 1082
● ⮫ Chapter 33.1.16 "Users and groups” tab on page 754
● ⮫ Chapter 17.4 Configuring Devices and I/O Mapping on page 118
● ⮫ Chapter 20.3 Encrypting Communication, Changing Security Settings
on page 258
is generated, a test is performed for checking the allocations, the data types,
and the availability of libraries. Moreover, the memory addresses are allocated
when the application code is generated.
You can click “Build 🠂 Generate Code” to execute this command explicitly. This
is useful for detecting any errors in your source code, even when the PLC is
not connected yet. The errors are output in the message view in the "Build"
category.
If you have encrypted the application, then consider the
NOTICE
following information: If a (new) boot application is gen-
erated on request after an online change, then the boot
application is formed in the RAM with the current code
that is not encrypted.
Data breakpoints
The function of data breakpoints depends on the target system. Currently, data
breakpoints are possible only with the ctrlX CORE.
Program execution stops at a data breakpoint when the value of a particular
variable or memory address changes. As with ordinary breakpoints, the halt can
be linked to an additional condition, or specific code can be processed instead
of the halt (converted to a data execution point).
You set a data breakpoint either by means of the “New Data Breakpoint”
command in the “Debug” menu or by means of the “New” button in the
“Breakpoints” view. You specify a qualified variable name or a memory address
directly which is to be monitored for changes in its value.
Example
In the following sample code, the memory of the variable iNumber is over-
written unintentionally. However, a data breakpoint at the variable iNumber
will detect when its value changes. The processing then stops with a corre-
sponding message at the array access, which overwrites the variable value:
Idx = 7. See also below: "Setting a data breakpoint".
PROGRAM PLC_PRG
VAR
Idx : INT;
Ary : ARRAY[0..3] OF BYTE;
5. Set more breakpoints and check the variable values at the break position.
6. Place the cursor in the line where a breakpoint should be removed.
7. Click “Debug 🠂 Toggle Breakpoint” or press [F9].
🡆 The marking disappears. The breakpoint is deleted.
See also
● ⮫ Chapter Command 'Toggle Breakpoint' on page 957
2. In the POUs, set breakpoints at the locations in the code that you want to
examine.
🡆 All breakpoints are listed in the “Breakpoints” view.
3. Start the application.
🡆 The application starts and the code is processed until the first break-
point.
Now the application is in debug mode. In the device tree, the applica-
tion is labeled with “[halt on breakpoint]”. The status bar provides
information about the operating state:
The editor was opened at the current break position. The line of code
with an active breakpoint where program execution was halted is high-
lighted in yellow and marked by the symbol. This statement high-
lighted in yellow has not been executed yet.
Now you can select the various stepping commands or display the call
tree.
Alternatively, you can first start the application and then set a breakpoint.
See also
● ⮫ Chapter Command 'Step Into' on page 958
● ⮫ Chapter Command 'Step Over' on page 957
● ⮫ Chapter Command 'Step Out' on page 958
● ⮫ Chapter Command 'Run to Cursor' on page 958
● ⮫ Chapter Command 'Set Next Statement' on page 959
● ⮫ Chapter Command 'Show Next Statement' on page 959
● ⮫ Chapter Command 'Call tree' on page 906
In PLC Engineering, variable values in the PLC can be changed in online mode.
It is distinguished between forcing and writing of a previously prepared value.
Writing is executed with the command “Write values”, [Ctrl] + [F7] and sets the
variable once to the prepared value. The program can thus overwrite the value
again at any time.
Forcing is executed with the command “Force values”, [F7] and permanently
sets the prepared value. For more information, see below.
Preparing a value for forcing or writing is possible at various points:
● Declaration part: “Prepared value” field
● Implementation part of the FBD/LD/IL editor: Inline monitoring field
● Monitoring window: “Prepared value” field
See below for instructions. If you want to prepare a new value for a variable
that has already been forced, the “Prepare value” dialog opens for this purpose
with options for handling the current force value.
Also refer to
● ⮫ Chapter Command 'Prepare Box for Forcing' on page 995
● ⮫ Chapter Command 'Force Function Block Input' on page 996
● ⮫ Chapter 33.4.10 Dialog 'Prepare Value' on page 1041
● ⮫ Chapter Command 'Force Values' on page 959
● ⮫ Chapter Command 'Unforce Values' on page 960
● ⮫ Chapter Command 'Write Values' on page 960
● ⮫ Chapter 22.3.3 Using Watch Lists on page 297
Sample program
Declaration
VAR
iVar: INT := 0;
END_VAR
VAR RETAIN
iVarRetain: INT :=0;
END_VAR
VAR PERSISTENT
iVarPersistent : INT:= 0;
END_VAR
Implementation
iVar := 100;
iVarRetain := 200;
iVarPersistent :=300;
1. Insert the “Persistent Variables” object below the application and open it
in the editor.
2. Select “Create 🠂 Build”.
3. Select “Declaration 🠂 Add all instance paths”.
🡆 The instance path of the persistent variables is inserted.
4. Load the application to the control.
Also refer to
● ⮫ Chapter 33.1.1 Tab “Communication” on page 735
● ⮫ Chapter Command 'Flow Control' on page 961
In IL, PLC Engineering uses two fields for each instruction to display actual
values. One to the left of the operator with the current accumulator and one to
the right of the operands with the operand value.
22 Application at runtime
22.1 Application at runtime – General information
When the application is running on the PLC, there are functionalities in the
PLC Engineering development system for monitoring and changing the variable
values, as well as for recording and saving their history.
There are also possibilities to retrieve certain information from the PLC, to view
the PLC logbook, to display a coredump, and to monitor the timing behavior of
the tasks.
Observe to restrict the access on the running application via online commands
Application at runtime
from the engineering system in case of critical machine states. For this pur-
pose, certain system variables are available via a module of the Component-
Manager library.
During the initialization process, the recipe management reads the values of
the variables that are defined in the recipe definition. This operation takes
place at the end of the initialization phase of the application. At this point, all
initial values of the application variables are set. This is performed to initialize
missing values from recipe files correctly.
Also refer to
● ⮫ RecipeManCommands
● ⮫ Input configuration
Creating recipes
1. Select the “Application” object in the device tree.
2. Click “Project 🠂 Add Object 🠂 Recipe Manager”.
🡆 PLC Engineering adds the recipe manager to the device tree.
3. Select the “Recipe Manager” object in the device tree.
4. Click “Project 🠂 Add Object 🠂 Recipe Definition”.
🡆 PLC Engineering adds the recipe definition below the recipe manager.
5. To open the editor of the recipe definition, double-click on the object.
6. Double-click on the blank field below “Variable” in the editor. Specify the
name of a variable that you will define a recipe. The input assistant can be
used: button.
7. Select “Recipes 🠂 Add a new recipe” and enter a name for the new
recipe.
🡆 A column with the recipe name is displayed in the editor.
8. Enter the variable value for this recipe in this field.
9. Insert additional fields if required.
10. Select a variable value of the recipe and click on “Recipes 🠂 Save recipe”.
Select storage location and file name.
🡆 PLC Engineering saves the recipe in the format defined in the recipe
manager.
Also refer to
● ⮫ Chapter 33.2.22 Object 'Recipe Manager' on page 784
● ⮫ Chapter 33.2.23 Object 'Recipe Definition' on page 787
● ⮫ Chapter 33.3.20 “Recipes” menu on page 1017
3. Click on the “myRec” column in the recipe definition and select “Load
recipe” from the context menu.
🡆 A dialog prompt notifies you about the possibly needing to perform an
online change when logging in again. An online change is necessary
when you change the current values of the recipe variables by loading
the recipe.
4. Click on “Yes” to close the dialog (continue). Select the myRec.txt file
from the file explorer for loading.
🡆 The recipe values in the recipe definition are updated according to the
values read in the file.
Application at runtime
If you want to overwrite only individual recipe variables with new values, then
remove the values for the other variables before loading to the recipe file.
Entries without value definitions are not read, and therefore updating leaves
these variables unchanged on the PLC and in the project.
For values of the data type REAL/LREAL, the hexadecimal value is also written
to the recipe file in some cases. This is necessary so that the exact identical
value is restored when converting back. In this case, change the decimal value
and delete the hexadecimal value.
Also refer to
● ⮫ Chapter “Load Recipe” command on page 1018
● ⮫ Chapter 'Load and write recipe' command on page 1019
Application at runtime
from function calls and the current variable values in property-type objects.
More options for recording current variable values:
− Reading and saving “Recipes”
− Record values on a timeline for displaying the history immediately or later:
trace and trend features
Also refer to
● ⮫ Chapter Attribute 'monitoring' on page 629
● ⮫ Chapter 22.3.3 Using Watch Lists on page 297
● ⮫ Chapter 22.2 Changing values with recipes on page 287
● ⮫ Chapter 22.4.1 Data recording with 'Trace' – General information
on page 298
● ⮫ Chapter 22.5.1 Data recording with 'Trend' – General information
on page 305
The actual value of an expression (1) is displayed in the “Value” column (3).
You can write and force a value in the “Prepared Value” (4) column. During the
forcing, the actual value is decorated with a red symbol ( ).
The expression of an interface reference can be expanded. If the interface
points to a global instance, then this global instance is displayed as the first
entry below the reference. Afterwards, if the interface reference changes, then
the displayed reference is collapsed.
If you have prepared values for variables for forcing or writing, then they are
displayed in angle brackets in the inline monitoring view after the current
value.
After forcing, the respective values are identified by the symbol.
● Network editors and the CFC editor:
Connecting lines are displayed in color according to their actual Boolean
value (blue means TRUE, black means FALSE).
● LD editor:
The contact and coil elements are also marked.
For contacts and coils, a prepared value (TRUE or FALSE) is shown in a small
view next to the element.
● SFC editor:
Transitions with the value TRUE are displayed in color according to their
actual Boolean value (blue means TRUE, black means FALSE).
Active steps are displayed in blue.
Forced transition values are displayed in red in the implementation.
● IL tabular editor:
Current values are displayed in a separate column.
Application at runtime
Monitoring in the SFC editor
You can deactivate the inline monitoring function in “Tools 🠂 Options”, in the
“Text Editor” category on the “Monitoring” tab.
See also
● ⮫ Chapter ST Editor on page 379
● ⮫ Chapter ST editor in online mode on page 380
● ⮫ Chapter FBD/LD/IL Editor in Online Mode on page 414
● ⮫ Chapter SFC Editor in Online Mode on page 391
● ⮫ Chapter CFC Editor in Online Mode on page 430
Monitoring a property
You can monitor variables in a property object by setting a breakpoint in
the function during online mode. When halted there, the current values are
displayed.
In addition to your own values, the values of the variables of the superordinate
instance are displayed automatically. In the declaration part of the property,
the THIS pointer, which points to the superordinate instance, appears in the
first line with the current data type information and values.
Example
Code
FUNCTION_BLOCK FB_BaseAlfa
VAR
iBaseLocal : INT;
sBaseLocal : STRING;
END_VAR
iBaseLocal := iBaseLocal + 1;
sBaseLocal := 'Testing Text';
FB_BaseAlfa.PorpBeta.Get
iBaseLocal := iBaseLocal + 1;
IF iBaseLocal > 0 THEN
PropBeta := TRUE;
END_IF
FB_BaseAlfa.PorpBeta.Set
PROGRAM PLC_PRG
VAR
fb_BaseAlfa : FB_BaseAlfa;
END_VAR
Application at runtime
fb_BaseAlfa();
See also
● ⮫ Chapter Object 'Property' on page 839
Monitoring a method
You can monitor variables in a method object by setting a breakpoint in
the method during online mode. When halted there, the current values are
displayed.
In addition to your own values, the values of the variables of the superordinate
instance are displayed automatically. In the declaration part of the method, the
THIS pointer, which points to the superordinate instance, appears in the first
line with the current data type information and values.
Example
Code
FUNCTION_BLOCK FB_BaseAlfa
VAR
iBaseLocal : INT;
sBaseLocal : STRING;
END_VAR
iBaseLocal := iBaseLocal + 1;
sBaseLocal := 'Testing Text';
PROGRAM PLC_PRG
VAR
fb_BaseAlfa : FB_BaseAlfa;
END_VAR
fb_BaseAlfa();
fb_BaseAlfa.MethBaseAlfa();
See also
● ⮫ Chapter Object 'Property' on page 839
● ⮫ Chapter 'Method’ object on page 829
Monitoring a function
You can monitor variables in a function object by setting a breakpoint in the
function during online mode. When halted there, the current values are dis-
played.
Application at runtime
or LINT.
● The pragma {attribute 'monitoring' := 'call'} is inserted into the
function.
See also
● ⮫ Chapter Object 'Function' on page 825
● ⮫ Chapter Attribute 'monitoring' on page 629
In online mode, create and edit watch lists using the context menu item “Add
to watch list”.
Also refer to
● ⮫ Chapter Command 'Watch' - 'Watch <n>' on page 900
Also refer to
● ⮫ Chapter 'Add to watch list' command on page 1034
● ⮫ Chapter 22.3.2 Calling of Monitoring in Programming Objects on page 291
● ⮫ Chapter 21.5 Forcing and writing of variables on page 277
Access to the trace manager from IEC code is possible by means of the func-
tions from the library CmpTraceMgr.library. For more information, refer to
the library documentation.
A running data recording with trace can lead to a signifi-
NOTICE
cant increase in the cycle time of the IEC task.
Data recording with trace also continues running after
NOTICE
logging out of the device.
Application at runtime
recording that depends on a trigger. At runtime, the application checks whether
the event has occurred or the the condition is fulfilled, and then it buffers the
data accordingly.
The trace configuration enables triggering by:
● a trigger variable that maps the event
● a condition as expression
● a combination of trigger variable and condition
PROGRAM PLC_PRG
VAR
iVar : INT;
rSin : REAL;
rVar : REAL;
END_VAR
iVar := iVar + 1;
iVar := iVar MOD 33;
Example
Application at runtime
● (1) : “Configuration”
● (2) : “Add Variable”
See also
● ⮫ Chapter 33.2.26 Object 'Trace' on page 799
Assigning a task
In this task, the data recording is executed in runtime mode. Usually the same
task is selected where the variables are written.
1. Double-click the trace object.
🡆 The trace editor opens with the commands available in the “Trace”
menu.
2. Click “Trace 🠂 Configuration”.
🡆 The “Trace Configuration” dialog opens. In the tree view “Trace
Record”, the top item is selected and the subdialog “Record Settings”
is shown on the right.
3. Click the "arrow down" symbol ( ) in the “Task” drop-down list.
🡆 The drop-down list opens with all tasks that are available throughout
the application.
4. Select a task for the trace.
See also
● ⮫ Chapter “Trace configuration” dialog on page 1096
Tracing a parameter
1. Double-click the trace object.
2. Click “Add Variable”.
🡆 The “Trace Configuration” dialog opens. The subdialog “Variable
Settings” is displayed on the right.
3. Click (right of the “Variable” setting, left of the input field).
4. Select the “Parameter” option in the drop-down list.
5. Click and select a parameter from the “Input Assistant” dialog.
6. Configure how the parameter is displayed.
7. Click “OK” to close the dialog.
🡆 The parameter will be traced and displayed in the trace variable list.
Configuring a trigger
1. Double-click the trace object.
🡆 The trace editor opens with the commands available in the “Trace”
menu.
2. Click “Trace 🠂 Configuration”.
🡆 The “Trace Configuration” dialog opens. The subdialog “Record
Settings” is displayed on the right.
3. Select the “Enable trigger” check box.
4. Select the task in which the trend record is to be executed.
5. Select a variable from the “Trigger Variable” field.
Application at runtime
1. Double-click a trace object.
2. Click the “Configuration” link above the configuration tree.
🡆 The “Trace Configuration” dialog opens.
3. Select “Time axis” in the display tree (below “Presentation (Diagrams)”).
🡆 The display settings of the time axis are shown on the right.
4. Edit the presets and click the “Preview” link.
🡆 The changes are seen in the coordinate system preview.
5. Click “Y-axis” in the display tree. The “Y-axis” item is below every con-
figured diagram. Therefore, the display of the value axis is set for each
diagram.
🡆 The subdialog “Display Settings” of the selected axis is displayed on
the right.
6. Change the preset value.
🡆 The changes are applied in the coordinate system preview.
7. Click OK to close the “Trace Configuration” dialog.
🡆 The display changes are visible in the affected diagrams.
Application at runtime
● ⮫ Chapter Command 'Save Trace' on page 1032
● ⮫ Chapter Command 'Load Trace' on page 1029
● ⮫ Chapter Command 'Export Symbolic Trace Config' on page 1027
Assign tasks
In this task, the runtime system records the trend.
In general, trend recording runs in the same task as the main program (for
example, PLC_PRG).
1. Double-click a “Trend Recording” object in the device tree.
🡆 The respective editor opens. In the tree view of the trend configuration,
the top entry is selected, and on the right you see the current configu-
ration in “Record Settings”.
2. Click the "Arrow Down" symbol ( ) in the “Task” list box.
🡆 The selection list opens with all tasks available application-wide.
Application at runtime
3. Select a task for trend recording.
add parameters
1. Double-click a “Trend Recording” object in the device tree.
🡆 The respective editor opens. In the tree view of the trend configuration,
the top entry is selected, and on the right you see the current configu-
ration in “Record Settings”.
2. Right-click an entry in the tree view.
3. Select “Add variable”.
🡆 PLC Engineering inserts a new variable. The blank settings open in the
“Variable Settings” to the right of the tree view.
4. Click the "down" symbol ( ) to the right of the “Variable” label.
5. Select “Parameter” from the list box.
6. Click and select a parameter from the “Input Assistant” dialog.
7. Configure how the parameter is displayed in the trend diagram.
8. Configure how the alert color is displayed in the trend diagram.
Also refer to
● ⮫ Chapter 22.4.3 Creating Trace Configuration on page 301
See also
● ⮫ Chapter Tab 'Monitor' on page 863
Reading logbook
Application at runtime
Prerequisite: The control is running.
1. Select the control in the device tree.
2. Click “Project 🠂 Edit Object”.
🡆 The device editor opens.
3. Select the “Log” tab.
4. Click on to refresh the view.
🡆 A connection is established to the control. The control is highlighted in
green in the device tree.
🡆 All log events of the control are displayed. The preceding icon shows
the scaling of the log event:
● : Warning
● : Errors
● : Exception
● : Information
● : Debug
5. If you do not want to see the events of a certain scaling, click on the
corresponding icon in the menu bar. If you click this icon again, these log
events are displayed again. For example, click on the icon in the menu
bar if you do not want to see log events with the "Error" scaling.
6. In the Search in messages input field, enter a search term to find a spe-
cific event in the list. Subsequently, use the and buttons to jump to
the color-coded search results.
7. To filter the events by scaling, timestamp, description or component, click
on the respective column title.
8. Click on the button to save the displayed log events to a file.
Also refer to
● ⮫ Chapter 33.1.14 "Log” tab on page 751
In addition, you can call a project view of the controller log file at the time of
generating the core dump.
The runtime system must completely support the func-
NOTICE
tionality to assure a correct display of variable values in
the core dump view.
In the online view of the application that PLC Engi-
neering created when loading the core dump into the
project, menu commands are displayed as available but
do not have any effect in this status. When selecting one
of these commands, a message is displayed.
Restriction (CDS-37572): Exception handling in the run-
CAUTION
time system may overwrite parts of the variable values
in the call stack. Therefore, the original values are lost
and important information may no longer be displayed
for variables in functions and methods at the time of
monitoring.
When creating project archives: If you created a core dump explicitly by clicking
“Create Core Dump”, then this option is available automatically in the archive
configuration. On the other hand, if you copied the core dump from the PLC,
then you can add it to a project archive only by selecting “Additional files”.
Important: A project archive with a core dump must necessarily include the
download information. If it does not, then PLC Engineering cannot use the core
dump.
Loading the core dump and device log into the project for analysis
Requirement: You have a project open with an application that has produced an
exception on the controller. The runtime system is able to create core dumps.
The application in the project is in offline mode.
1. Load the required core dump from the controller by clicking “Debug
🠂 Load Core Dump”.
🡆 PLC Engineering shows an online view of the application. You see the
variable values and call stack from the time of error (see below). This
includes also the values of the I/O variables in the mapping dialog
box of the device configurator and the task configuration. "Core dump
loaded" appears in the status line. PLC Engineering copies the core
dump file as <project name>.<device name>.<application name>.<appli-
cation Guid>.core to the local project directory.
2. Click “Debug 🠂 Load Device Log from Core Dump” to load the device log
from the time of error into the project.
🡆 The log view opens (as in online mode of the device editor) with the
events at the time of the core dump.
3. After completing the core dump analysis, click “Debug 🠂 Close Core
Dump”.
🡆 PLC Engineering closes the core dump view of the application. The
project returns to the normal offline mode with its views.
See also
● ⮫ Chapter Command 'Create Core Dump' on page 962
● ⮫ Chapter Command 'Load Core Dump' on page 961
Application at runtime
● ⮫ Chapter Command 'Close Core Dump' on page 962
● ⮫ Chapter Command 'Load Device Log from Core Dump' on page 962
Application at runtime
above.
1. Open the device editor by double-clicking the device entry in the device
tree. Click the “Backup and Restore” tab.
Click “Restore 🠂 Load Backup File from Disc”.
🡆 The default prompt opens for selecting a backup file tbf in the local
file system.
2. Select the backup file and click “Open”.
🡆 The files are read from the backup file and shown in the
table of the dialog below. The file $PlcLogic$/Application/
myExternalFile.txt that was excluded in the backup is missing.
3. Click “Restore 🠂 Restore Backup to Device”.
🡆 A dialog prompt opens with information about the actions when
restoring.
4. Click “OK” to start restoring the files to the PLC file system.
🡆 When restore is complete, you are prompted to restart the PLC in order
to activate the loaded application.
--culture=<Culture>
<Culture>: Common language abbreviation for the desired national language,
for example de, en, fr, it, es, zh-CHS.
Example
Launching the PLC Engineering with English user interface:
PLC Engineering.exe --culture=en
Also refer to
● ⮫ Chapter Dialog 'Options' – 'International Settings' on page 1084
Example
PLC Engineering.exe --culture=de --profile="PLC Engineering
V3.6"
Example
PLC Engineering.exe --compare "D:\proj\project1.project"
"D:\proj\project2.project"
Also refer to
● ⮫ Chapter 'Compare’ command on page 917
Example
Open the project test:
PLC Engineering.exe --culture=de --
project="D:\projects\test.project"
Also refer to
● ⮫ Chapter 'Open project’ command on page 869
Example
Extract the project archive test.projectarchive and open the project in
the programming system:
PLC Engineering.exe --
projectarchive="D:\projects\test.projectarchive"
Also refer to
● ⮫ Chapter Command 'Extract archive' on page 873
For more information on the __name__ global variable, see the Python docu-
mentation.
initdebug.py file:
Also refer to
● ⮫ http://docs.python.org/tutorial/modules.html
Option --ignorewhitespace
Add this option to the call of the development system in the command line
after the --compare <project1> <project2> option so that spaces are not
included in the project comparison. Note: Semantically relevant spaces, such as
in STRING literals, are nevertheless taken into account in any case.
Syntax
--compare="<path of project file>" "<path of reference project
file>" --ignorewhitespace="true"|"false"
Example
PLC Engineering.exe --compare "D:\proj\project1.project"
"D:\proj\project2.project" --ignorewhitespace="true"
Also refer to
● ⮫ Chapter 'Compare’ command on page 917
Option --ignorecomments
Add this option to the development system call in the command line after the
--compare <project1> <project2> option so that comments are not taken
into account in the project comparison.
Syntax:
--compare="<path of project file>" "<path of reference project
file>" --ignorecomments="true"|"false"
Example
PLC Engineering.exe --compare "D:\proj\project1.project"
"D:\proj\project2.project" --ignorecomments="true"
Also refer to
● ⮫ Chapter 'Compare’ command on page 917
Option --ignoreproperties
Add this option to the development system call in the command line so that
object properties (access rights, translation settings, directories, bitmaps, etc.)
are not taken into account in the project comparison.
Syntax:
--compare="<path of project file>" "<path of reference project
file>" --ignoreproperties="true"|"false"
Example
PLC Engineering.exe --compare "D:\proj\project1.project"
"D:\proj\project2.project" --ignoreproperties="true"
Also refer to
● ⮫ Chapter 'Compare’ command on page 917
Example
PLC Engineering.exe --skipunlicensedplugins
The ctrlX PLC Engineering API initialization of the standard port can be modi-
fied by explicitly calling ctrlX PLC Engineering.
● Via the Windows input panel
<storage location>ctrlX-PLC-Engineering.exe --webserverport="Port number"
● Via a link
<storage location>\ctrlX-PLC-Engineering.exe --webserverport="Port number"
The selected port number is required to start a web server and must not be
assigned by another application.
27 Using libraries
27.1 Library repository
Libraries and their respective metadata are stored in the library repository on
the engineering system. Implement any installed the libraries into your project
using the library manager. The libraries are installed under version control to
easily update the libraries.
You can create and edit more repositories in addition to the preinstalled
System repository.
Also refer to
● ⮫ Chapter Command 'Library Repository' on page 969
Using libraries
27.2 Library manager
To be able to use programming blocks provided in a block library in the applica-
tion, the library has to be included in the project in the library manager. The
prerequisite for this is the installation of the library in the library repository.
The library manager displays all included libraries according to their library
type and associated properties. In the Library Manager, you can add more libra-
ries from the library repository, remove libraries, and edit library properties.
The Library Manager can be inserted into the “POUs” view or the “Devices”
view. In this way, a project can have one Library Manager per application and
also one cross-application Library Manager in the “POUs” view. The library
modules of the linked libraries in the “POUs” view can be called regardless of
the application. The library modules of the linked libraries in the “Devices” view
can be called in the respective application code only. Furthermore, placeholder
libraries respond differently when downloading depending on their positions.
Libraries that are linked to a specific version in the project also have a place-
holder for that version (placeholder library). You can define special placeholder
resolutions. You can also use the placeholder resolution that is defined for a
device in the device description or that is stored in the library repository for
a library. The library manager notifies about the actual placeholder resolution
and shows the version that is used when downloading an application (effective
version).
If a library manager is included in the “POUs” view across applications, you
can access its contents globally. If placeholder libraries are linked, then only
the placeholder resolutions in the device description or library repository are
checked.
Normally, a Library Manager is linked in the “Devices” view. Then, only the
application code below calls the library function blocks. Moreover, the special
placeholder resolutions are checked first for placeholder libraries. Only after
that are the placeholder resolutions checked that are in the device description
or that originate from the library repository.
Also refer to
● ⮫ Chapter 33.2.19 "Library manager” object on page 780
● ⮫ Chapter 18.7 Using library function blocks on page 136
General information
● Categories for libraries can be defined. The libraries are then displayed in
the library repository below these categories.
● Define a namespace for a library to ensure unambiguous access to the inte-
grated objects. For a unique access, add the namespace in front of the
function block name:
<namespace>.<variable name>
Example: AC.Module
● To open the POUs of unencrypted libraries (*.library), double-click on the
respective entry in the library manager.
● The following library types can be created:
– *.library: Implementation library (source code of the library)
– *.compiled-library, *.compiled-library-v3: Protected library; the
source code can no longer be accessed.
– *_Itfs.library: Interface library; contains only objects that serve the
interface definition of a component (for example, constants, structures,
interfaces) and do not generate any code
– *_Cnt.library: Container library; does not contain any programming
function blocks, but only other libraries; thus serves for convenient inclu-
sion of a whole set of libraries whose blocks are published at the top
level of the container library.
● External libraries can be integrated into the application. External libraries
are programmed outside of PLC Engineering in a different programming
language, for example C.
Library protection
● Source code protection:
When a library is prepared in "compiled-library" format, the source code of
the library modules is no longer visible after the library is integrated into a
project.
● Signing:
In PLC Engineering V3 SP15 and later, a certificate is always used for the
signing of library projects (*.compiled-library-v3). The signing can be
enforced by means of a setting in the security screen. Then for generating a
compiled library, you need a certificate suitable for code signing in your user
profile.
For library projects that have to be compatible with PLC Engineering < V3
SP15 (*.compiled-library), only the less secure signing with a private
key and an associated token is possible. This outdated method should only
be used for compatibility reasons and is executed via the “Sign” tab of the
“Project information”.
Note: For signing libraries you should use compiler version 3.5.15.0 or
higher, as this version uses a better memory format.
● Licensing:
Using libraries
nesting depth is arbitrary.
● It can be defined whether referenced libraries should be visible in the library
manager.
● You can integrate referenced libraries via library placeholders. This avoid
problems that can occur due to version dependencies or the necessity to
use vendor-specific libraries.
Also refer to
● ⮫ Chapter 8.4 Retrieving and editing project information on page 64
See also
● ⮫ Chapter 27.4 Adding a Library to the Application on page 331
See also
● ⮫ Chapter 33.2.19 "Library manager” object on page 780
● ⮫ Chapter Command 'Library Repository' on page 969
28 Managing Devices
28.1 General
PLC Engineering manages the installed devices in the so-called device reposi-
tory. A device repository is a defined location in the file system. In the default
PLC Engineering installation, it is defined with an absolute path as the system
repository. You install or uninstall devices in the “Device Repository” dialog.
The system installs a device by reading the device description file. The proper-
ties of a device are defined in these files regarding configurability, programma-
bility, and possible connections to other devices.
You can use the devices provided in the device repository by adding them to
Managing Devices
the device tree of your project.
Also refer to
● ⮫ Chapter Command 'Device Repository' on page 963
● ⮫ Chapter 28.2 Installing Devices on page 333
Both licenses of add-on products on the local computer and individual device
licenses can be managed uniformly via the PLC Engineering license manager.
For devices with a unique serial number, if the license information on the
device is lost, the license manager can reactivate the license from an automati-
cally stored license backup file.
If possible, license your products via online activation instead of offline activa-
tion.
Online activation
Offline activation
If your workstation computer does not have internet access, activate products
using a license activation file. The PLC Engineering license server provides
the file. Connect to the server from any web-enabled computer and request
the file. Then transfer the file to your workstation computer using any storage
device. As usual, the product is activated in ctrlX I/O Engineering System, both
for workstation licenses and for single device licenses.
Optionally, if you have access to a web-enabled computer but ctrlX I/O Engi-
neering System is not installed, you can access the “CodeMeter Control
Center” from Wibu-Systems to activate the license.
The “CodeMeter control center” controls the CodeMeter service and is
included in the PLC Engineeringsetup.
Restoring licenses
From PLC Engineering V3.5 SP13, a license backup file *.WibuCmRau is auto-
matically generated when activating single-user licenses for devices with a
unique serial number. The file is stored on your computer and on the license
server. In case of loss of the licensing files on the device, the license can be
restored from this file with the help of the License Manager.
A device license was activated.
1. In PLC Engineering select the command “Tools 🠂 License Manager”.
Follow the wizard with the appropriate entries for the target device:
Device and container (soft container or dongle), and the selection of the
device in question.
2. In the “License Manager” dialog, click on the “Additional functions” button
and select the “Restore license” command.
🡆 The “Restore licenses” dialog opens.
3. Enter the “ticket ID” for the device license and click on “Restore”.
🡆 PLC Engineering searches for the license backup file, first on the local
computer, then on the License Central Server. When the file matching
the device is found, the license is restored and activated.
30 Using scripts
30.1 Using scripts– Basic information
With the scripting feature in PLC Engineering, you can automate commands
or complex program operations that you would otherwise have to do manually
with mouse clicks and text input in the PLC Engineering user interface. You
can start these scripts from the PLC Engineering user interface (command or
configured toolbar) or from the Windows command line.
Using scripts
– Continuous Integration (CI)
– Continuous Delivery (CD)
– Continuous Testing
● Integration with third-party software, for example:
– Code generators
– Creation of projects that are custom tailored to a specific machine config-
uration
● Creation of documentation
● Updating of libraries:
– Setting of project information during the release process
● Automatic testing:
– Mostly in connection with the CODESYS Test Manager
● Outputting variables via monitoring APIs
Also refer to
● ⮫ Continuous Delivery (CD)
● ⮫ Continuous Integration (CI)
● ⮫ Continuous Testing
Scripting language
The PLC Engineering scripting language is modular and based on IronPython.
For this purpose, the PLC Engineering "ScriptEngine" component combines
the IronPython interpreter with the PLC Engineering development environment.
Then you can use the extensive Python framework libraries, which includes file
access in networks and much more.
PLC Engineering does not yet include its own Python editor. Create your scripts
with any text editor or the Python editor.
Also refer to
● ⮫ Chapter 30.3.1 Python script – Basic information on page 348
There is not an integrated Python editor in PLC Engineering. Use your favorite
text editor or the Python development environment.
With the Automation Platform APIs, the ScriptEngine APIs can be extended.
Examples for this are CODESYS Test Manager and CODESYS SVN. Both provide
their own objects and methods as an extension to the scripting APIs. In addi-
tion, the CODESYS Test Manager allows for the execution of scripts in a test
case. Refer to the respective API documentation of the AddOns. Registered
Automation Platform users will find more information in the PLC Engineering
Developer Network.
Also refer to
● In the offline help: ⮫ API reference documentation for the ScriptEngine
● In the online help: ⮫ API reference documentation for the ScriptEngine
Using scripts
2. Open the Windows “Command prompt” and execute the CMD file.
You can pass arguments with additional information to the script. Python
scripts can access arguments with the sys.argv[] list. The first element
(Index 0) is always the name or path of the Python script that is executed,
followed by the actual parameters. (This is similar to argc/argv in C.) In addi-
tion, scripts can also access environment variables that are set before PLC
Engineering is started with the corresponding Python or .NET APIs.
Example
A CMD batch file argvtestbat.cmd has the following contents (all in one
line):
"C:\Program Files (x86)\3S CODESYS V3.5
SP10\CODESYS\Common\CODESYS.exe" --profile="CODESYS V3.5
SP10" --runscript="D:\Dokumente\Scripting\ArgvTestScript.py"
--scriptargs:'username password 3.14 "path=\"C:\temp\\\""' --
noUI
Example
from __future__ import print_function
import sys
print("sys.argv: ",
len(sys.argv),
" elements:")
For a complete reference of all possible command line parameters, see the
help page for the command line interface in PLC Engineering in the section on
"--runscript".
Also refer to
● ⮫ Python API documentation
● ⮫ Information about the .NET API
Example
Standardinstallation auf Windows 7
If you store a config.json file with different call information at each of the
storage locations, then you can configure up to 32 different icons.
Configuration file
Schema der Konfigurationsdatei für 2 Icons
[
{
<icon call information>
},
{
<last icon call information>
}
]
Schema der Aufrufinformation <icon call information>
Using scripts
"Path" Mandatory, path of the Python script <directory path>\<script
name>.ico
Example: "Path": "stop.py"
Tip: If the file is located in the same folder as the config.json file,
the file name is sufficient.
"Params" Optional; only if the script requires parameters
Example: "Params": [ "file1", "file2" ]
Example
Datei config.json
[
{
"Name": "Start",
"Desc": "Starts processing",
"Icon": "start.ico",
"Path": "goon.py",
"Params":
[
"--continue"
]
},
{
"Name": "Pause",
"Desc": "Pause operation",
"Icon": "pause.ico",
"Path": "stop.py",
"Params":
[
"delay:-1"
]
},
{
"Name": "Processing",
"Desc": "Process again",
"Icon": "VarStatSmall.ico",
"Path": "process.py",
"Params":
[
"exit"
]
}
]
The Script Commands folder contains the following files:
config.json
goon.py
stop.py
process.py
start.ico
pause.ico
VarStatSmall.ico"
Using scripts
{
"Name": "Copy Below",
"Desc": "Copy something",
"Icon": "Copy_below.ico",
"Path": "copy.py"
},
{
"Name": "Copy All",
"Desc": "Copy something",
"Icon": "CopyAll.ico",
"Path": "copy.py",
"Params":
[
"all"
]
},
{
"Name": "Delete",
"Desc": "Delete something",
"Icon": "Delete.ico",
"Path": "delete.py",
}
]
6. Start PLC Engineering.
🡆 The script files, the symbol files and the configuration file are read
in and are then available in the dialog “Tools 🠂 Customize” dialog in
the “Command icons” tab of the “ScriptEngine commands” command
category.
7. Open the dialog “Tools 🠂 Customize” and click on the “Toolbars” tab.
8. Select the empty toolbar and click on the “Add Toolbar” button.
🡆 A line editor opens at the empty toolbar.
9. Type in a name (example: User defined toolbar).
🡆 The custom toolbar is displayed in the PLC Engineering window.
10. Add the recently imported commands and close the dialog.
Also refer to
● ⮫ Chapter 7.2.2 Customizing Toolbars on page 48
Using scripts
For more detailed examples of Python scripts for different use cases with PLC
Engineering, refer to the following help pages:
See also
● ⮫ Chapter 30.3.4 Basic Syntax of Python (with Examples) on page 350
● ⮫ Chapter 30.3.5 Python Control Structures (with Examples) on page 358
Example: print
# encoding:utf-8
Using scripts
branches)
elif i=0:
print("The sum did not change: %i" % sum)
Everything that belongs to the same block has to be indented the same dis-
tance. The size of the indentation is irrelevant. Elements such as brackets and
braces have a higher priority than indentations. Therefore, the following code
segment is completely correct, even if it is written in a poor programming style:
Example: Indentation
# warning: bad style below. Kids, don't try this at home!
if foo >= bar:
print("foobar")
else:
print(
"barfoo"
)
To avoid ambiguity, you should not mix tabs and spaces in a file.
At this time, mixing tabs and spaces gilt in Python 3 qualifies as a syntax error.
The official Python Style Guide recommends indentation of four spaces and
includes some examples of good and poor style. The Python tutorial provides a
summary of coding style.
Python is case-sensitive, similar to and in contrast to ST. Keywords, such as
def, if, else, and while, have to be lowercase (in contrast to the ST rule:
keywords are uppercase). Two identifiers, such as "i" and "I", also identify two
different variables.
the following keywords are reserved in Python and not permitted for use as
identifiers for variables, functions, etc.: and | as | assert | break |
class | continue | def | del | elif | else | except | exec |
finally | for | from | global | if | import | in | is | lambda
| not | or | pass | print | raise | return | try | while | with
| yield.
Python 3 defined four other keywords: False | None | True | nonlocal.
While the first three are really new, the first three were already predefined
constants in Python 2 and should not be used for any other purposes.
See also
● ⮫ Python Style Guide
● ⮫ Python Tutorial
Example: Variables
# assign the integer 1 to the variable i (also "creates" the
variable")
i = 1
All existing variables reference one value only. There is not any unassigned or
uninitialized variables in Python. To express the absence of a value, Python
provides a special object: None. In C or ST, you would use a null pointer. Its
only purpose is to express "no value here", although None is actually an existing
instance of the class NoneType.
Example: Integers.py
from __future__ import print_function
i = 1
print(i)
Using scripts
m = (2 + 3)*10 # k is 50 now
print(m)
There is also only one floating-point type in Python which is similar to the IEC
data type LREAL. It provides 64-bit IEEE floating point arithmetic.
The syntax is like C-based languages for the most part:
Two special cases are True and False, two constants that define the Boolean
truth values. They behave similar to the integer values 0 and 1, except when
they are converted into strings and return their names.
Example: Booleans.py
# booleans behave like integers, except when converted to
strings.
# The built-in function "type" can be used to query the type
of a value.
print("True: ", True, type(True))
print("False: ", False, type(False))
print("1: ", 1, type(1))
print("False + 0: ", False + 0, type(False + 0))
print("True * 5: ", True * 5, type(True * 5))
Resulting output:
Strings
In IronPython, strings are always in Unicode and any length. It does not make
any difference if they are enclosed in ' or ". Strings can also have triple quota-
tion marks """ or ''', which allows for multiline string literals.
Similar to C, special characters can be excluded by means of backslashes (\):
As a comparison, the dollar sign ($) is used in IEC for this purpose.
There are also raw strings that have other rules for the backslash. This is prac-
tical when the string should have literal backslashes. Example: Windows file
paths or regular expressions.
Example: Strings.py
# encoding:utf-8
from __future__ import print_function
Python does not have characters types. Characters are expressed by the use
of strings with a length of 1. In this way, iteration via a string, or indexing in a
Using scripts
string, returns a single-character string.
See also
● ⮫ Python Documentation, Strings
Example: list_tuples.py
from __future__ import print_function
print("Testing tuples and lists")
Dictionary
Python also has a hash table type ( also "hashmap"). In contrast to the list,
it can be indexed with any elements, for example strings. Its constructor is
dict() and its literals are declared with braces {}.
The sample script dictionaries.py creates the output displayed below. In
the last line, the script is terminated with a "KeyError" exception:
Example: dictionaries.py
from __future__ import print_function
print("Testing dictionaries")
Using scripts
Resulting output:
You can view the stack trace by clicking the “Details” button. Here you find out
about line number 27 and the unknown key 23.
Example: loops.py
from __future__ import print_function
Using scripts
If you require an index or number in addition to the item, then you should use
enumerate as shown in the last case of the sample script. The following code
is considered as poor style:
Besides for loops, Python also has while loops which are very similar to those
in C and ST:
IF / ELSE
The if/else construct is similar to those in other programming languages.
Here is a short example:
Example: "if_else.py"
from __future__ import print_function
i = int(system.ui.query_string("Please enter an integral
number..."))
if i < 0:
print("Your number was negative.")
elif i > 0:
print("Your number was positive.")
else:
print("It seems your number was zero.")
The else branch is optional and there can be zero, one, or many elif
branches.
See also
● ⮫ Python Documentation, Defining Functions
● ⮫ Python Documentation, Classes
● String processing
● Date and time handling
● Collections
● Threading
● Mathematical functions
● File handling
● Persistence
● Compression and archiving
● Database access
● Encryption services
● Network and Internet access
Using scripts
● Sending of emails
To create your own modules, write a Python file that defines the functions and
classes that you want to provide. Save this file to the same directory as our
sample script. If you name the file mymodule.py, then you can import it with
import mymodule.
Here is an example of importing and using the cosine function and the pi
constant from the math module:
The following contains more examples that access information about the oper-
ating system, the Python version, and the interpreter:
Example: "__future__"
# make print() a function instead of a statement
from __future__ import print_function
MessageBox.Show("Hello")
See also
● ⮫ Description of the Python standard library
● ⮫ List of all "__future__" imports
● ⮫ Overview of .NET framework class libraries
Using scripts
currently opened project.
Load a project that contains some device objects and then run the script.
Example PrintDeviceTree.py
# encoding:utf-8
# We enable the new python 3 print syntax
from __future__ import print_function
Arguments:
treeobj -- the object to print
depth -- The current depth within the tree (default 0).
print_tree(obj)
Example ReadVariable.py
# encoding:utf-8
from __future__ import print_function
# opens project
proj = projects.open(r"D:\data\projects\Ampel.project")
# login to device
onlineapp.login(OnlineChangeOption.Try, True)
# wait 1 second
system.delay(1000)
Example MailVariables.py
# encoding:utf-8
from __future__ import print_function
Using scripts
application = project.active_application
# login to application.
online_application.login(OnlineChangeOption.Try, True)
# wait 2 seconds
system.delay(2000)
watch_expressions = []
print watch_expressions
print watch_values
# Close files
recipe_input_file.close()
recipe_output_file.close()
# send Email
# import respective libraries
import smtplib
from email.mime.text import MIMEText
# send email
smtp = smtplib.SMTP("name of smtp server")
smtp.sendmail(fromm, [to], mail.as_string())
smtp.quit()
CreateDut.py
# encoding:utf-8
from __future__ import print_function
STRUCT_CONTENT = """\
a : BOOL;
b : BIT;
c : BIT;
"""
UNION_WHOLE = """\
TYPE MyUnion :
UNION
Zahl : INT;
Prozent : MyAlias;
Bits : MyStruct;
END_UNION
END_TYPE
"""
proj = projects.primary
# Alias types get their "content" via the base type, which
Using scripts
will just end up
# as one line in the declaration part:
# TYPE MyAlias : INT (0..100); END_TYPE
bereich = folder.create_dut('MyAlias', DutType.Alias, "INT
(0..100)")
Example System_UI_Test.py
# encoding:utf-8
from __future__ import print_function
Example ProjectInfoExample.py
Using scripts
# encoding:utf-8
from __future__ import print_function
proj = projects.load("D:\Some.library")
info = proj.get_project_info()
proj.save()
Example DeviceImportFromSVN.py
# encoding:utf-8
# Imports a Device in PLCOpenXML from Subversion via command
line svn client.
import sys, os
Advanced example: Retrieve library from SVN and install in PLC Engineering
The following sample script can handle retrieving and installing a library as part
of a CT (Continuous Testing) environment so that it can then be tested. In
addition to the standard PLC Engineering, the add-on CODESYS SVN also has
to be installed with a valid license.
Example
import tempfile
if projects.primary:
projects.primary.close()
tempdir = tempfile.mkdtemp()
URL = "svn://localhost/testrepo/trunk/SvnTestLibrary/"
Using scripts
repo = librarymanager.repositories[0]
librarymanager.install_library(proj.path, repo, True)
proj.close()
31 Security
31.1 Security – Preface
Due to the increased networking of controllers and plants, potential threats are
also quickly rising. Therefore, you should carefully consider all possible safety
measures.
Security measures are absolutely necessary to protect data and communication
channels from unauthorized access.
On the following help pages, you can learn more about the safety functions of
PLC Engineering and the controller.
Security
Below, find some general information about security functions ("Security"
measures). This information applies regardless of the use in PLC Engineering
or a connected control.
Encryption, Signature
Encryption:
Encryption of data means: The data is converted into a non-readable form and
can only be rendered readable again with a matching key. In the simplest case,
the key is a password or a key pair.
There are two types of encryption methods:
● Symmetrical method: (the only type of encryption until the mid-1970s)
Feature: Use of a secret key
Advantages: Fast, easy encoding
Disadvantages: The key has to be exchanged secretly!
● Asymmetric method:
Feature: Use of a key pair (private/secret and public key)
Advantages: A public key can be made available to anyone; authentication is
possible with the key
Disadvantages: Slow (approx. 1,000-10,000x slower than symmetric
methods); complex coding; long key lengths
Key exchange is usually performed by asymmetric methods; encryption and
decryption by symmetric methods.
Signature:
Certificates
To be able to assign the public key to an identity, it is usually embedded in a
so-called certificate.
In certificate-based systems, each user receives a digital certificate. The certif-
icate is used for digital identification. It contains information about the iden-
tity and the public key of the user. Each certificate is authenticated by an
issuing authority, which in turn may be authenticated by higher authorities. The
trust system of this PKI (Public Key Infrastructure) is strictly hierarchical. The
common trust anchor is a so-called root certificate.
Contents of a certificate:
● Version
● Serial number
● Algorithm ID
● Issuer (authority or company)
● Validity from (not before) to (not after)
● Certificate owner (subject)
● Certificate owner key information (subject public key)
– Public key algorithm
– Public key of the certificate owner
● Unique ID of the issuer (optional)
● Unique ID of the owner (optional). The owner has a private key matching the
public key
● Extensions
– Purpose (extended key usage)
– ...
The certificate consists of 2 parts / files:
● Public X.509 certificate (can be issued to anyone)
● Private key that matches the certificate or its public key only (must not be
passed on!).
To manage the certificates in your local "Windows Certificate Store" please also
see the following help page:
● ⮫ Chapter 11 Protecting and saving the project on page 75
Security
● Enabling user management: simple or group-based
● Certificate-based encryption of communication with the controller
A user management is mandatory for the SL runtime sys-
NOTICE
tems
See also
● ⮫ Chapter "Run as CODESYS WebVisu"
● ⮫ Chapter "User management of the visualization"
● ⮫ Chapter 20.3 Encrypting Communication, Changing Security Settings
on page 258
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
32 Reference, programming
32.1 Programming languages and their editors
32.1.1 Programming languages and their editors – General information
Program a POU in the editor for the implementation language you selected
when creating the POU. PLC Engineering provides a text editor for ST and
graphical editors for SFC, FBD/LD/IL and CFC.
The editor opens when you double-click on the POU in the device tree or in the
Reference, programming
“POUs” view.
Each programming editor consists of two subwindows:
● In the upper part, use the “declaration editor” to make declarations.
Depending on the setting, declarations can either be made as text or table.
● Insert the implementation code of the respective language in the lower part.
You can configure the representation and behavior of each editor across the
project in the associated tab of the PLC Engineering options.
coupled and uncoupled click on the symbol to the right of the bars. In the
uncoupled state, you can increase or decrease the perimeter of the area to be
monitored.
The “Prepared Value” column contains the value that you prepared for forcing
or writing.
If you double-click a “Prepared Value” field, then you can specify a value explic-
itly for writing or forcing. In case of enumerations, a combo box opens to select
a value from. In the case of a Boolean variable you can toggle the prepared
value with the help of the [Enter] key or the [Space] bar. If an expression
(variable) is of a structured data type, e.g. the instance of a function block or
an array variable, a plus or a minus is placed in front.
You can customize the format of the representation of floating-point values in
the options for monitoring.
Also refer to
● ⮫ Chapter 18.16.3 Using the Declaration Editor on page 165
● ⮫ Chapter 33.4.10 Dialog 'Prepare Value' on page 1041
● ⮫ Forcing in the declaration section on page 279
You can drag function block declarations in the FBD, LD, and CFC 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.
See also
● ⮫ Chapter SFC (sequential function chart) editor on page 391
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter CFC editor on page 425
Reference, programming
32.1.4 Structured text and Extended Structured text (ExST)
ST Editor
The ST editor is a textual editor used for the implementation of code in Struc-
tured Text (ST) and Extended Structured Text (ExST).
The line numbering is displayed on the left side of the editor. The functionality
"List components" (to be activated in the PLC Engineering options, category
“Intelligent coding”), and the input help[(F2]) when entering the programming
elements. When the cursor is on a variable, PLC Engineering displays informa-
tion about the variable's declaration in the tooltip.
The box selection can be made with the following key combinations:
● [Shift] + [Alt] + [right arrow]: The selected area is extended one place to the
right
● [Shift] + [Alt] + [left arrow]: The selected area is extended one place to the
left
● [Shift] + [Alt] + [up arrow]: The selected area is extended upwards by one
line
● [Shift] + [Alt] + [down arrow]: The selected range is extended downward by
one digit
If the editor window has a scroll bar due to long text lines, you can scroll using
the scroll wheel of the mouse while holding down the Shift key.
Zooming in the editor window is possible by using the scroll function of the
mouse while holding down the Ctrl key.
You configure the behavior (such as bracketing, mouse actions, tabs) and
appearance of the editor in the PLC Engineering options in the “Text editor”
category.
For an incremental search for strings within the editor, use the key combination
[Ctrl] + [Shift] + [i] to open an input field at the bottom of the editor. As
soon as you start typing in characters, the corresponding search locations are
highlighted in color in the editor. The number of found matches is shown to
the right of the input field. Using the arrow buttons or the key combinations
[Alt] + [Page up] or [Alt] + [Page down], you can position the cursor on a found
location.
When you place the cursor on a symbol name, all occurrence locations of the
symbol within the editor are highlighted in color. The search locations corre-
spond to the hits in the cross-reference list. For very large projects, this can
cause input delays. In this case, you can disable the function in the options of
the text editor.
PLC Engineering detects syntax errors while entering data in the editor
and outputs the corresponding messages in the message window in the
“precompilation” category. In addition, if the corresponding option is enabled
in the PLC Engineering options, “Intelligent coding” category, the error places
in the text will be underlined in red.
ST expressions
An expression is a construct that returns a value after being evaluated.
Expressions are composed of operators and operands. In Extended Structured
Text (ExST), assignments can also be used as expressions. An operand can be a
constant, a variable, a function call or another expression.
Examples
2014 (* Constant *)
ivar (* Variable *)
fct(a,b) (* Function call *)
(x*y)/z (* Expression *)
real_var2 := int.var; (* in ExST: Assignment *) *)
Also refer to
● ⮫ Chapter ExST - Extended Structured Text on page 192
Evaluation of expressions
The evaluation of an expression is realized by processing the operators
according to certain binding rules. PLC Engineering processes the operator
with the strongest binding first. Operators with equal priority are processed
from left to right.
Reference, programming
Divide /
Modulo MOD
Adding +
Subtracting -
Compare <,>,<=,>=
Equality =
Inequality <>
Bool AND AND
AND_THEN
Bool XOR XOR
Bool OR OR Lowest priority
OR_ELSE
Also refer to
● ⮫ Chapter 32.3 Operators on page 454
Assignments (ST)
ST Assignment Operator
Syntax:
<operand> := <expression>
This assignment operator executes the same function as the MOVE operator.
See also
● ⮫ Chapter 32.3.20 Operator 'MOVE' on page 462
Example
FBcomp_Output1 => bVar1;
FBcomp_Output2 => ;
FBcom_Output1 and FB_Output2 are outputs of a function block. The value of
FBcom_Output1 is assigned to the variable bVar1.
Example
PROGRAM PLC_PRG
VAR
xOperand: BOOL := FALSE;
xSetVariable: BOOL := FALSE;
END_VAR
xSetVariable S= xOperand;
When the operand xOperand switches from FALSE to TRUE, then TRUE is also
assigned to the variable xSetVariable. But then the variable keeps this state,
even if the operand continues to change its state.
Multiple assignments
In the case of multiple assignments within a code line,
NOTICE
the individual assignments are not processed from right
to left, but all assignments refer to the operands at the
end of the code line.
Example
PROGRAM PLC_PRG
VAR
xSetVariable: BOOL;
xResetVariable: BOOL := TRUE;
xVar: BOOL;
END_VAR
xSetVariable S= xResetVariable R= funCompute(xIn := xVar);
xResetVariable receives the R= assignment of the return value of
funCompute. xSetVariable receives the S= assignmentof the return value
from funCompute, but not from xResetVariable.
Also refer to
● ⮫ Chapter ExST - Extended Structured Text on page 192
● ⮫ Chapter ExST Assignment 'R=' on page 383
Example
VAR
Reference, programming
xOperand: BOOL := FALSE;
xResetVariable: BOOL := TRUE;
END_VAR
xResetVariable R= xOperand;
When the operand xOperand switches from FALSE to TRUE, then FALSE is
also assigned to the variable xResetVariable. But then the variable keeps its
state, even if the operand continues to change its state.
Multiple assignments
In the case of multiple assignments within a code line,
NOTICE
the individual assignments are not processed from right
to left, but all assignments refer to the operands at the
end of the code line.
Example
PROGRAM PLC_PRG
VAR
xSetVariable: BOOL;
xResetVariable: BOOL := TRUE;
xVar: BOOL;
END_VAR
xSetVariable S= xResetVariable R= funCompute(xIn := xVar);
xResetVariable receives the R= assignment of the return value of
funCompute. xSetVariable receives the S= assignmentof the return value
from funCompute, but not from xResetVariable.
Also refer to
● ⮫ Chapter ExST - Extended Structured Text on page 192
● ⮫ Chapter ExST Assignment 'S=' on page 382
Examples
int_var1 := int_var2 := int_var3 + 9; (* int_var1 and int_var2 get value of
int_var3 + 9 *)
real_var1 := real_var2 := int_var; (* real_var1 and real_var2 obtain the value
of int_var *)
int_var := real_var1 := int_var; (* incorrect assignment, data types do not
match! *)
IF b := (i = 1) THEN
i := i + 1;
END_IF
Also refer to
● ⮫ Chapter ExST - Extended Structured Text on page 192
Example
See also
● ⮫ Chapter 32.5.17 Reference on page 567
● ⮫ Chapter Command 'REF= (Reference Assignment)' on page 987
Instructions (ST)
ST Statement 'IF'
The IF statement is used for checking a condition and, depending on this
condition, for executing the subsequent statements.
A condition is coded as an expression that returns a Boolean value. If the
expression returns TRUE, then the condition is fulfilled and the corresponding
statements after THEN are executed. If the expression returns FALSE, then
the following conditions, which are identified with ELSIF, are evaluated. If
an ELSIF condition returns TRUE, then the statements are executed after the
corresponding THEN. If all conditions return FALSE, then the statements after
ELSE are executed.
Therefore, at most one branch of the IF statement is executed. ELSIF branches
and the ELSE branch are optional.
Syntax
IF <condition> THEN
<statements>
( ELSIF <condition> THEN
<statements> )*
( ELSE
<statements> )?
END_IF;
// ( ... )* None, once or several times
// ( ... )? Optional
Example
PROGRAM PLC_PRG
VAR
iTemp: INT;
xHeatingOn: BOOL;
Reference, programming
xOpenWindow: BOOL;
END_VAR
See also
● ⮫ Chapter ST expressions on page 380
ST Instruction 'FOR'
The FOR loop is used to execute instructions with a certain number of repeti-
tions.
Syntax:
FOR <counter> := <start value> TO <end value> {BY
<increment> } DO
<instructions>
END_FOR;
The section inside the curly parentheses {} is optional.
PLC Engineering executes the <instructions> as long as the <counter> is
not greater, or - in case of negative increment - is not smaller than the <end
value>. This is checked before the execution of the <instructions>.
Every time the instructions <instructions> have been executed, the counter
<counter> is automatically increased by the increment <increment>. The
increment <increment> can have any integral value. If you do not specify an
increment, the standard increment is 1.
Example
FOR iCounter := 1 TO 5 BY 1 DO
iVar1 := iVar1*2;
END_FOR;
Erg := iVar1;
If you have pre-configured iVar1 with 1, iVar1 has the value 32 after the FOR
loop.
The end value <end value> may not attain the same value
CAUTION
as the upper limit of the data type of the counter.
If the end value of the counter is equal to the upper
limit of the data type of the counter, an endless loop
results. For example, an endless loop results in the
above example if iCounter is of the data type SINT and
the <end value> equals 127, since the data type SINT
has the upper limit 127.
As an extension to the IEC 61131-3 standard you can use the CONTINUE instruc-
tion within the FOR loop.
See also
● ⮫ Chapter 32.5.6 Integer Data Types on page 556
● ⮫ Chapter EXST Statement 'CONTINUE' on page 389
ST Instruction 'CASE'
Use this dialog box for pooling several conditional instructions containing the
same condition variable into a construct.
Syntax:
CASE <Var1> OF
<value1>:<instruction1>
<value2>:<instruction2>
<value3, value4, value5>:<instruction3>
<value6 ... value10>:<instruction4>
...
<value n>:<instruction n>
{ELSE <ELSE-instruction>}
END_CASE;
The section within the curly brackets {} is optional.
Processing scheme of a CASE instruction.
● If the value of the variable <Var1> is <value i>, then the instruction
<instruction i> is executed.
● If the variable <Var1> has non of the given values, then the <ELSE-
instruction> is executed.
● If the same instruction is executed for several values of the variable, then
you can write the values in sequence, seperated by commas.
Example
CASE iVar OF
1, 5: bVar1 := TRUE;
bVar3 := FALSE;
2: bVar2 := FALSE;
bVar3 := TRUE;
Reference, programming
ELSE
bVar1 := NOT bVar1;
bVar2 := bVar1 OR bVar2;
END_CASE;
ST Instruction 'WHILE'
The WHILE loop is used like the FOR loop in order to execute instructions
several times until the abort condition occurs. The abort condition of a WHILE
loop is a boolean expression.
Syntax:
WHILE <boolean expression> DO
<instructions>
END_WHILE;
PLC Engineering repeatedly executes the <instructions> for as long as the
<boolean expression> returns TRUE. If the boolean expression is already
FALSE at the first evaluation, then PLC Engineering never executes the instruc-
tions. If the boolean expression never adopts the value FALSE, then the instruc-
tions are repeated endlessly, as a result of which a runtime error results.
Example
WHILE iCounter <> 0 DO
Var1 := Var1*2
iCounter := iCounter-1;
END_WHILE;
ST Statement 'REPEAT'
The REPEAT loop is used like the WHILE loop, but with the difference that PLC
Engineering only checks the abort condition after the execution of the loop.
The consequence of this behavior is that the REPEAT loop is executed at least
once, regardless of the abort condition.
Syntax:
REPEAT
<instructions>
UNTIL <boolean expression>
END_REPEAT;
Example
REPEAT
Var1 := Var1*2;
iCounter := iCounter-1;
UNTIL
iCounter = 0
END_REPEAT;
In a certain sense the WHILE and REPEAT loops are more powerful than the FOR
loop, since the number of executions of the loop doesn't already need to be
known before its execution. In some cases you can only work with these two
kinds of loop. If the number of executions of the loop is clear, however, then a
FOR loop is preferable in order to avoid endless loops.
As an extension to the IEC 61131-3 standard you can use the CONTINUE
instruction within the WHILE loop.
See also
● ⮫ Chapter ST Instruction 'WHILE' on page 387
● ⮫ Chapter ST Instruction 'FOR' on page 385
● ⮫ Chapter EXST Statement 'CONTINUE' on page 389
ST instruction “RETURN”
Use the RETURN statement in order to exit from a function block. Perform this
with regard to a condition for example.
Example
iCounter := iCounter + 1;
If the value of xIsDone is equal to TRUE, then the function block is exited
immediately and the statement iCounter := iCounter + 1; is not exe-
cuted.
Since the RETURN statement also supports conditional returns, the above
example can also be written as follows:
RETURN (xIsDone);
iCounter := iCounter + 1;
Also refer to
● ⮫ Chapter ST Statement 'IF' on page 384
ST Instruction 'JMP'
The JMP instruction is used to execute an unconditional jump to a program line
that is marked by a jump label.
Syntax:
<label>: <instructions>
JMP <label>;
The jump label <label> is any unique identifier that you place at the beginning
of a program line. On reaching the JMP instruction, a return to the program line
with the <label> takes place.
Reference, programming
Example
iVar1 := 0;
_label1: iVar1 := iVar1+1;
(*instructions*)
ST Instruction 'EXIT'
The EXIT instruction is used in a FOR, WHILE or REPEAT loop in order to end
the loop regardless of other abort conditions.
See also
● ⮫ Chapter ST Instruction 'FOR' on page 385
● ⮫ Chapter ST Instruction 'WHILE' on page 387
● ⮫ Chapter ST Statement 'REPEAT' on page 387
Example
FOR Counter:=1 TO 5 BY 1 DO
INT1:=INT1/2;
IF INT1=0 THEN
CONTINUE; (* to avoid a division by zero *)
END_IF
Var1:=Var1/INT1; (* executed, if INT1 is not 0 *)
END_FOR;
Erg:=Var1;
See also
● ⮫ Chapter ST Instruction 'FOR' on page 385
● ⮫ Chapter ST Instruction 'WHILE' on page 387
● ⮫ Chapter ST Statement 'REPEAT' on page 387
Example
TMR:TON;
The timer function block TON is instanced in TMR:TON and called with assign-
ments for the parameters IN and PT.
The output Q is addressed with TMR.Q and assigned to the variable varA.
See also
● ⮫ Chapter ‘Function block’ object on page 823
ST – Comments
Comment Description Example
Single-line There are two ways of marking: /// This is a comment.
● Starts with // and ends at the end /// This is a comment.
of the line
● Starts with /// and ends at the end
of the line
In PLC Engineering, these comments
are handled the same way.
However, if library documentation is
created using the LibDoc Scripting Col-
lection, the following applies:
● When the property LibDocContent
= DocsOnly is entered in the
project information, only comments
marked with /// are processed
into library documentation. See the
example for this below the table.
● When LibDocContent =
CommentsAndDocs (default setting)
is defined, all comments are proc-
essed into library documentation.
Multiline Starts with (* and ends with *). (* This is a multiline comment
*)
Nested Starts with (* and ends with *). Addi- ( * a:=inst.out; (* comment 1
tional comments (*....*) can be con- *) b:=b+1; (* comment 2 *) *)
tained within this comment.
Note: It is not recommended to mix the different comment types because this
can cause unwanted side-effects when the documentation is generated.
Reference, programming
When inserting by means of a menu command, the elements that can be
inserted at the currently selected position are available.
Before inserting branches parallel to multiple actions and transitions, you must
highlight these actions and transitions in a multiple selection.
You can also drag&drop SFC elements from the “Tools” view into the diagram.
When you drag an element over the editor, PLC Engineering marks all possible
insertion points with gray boxes. If you move the mouse over a gray box, then
the color of the box changes to green. When you release the mouse button, the
object is inserted at that location.
If a branching is inserted via drag&drop, select the beginning and the end of
the branching using the mouse. To highlight the beginning of the branching,
release the mouse on the insertion position. The color of the rectangle
becomes red. You set the end of the branch by clicking the second insertion
point. Then PLC Engineering inserts a branch around the objects between the
beginning and end markers.
For copying step and transition elements that call action objects or transition
objects, two different duplication modes can be set. Either the references are
copied at the same time, or the referenced objects are embedded and dupli-
cated when copying.
Define the look and feel of the editor in the PLC Engineering options in the
“SFC Editor” category.
Also refer to
● ⮫ Chapter 32.1.3 Common Functions in Graphical Editors on page 378
● ⮫ Chapter 32.1 Programming languages and their editors on page 377
● ⮫ Chapter Programming in SFC on page 193
● ⮫ Chapter “Options” - “SFC editor” dialog on page 1089
See also
● ⮫ Chapter Implicit Variables on page 394
● ⮫ Chapter 18.16.3 Using the Declaration Editor on page 165
● ⮫ Chapter Processing Order in SFC on page 392
● ⮫ Chapter “Options” - “SFC editor” dialog on page 1089
Reference, programming
layout in the SFC diagram, from top to bottom and from left to right. If the
conditions are fulfilled, then PLC Engineering executes the entry actions.
PLC Engineering executes an entry action as soon as the transition of the
preceding step has been processed and yields TRUE, thus indicating that
the step has been activated.
4. Time check / Execute step actions
PLC Engineering performs the following check for each step in the order
of the SFC layout:
● PLC Engineering copies the elapsed time of the active step to
the respective implicit step variable <step name>.t. (not yet imple-
mented)
● If a timeout occurs, then PLC Engineering sets the respective error
flags. (not yet implemented)
● For non-IEC steps: PLC Engineering executes the step action.
5. Execute IEC actions
PLC Engineering executes the IEC actions in alphabetical order, passing
through the list of actions two times. In the first pass, PLC Engineering
executes the IEC actions for each step that was deactivated in the pre-
ceding cycle. In the second pass, the IEC actions are executed for each
active step.
6. Transition check / Activate next steps
The transitions are passed as follows: If a step is active in the current
cycle and the subsequent transition yields TRUE and any defined minimum
time of the step has elapsed, then the subsequent step is activated.
See also
● ⮫ Chapter Implicit Variables on page 394
● ⮫ Chapter Qualifiers for Actions in SFC on page 394
Implicit Variables
Every SFC object supplies implicit variables for you to monitor the status of
steps and IEC actions at runtime. These implicit variables are declared auto-
matically by PLC Engineering for each step and each IEC action.
The implicit variables are structure instances of the type SFCStepType for
steps and type SFCActionType for actions. The variables have the same names
as their elements, for example "step1" variable name for "step1" step name.
The structure members describe the status of a step or action or the currently
elapsed time in an active step.
In the element properties, you can define whether PLC Engineering should
export a symbol definition for this flag to the symbol configuration.
See also
● ⮫ Chapter SFC Element Properties on page 408
Reference, programming
Table 8: The following implicit variables are available for step or IEC action status:
Step
<step name>.x Shows the activation status in the current cycle.
When <step name>.x = TRUE, PLC Engineering processes the
step in the current cycle.
<step name>._x Shows the activation status for the next cycle.
When <step name>._x = TRUE and <step name>.x = FALSE,
PLC Engineering processes the step in the next cycle. This means
that <step name>._x is copied to <step name>.x at the begin-
ning of a cycle.
<step name>.t The flag t yields the current elapsed time since the step was
activated. This applies only to steps, regardless of whether a min-
imum time has been defined or not in the step properties.
Also see SFC flag SFCError.
<step name>._t For internal use only
IEC action
_<action name>.x TRUE when the action is being executed.
_<action name>._x TRUE when the action is active.
You can use the above variables to force a specific status
NOTICE
value to a step (activate a step). However, note that this
can cause an unstable status in the SFC.
Example
status:=step1._x;
Example
status:=SFC_prog.step1._x;
Symbol generation
In the element properties of a step or action, you define whether PLC Engi-
neering should add a symbol definition for the step or action flag. In the
“Properties” view, you have to select the necessary access rights in the
“Symbol” column.
See also
● ⮫ Chapter SFC Element Properties on page 408
SFC Flags
SFC flags are implicitly generated variables with predefined names. You can
use them to influence the processing of an SFC diagram. You can use these
flags, for example, to display timeouts or reset step chains. In addition, you can
activate jogging mode specifically to activate transitions. You have to declare
and activate these variables in order to have access to them.
SFC flags
Name Data Type Description
SFCInit Bool TRUE: PLC Engineering resets the sequence to the initial step. The other
SFC flags are also reset (initialization). While the variable is TRUE, the
initial step remains set (active), but its actions are not executed. Only
when you set SFCInit again to FALSE is the POU further processed
normally.
SFCReset Bool This function behaves similar to SFCInit. However, PLC Engineering
continues processing after the initialization of the initial step. For
example, in the initial step, you could immediately reset the SFCReset
flag to FALSE.
SFCError Bool TRUE if a timeout occurs in an SFC diagram. If second timeout occurs
in the program, it is not registered unless you previously reset the vari-
able SFCError. The declaration of SFCError is a requirement for other
flag variables to function for controlling the chronological sequence
(“SFCErrorStep”, SFCErrorPOU, SFCQuitError).
SFCEnableLim Bool Used specifically for activating (TRUE) and deactivating (FALSE) the
it timeout control in steps using SFCError. If you declare and activate
this variable (SFC settings), then you must set it to TRUE for SFCError
to work. If you do not, then the timeouts are ignored. The is useful, for
example, at start-up or in manual operation. If you do not declare the
variable, then SFCError will work automatically.
The requirement is the declaration of SFCError.
SFCErrorStep String Stores the name of the step that caused a timeout, which was regis-
tered by SFCError. The name is kept until the registered step error is
reset by means of SFCQuitError (FALSE -> TRUE).
The requirement is the declaration of SFCError.
SFCErrorPOU String Stores the name of the block in which a timeout occurred and was
registered by SFCError. The name is saved until the timeout is reset by
SFCQuitError.
The requirement is the declaration of SFCError.
SFCQuitError Bool As long as this Boolean variable is TRUE, PLC Engineering pauses the
processing of the SFC diagram and any timeout, saved in the variable
SFCError, is reset. If you reset the variable to FALSE, then all previous
times in the active steps are reset.
The requirement is the declaration of SFCError.
Reference, programming
next step only by setting SFCTip to TRUE. While SFCTipMode is set to
FALSE, transitions can also be used to continue activation.
SFCErrorAnal Contains as string all variables that contribute to the total value TRUE
yzation, of SFCError (timeout in one step). SFCError needs to be activated for
this.
SFCErrorAnalyzation implicitly uses the function of the POU
AnalyzeExpression of the library Analyzation.
SFCErrorAnal Contains in a table all variables that contribute to the total value TRUE
yzationTable of SFCError (timeout in one step). SFCError needs to be activated for
, this.
SFCErrorAnalyzationTable implicitly uses the function of the POU
AnalyzeExpressionTable of the library Analyzation.
Example
You have created an SFC block named sfc1, which contains the s1 step. You
have defined timeouts in the step properties. (See "Online view of SFC block
sfc1" below.)
If for any reason the s1 step remains active longer than its time properties
have permitted (timeout), then PLC Engineering sets the SFCError flag to
permit access by the application.
To permit access, you have to declare and activate the SFC flag in the SFC
settings. If you have only declared it, then the SFC flag is only displayed in the
online view of sfc1 in the declaration part, but it has no function.
Now the SFC flag can be referenced within the POU, for example in an action
(2) or outside of the block (1).
Reference, programming
SFCError is TRUE as soon as a timeout occurs within sfc2.
Note that you can use the flags SFCErrorAnalyzation and
SFCErrorAnalyzationTable to determine the components of the expression
that contributes to the value TRUE of the SFCError.
See also
● ⮫ Chapter Library "Analyzation" on page 400
Example
checkerror:=SFCerror;
Example:
checkerror:=SFC_prog.SFCerror;
If you need write access from another block, then you also have to declare the
SFC flag explicitly as a VAR_INPUT variable in the SFC block or globally in a
GVL.
Example
Local declaration:
PROGRAM SFC_prog
VAR_INPUT
SFCinit:BOOL;
END_VAR
Global declaration in a global variable list:
VAR_GLOBAL
SFCinit:BOOL;
END_VAR
PROGRAM PLC_PRG
VAR
setinit: BOOL;
END_VAR
SFC_prog.SFCinit:=setinit; // write access to SFCinit in
SFC_prog
See also
● ⮫ Chapter Library "Analyzation" on page 400
Library "Analyzation"
This library contains POUs for the analysis of expressions. When a compo-
site expression has the total value of FALSE, those of its components that
contribute to this result can be determined. In the SFC editor, the flags
SFCErrorAnalyzation and SFCErrorAnalyzationTable use these functions
implicitly to examine the transition expressions. Then the flags provide the
identifiers of the variables that contributed to a timeout error. They keep
this information until they are reset explicitly by means of the SFC flag
SFCQuitError.
See also
● ⮫ Chapter Programming in SFC on page 193
● ⮫ Chapter SFC Flags on page 396
Elements (AS)
Reference, programming
step” or by setting the respective property in the SFC properties.
All steps are defined by the step properties, which you can display and edit in
the “Properties” view, depending on the set options.
You have to add those actions to the step which are to be executed when the
step is active. A distinction is made between IEC actions and step actions.
Details for this are found in the chapter about the SFC element "Action".
A transition must include the condition for the subsequent step to be active as
soon as the value of the condition yields TRUE. Therefore, a transition condition
must yield TRUE or FALSE. It can be defined in one of two ways:
● (1) Inline condition (direct): You replace the default transition name with
either the name of a Boolean variable, a Boolean address, a Boolean con-
stant, or a statement with a Boolean result, for example (i<100) AND b.
You cannot specify programs, function blocks, or assignments here.
● (2) Multi-use condition (separate transition or property object): You replace
the default transition name with the name of a transition or property object
( , ). You create these objects by clicking “Project 🠂 Add Object”. This
allows multiple use of transitions, for example "condition_xy" in the figures
below. Like an inline condition, the object can contain a Boolean variable,
Boolean address, Boolean constant, or an statement with a Boolean result.
In addition, it can also contain multiple statements with any code.
Exception: In the case of IEC actions, which you add to a step as action associ-
Reference, programming
ation, you can also specify a Boolean variable instead of an action object. The
value of these variables is switched between FALSE and TRUE each time the
action is executed.
You have to define unique step names within the scope
NOTICE
of the parent block. An action written in SFC must not
contain a step with a name identical to the step to which
the action is assigned.
A distinction is made between IEC actions and step actions:
1. IEC actions
IEC actions comply with the IEC 61131-3 standard. They are executed
according to their qualifiers.
IEC actions are executed two times: first when the step is activated and second
when the step is deactivated. If you assign multiple actions to one step, then
the action list is processed from top to bottom.
Each action box includes the qualifier in the first column and the action name
in the second column. Both can be edited directly.
2. Step actions
These are actions that you can use to extend the IEC standard.
● Entry action:
PLC Engineering executes this action after the step is activated and before
the main action is executed.
You reference a new action, or an action created below the SFC object, from
a step by means of the “Entry action” element property (2). You can also
add a new action to the step by means of the “Add Entry Action” command.
The entry action is marked with an E in the lower left corner of the step box.
● Main action:
PLC Engineering executes this action when the step is active and any entry
actions have already been processed. However, in contrast to IEC actions
(see above), these step actions are not executed a second time when the
step is deactivated. Moreover, you cannot use qualifiers here.
You add an existing action to a step by means of the “Main action” element
property (1). You can create and add a new action by clicking the step
element. A main action is marked with a filled triangle in the upper right
corner of the step box.
● Exit action:
PLC Engineering executes this action one time when the step is deactivated.
However, note that an exit action is not executed in the same cycle, but at
the beginning of the next cycle.
You reference a new action, or an action created below the SFC object, from
a step by means of the “Exit action” element property (3). You can also add
a new action to the step by means of the “Insert Exit Action” command. The
exit action is marked with an X in the lower right corner of the step box.
See also
● ⮫ Chapter SFC Element Properties on page 408
Example
Reference, programming
You have attached the Action_AS1 action to the AS1 step as a step action
(left) and as an IEC action with qualifier N (right). Because two transitions
are activated in each case, the time to reach the initial step again is two PLC
cycles. This is true as long as the iCounter counter variable was initialized
at 0 and then incremented in the Action_AS1 action. After the Init step
is reactivated, iCounter returns a value of 1 in the example on the left. In
the example on the right, a value of 2 is returned because the IEC action is
executed a second time due to the deactivation of AS1.
Parallel branch
For parallel branches, the branch lines must begin and end with steps. Parallel
branch lines can contain additional branches.
The horizontal lines before and after the branch are double lines.
Processing in online mode: If the preceding transition (t2 in the example) yields
TRUE, then the first steps in all parallel branch lines are active (Step11 and
Step21). PLC Engineering processes the individual branch lines at the same
time and the subsequent transition is passed afterwards (t3).
The "Branch<n>" jump marker is added automatically to the horizontal line that
indicates the beginning of a branch. You can define this marker as the jump
destination.
Please note that you can convert a parallel branch into an alternative branch by
clicking “Alternative”.
See also
● ⮫ Chapter Command 'Alternative' on page 980
Alternative branch
The horizontal line before and after the branch is a single line.
In an alternative branch, the branch lines must begin and end with transitions.
The branch lines can contain additional branches.
If the step before the branch is active, then PLC Engineering passes the first
transition of each alternative branch line from left to right. For the first transi-
tion that yields TRUE, the associated branch line opens, thus activating the step
following the transition.
Please note that you can convert an alternative branch into a parallel branch by
clicking “Parallel”.
See also
● ⮫ Chapter Command 'Parallel' on page 980
Reference, programming
See also
● ⮫ Chapter Programming in SFC on page 193
● ⮫ Chapter Command 'Insert Jump' on page 983
See also
● ⮫ Chapter Programming in SFC on page 193
● ⮫ Chapter Command 'Zoom Into Macro' on page 984
● ⮫ Chapter Command 'Zoom Out of Macro' on page 984
General
Property Value description
“Name” Element name, by default "<element><consecutive number>", for
example step name "Step0", "Step1", branch name "Branch0”, etc.
“Comment” Element comment in text, for example “counter reset”. You can insert
line breaks by pressing [Ctrl]+[Enter].
Reference, programming
● “Write”: The symbol is exported to the symbol configuration and
can be written from the PLC.
● “Read/Write”: Combination of read and write.
● Empty: A symbol is not exported to the symbol configuration.
Specific
Property Value description
“Init step” : This option is activated only for the defined initial step. By default,
this is the first step in an SFC diagram.
Note: If you activate this property for another step, then it must be
deactivated in the previous step to prevent compilation errors.
“Duplicate when copying” This option is available for steps that contain a step action (entry
action, main action, or exit action), and for transitions that are linked
to a transition object.
: When copying the step or transition, a new object is created for
each called action or transition. It contains a copy of the implementa-
tion code of the copied object.
: When copying a step or transition, the link to the called object is
retained for the respective action or transition. No new objects are
generated. The source and the copies of the step or transition call the
same action or transition.
“Times” Minimum time that the step is active, even when the subsequent tran-
● “Minimum active” sition is TRUE.
● “Maximum active” Maximum time that the step can be active. If this time is exceeded,
then PLC Engineering sets the SFCError implicit variable to TRUE.
Times according to IEC syntax (for example t#8s) or the TIME variable;
default: t#0s.
“Actions” ● “Entry action”: PLC Engineering executes these actions after acti-
● “Entry action” vating the step.
● “Step action” ● “Step action”: PLC Engineering executes this action when the step
● “Exit action” is active and any entry actions have already been processed.
● “Exit action”: PLC Engineering executes this action in the subse-
quent cycle when the step is deactivated.
Please note the processing sequence.
When using the respective implicit SFC variables and flags, you receive informa-
tion about the status of a step or an action or about timeouts.
See also
● ⮫ Chapter “Options” - “SFC editor” dialog on page 1089
● ⮫ Chapter Implicit Variables on page 394
● ⮫ Chapter SFC Element 'Action' on page 402
Example
If you drag a function block or an operator from the toolbox or a network at the
Reference, programming
left-hand side of the network onto one of the two arrows, then PLC Engineering
automatically creates a new network and inserts the element there.
In order to replace an element, drag a suitable other element onto its position
with the mouse. Elements that you can replace by the new element are marked
by PLC Engineering in the editor with text fields, for example “Replace”,
“Attach input”.
You can use the usual commands in the menu “Edit” for cutting, copying,
pasting and deleting elements. Copying also works with drag&drop, keeping
the [Ctrl] key pressed.
The operators with EN/ENO functionality can only be
NOTICE
inserted in the FBD and IL editors.
Selecting elements
A box or a connecting line in the editor is selected by clicking it with the mouse
so that it has the focus. Multiple selection is possible while the [Ctrl] key is
pressed. A selected element is highlighted in red.
Tooltip
If the cursor points to certain elements, for example to a variable or to an input,
a tooltip appears showing information about this element.
In the case of elements underlined with a wavy red line, the tooltip shows the
pre-compile error message of the error that occurs with this element.
Navigating in the editor
Table 9: Navigating in the editor
With the help of the keys and commands described below, you can place the
focus within the editor on a different cursor position. The change between the
positions is also network-spanning in function.
[¬] Change to the neighboring cursor position, along the signal
[®] flow, i.e. from left to right, and the other way around.
[][¯] Change to the next cursor position above or below the current
[¯] position, if this neighboring position belongs to the same log-
ical group. For example, all connections of a box form a logical
group.
If such a logical group does not exist: Change to the first
cursor position in the next higher or lower neighboring ele-
ment. In the case of parallel-connected elements, navigation
takes place along the first branch.
[Ctrl] + Change to the first network; this will be selected.
[Home]
[Ctrl] + [End] Change to the last network; this will be selected.
[Image ] Scrolls up 1 page; the topmost network on this page is
selected.
IL editor
Inserting and arranging elements:
You can insert elements with the help of the commands of the menu
“FBD/LD/IL” in the context menu. A new network can also be dragged from
the toolbox into the implementation section of the editor.
You can use the usual commands in the menu “Edit” for cutting, copying,
pasting and deleting elements. Copying also works with drag&drop, keeping
the [Ctrl] key pressed.
Please note that operators with EN/ENO functionality
NOTICE
can only be inserted into the FBD and IL editors.
Each program line is entered in a table row.
Table 10: Structure of networks in the IL editor
1st line: Network title
Prerequisite: The option is activated in the PLC Engineering options.
2nd line: Network comment
Prerequisite: The option is activated in the PLC Engineering options.
From the third line:
Column Content Description
1 Operator Contains the IL operator (LD, ST, CAL, AND,
OR, etc.) or a function name. When calling
a function block, additionally specify the
corresponding parameters here; in the pre-
ceding field, enter := or =>.
2 Operand Contains precisely one operand or the name
of a jump label.
In the case of several operands you must
enter them in several rows and when doing
so insert a comma directly behind the indi-
vidual operands. (See example below)
Reference, programming
tion.
Not editable
You can activate/deactivate the display by
means of the “Display symbol comment”
option if you click “Tools 🠂 Options” and
the “General” tab in the “FBD, LD and IL”
category.
5 Operand comment Comment for the current program line.
You can activate/deactivate the display by
means of the “Operand comment” option
if you click “Tools 🠂 Options” and the
“General” tab in the “FBD, LD and IL” cate-
gory.
Example
Example
Forced variable:
Prepared value
In the online view of a ladder diagram (LD) the connecting lines are marked
in color: connections with the value TRUE are displayed as a thick blue line,
connections with the value FALSE as a thick black line. Conversely, connections
with an unknown or analog value are displayed normally (thin black line).
Note that values of the connections are calculated from
NOTICE
the monitored variables. This is not a genuine flow con-
trol.
Breakpoints
Possible positions for breakpoints are in principle the positions at which values
of variables can change (instructions), at which the program branches or at
which another box is called.
Possible breakpoint positions:
● On the entire network: causes the breakpoint to be set at the first possible
position in the network.
● On a box, if the box contains an assignment. Not possible with operator
boxes, for example ADD, DIV.
● On assignments.
● At the end of the box at the position of the return to the calling box. In
online mode an empty network automatically appears here; it is marked by
'RET' in place of a network number.
Reference, programming
method is called by a pointer to a function block, PLC
Engineering sets the breakpoints in the method of the
function block and in all derived function blocks that use
the method.
See also
● ⮫ Chapter 21.5 Forcing and writing of variables on page 277
● ⮫ Chapter 21.3 Using Breakpoints on page 271
Example
Reference, programming
Application Description Examples
Several operands for 1 Options Variant 1:
operator ● Enter the operands
into consecutive lines
separated by commas
in the second column.
● Repeat the operator in
consecutive rows. Variant 2:
Reference, programming
one of the following com-
mands: ST, STN, S, R,
CAL, RET, JMP
In case of a conditional
jump, the execution of
the jump depends on the
loaded value.
Also refer to
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter Instruction list (IL) on page 177
● ⮫ Chapter Programming in Instruction List (IL) on page 178
Elements (FUP/LD/IL)
See also
● ⮫ Chapter Command 'Insert Box' on page 998
● ⮫ Chapter “Options” - “FBD, LD and IL” dialog on page 1091
● ⮫ Chapter Command 'Update Parameters' on page 1005
Reference, programming
● ⮫ Chapter Command 'Insert Jump' on page 999
● ⮫ Chapter FBD/LD/IL Element 'Label' on page 420
Closed Branch
A closed branch is available in LD only, and it contains a starting point and an
end point. It is used for implementing parallel analyses of logical elements.
Inserting a closed branch
● Command “FBD/LD/IL 🠂 Insert Contact Parallel (Below) ”
● Command “FBD/LD/IL 🠂 Insert Contact Parallel (Above) ”
● Command “FBD/LD/IL 🠂 Set Branch Start/End Point”
blocks, they are analyzed from top to bottom and their outputs are logically
ORed. If there are no branches with function blocks, normal OR operations are
performed.
Example
The function block instance x1 (TON) has a Boolean input and a Boolean
output. The execution of x1 is skipped if TRUE is determined for the condition
in the parallel line branch. The condition value results from the OR and AND
operations that connect contacts cond1, cond2 and cond3.
x1 is executed if the condition value from the connection of the contacts
cond1, cond2 and cond3 is FALSE.
(1) Indicates from the double vertical connections that it is a construct sub-
ject to an SCE.
(2) Indicates from the single vertical connections that it is an OR construct.
The given LD example is shown below as ST code. P_IN and P_OUT are the
Boolean values at the input (split point) and output (reunification point) of
the parallel line branch.
P_IN := b1 AND b2;
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter Command 'Set Branch Start Point' on page 1005
● ⮫ Chapter Command 'Set Branch End Point' on page 1005
● ⮫ Chapter Command 'Insert Contact in Parallel (Above)' on page 1001
● ⮫ Chapter Command 'Insert Contact in Parallel (Below)' on page 1001
● ⮫ Chapter Command 'Toggle Parallel Mode' on page 1002
You can drag the “Execute” element with the mouse from the “Tools” view into
the implementation part of your POU. If you click on “Enter ST code here...”, an
input field opens where you can input multiple-line ST code.
● ⮫ Chapter FBD/LD/IL Editor on page 410
LD Element 'Contact'
Symbol: , in the editor
The element is available only in the LD editor.
A contact passes on the signal TRUE (ON) or FALSE (OFF) from left to right
until the signal finally reaches a coil in the right-hand part of the network. For
Reference, programming
this purpose a boolean variable containing the signal is assigned to the contact.
To do this, replace the placeholder ??? above the contact with the name of a
boolean variable.
You can arrange several contacts both in series and in parallel. In the case of
two parallel contacts, only one needs to obtain the value TRUE in order for ON
to be passed on to the right. If contacts are connected in series, all of them
must obtain the value TRUE in order for ON to be passed on to the right by the
last contact in the series. Hence, you can program electrical parallel and series
connections with LD.
A negated contact forwards the signal TRUE if the variable value is FALSE.
You can negate an inserted contact with the help of the command “FBD/LD/IL
🠂 Negation” or insert a negated contact from the “Tools” view.
If you place the mouse pointer on a contact with the left mouse button pressed
and with a network selected, the button “Convert to coil” appears in the net-
work. If you now move the mouse pointer onto this button, still with the mouse
button pressed, and then release the mouse button over this button, PLC Engi-
neering converts the contact into a coil.
See also
● ⮫ Chapter Command 'Insert Contact' on page 1001
● ⮫ Chapter Command 'Insert Negated Contact' on page 1002
● ⮫ Chapter Command 'Insert Contact (Right)' on page 1001
● ⮫ Chapter Command 'Insert Contact in Parallel (Above)' on page 1001
● ⮫ Chapter Command 'Insert Contact in Parallel (Below)' on page 1001
● ⮫ Chapter FBD/LD/IL Editor on page 410
LD Element 'Coil'
Symbol: , in the editor
The element is available only in the LD editor.
A coil adopts the value supplied from the left and saves it in the boolean
variable assigned to the coil. Its input can have the value TRUE (ON) or FALSE
(OFF).
Several coils in a network can only be arranged in parallel.
In a negated coil the negated value of the incoming signal is stored in the
boolean variable that is assigned to the coil.
Set coil, Reset coil
Symbol: , , in the editor: ,
Set coil: If the value TRUE arrives at a set coil, the coil retains the value TRUE.
As long as the application is running, the value can no longer be overwritten
here.
Reset coil: If the value TRUE arrives at a reset coil, the coil retains the value
FALSE. As long as the application is running, the value can no longer be over-
written here.
You can define an inserted coil as a set or reset coil with the help of the
command “FBD/LD/IL 🠂 Set/Reset” or insert it as an element “Set Coil” and
“Reset Coil” from the “Tools” view.
See also
● ⮫ Chapter Command 'Insert Coil' on page 1000
● ⮫ Chapter "Insert reset coil" command on page 1000
● ⮫ Chapter Command 'Negation' on page 1003
● ⮫ Chapter Command 'Set/Reset' on page 1004
In order to delete a subnetwork, you must first delete all elements of the
network and then the marker symbol of the subnetwork.
See also
● ⮫ Chapter Command 'Insert Branch' on page 1004
● ⮫ Chapter Command 'Insert Branch Above' on page 1004
● ⮫ Chapter Command 'Insert Branch Below' on page 1005
Reference, programming
mainly illustrates the data flow through the system. Therefore, a continuous
function chart is also referred to as a "signal flow chart".
In the page-oriented CFC editor, you can wire POUs to each other and create
well-structured function block diagrams distributed over multiple pages. The
page-oriented editor behaves like the CFC editor, but provides support with the
following functionality:
CFC editor
Configuring the editor
You can configure the appearance, behavior and printing for the entire project
in the PLC Engineering options in the “CFC Editor” category. For example, on
the “View” tab, you can configure the color of the connecting lines depending
on the data type.
Editing
Cursor symbol: Prerequisite: “Pointer” is selected in the “ToolBox” view.
The symbol indicates that you can edit in the editor. Select elements
or connections to move them or to execute commands.
Cursor symbol: Prerequisite: An element is selected in the “ToolBox” view.
Clicking in the editor inserts the selected element. Also use drag&drop
to drag an element into the editor.
Dragging a function block Prerequisite: A line is selected in the declaration of the CFC.
instance from the declara- The instance is inserted as a POU with name, type, and all pins.
tion and dropping it into
the editor
Dragging a variable from The variable is inserted as an input or output with a connection to the
the declaration and drop- POU pin in focus.
ping it into the editor at a Tip: The cursor indicates when your focused location is valid for a
function block pin variable:
Dragging a variable from Prerequisite: In the declaration, the respective element is selected
the declaration and drop- ● Function block instance: A block with the corresponding data type
ping it into the editor is created
● Declaration of VAR_INPUT or CONSTANT: One input element is
inserted.
● VAR_OUTPUT declaration: An output element is inserted
● VAR, VAR_GLOBAL declaration: A window opens at the insertion
position where you can select whether to insert an input or an
output element
If a variable from the declaration part is dragged&dropped onto an
existing replaceable element, the existing element is replaced.
Drag&drop a function block A function block element with the corresponding type is inserted.
or programming function ● If a block is dragged&dropped onto an existing link line and both
block from the “Devices”, an input and an output of the block are compatible with the data
“POUs” or Library Manager type of the line, the block is inserted on the line. Here, its first
view into the editor matching input and output are connected to the elements that were
previously connected by the link line
● When a block is dragged&dropped onto an existing block, the
existing block is replaced
Reordering the sequence of Prerequisite: The text field of the input or output to be reordered to
inputs and outputs within another position is selected.
a function block using
drag&drop
[Ctrl] + click in the pro- Prerequisite: An element is selected in the “ToolBox” view.
graming area As long as you hold down the [Ctrl] key, a selected element is created
each time you click in the programming area.
[Ctrl]+[Right arrow] Prerequisite: In the CFC program, exactly one output pin is selected
for an element.
The selection is moved so that the input pin at the end of the con-
necting line is selected. In the case of multiple pins, all are selected.
Reference, programming
[Ctrl]+[Left arrow] Prerequisite: In the CFC program, exactly one input pin is selected for
an element.
The selection is moved so that the output pin at the beginning of
the connecting line is selected. In the case of multiple pins, all are
selected.
Example:
Also refer to
● ⮫ Chapter 32.1.3 Common Functions in Graphical Editors on page 378
Connecting
You can insert connecting lines between element connections. Connecting lines
are inserted by means of auto-routing so that connecting lines are automatically
optimal and as short as possible. The connecting lines are checked for colli-
sions.
Dragging a pin and drop- A connecting line is inserted between the two element pins.
ping it to another
Dragging a function block Release (drop) can be performed on a port or on the text field of a
and dropping it to another port.
For extensible operators (for example ADD) the release can also be
realized within the block. The following behavior applies: If there are
still unconnected input terminals, the uppermost free terminal is con-
nected. If there are no more unconnected input ports, a new port is
automatically inserted at the bottom.
Command “Connect Prerequisite: Multiple pins are selected. The pins are marked in red.
Selected Pins”
Editing
You can drag a “Page” element from the “ToolBox” view to the page navigation.
Then an additional page is inserted.
You can select existing pages in the page navigation and duplicated them by
clicking “Edit 🠂 Copy” and “Edit 🠂 Paste”.
Change the page size via “Edit page size”.
Connections over multiple pages are established by means of the “Connection
Mark - Source” and “Connection Mark - Sink” elements. When you drag a
connecting line from an input pin or an output pin to the border area, a
new connection mark is created automatically. The advantage is that the "List
components" input assistance provides all previously defined connection mark
sources.
If you have selected an element in the editor, then you can use the arrow keys
to move the selection from one element to the next to navigate through the
circuit. If you then select a connection mark and press another arrow key, even
the corresponding connection mark of the next/previous page will be selected.
You can transfer networks from a CFC POU to the program area of a page-ori-
ented CFC by clicking “Edit 🠂 Copy” and “Edit 🠂 Paste” (from the clipboard).
Also use drag&drop.
Processing order
The execution order is determined automatically according to the order of the
Reference, programming
pages as they are sorted in the page navigator of the editor. Within a page, a
page-oriented CFC object behaves like a CFC object. Therefore, you can switch
between “Auto Data Flow Mode” and “Explicit Execution Order Mode”.
Also refer to
● ⮫ Chapter 32.1.3 Common Functions in Graphical Editors on page 378
● ⮫ Chapter Programming in the CFC editor on page 184
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter 33.3.13 "CFC" menu on page 985
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
See also
● ⮫ Chapter CFC Element 'Box' on page 435
● ⮫ Chapter CFC Element 'Input' on page 435
● ⮫ Chapter CFC Element 'Output' on page 435
● ⮫ Chapter CFC Element 'Jump' on page 436
● ⮫ Chapter Command 'Negate' on page 986
● ⮫ Chapter Command 'S (Set)' on page 987
● ⮫ Chapter Command 'R (Reset)' on page 986
● ⮫ Chapter Command 'REF= (Reference Assignment)' on page 987
● ⮫ Chapter Command 'None' on page 986
● ⮫ Chapter Command 'Reset Pins' on page 993
Monitoring
As usual, you can monitor values in the declaration part as well as in the
implementation part (with inline monitoring).
Inline monitoring of a function block is possible only when an instance of the
function block is open. No values are displayed in the basic implementation
view.
Example
An application contains a CFC POU. An internal Boolean variable is switched
there. The iToggle variable changes its state from TRUE to FALSE with each
bus cycle.
Reference, programming
Monitoring a scalar variable
In the case of scalar variables, the element pins are decorated with the actual
values.
Example
FUNCTION_BLOCK FB_DoIt
VAR_INPUT
iAlfa : INT;
iBravo: INT;
sCharlie : STRING := 'Charlie';
xItem : BOOL;
iDelta : INT;
END_VAR
VAR_INPUT CONSTANT
MAXIMUM : INT := 12;
END_VAR
VAR_OUTPUT
iResult : INT;
sResult : STRING;
xResult : BOOL;
END_VAR
Reference, programming
The difference between both values is shown by a red cross next to the
parameter field of the function block instance.
Breakpoint locations
Possible position of a breakpoint
● Element “Output”
Variables are described.
● Element “Box”
POUs are called.
● Element “RETURN”
The program flow branches.
● Element “Selector”
Structure elements are described.
Click “Debug 🠂 Toggle Breakpoint” to set a new breakpoint or delete an
existing breakpoint. A red circle in the block diagram represents an active
breakpoint.
Also refer to
● ⮫ Chapter 22.3 Monitoring values on page 291
● ⮫ Chapter 21.5 Forcing and writing of variables on page 277
● ⮫ Forcing a function block input in CFC on page 280
● ⮫ Chapter 21.3 Using Breakpoints on page 271
● ⮫ Chapter 21.4 Stepping Through a Program on page 275
Elements (CFC)
The element inserts a new page into the editor. It is available only in the
page-oriented CFC editor. The number of the page is automatically assigned
in accordance with its position. You can enter the name and the description of
the page into the orange header. The page size is adapted with the “Edit Page
Size” command.
See also
● ⮫ Chapter Command 'Edit Page Size’ on page 985
Reference, programming
Use a control point in order to fix points of a connection before you adapt
the line routing. To do this, drag the element to the desired position on a
connecting line. Connecting lines with control points are no longer routed auto-
matically.
See also
● ⮫ Chapter Programming in the CFC editor on page 184
● ⮫ Chapter Command 'Create Control Point' on page 994
● ⮫ Chapter Command 'Remove Control Point' on page 994
In order to replace an existing box, you replace only the currently inserted iden-
tifier with the new desired name. When you do this, note that PLC Engineering
adapts the number of input and output pins according to the definition of the
POU and that existing assignments may be deleted as a result.
Because feedback is allowed in CFC, implicit variables
NOTICE
with the data type of the input variable are created at
the output of a box (in the example: temp_USINT). If
the result of the operation of a function block is a value
which exceeds the number range of the data type of the
input variable, then the overflow is written to the implicit
variable. The actual output variable gets the value of the
implicit variable, thus the overflow and not the actual
result of the operation (see example).
Example
Implicitly generated variables at the box output:
See also
● ⮫ Chapter Command 'Edit Parameters' on page 991
Please note that in online mode in the CFC editor a return element is automat-
ically inserted before the first line and after the last element. In single-step
execution PLC Engineering automatically jumps to the return element at the
end before exiting the function block.
Reference, programming
(replace the “???”).
The composer element is the counterpart to the selector element.
See also
● ⮫ Chapter CFC Element 'Selector' on page 437
See also
● ⮫ Chapter Command 'Connection Mark' on page 995
● ⮫ Chapter CFC editor on page 425
32.2 Variables
32.2.1 Variables – General information
The scope of a variable defines how and where you can use a variable. You
define the scope in the variable declaration.
Example
VAR
iVar1 : INT;
END_VAR
Also refer to
● ⮫ Chapter 18.22 Data persistence on page 211
Example
VAR_INPUT
iIn1 : INT; (* 1st input variable *)
END_VAR
Also refer to
● ⮫ Chapter 18.22 Data persistence on page 211
Reference, programming
Declare VAR_OUTPUT variables in the declaration part of programming objects
between the keywords VAR_OUTPUT and END_VAR. PLC Engineering returns the
values of these variables to the calling function block. There you can retrieve
the values and continue using them.
You can extend output variables with an attribute keyword.
Example
VAR_OUPUT
iOut1 : INT; (*1st output variable *)
END_VAR
Also refer to
● ⮫ Chapter 18.22 Data persistence on page 211
Example
fun(iIn1 := 1, iIn2 := 2, iOut1 => iLoc1, iOut2 => iLoc2);
Example
Übergabe eines Arrays
TYPE DUT_A :
STRUCT
xA: BOOL;
iB: INT;
END_STRUCT
END_TYPE
FUNCTION_BLOCK FB_SetArray
VAR_IN_OUT
aData_A : ARRAY[0..1] OF DUT_A; // Formal variable
END_VAR
aData_A[0].xA := TRUE;
aData_A[0].iB := 100;
PROGRAM PLC_PRG
VAR
fbSetA : FB_SetArray;
aSpecialData : ARRAY[0..1] OF DUT_A; // Actual variable
END_VAR
fbSetA(aData_A := aSpecialData);
Stringübergabe
Reference, programming
{attribute 'qualified_only'}
VAR_GLOBAL
g_sDEV_STATUS : STRING(25) := 'Device_A';
END_VAR
FUNCTION_BLOCK FB_SetStatus
VAR_IN_OUT
sDeviceStatus : STRING(25); // Formal parameter
END_VAR
sDeviceStatus := CONCAT(sDeviceStatus, ' Activ');
PROGRAM PLC_PRG
VAR
fbDoB : FB_SetStatus;
END_VAR
fbDoB(sDeviceStatus := GVL.g_sDEV_STATUS); //Call with actual
parameter
The variable sDeviceStatus is part of the POU interface of FB_B. When
calling fbDoB, first a device name is assigned to the string and then the string
is manipulated.
VAR_GLOBAL
xBit0 AT %MX0.1 : BOOL;
xTemp : BOOL;
END_VAR
FUNCTION_BLOCK FB_DoSomething
VAR_INPUT
xIn : BOOL;
END_VAR
VAR_IN_OUT
xInOut : BOOL;
END_VAR
IF xIn THEN
xInOut := TRUE;
END_IF
PROGRAM PLC_PRG
VAR
xIn : BOOL;
DoSomething_1 : FB_DoSomething;
DoSomething_2 : FB_DoSomething;
END_VAR
// Workaround
xTemp := xBit0;
DoSomething_2(xIn := xIn, xInOut := xTemp);
xBit0 := xTemp;
Example
Parameterübergabe von Stringkonstanten und Stringvariablen
Reference, programming
VAR_IN_OUT CONSTANT
c_sReadOnly : STRING(16); (* Constant string variable can
only be read here in POU *)
END_VAR
sReadWrite := 'String_from_POU';
dwVarReadWrite := STRING_TO_DWORD(c_sReadOnly);
PROGRAM PRG_A
VAR
sVarFits : STRING(16);
sValFits : STRING(16) := '1234567890123456';
dwVar: DWORD;
END_VAR
// Correct code
funManipulate(sReadWrite := sValFits, c_sReadOnly := '23',
dwVarReadWrite := dwVar);
funManipulate(sReadWrite := sVarFits, c_sReadOnly :=
sValFits, dwVarReadWrite := dwVar);
In the code, strings are passed to the funManipulate function via different
VAR_IN_OUT variables. A compiler error is issued when transferring a string
literal to a VAR_IN_OUT variable. When passing a constant variable to a
VAR_IN_OUT CONSTANT variable, correct code is generated even for passing
string variables.
Also refer to
● ⮫ Chapter 18.16 Declaring variables on page 160
● ⮫ Chapter 'Project settings' dialog - 'Compiler options' on page 1062
● ⮫ Chapter Object 'Function' on page 825
● ⮫ Chapter ‘Function block’ object on page 823
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Interface' on page 827
● ⮫ Chapter Object 'Interface Method' on page 835
● ⮫ Chapter 32.2.12 Constant variables - 'CONSTANT' on page 446
Example
VAR_GLOBAL
iVarGlob1 : INT;
END_VAR
See also
● ⮫ Chapter 33.2.15 Object 'GVL' - Global Variable List on page 777
● ⮫ Chapter 32.3.83 Operator - Global Namespace on page 537
Example
VAR_TEMP
iVarTmp1 : INT; (*1st temporary variable *)
END_VAR
Example
VAR_STAT
iVarStat1 : INT;
END_VAR
Also refer to
● ⮫ Chapter 18.22 Data persistence on page 211
Reference, programming
You declare these variables between the keywords VAR_EXTERNAL and
END_VAR. If the global variable does not exist, then an error message is printed.
PLC Engineering does not require you to declare a global
NOTICE
variable as external in order to use it in a POU. The
keyword exists only for maintaining compliance with IEC
61131-3.
Syntax
Example
FUNCTION_BLOCK FB_DoSomething
VAR_EXTERNAL
iVarExt1 : INT; (* 1st external variable *)
END_VAR
See also
● ⮫ Chapter 33.2.15 Object 'GVL' - Global Variable List on page 777
Example
METHOD meth_last : INT
VAR_INPUT
iVar : INT;
END_VAR
VAR_INST
iLast : INT := 0;
END_VAR
meth_last := iLast;
iLast := iVar;
See also
● ⮫ Chapter 'Method’ object on page 829
Example
Declaration of the variable xLocIn with incomplete address %I* in a function
block:
FUNCTION_BLOCK locio
VAR
xLocIn AT %I* : BOOL := TRUE;
END_VAR
VAR
locioVar1 : locio;
END_VAR
END_VAR
See also
● ⮫ Chapter 18.18.2 Variables Configuration - VAR_CONFIG on page 198
Syntax
<scope> CONSTANT
<identifier> : <data type> := <initial value> ;
END_VAR
Reference, programming
the constant cannot be written any more.
Example
Deklaration
VAR CONSTANT
c_rTAXFACTOR : REAL := 1.19;
END_VAR
Aufruf
rPrice := rValue * c_rTAXFACTOR;
You can only access constant variables in a read-only implementation. Con-
stant variables are located to the right of the assignment operator.
Also refer to
● ⮫ Chapter 32.2.5 Input/Output Variable (VAR_IN_OUT) on page 439
● ⮫ Chapter 32.4.1 Operands – General information on page 540
Never use the POINTER TO data type in persistent variable lists. If the applica-
tion is downloaded again, their addresses could change. The corresponding
compiler warnings are shown in the message window.
If you frequently change the names or data types of remanent variables, then it
is better to declare them as retain variables with the RETAIN keyword only.
Avoid inserting instance paths, as in this case twice as
NOTICE
much memory is used and an increased cycle time may
occur. Instead, declare variables directly in the list of
persistent variables.
Example
Deklaration in der persistenten Variablenliste PersistentVars:
{attribute 'qualified_only'}
VAR_GLOBAL PERSISTENT RETAIN
g_iCounter : INT;
// Generated instance path of persistent variable
PLC_PRG.fb_A.iPersistentCounter_A: INT;
END_VAR
Deklaration im Funktionsbaustein FB_A:
FUNCTION_BLOCK FB_A
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR PERSISTENT
iPersistentCounter_A : INT;
END_VAR
Deklaration im Programm PLC_PRG:
VAR
fb_A1 : FB_A;
END_VAR
Also refer to
● ⮫ Chapter 18.22 Data persistence on page 211
● ⮫ Chapter 18.22.8 Declaring VAR PERSISTENT Variables on page 218
● ⮫ Chapter Command 'Add all instance paths' on page 1014
● ⮫ Chapter 18.22.5 Preserving Data with Persistent Variables on page 214
Reference, programming
32.2.14 Retain variable - RETAIN
Retain variables are declared by the keyword RETAIN is added in programming
objects in the scope VAR, VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT, VAR_STAT, or
VAR_GLOBAL.
Syntax bei der Deklaration
<scope> RETAIN
<identifier>: <data type> ( := <initialization> )? //
( ... )? : Optional
END_VAR
<scope> : VAR | VAR_INPUT | VAR_OUTPUT | VAR_IN_OUT | VAR_STAT
| VAR_GLOBAL
Assignment of input, output or memory addresses with the keyword AT is not
allowed.
Example
In einer POU:
VAR RETAIN
iVarRetain: INT;
END_VAR
In einer GVL:
VAR_GLOBAL RETAIN
g_iVarRetain: INT;
END_VAR
Also refer to
● ⮫ Chapter 18.22 Data persistence on page 211
● ⮫ Chapter 18.22.8 Declaring VAR PERSISTENT Variables on page 218
● ⮫ Chapter Command 'Add all instance paths' on page 1014
● ⮫ Chapter 18.22.6 Preserving Data with Retain Variables on page 217
32.2.15 SUPER
SUPER is a special variable and is used for object-oriented programming.
SUPER is the pointer of a function block to the basic function block instance
used to generate the function block. The SUPER pointer thus also allows to
access the implementation of the methods of the basic function block (basic
class). A SUPER pointer is automatically available for each function block.
You can use SUPER only in methods and in the associated function block imple-
mentations.
Dereferencing the pointer: SUPER^
Use of the SUPER pointer: with the help of the keyword SUPER you call a
method that is valid in the instance of the basic class or parent class.
Examples
ST:
SUPER^.METH_DoIt();
FBD/CFC/LD
Examples
Using the SUPER and THIS pointers
FUNCTION_BLOCK FB_Base
VAR_OUTPUT
iCnt : INT;
END_VAR
Reference, programming
METH_DoIt := TRUE;
PROGRAM PLC_PRG
VAR
myBase : FB_Base;
myFB_1 : FB_1;
iTHIS : INT;
iBase : INT;
END_VAR
myBase();
iBase := myBase.iCnt;
myFB_1();
iTHIS := myFB_1.iCnt;
Also refer to
● ⮫ Chapter 32.5 Data types on page 555
● ⮫ Chapter 32.2.16 THIS on page 451
32.2.16 THIS
THIS is a special variable and is used for object-oriented programming.
THIS is the pointer of a function block to its own function block instance. A
THIS pointer is automatically available for each function block.
You can use THIS only in methods and in function blocks. THIS is available for
the implementation in the input assistant in the category “Keywords”.
Dereferencing of the pointer: THIS^
Use of the THIS pointer
● If a local variable obscures a function block variable in a method, you can set
the function block variable with the THIS pointer. See example below (1)
● If the pointer to the function block's own function block instance is refer-
enced for use in a function. (See example below (2))
Examples
ST:
THIS^.METH_DoIt();
FBD/CFC/LD:
Examples
(1) The local variable iVarB obscures the function block variable iVarB.
FUNCTION_BLOCK fbA
VAR_INPUT
iVarA: INT;
END_VAR
iVarA := 1;
PROGRAM PLC_PRG
VAR
MyfbB: fbB;
END_VAR
FUNCTION_BLOCK fbA
VAR_INPUT
iVarA: INT;
END_VAR
...;
END_VAR
VAR
iVarB: INT;
END_VAR
iVarB := 22; //The local variable iVarB is set.
funA(pFB := THIS^); //funA is called via THIS^.
PROGRAM PLC_PRG
VAR
MyfbB: fbB;
END_VAR
Reference, programming
MyfbB(iVarA:=0 , iVarB:= 0);
MyfbB.DoIt();
See also
● ⮫ Chapter 32.5.16 Pointers on page 566
● ⮫ Chapter 32.2.15 SUPER on page 450
Declaration
Example:
<variable name> : (<list of component names>) :=
<initialization>;
Call
Example:
PROGRAM PLC_PRG
VAR
iAlphabet : (Alfa, Bravo, Charlie, Delta, Echo) := Echo;
strText : STRING;
iNumber : INT;
END_VAR
CASE iAlphabet OF
Alfa:
strText := 'A';
Bravo:
strText := 'B';
Charlie:
strText := 'C';
Delta:
strText := 'D';
Echo:
strText := 'E';
END_CASE
iNumber := Alphabet;
32.3 Operators
32.3.1 Operators – General information
PLC Engineering supports all operators of the IEC-61131-3 standard.
These operators are known implicitly in the entire project.
In addition to these IEC operators, PLC Engineering also supports non-IEC
61131-3 operators.
Operators are used in blocks, such as functions.
For information on the processing order (binding strength) of the ST operators,
refer to the chapter "ST expressions".
For operations with floating-point data types, the com-
CAUTION
putational result depends on the applied target system
hardware.
For operations with overflow or underflow in the data
CAUTION
type, the computational result depends on the applied
target system hardware.
Examples
Reference, programming
Example 1
The result of this addition is not truncated and the result in dwVar is 65536.
VAR
wVar : WORD;
dwVar: DWORD;
END_VAR
wVar := 65535;
dwVar := wVar + 1;
Example 2
The overflow and underflow in the data type is not truncated and the results
(bVar1, bVar2) of both comparisons are FALSEon a 32 bit and on a 64 bit
hardware.
VAR
wVar1 : WORD;
wVar2 : WORD;
bVar1 : BOOL;
bVar2 : BOOL;
END_VAR
wVar1 := 65535;
wVar2 := 0;
bVar1 := (wVar1 + 1) = wVar2;
bVar2 := (wVar2 - 1) = wVar1;
Example 3
The assignment to wVar3 truncates the value to the target data type WORD and
the result bvar1 is TRUE.
VAR
wVar1 : WORD;
wVar2 : WORD;
wVar3 : WORD;
bVar1 : BOOL;
END_VAR
wVar1 := 65535;
wVar2 := 0;
wVar3 := (wVar1 + 1);
bVar1 := wVar3 = wVar2;
Example 4
To force the compiler to truncate the intermediate result, a conversion can be
inserted.
The type conversion ensures that both comparisons compare only 16 bits and
that the results(bVar1, bVar2) of both comparisons are TRUE.
VAR
wVar1 : WORD;
wVar2 : WORD;
bVar1 : BOOL;
bVar2 : BOOL;
END_VAR
wVar1 := 65535;
wVar2 := 0;
bVar1 := TO_WORD(wVar1 + 1) = wVar2;
bVar2 := TO_WORD(wVar2 - 1) = wVar1;
Reference, programming
32.3.9 Call operators
⮫ Chapter 32.3.48 Operator 'CAL' on page 476
Reference, programming
REAL | SINT | TIME | TIME_OF_DAY | TOD | UDINT | UINT | ULINT |
USINT | WORD
Possible combinations for time data types:
● TIME + TIME = TIME
● TIME + LTIME = LTIME
● LTIME + LTIME = LTIME
Possible combinations for date and time data types:
● TOD + TIME = TOD
● DT + TIME = DT
● TOD + LTIME = LTOD
● DT + LTIME = LDT
● LTOD + TIME = LTOD
● LDT + LTIME = LDT
● LTOD +LTIME = LTOD
● LDT + LTIME = LDT
Feature in the FBD/LD editor: You can extend the ADD operator to function
block inputs. The number of additional function block inputs is limited.
Examples
ST:
var1 := 7+2+4+7;
FBD:
Feature in the FBD/LD editor: You can extend the MUL operator to additional
function block inputs. The number of additional function block inputs is limited.
Examples
ST:
var1 := 7*2*4*7;
FBD:
Examples
ST:
var1 := 7-2;
FBD:
Reference, programming
32.3.18 Operator 'DIV'
This IEC operator is used for dividing variables.
Permitted data types: BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT,
DINT, UDINT, LINT, ULINT, REAL, LREAL, TIME
Division by zero may have different results depending on
NOTICE
the target system.
Examples
ST:
var1 := 8/2;
FBD:
1. Series of DIV blocks, 2. Single DIV block, 3. DIV blocks with EN/ENO param-
eters
Examples
Result in Var1: 1
ST:
var1 := 9 MOD 2;
FBD:
ST:
ivar2 := MOVE(ivar1);
This corresponds to:
ivar2 := ivar1;
Example in ST
PROGRAM PLC_PRG
VAR
Reference, programming
aData_1 : ARRAY[0..4] OF INT;
iReturnValue : INT;
END_VAR
iReturnValue := SIZEOF(aData_1); (* iReturnValue :=
USINT#10; *)
Result in iReturnValue is 10.
Also refer to
● ⮫ Chapter 32.3.23 Operator 'XSIZEOF' on page 463
Syntax
<return value> := XSIZEOF(<variable>);
Example in ST
PROGRAM PLC_PRG
VAR
uxiReturnValue : __UXINT; (* Datentyp bei 64-bit-
Plattformen: ULINT *)
aData_1 : ARRAY[0..4] OF INT;
END_VAR
uxiReturnValue := XSIZEOF(aData_1);
Result: uxiReturnValue = 10
When the respective input bit yields 0, the output bit also yields 1, and vice-
versa.
Permitted data types: BOOL, BYTE, WORD, DWORD, LWORD
Examples
Result in var1: 2#0110_1100
ST:
var1 := NOT 2#1001_0011;
FBD:
Examples
Result in var1 is 2#1000_0010
ST:
var1 := 2#1001_0011 AND 2#1000_1010;
FBD:
Examples
Result in Var1 is 2#1001_1011
ST:
Var1 := 2#1001_0011 OR 2#1000_1010;
FBD:
When only one of the two input bits yields 1, the output bit also yields 1. When
both inputs yield 1 or 0, then the output yields 0.
Permitted data types: BOOL, BYTE, WORD, DWORD, LWORD
Please note the following behavior of the XOR block in
NOTICE
extended form (more than two inputs): PLC Engineering
compares the inputs in pairs and then the corresponding
results (according to the standard, but not necessarily
according to expectations).
Examples
Reference, programming
Result in var1: 2#0001_1001
ST:
var1 := 2#1001_0011 XOR 2#1000_1010;
FBD:
Example
VAR
bEver: BOOL;
bX: BOOL;
dw: DWORD := 16#000000FF;
END_VAR
bEver := FALSE;
bX := dw.8 OR_ELSE dw.1 OR_ELSE dw.1 OR_ELSE (bEver := TRUE);
dw.8 is FALSE and dw.1 is TRUE; therefore bX is the result of the operation
TRUE. However, the expression at the third input is not executed, and bEver
remains FALSE. On the other hand, if the standard OR operation was used,
bEver would be set to TRUE.
See also
● ⮫ Chapter 32.3.26 Operator 'OR' on page 464
Examples
The results for erg_byte and erg_word are different, although the values of
the in_byte and in_word input variables are the same and the data types of
the input variables are different.
ST:
PROGRAM shl_st
VAR
in_byte : BYTE := 16#45; (* 2#01000101 )
in_word : WORD := 16#0045; (* 2#0000000001000101 )
erg_byte : BYTE;
erg_word : WORD;
n: BYTE := 2;
END_VAR
FBD:
Reference, programming
in: Operand that is shifted to the right
n: Number of bits for shifting in to the right
If n overwrites the data type width, then it depends on
NOTICE
the target system how the BYTE, WORD, DWORD, and LWORD
operands are padded. The target systems cause padding
with zeros or n MOD <tab width>.
Examples
ST:
PROGRAM shr_st
VAR
in_byte : BYTE:=16#45; (* 2#01000101 )
in_word : WORD:=16#0045; (* 2#0000000001000101 )
erg_byte : BYTE;
erg_word : WORD;
n: BYTE :=2;
END_VAR
FBD:
Examples
The results for erg_byte and erg_word are different depending on the data
type of the input variables, although the values of the in_byte and in_word
input variables are the same.
ST:
PROGRAM rol_st
VAR
in_byte : BYTE := 16#45;
in_word : WORD := 16#45;
erg_byte : BYTE;
erg_word : WORD;
n: BYTE := 2;
END_VAR
IL:
Examples
The results for erg_byte and erg_word are different depending on the data
type of the input variables, although the values of the in_byte and in_word
input variables are the same.
ST:
PROGRAM ror_st
VAR
in_byte : BYTE := 16#45;
Reference, programming
in_word : WORD := 16#45;
erg_byte : BYTE;
erg_word : WORD;
n: BYTE := 2;
END_VAR
Examples
ST:
Var1 := SEL(TRUE,3,4); (* Result: 4 *)
FBD:
Examples
ST:
Result: 90
Var1 := MAX(30,40);
Var1 := MAX(40,MAX(90,30));
FBD:
Result: 90
Examples
Result: 30
ST:
Var1:=MIN(90,30);
Var1 := MIN(MIN(90,30),40);
FBD:
Reference, programming
32.3.37 Operator 'LIMIT'
This IEC selection operator is used for limiting.
OUT := LIMIT(Min, IN, Max)
Means: OUT := MIN (MAX (IN, Min), Max)
Max is the upper limit and Min is the lower limit for the result. If the IN value is
above the Max upper limit, then LIMIT yields Max. If the value of IN is below the
Min lower limit, then the result is Min.
Permitted data types for IN and OUT: all
Examples
Result in Var1 is 80
ST:
Var1 := LIMIT(30,90,80);
Examples
Result in Var1 is 30.
ST:
Var1 := MUX(0,30,40,50,60,70,80);
Examples
Result: FALSE
ST:
VAR1 := 20 > 30;
FBD:
Examples
Result: TRUE
ST:
Var1 := 20 < 30;
Examples
Result in Var1: TRUE
ST:
Var1 := 20 <= 30;
Examples
Result: TRUE
ST:
Reference, programming
VAR1 := 60 >= 40;
FBD:
Examples
Result: TRUE
ST:
VAR1 := 40 = 40;
FBD:
Examples
Result in Var1 is FALSE
ST:
Var1 := 40 <> 40;
FBD:
VAR
<address name> : DWORD | LWORD | POINTER TO < basis data
type>
END_VAR
Example
FUNCTION_BLOCK FB_Address
VAR
piAddress1: POINTER TO INT;
iNumber1: INT := 5;
lwAddress2
iNumber2: INT := 10;
END_VAR
See also
● ⮫ Chapter 32.5.16 Pointers on page 566
Reference, programming
32.3.46 Operator 'Content Operator'
This operator is an extension of the IEC 61131-3 standard.
You can use this operator to dereference pointers by appending the operator as
^ to the pointer identifier.
When using pointers to addresses, please note that
CAUTION
applying an online change can shift address contents.
Example
ST:
pt : POINTER TO INT;
var_int1 : INT;
var_int2 : INT;
pt := ADR(var_int1);
var_int2 := pt^;
Example
ST implementation language:
VAR
xVar AT %IX2.3 : BOOL;
dwBitoffset : DWORD;
END_VAR
Example
Call of the Inst instance of a function block with assignment of the input
variables Par1 and Par2 with 0 or TRUE.
CAL Inst(Par1 := 0, Par2 := TRUE);
32.3.49 Overload
If the operand value for a type conversion operator is
NOTICE
outside of the value range of the target data type, then
the result output depends on the processor type and is
therefore undefined. This is the case, for example, when
a negative operand value is converted from LREAL to the
target data type UINT.
Information can be lost when converting from larger data
types to smaller data types.
The rounding logic for borderline cases depends on the
NOTICE
target system or the FPU (floating point unit) of the
target system. A value such as -1.5 can be converted
differently on different controls.
Intercept value range overruns via the application to pro-
gram code independent of the target system.
IEC61131-3 does not detect overloaded functions.
If you want to program strictly according to IEC61131-3, please use the opera-
tors of the scheme <type> _TO_ <another type> described in the following
sections.
The rules for typed conversions also apply to overloading.
The operators convert values to other data types, explicitly specifying only
a target data type and no initial data type (data type of the operand) ("over-
loaded conversion"). Overcharges are not part of IEC 61131-3.
Call syntax
TO___UXINT
TO___XINT
TO___XWORD
TO_BIT
TO_BYTE
TO_BOOL
TO_DATE
TO_DINT
TO_DT
TO_DWORD
TO_INT
TO_LDATE
TO_LDT
TO_LINT
TO_LREAL
TO_LTIME
TO_LTOD
TO_LWORD
TO_REAL
TO_SINT
TO_STRING
Reference, programming
TO_TIME
TO_TOD
TO_UDINT
TO_UINT
TO_ULINT
TO_USINT
TO_WORD
TO_WSTRING
Examples
ST implementation language:
VAR
iNumber_1 : INT;
rNumber_2 : REAL := 123.456;
iNumber_2 : INT;
xIsTrue : BOOL;
sOutputText : STRING;
sText : STRING := 'Hello World!';
wsText: WSTRING;
dateEvent : DATE := D#2019-9-3;
uiEvent : UINT;
uxiData : __UXINT;
END_VAR
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
● ⮫ Chapter 32.3.50 Boolean conversion on page 478
● ⮫ Chapter 32.3.51 Integer conversion on page 482
● ⮫ Chapter 32.3.52 Floating point number conversion on page 495
● ⮫ Chapter 32.3.53 String conversion on page 498
● ⮫ Chapter 32.3.55 Date and time conversion on page 511
● ⮫ Chapter 32.3.54 Time conversion on page 506
Call syntax
BOOL_TO___UXINT
BOOL_TO___XINT
BOOL_TO___XWORD
BOOL_TO_BIT
BOOL_TO_BYTE
BOOL_TO_DATE
BOOL_TO_DINT
BOOL_TO_DT
BOOL_TO_DWORD
BOOL_TO_INT
BOOL_TO_LDATE
BOOL_TO_LDT
BOOL_TO_LINT
BOOL_TO_LREAL
BOOL_TO_LTIME
BOOL_TO_LTOD
BOOL_TO_LWORD
BOOL_TO_REAL
BOOL_TO_SINT
BOOL_TO_STRING
BOOL_TO_TIME
BOOL_TO_TOD
BOOL_TO_UDINT
BOOL_TO_UINT
BOOL_TO_ULINT
BOOL_TO_USINT
BOOL_TO_WORD
BOOL_TO_WSTRING
If the operand value is TRUE, the following typed values are returned:
● BOOL_TO_DATE: D#1970-1-1 // The zeroth bit is set, but does
not effect the display.
● BOOL_TO_DT: DT#1970-01-01-0:0:1
● BOOL_TO_LTIME: LTIME#1NS
● BOOL_TO_REAL: '1'
● BOOL_TO_STRING: 'TRUE'
● BOOL_TO_TOD: TOD#0:0:0.001
● BOOL_TO_TIME: T#1MS
● BOOL_TO_WSTRING: "TRUE"
If the operand value is FALSE, the following typed values are returned:
● BOOL_TO_DATE: D#1970-1-1
● BOOL_TO_DT: DT#1970-01-01-00:00:00
● BOOL_TO_LTIME: LTIME#0NS
● BOOL_TO_REAL: '0.0'
● BOOL_TO_STRING: 'FALSE'
● BOOL_TO_TOD: TOD#0:0:0
Reference, programming
● BOOL_TO_TIME: T#0MS
● BOOL_TO_WSTRING: "FALSE"
Examples
ST implementation language
FUNCTION_BLOCK FB_ConvertFromBool
VAR
VAR
uxiReturn_1: __UXINT;
uxiReturn_10: __UXINT;
iReturn_2: __XINT;
iReturn_20: __XINT;
xwReturn_3: __XWORD;
xwReturn_30: __XWORD;
bitReturn_4: BOOL;
bitReturn_40: BOOL;
bReturn_6: BYTE;
bReturn_60: BYTE;
dateReturn_7: DATE;
dateReturn_70: DATE;
dtReturn_8: DATE_AND_TIME;
dtReturn_80: DATE_AND_TIME;
diReturn_9: DINT;
diReturn_90: DINT;
dtReturn_10: DATE_AND_TIME;
dtReturn_100: DATE_AND_TIME;
dwReturn_11: DWORD;
dwReturn_110: DWORD;
iReturn_12: INT;
iReturn_120: INT;
liReturn_13: LINT;
liReturn_130: LINT;
lrReturn_14: LREAL;
lrReturn_140: LREAL;
lwReturn_15: LWORD;
lwReturn_150: LWORD;
rReturn_16: REAL;
rReturn_160: REAL;
siReturn_17: SINT;
siReturn_170: SINT;
sReturn_18: STRING;
sReturn_180: STRING;
todReturn_19: TIME_OF_DAY;
todReturn_190: TIME_OF_DAY;
timReturn_20: TIME;
timReturn_200: TIME;
todReturn_21: TIME_OF_DAY;
todReturn_210: TIME_OF_DAY;
udiReturn_22: UDINT;
udiReturn_220: UDINT;
uiReturn_23: UINT;
uiReturn_230: UINT;
uliReturn_24: ULINT;
uliReturn_240: ULINT;
usiReturn_25: USINT;
usiReturn_250: USINT;
wReturn_26: WORD;
wReturn_260: WORD;
wsReturn_27: WSTRING;
wsReturn_270: WSTRING;
END_VAR
iReturn_2 := BOOL_TO___XINT(TRUE);
iReturn_20 := BOOL_TO___XINT(FALSE);
xwReturn_3 := BOOL_TO___XWORD(TRUE);
xwReturn_30 := BOOL_TO___XWORD(FALSE);
bitReturn_4 := BOOL_TO_BIT(TRUE);
bitReturn_40 := BOOL_TO_BIT(FALSE);
bReturn_6 := BOOL_TO_BYTE(TRUE);
bReturn_60 := BOOL_TO_BYTE(FALSE);
dateReturn_7 := BOOL_TO_DATE(TRUE);
dateReturn_70 := BOOL_TO_DATE(FALSE);
dtReturn_8 := BOOL_TO_DT(TRUE);
dtReturn_80 := BOOL_TO_DT(FALSE);
diReturn_9 := BOOL_TO_DINT(TRUE);
diReturn_90 := BOOL_TO_DINT(FALSE);
dwReturn_11 := BOOL_TO_DWORD(TRUE);
dwReturn_110 := BOOL_TO_DWORD(FALSE);
iReturn_12 := BOOL_TO_INT(TRUE);
iReturn_120 := BOOL_TO_INT(FALSE);
liReturn_13 := BOOL_TO_LINT(TRUE);
liReturn_130 := BOOL_TO_LINT(FALSE);
lrReturn_14 := BOOL_TO_LREAL(TRUE);
lrReturn_140 := BOOL_TO_LREAL(FALSE);
lwReturn_15 := BOOL_TO_LWORD(TRUE);
lwReturn_150 := BOOL_TO_LWORD(FALSE);
rReturn_16 := BOOL_TO_REAL(TRUE);
rReturn_160 := BOOL_TO_REAL(FALSE);
siReturn_17 := BOOL_TO_SINT(TRUE);
siReturn_170 := BOOL_TO_SINT(FALSE);
sReturn_18 := BOOL_TO_STRING(TRUE);
sReturn_180 := BOOL_TO_STRING(FALSE);
Reference, programming
timReturn_20 := BOOL_TO_TIME(TRUE);
timReturn_200 := BOOL_TO_TIME(FALSE);
todReturn_21 := BOOL_TO_TOD(TRUE);
todReturn_210 := BOOL_TO_TOD(FALSE);
udiReturn_22 := BOOL_TO_UDINT(TRUE);
udiReturn_220 := BOOL_TO_UDINT(FALSE);
uiReturn_23 := BOOL_TO_UINT(TRUE);
uiReturn_230 := BOOL_TO_UINT(FALSE);
uliReturn_24 := BOOL_TO_ULINT(TRUE);
uliReturn_240 := BOOL_TO_ULINT(FALSE);
usiReturn_25 := BOOL_TO_USINT(TRUE);
usiReturn_250 := BOOL_TO_USINT(FALSE);
wReturn_26 := BOOL_TO_WORD(TRUE);
wReturn_260 := BOOL_TO_WORD(FALSE);
wsReturn_27 := BOOL_TO_WSTRING(TRUE);
wsReturn_270 := BOOL_TO_WSTRING(FALSE);
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
● ⮫ Chapter 32.3.49 Overload on page 476
● ⮫ Chapter 32.3.51 Integer conversion on page 482
● ⮫ Chapter 32.3.52 Floating point number conversion on page 495
● ⮫ Chapter 32.3.53 String conversion on page 498
● ⮫ Chapter 32.3.55 Date and time conversion on page 511
● ⮫ Chapter 32.3.54 Time conversion on page 506
Call syntax
__UXINT_TO___XINT
__UXINT_TO___XWORD
__UXINT_TO_BIT
__UXINT_TO_BOOL
__UXINT_TO_BYTE
Reference, programming
__UXINT_TO_DATE
__UXINT_TO_DINT
__UXINT_TO_DT
__UXINT_TO_DWORD
__UXINT_TO_INT
__UXINT_TO_LDATE
__UXINT_TO_LDT
__UXINT_TO_LINT
__UXINT_TO_LREAL
__UXINT_TO_LTIME
__UXINT_TO_LTOD
__UXINT_TO_LWORD
__UXINT_TO_REAL
__UXINT_TO_SINT
__UXINT_TO_STRING
__UXINT_TO_TIME
__UXINT_TO_TOD
__UXINT_TO_UDINT
__UXINT_TO_UINT
__UXINT_TO_ULINT
__UXINT_TO_USINT
__UXINT_TO_WORD
__UXINT_TO_WSTRING
__XINT_TO___UXINT
__XINT_TO___XWORD
__XINT_TO_BIT
__XINT_TO_BOOL
__XINT_TO_BYTE
__XINT_TO_DATE
__XINT_TO_DINT
__XINT_TO_DT
__XINT_TO_DWORD
__XINT_TO_INT
__XINT_TO_LDATE
__XINT_TO_LDT
__XINT_TO_LINT
__XINT_TO_LREAL
__XINT_TO_LTIME
__XINT_TO_LTOD
__XINT_TO_LWORD
__XINT_TO_REAL
__XINT_TO_SINT
__XINT_TO_STRING
__XINT_TO_TIME
__XINT_TO_TOD
__XINT_TO_UDINT
__XWORD_TO_UXINT
__XWORD_TO_XINT
__XWORD_TO_BIT
__XWORD_TO_BOOL
__XWORD_TO_BYTE
__XWORD_TO_DATE
__XWORD_TO_DINT
__XWORD_TO_DT
__XWORD_TO_DWORD
__XWORD_TO_INT
__XWORD_TO_LDATE
__XWORD_TO_LDT
__XWORD_TO_LINT
__XWORD_TO_LREAL
__XWORD_TO_LTIME
__XWORD_TO_LTOD
__XWORD_TO_LWORD
__XWORD_TO_REAL
__XWORD_TO_SINT
__XWORD_TO_STRING
__XWORD_TO_TIME
__XWORD_TO_TOD
__XWORD_TO_UDINT
__XWORD_TO_UINT
__XWORD_TO_ULINT
__XWORD_TO_USINT
__XWORD_TO_WORD
__XWORD_TO_WSTRING
BIT_TO___UXINT
BIT_TO___XINT
BIT_TO___XWORD
BIT_TO_BOOL
BIT_TO_BYTE
BIT_TO_DATE
BIT_TO_DINT
BIT_TO_DT
BIT_TO_DWORD
BIT_TO_INT
BIT_TO_LDATE
BIT_TO_LDT
BIT_TO_LINT
BIT_TO_LREAL
BIT_TO_LTIME
BIT_TO_LTOD
BIT_TO_LWORD
BIT_TO_REAL
BIT_TO_SINT
BIT_TO_STRING
BIT_TO_TIME
BIT_TO_TOD
BIT_TO_UDINT
ctrlX PLC Engineering 485 / 1158
Operators
BIT_TO_UINT
BIT_TO_ULINT
BIT_TO_USINT
BIT_TO_WORD
BIT_TO_WSTRING
BYTE_TO___UXINT
BYTE_TO___XINT
BYTE_TO___XWORD
BYTE_TO_BOOL
BYTE_TO_BIT
Reference, programming
BYTE_TO_DATE
BYTE_TO_DINT
BYTE_TO_DT
BYTE_TO_DWORD
BYTE_TO_INT
BYTE_TO_LDATE
BYTE_TO_LDT
BYTE_TO_LINT
BYTE_TO_LREAL
BYTE_TO_LTIME
BYTE_TO_LTOD
BYTE_TO_LWORD
BYTE_TO_REAL
BYTE_TO_SINT
BYTE_TO_STRING
BYTE_TO_TIME
BYTE_TO_TOD
BYTE_TO_UDINT
BYTE_TO_UINT
BYTE_TO_ULINT
BYTE_TO_USINT
BYTE_TO_WORD
BYTE_TO_WSTRING
DINT_TO___UXINT
DINT_TO___XINT
DINT_TO___XWORD
DINT_TO_BOOL
DINT_TO_BIT
DINT_TO_BYTE
DINT_TO_DATE
DINT_TO_DT
DINT_TO_DWORD
DINT_TO_INT
DINT_TO_LDATE
DINT_TO_LDT
DINT_TO_LINT
DINT_TO_LREAL
DINT_TO_LTIME
DINT_TO_LTOD
DINT_TO_LWORD
DINT_TO_REAL
DINT_TO_SINT
DINT_TO_STRING
DINT_TO_TIME
DINT_TO_TOD
DINT_TO_UDINT
DWORD_TO___UXINT
DWORD_TO___XINT
DWORD_TO___XWORD
DWORD_TO_BIT
DWORD_TO_BOOL
DWORD_TO_BYTE
DWORD_TO_DATE
DWORD_TO_DINT
DWORD_TO_DT
DWORD_TO_INT
DWORD_TO_LDATE
DWORD_TO_LDT
DWORD_TO_LINT
DWORD_TO_LREAL
DWORD_TO_LTIME
DWORD_TO_LTOD
DWORD_TO_LWORD
DWORD_TO_REAL
DWORD_TO_SINT
DWORD_TO_STRING
DWORD_TO_TIME
DWORD_TO_TOD
DWORD_TO_UDINT
DWORD_TO_UINT
DWORD_TO_ULINT
DWORD_TO_USINT
DWORD_TO_WORD
DWORD_TO_WSTRING
INT_TO___UXINT
INT_TO___XINT
INT_TO___XWORD
INT_TO_BIT
INT_TO_BOOL
INT_TO_BYTE
INT_TO_DATE
INT_TO_DINT
INT_TO_DT
INT_TO_DWORD
INT_TO_LDATE
INT_TO_LDT
INT_TO_LINT
INT_TO_LREAL
INT_TO_LTIME
INT_TO_LTOD
INT_TO_LWORD
INT_TO_REAL
INT_TO_SINT
INT_TO_STRING
INT_TO_TIME
INT_TO_TOD
INT_TO_UDINT
INT_TO_UINT
INT_TO_ULINT
INT_TO_USINT
INT_TO_WORD
INT_TO_WSTRING
LINT_TO___UXINT
LINT_TO___XINT
LINT_TO___XWORD
LINT_TO_BIT
LINT_TO_BOOL
LINT_TO_BYTE
LINT_TO_DATE
LINT_TO_DINT
LINT_TO_DT
LINT_TO_DWORD
LINT_TO_INT
LINT_TO_LDATE
LINT_TO_LDT
LINT_TO_LREAL
LINT_TO_LTIME
LINT_TO_LTOD
LINT_TO_LWORD
LINT_TO_REAL
LINT_TO_SINT
LINT_TO_STRING
LINT_TO_TIME
LINT_TO_TOD
LINT_TO_UDINT
LINT_TO_UINT
LINT_TO_ULINT
LINT_TO_USINT
LINT_TO_WORD
LINT_TO_WSTRING
LWORD_TO___UXINT
LWORD_TO___XINT
LWORD_TO___XWORD
LWORD_TO_BIT
LWORD_TO_BOOL
LWORD_TO_BYTE
LWORD_TO_DATE
LWORD_TO_DINT
LWORD_TO_DT
LWORD_TO_DWORD
LWORD_TO_INT
LWORD_TO_LDATE
LWORD_TO_LDT
LWORD_TO_LINT
LWORD_TO_LREAL
LWORD_TO_LTIME
LWORD_TO_LTOD
LWORD_TO_REAL
LWORD_TO_SINT
LWORD_TO_STRING
LWORD_TO_TIME
LWORD_TO_TOD
LWORD_TO_UDINT
488 / 1158 ctrlX PLC Engineering
Operators
LWORD_TO_UINT
LWORD_TO_ULINT
LWORD_TO_USINT
LWORD_TO_WORD
LWORD_TO_WSTRING
SINT_TO___UXINT
SINT_TO___XINT
SINT_TO___XWORD
SINT_TO_BIT
SINT_TO_BOOL
SINT_TO_BYTE
SINT_TO_DATE
SINT_TO_DINT
SINT_TO_DT
SINT_TO_DWORD
SINT_TO_INT
SINT_TO_LDATE
SINT_TO_LDT
SINT_TO_LINT
SINT_TO_LREAL
SINT_TO_LTIME
SINT_TO_LTOD
SINT_TO_LWORD
SINT_TO_REAL
SINT_TO_STRING
SINT_TO_TIME
SINT_TO_TOD
SINT_TO_UDINT
SINT_TO_UINT
SINT_TO_ULINT
SINT_TO_USINT
SINT_TO_WORD
SINT_TO_WSTRING
UDINT_TO___UXINT
UDINT_TO___XINT
UDINT_TO___XWORD
UDINT_TO_BIT
UDINT_TO_BOOL
UDINT_TO_BYTE
UDINT_TO_DATE
UDINT_TO_DINT
UDINT_TO_DT
UDINT_TO_DWORD
UDINT_TO_INT
UDINT_TO_LDATE
UDINT_TO_LDT
UDINT_TO_LINT
UDINT_TO_LREAL
UDINT_TO_LTIME
UDINT_TO_LTOD
UDINT_TO_LWORD
UDINT_TO_REAL
UDINT_TO_SINT
UDINT_TO_STRING
UDINT_TO_TIME
UDINT_TO_TOD
UINT_TO___UXINT
UINT_TO___XINT
UINT_TO___XWORD
UINT_TO_BIT
UINT_TO_BOOL
UINT_TO_BYTE
UINT_TO_DATE
UINT_TO_DINT
UINT_TO_DT
UINT_TO_DWORD
UINT_TO_INT
UINT_TO_LDATE
UINT_TO_LDT
UINT_TO_LINT
UINT_TO_LREAL
UINT_TO_LTIME
UINT_TO_LTOD
UINT_TO_LWORD
UINT_TO_REAL
UINT_TO_SINT
UINT_TO_STRING
UINT_TO_TIME
UINT_TO_TOD
UINT_TO_UDINT
UINT_TO_ULINT
UINT_TO_USINT
UINT_TO_WORD
UINT_TO_WSTRING
ULINT_TO___UXINT
ULINT_TO___XINT
ULINT_TO___XWORD
ULINT_TO_BIT
ULINT_TO_BOOL
ULINT_TO_BYTE
ULINT_TO_DATE
ULINT_TO_DINT
ULINT_TO_DT
ULINT_TO_DWORD
ULINT_TO_INT
ULINT_TO_LDATE
ULINT_TO_LDT
ULINT_TO_LINT
ULINT_TO_LREAL
ULINT_TO_LTIME
ULINT_TO_LTOD
ULINT_TO_LWORD
ULINT_TO_REAL
ULINT_TO_SINT
ULINT_TO_STRING
ULINT_TO_TIME
ULINT_TO_TOD
490 / 1158 ctrlX PLC Engineering
Operators
ULINT_TO_UDINT
ULINT_TO_UINT
ULINT_TO_USINT
ULINT_TO_WORD
ULINT_TO_WSTRING
USINT_TO___XINT
USINT_TO___XINT
USINT_TO___XWORD
USINT_TO_BIT
USINT_TO_BOOL
USINT_TO_BYTE
USINT_TO_DATE
USINT_TO_DINT
USINT_TO_DT
USINT_TO_DWORD
USINT_TO_INT
USINT_TO_LDATE
USINT_TO_LDT
USINT_TO_LINT
USINT_TO_LREAL
USINT_TO_LTIME
USINT_TO_LTOD
USINT_TO_LWORD
USINT_TO_REAL
USINT_TO_SINT
USINT_TO_STRING
USINT_TO_TIME
USINT_TO_TOD
USINT_TO_UDINT
USINT_TO_UINT
USINT_TO_ULINT
USINT_TO_WORD
USINT_TO_WSTRING
WORD_TO___XINT
WORD_TO___XINT
WORD_TO___XWORD
WORD_TO_BIT
WORD_TO_BOOL
WORD_TO_BYTE
WORD_TO_DATE
WORD_TO_DINT
WORD_TO_DT
WORD_TO_DWORD
WORD_TO_INT
WORD_TO_LDATE
WORD_TO_LDT
WORD_TO_LINT
WORD_TO_LREAL
WORD_TO_LTIME
WORD_TO_LTOD
WORD_TO_LWORD
WORD_TO_REAL
WORD_TO_SINT
WORD_TO_STRING
WORD_TO_TIME
WORD_TO_TOD
WORD_TO_UDINT
WORD_TO_UINT
WORD_TO_ULINT
WORD_TO_USINT
WORD_TO_WSTRING
Converting to a string
String manipulation when converting to STRING or
NOTICE
WSTRING
When converting the type to STRING or WSTRING, the
Reference, programming
typed value is left-aligned as a character string and trun-
cated if it is too long. Therefore, declare the return var-
iable for the type conversion operators <>_TO_STRING
and <>_TO_WSTRING long enough that the character
string has enough space without any manipulation.
The operators that convert a value to a STRING or WSTRING type string need an
operand that matches the target data type.
Example
Examples
ST implementation language
When a larger data type is converted to a smaller one, the higher order (front)
bytes are truncated. When a smaller data type is converted to a larger one, the
more significant bytes are completed with zeros.
FUNCTION_BLOCK FB_ConvertIntegersFromInt
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
uxiReturn: __UXINT;
xiReturn: __XINT;
xwReturn: __XWORD;
bitReturn: BIT;
xReturn: BOOL;
bReturn: BYTE;
dateReturn: DATE;
diReturn: DINT;
dtReturn: DATE_AND_TIME;
dwReturn: DWORD;
liReturn: LINT;
lrReturn: LREAL;
lwReturn: LWORD;
siReturn: SINT;
sReturn: STRING;
timReturn: TIME;
todReturn: TIME_OF_DAY;
udiReturn: UDINT;
uiReturn: UINT;
usiReturn: USINT;
wReturn: WORD;
wsReturn: WSTRING;
uliReturn: ULINT;
END_VAR
uxiReturn := INT_TO___UXINT(127);
xiReturn := INT_TO___XINT(127);
xwReturn := INT_TO___XWORD(127);
bitReturn := INT_TO_BIT(127);
xReturn := INT_TO_BOOL(127);
bReturn := INT_TO_BYTE(127);
dateReturn := INT_TO_DATE(127);
diReturn := INT_TO_DINT(127);
dtReturn := INT_TO_DT(127);
dwReturn := INT_TO_DWORD(127);
liReturn := INT_TO_LINT(127);
lrReturn := INT_TO_LREAL(127);
lwReturn := INT_TO_LWORD(127);
siReturn := INT_TO_SINT(127);
sReturn := INT_TO_STRING(127);
timReturn := INT_TO_TIME(127);
todReturn := INT_TO_TOD(127);
udiReturn := INT_TO_UDINT(127);
uiReturn := INT_TO_UINT(127);
uliReturn := INT_TO_ULINT(127);
usiReturn := INT_TO_USINT(127);
wReturn := INT_TO_WORD(127);
wsReturn := INT_TO_WSTRING(127);
FUNCTION_BLOCK FB_ConvertIntegersToInt
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
Reference, programming
iReturn_uxi: INT;
iReturn_xi: INT;
iReturn_xw: INT;
iReturn_bit: INT;
iReturn_bool: INT;
iReturn_b: INT;
iReturn_d: INT;
iReturn_di: INT;
iReturn_dt: INT;
iReturn_dw: INT;
iReturn_li: INT;
iReturn_lr: INT;
iReturn_lw: INT;
iReturn_r: INT;
iReturn_si: INT;
iReturn_s: INT;
iReturn_tim: INT;
iReturn_tod: INT;
iReturn_tod_0: INT;
iReturn_udi: INT;
iReturn_ui: INT;
iReturn_uli: INT;
iReturn_usi: INT;
iReturn_w: INT;
iReturn_ws: INT;
END_VAR
iReturn_uxi := __UXINT_TO_INT(18446744073709551615);
iReturn_xi := __XINT_TO_INT(9223372036854775807);
iReturn_xw := __XWORD_TO_INT(16#FFFF_FFFF_FFFF_FFFF);
iReturn_bit := BIT_TO_INT(1);
iReturn_bool := BOOL_TO_INT(TRUE);
iReturn_b := BYTE_TO_INT(2#1111_0000);
iReturn_d := DATE_TO_INT(DATE#2019-9-13);
iReturn_di := DINT_TO_INT(2147483647);
iReturn_dt := DT_TO_INT(DT#1979-1-1-00:00:00);
iReturn_dw := DWORD_TO_INT(16#FFFF_FFFF);
// iReturn_i := INT_TO_<>(iData_12);
iReturn_li := LINT_TO_INT(9223372036854775807);
iReturn_lr := LREAL_TO_INT(1.7976931348623157E+30);
iReturn_lw := LWORD_TO_INT(16#FFFF_FFFF_FFFF_FFFF);
iReturn_r := REAL_TO_INT(3.402823E+38);
iReturn_si := SINT_TO_INT(127);
iReturn_s := STRING_TO_INT('127');
iReturn_tim := TIME_TO_INT(T#49D17H2M47S295MS);
iReturn_tod := TOD_TO_INT(TOD#23:59:59.999);
iReturn_tod_0 := TOD_TO_INT(TOD#1:1:1.001);
iReturn_udi := UDINT_TO_INT(4294967295);
iReturn_ui := UINT_TO_INT(65535);
iReturn_uli := ULINT_TO_INT(18446744073709551615);
iReturn_usi := USINT_TO_INT(255);
iReturn_w := WORD_TO_INT(16#FFFF);
iReturn_ws := WSTRING_TO_INT("1234567890");
PROGRAM PLC_PRG
VAR
fbConvertIntegersFromInt : FB_ConvertIntegersFromInt;
fbConvertIntegersToInt : FB_ConvertIntegersToInt;
END_VAR
fbConvertIntegersFromInt();
fbConvertIntegersToInt();
Reference, programming
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
● ⮫ Chapter 32.3.50 Boolean conversion on page 478
● ⮫ Chapter 32.3.49 Overload on page 476
● ⮫ Chapter 32.3.52 Floating point number conversion on page 495
● ⮫ Chapter 32.3.53 String conversion on page 498
● ⮫ Chapter 32.3.55 Date and time conversion on page 511
● ⮫ Chapter 32.3.54 Time conversion on page 506
Call
Syntax
<floating-point type> =
REAL |
LREAL
Operatoren
REAL_TO___UXINT
REAL_TO___XINT
REAL_TO___XWORD
REAL_TO_BIT
REAL_TO_BOOL
REAL_TO_BYTE
REAL_TO_DATE
REAL_TO_DINT
REAL_TO_DT
REAL_TO_DWORD
REAL_TO_INT
REAL_TO_LINT
REAL_TO_LREAL
REAL_TO_LTIME
REAL_TO_LWORD
REAL_TO_SINT
REAL_TO_STRING
REAL_TO_TIME
REAL_TO_TOD
REAL_TO_UDINT
REAL_TO_UINT
REAL_TO_ULINT
REAL_TO_USINT
REAL_TO_WORD
REAL_TO_WSTRING
LREAL_TO___UXINT
LREAL_TO___XINT
LREAL_TO___XWORD
LREAL_TO_BIT
LREAL_TO_BOOL
LREAL_TO_BYTE
LREAL_TO_DATE
LREAL_TO_DINT
LREAL_TO_DT
LREAL_TO_DWORD
LREAL_TO_INT
LREAL_TO_LINT
LREAL_TO_LTIME
LREAL_TO_LWORD
LREAL_TO_REAL
LREAL_TO_SINT
LREAL_TO_STRING
LREAL_TO_TIME
LREAL_TO_TOD
LREAL_TO_UDINT
LREAL_TO_UINT
LREAL_TO_ULINT
LREAL_TO_USINT
LREAL_TO_WORD
LREAL_TO_WSTRING
Rounding
When converting to an integer, the operand is rounded up or down to an
integer value. For 1 to 4 after the point, round down, for 5 to 9 round up.
Then the rounded number is converted to the specified integer type. In case
the rounded value is outside the value range of the integer, an undefined, target
system dependent value is returned. An exception is possible.
The rounding logic for borderline cases depends on the
NOTICE
target system or the FPU (floating point unit) of the
target system. A value such as -1.5 can be converted
differently on different controls.
Reference, programming
To program target system-independent code, intercept
exceedances of the value range via the application.
Converting to a string
String manipulation when converting to STRING or
NOTICE
WSTRING
When converting the type to STRING or WSTRING, the
typed value is left-aligned as a character string and trun-
cated if it is too long. Therefore, declare the return var-
iable for the type conversion operators <>_TO_STRING
and <>_TO_WSTRING long enough that the character
string has enough space without any manipulation.
For a floating point number conversion to a string, the number of decimal
places of the mantissa is limited to 6. If the number < is 1, the mantissa is m:
1 <= m < 10. If the mantissa has more digits after the decimal point, it is
rounded to the 6th digit and then converted.
Also, the string variable may be declared too short for the return value. Then
the return string is truncated on the right.
Examples
ST implementation language
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
● ⮫ Chapter 32.3.50 Boolean conversion on page 478
● ⮫ Chapter 32.3.49 Overload on page 476
● ⮫ Chapter 32.3.51 Integer conversion on page 482
● ⮫ Chapter 32.3.53 String conversion on page 498
● ⮫ Chapter 32.3.55 Date and time conversion on page 511
● ⮫ Chapter 32.3.54 Time conversion on page 506
Only if the operand matches the target data type according to the IEC 61131-3
standard, a conversion with meaningful result is possible. This is the case if the
value of the operand corresponds to a valid constant (literal) of the target data
type.
Convertible strings include:
● Number with type prefix (for example '16#FFFFFF')
● Number with grouping character (for example '2#1111_1111')
Note: The international weight and measure grouping character (thinspace)
is not accepted, only the underscore.
● Floating point number, also in exponential notation (for example '9.876'
Reference, programming
or '1.2E-34')
Note: Floating point numbers are not convertible. The comma is treated as a
trailing character and truncated.
● Time- time and date information with prefix and size (for example 'T#2h',
'DT#2019-9-9-12:30:30.9')
● Infinite values (for example '1.7E+400')
● Additional characters after a number (for example '2m' or '3.14'). These
characters are cut off. Additional characters in front of a number are not
permitted.
● Space in front of it (for example ' 3.14')
Call syntax
STRING_TO___UXINT
STRING_TO___XINT
STRING_TO___XWORD
STRING_TO_BIT
STRING_TO_BOOL
STRING_TO_BYTE
STRING_TO_DATE
STRING_TO_DINT
STRING_TO_DT
STRING_TO_DWORD
STRING_TO_INT
STRING_TO_LDATE
STRING_TO_LDT
STRING_TO_LINT
STRING_TO_LREAL
STRING_TO_LTIME
STRING_TO_LWORD
STRING_TO_LTIME
STRING_TO_LTOD
STRING_TO_REAL
STRING_TO_SINT
STRING_TO_TIME
STRING_TO_TOD
STRING_TO_UDINT
STRING_TO_UINT
STRING_TO_ULINT
STRING_TO_USINT
STRING_TO_WORD
STRING_TO_WSTRING
WSTRING_TO___UXINT
WSTRING_TO___XINT
WSTRING_TO___XWORD
WSTRING_TO_BIT
WSTRING_TO_BOOL
WSTRING_TO_BYTE
WSTRING_TO_DATE
WSTRING_TO_DINT
WSTRING_TO_DT
WSTRING_TO_DWORD
WSTRING_TO_INT
WSTRING_TO_LDATE
WSTRING_TO_LDT
WSTRING_TO_LINT
WSTRING_TO_LREAL
WSTRING_TO_LTIME
WSTRING_TO_LTOD
WSTRING_TO_LWORD
WSTRING_TO_LTIME
WSTRING_TO_REAL
WSTRING_TO_SINT
WSTRING_TO_STRING
WSTRING_TO_TIME
WSTRING_TO_TOD
WSTRING_TO_UDINT
WSTRING_TO_UINT
WSTRING_TO_ULINT
WSTRING_TO_USINT
WSTRING_TO_STRING
WSTRING_TO_WORD
Reference, programming
Examples
ST implementation language
FUNCTION_BLOCK FB_ConvertStrings
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
xReturn_0: BOOL;
xReturn_1: BOOL;
dateReturn: DATE;
dtReturn: DATE_AND_TIME;
iReturn: INT;
lrReturn: LREAL;
lrReturn_0: LREAL;
lwReturn: LWORD;
lwReturn_0: LWORD;
lwReturn_1: LWORD;
ltReturn: LTIME;
ltReturn_0: LTIME;
ltReturn_1: LTIME;
ltReturn_2: LTIME;
rReturn: REAL;
rReturn_0: REAL;
timReturn: TIME;
timReturn0: TIME;
timReturn1: TIME;
timReturn2: TIME;
todReturn: TIME_OF_DAY;
todReturn0: TIME_OF_DAY;
todReturn1: TIME_OF_DAY;
todReturn2: TIME_OF_DAY;
uliReurn: ULINT;
uliReurn_0: ULINT;
uliReurn_1: ULINT;
wReturn: WORD;
wReturn_0: WORD;
wReturn_1: WORD;
wstrReturn: WSTRING;
wstrReturn_0: WSTRING;
END_VAR
xReturn_0 := STRING_TO_BOOL('FALSE');
xReturn_1 := STRING_TO_BOOL('TRUE');
dateReturn := STRING_TO_DATE('DATE#2019-9-9');
dtReturn := STRING_TO_DT('DT#2019-9-9-1:1:1.1');
iReturn := STRING_TO_INT('123abc');
lrReturn := STRING_TO_LREAL('4.94E-323');
lrReturn_0 := STRING_TO_LREAL('1.7E+308');
lwReturn := STRING_TO_LWORD('16#FFFF_FFFF_FFFF_FFFF');
lwReturn_0 := STRING_TO_LWORD('16#0123456789ABCDEF');
lwReturn_1 := STRING_TO_LWORD('16#0123456789ABCDEF');
ltReturn :=
STRING_TO_LTIME('LTIME#213503d23h34m33s709ms551us615ns');
ltReturn_0 := STRING_TO_LTIME('LTIME#0ns');
ltReturn_1 := STRING_TO_LTIME('LTIME#1ms');
ltReturn_2 := STRING_TO_LTIME('LTIME#2s');
rReturn := STRING_TO_REAL('6.543e21');
rReturn_0 := STRING_TO_REAL('1.234');
timReturn := STRING_TO_TIME('T#5d4h3m2s');
timReturn0 := STRING_TO_TIME('TIME#1s');
timReturn1 := STRING_TO_TIME('1s');
timReturn2 := STRING_TO_TIME('TIME#5s');
todReturn := STRING_TO_TOD('TOD#12:0:0.1');
todReturn0 := STRING_TO_TOD('TOD#0:0:0.0');
todReturn1 := STRING_TO_TOD('20:15');
todReturn2 := STRING_TO_TOD('TOD#20:15');
uliReurn := STRING_TO_ULINT('18446744073709551615');
uliReurn_0 := STRING_TO_ULINT('1');
uliReurn_1 := STRING_TO_ULINT('0');
wReturn := STRING_TO_WORD('16#FFFF_0000');
wReturn_0 := STRING_TO_WORD('34abc');
wReturn_1 := STRING_TO_WORD('16#34abc');
wstrReturn := STRING_TO_WSTRING('Hello World!');
wstrReturn_0 := STRING_TO_WSTRING('123456789');
Reference, programming
WSTRING conversion in ST
FUNCTION_BLOCK FB_ConvertWstrings
VAR
xReturn_0: BOOL;
xReturn_1: BOOL;
dateReturn: DATE;
dtReturn: DATE_AND_TIME;
iReturn: INT;
lrReturn: LREAL;
lrReturn_0: LREAL;
lwReturn: LWORD;
lwReturn_0: LWORD;
lwReturn_1: LWORD;
ltReturn: LTIME;
ltReturn_0: LTIME;
ltReturn_1: LTIME;
ltReturn_2: LTIME;
rReturn: REAL;
rReturn_0: REAL;
timReturn: TIME;
timReturn0: TIME;
timReturn1: TIME;
timReturn2: TIME;
todReturn: TIME_OF_DAY;
todReturn0: TIME_OF_DAY;
todReturn1: TIME_OF_DAY;
todReturn2: TIME_OF_DAY;
uliReurn: ULINT;
uliReurn_0: ULINT;
uliReurn_1: ULINT;
wReturn: WORD;
wReturn_0: WORD;
wReturn_1: WORD;
wstrReturn: WSTRING;
wstrReturn_0: WSTRING;
END_VAR
xReturn_0 := WSTRING_TO_BOOL("FALSE");
xReturn_1 := WSTRING_TO_BOOL("TRUE");
dateReturn := WSTRING_TO_DATE("DATE#2019-9-9");
dtReturn := WSTRING_TO_DT("DT#2019-9-9-1:1:1.1");
iReturn := WSTRING_TO_INT("123abc");
lrReturn := WSTRING_TO_LREAL("4.94E-323");
lrReturn_0 := WSTRING_TO_LREAL("1.7E+308");
lwReturn := WSTRING_TO_LWORD("16#FFFF_FFFF_FFFF_FFFF");
lwReturn_0 := WSTRING_TO_LWORD("16#0123456789ABCDEF");
lwReturn_1 := WSTRING_TO_LWORD("16#0123456789ABCDEF");
ltReturn :=
WSTRING_TO_LTIME("LTIME#213503d23h34m33s709ms551us615ns");
ltReturn_0 := WSTRING_TO_LTIME("LTIME#0ns");
ltReturn_1 := WSTRING_TO_LTIME("LTIME#1ms");
ltReturn_2 := WSTRING_TO_LTIME("LTIME#2s");
rReturn := WSTRING_TO_REAL("6.543e21");
rReturn_0 := WSTRING_TO_REAL("1.234");
timReturn := WSTRING_TO_TIME("T#5d4h3m2s");
timReturn0 := WSTRING_TO_TIME("TIME#1s");
timReturn1 := WSTRING_TO_TIME("1s");
timReturn2 := WSTRING_TO_TIME("TIME#5s");
todReturn := WSTRING_TO_TOD("TOD#12:0:0.1");
todReturn0 := WSTRING_TO_TOD("TOD#0:0:0.0");
todReturn1 := WSTRING_TO_TOD("20:15");
todReturn2 := WSTRING_TO_TOD("TOD#20:15");
uliReurn := WSTRING_TO_ULINT("18446744073709551615");
uliReurn_0 := WSTRING_TO_ULINT("1");
uliReurn_1 := WSTRING_TO_ULINT("0");
wReturn := WSTRING_TO_WORD("16#FFFF_0000");
wReturn_0 := WSTRING_TO_WORD("34abc");
wReturn_1 := WSTRING_TO_WORD("16#34abc");
Reference, programming
FBD implementation language
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
● ⮫ Chapter 32.3.50 Boolean conversion on page 478
● ⮫ Chapter 32.3.49 Overload on page 476
● ⮫ Chapter 32.3.51 Integer conversion on page 482
● ⮫ Chapter 32.3.52 Floating point number conversion on page 495
● ⮫ Chapter 32.3.55 Date and time conversion on page 511
● ⮫ Chapter 32.3.54 Time conversion on page 506
Call syntax
TIME_TO___UXINT
TIME_TO___XINT
TIME_TO___XWORD
TIME_TO_BIT
TIME_TO_BOOL
TIME_TO_BYTE
TIME_TO_DATE
TIME_TO_DINT
TIME_TO_DT
TIME_TO_DWORD
TIME_TO_INT
TIME_TO_LDATE
TIME_TO_LDINT
TIME_TO_LINT
TIME_TO_LREAL
TIME_TO_LTIME
TIME_TO_LTOD
TIME_TO_LWORD
TIME_TO_REAL
TIME_TO_SINT
TIME_TO_STRING
TIME_TO_TOD
TIME_TO_UDINT
TIME_TO_UINT
TIME_TO_ULINT
TIME_TO_USINT
TIME_TO_WORD
TIME_TO_WSTRING
LTIME_TO___UXINT
LTIME_TO___XINT
LTIME_TO___XWORD
LTIME_TO_BIT
LTIME_TO_BOOL
LTIME_TO_BYTE
LTIME_TO_DATE
LTIME_TO_DINT
LTIME_TO_DT
LTIME_TO_DWORD
LTIME_TO_INT
LTIME_TO_LDATE
LTIME_TO_LDINT
LTIME_TO_LINT
LTIME_TO_LREAL
LTIME_TO_LTOD
LTIME_TO_LWORD
LTIME_TO_REAL
LTIME_TO_SINT
Reference, programming
LTIME_TO_STRING
LTIME_TO_TIME
LTIME_TO_TOD
LTIME_TO_UDINT
LTIME_TO_UINT
LTIME_TO_ULINT
LTIME_TO_USINT
LTIME_TO_WORD
LTIME_TO_WSTRING
Converting to a string
String manipulation when converting to STRING or
NOTICE
WSTRING
When converting the type to STRING or WSTRING, the
typed value is left-aligned as a character string and trun-
cated if it is too long. Therefore, declare the return var-
iable for the type conversion operators <>_TO_STRING
and <>_TO_WSTRING long enough that the character
string has enough space without any manipulation.
sTime := TIME_TO_STRING(T#0MS); sTime = 'T#0MS'
Examples
ST implementation language
FUNCTION_BLOCK FB_ConvertTimeAndDate
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
ltReturn_1: LTIME;
lwReturn_2: LWORD;
rReturn_3: REAL;
strReturn_4: STRING;
timReturn_5: TIME;
todReturn_6: TIME_OF_DAY;
uliReurn_7: ULINT;
wstrReturn_8: WSTRING;
wstrReturn_80: WSTRING;
uliReurn_70: ULINT;
todReturn_60: TIME_OF_DAY;
timReturn_50: TIME;
strReturn_40: STRING;
rReturn_30: REAL;
lwReturn_20: LWORD;
ltReturn_10: LTIME;
ltReturn_11: LTIME;
lwReturn_21: LWORD;
rReturn_31: REAL;
strReturn_41: STRING;
timReturn_51: TIME;
todRedurn_61: TIME_OF_DAY;
uliReurn_71: ULINT;
wstrReturn_81: WSTRING;
ltReturn_12: LTIME;
xReturn_9: BOOL;
xReturn_90: BOOL;
xReturn_91: BOOL;
xReturn_92: BOOL;
dateReturn_6: DATE;
timReturn_60: TIME;
wReturn_61: WORD;
todReturn_61: TIME_OF_DAY;
END_VAR
ltReturn_1 := DT_TO_LTIME(DT#2019-9-9-23:59:59);
ltReturn_10 := DT_TO_LTIME(DT#1970-1-1-0:0:0);
ltReturn_11 := DT_TO_LTIME(DT#1970-1-2-0:0:1);
ltReturn_12 := DT_TO_LTIME(DT#1970-1-3-12:30:30);
lwReturn_2 := TIME_TO_LWORD(T#5D4H2M3S2MS);
lwReturn_20 := TIME_TO_LWORD(T#0D0H0M0S0MS);
rReturn_3 := TIME_TO_REAL(T#5D4H2M3S2MS);
rReturn_30 := TIME_TO_REAL(T#0D0H0M0S0MS);
strREturn_4 := TIME_TO_STRING(T#5D4H2M3S2MS);
strREturn_40 := TIME_TO_STRING(T#0D0H0M0S0MS);
timReturn_5 := TOD_TO_TIME(TOD#23:59:59.999);
timReturn_50 := TOD_TO_TIME(TOD#0:0:0.000);
timReturn_51 := TOD_TO_TIME(TOD#0:0:0.001);
dateReturn_6 := TOD_TO_DATE(TOD#23:59:59.999);
timReturn_60 := TOD_TO_TIME(TOD#0:0:0.000);
wReturn_61 := TOD_TO_WORD(TOD#0:0:0.001);
Reference, programming
uliReurn_7 := DATE_TO_ULINT(D#2019-9-9);
uliReurn_70 := DATE_TO_ULINT(D#1970-1-1);
uliReurn_71 := DATE_TO_ULINT(D#1970-1-2);
wstrReturn_8 := DATE_TO_WSTRING(D#2019-9-9);
wstrReturn_80 := DATE_TO_WSTRING(D#1970-1-1);
wstrReturn_81 := DATE_TO_WSTRING(D#1970-1-2);
xReturn_9 := DATE_TO_BOOL(D#2019-9-9);
xReturn_90 := DATE_TO_BOOL(D#1970-1-1);
xReturn_91 := DATE_TO_BOOL(D#1970-1-2);
xReturn_92 := DATE_TO_BOOL(D#1970-1-3);
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
● ⮫ Chapter 32.3.50 Boolean conversion on page 478
● ⮫ Chapter 32.3.49 Overload on page 476
● ⮫ Chapter 32.3.51 Integer conversion on page 482
● ⮫ Chapter 32.3.52 Floating point number conversion on page 495
Reference, programming
Information can be lost when converting from larger data
types to smaller data types.
The operators convert a date and time specification to the specified data type
and return a type-converted value.
Call syntax
DATE_TO___UXINT
DATE_TO___XINT
DATE_TO___XWORD
DATE_TO_BIT
DATE_TO_BOOL
DATE_TO_BYTE
DATE_TO_DINT
DATE_TO_DT
DATE_TO_DWORD
DATE_TO_INT
DATE_TO_LINT
DATE_TO_LREAL
DATE_TO_LTIME
DATE_TO_LWORD
DATE_TO_REAL
DATE_TO_SINT
DATE_TO_STRING
DATE_TO_TIME
DATE_TO_TOD
DATE_TO_UDINT
DATE_TO_UINT
DATE_TO_ULINT
DATE_TO_USINT
DATE_TO_WORD
DATE_TO_WSTRING
DT_TO___UXINT
DT_TO___XINT
DT_TO___XWORD
DT_TO_BIT
DT_TO_BOOL
DT_TO_BYTE
DT_TO_DATE
DT_TO_DINT
DT_TO_DWORD
DT_TO_INT
DT_TO_LINT
DT_TO_LREAL
DT_TO_LTIME
DT_TO_LWORD
DT_TO_REAL
DT_TO_SINT
DT_TO_STRING
DT_TO_TIME
DT_TO_TOD
DT_TO_UDINT
DT_TO_UINT
DT_TO_ULINT
DT_TO_USINT
DT_TO_WORD
DT_TO_WSTRING
TOD_TO___UXINT
TOD_TO___XINT
TOD_TO___XWORD
TOD_TO_BOOL
TOD_TO_BIT
TOD_TO_BYTE
TOD_TO_DATE
TOD_TO_DINT
TOD_TO_DT
TOD_TO_DWORD
TOD_TO_INT
TOD_TO_LINT
TOD_TO_LREAL
TOD_TO_LTIME
TOD_TO_LWORD
TOD_TO_REAL
TOD_TO_SINT
TOD_TO_STRING
TOD_TO_TIME
TOD_TO_UDINT
TOD_TO_UINT
TOD_TO_ULINT
TOD_TO_USINT
TOD_TO_WORD
TOD_TO_WSTRING
Long-Operatoren
LDATE_TO___UXINT
LDATE_TO___XINT
LDATE_TO___XWORD
LDATE_TO_BIT
LDATE_TO_BOOL
LDATE_TO_BYTE
LDT_TO___UXINT
LDT_TO___XINT
LDT_TO___XWORD
LDT_TO_BIT
LDT_TO_BOOL
LDT_TO_BYTE
LDT_TO_DATE
LDT_TO_DINT
LDT_TO_DWORD
LDT_TO_INT
LDT_TO_LDATE
LDT_TO_LINT
LDT_TO_LREAL
LDT_TO_LTIME
LDT_TO_LTOD
LDT_TO_LWORD
LDT_TO_REAL
LDT_TO_SINT
LDT_TO_STRING
LDT_TO_TIME
LDT_TO_TOD
LDT_TO_UDINT
LDT_TO_UINT
LDT_TO_ULINT
LDT_TO_USINT
LDT_TO_WORD
LDT_TO_WSTRING
LTOD_TO___UXINT
LTOD_TO___XINT
LTOD_TO___XWORD
LTOD_TO_BOOL
LTOD_TO_BIT
LTOD_TO_BYTE
LTOD_TO_DATE
514 / 1158 ctrlX PLC Engineering
Operators
LTOD_TO_DINT
LTOD_TO_DT
LTOD_TO_DWORD
LTOD_TO_INT
LTOD_TO_LDATE
LTOD_TO_LDT
LTOD_TO_LINT
LTOD_TO_LREAL
LTOD_TO_LTIME
LTOD_TO_LWORD
LTOD_TO_REAL
LTOD_TO_SINT
LTOD_TO_STRING
LTOD_TO_TIME
LTOD_TO_UDINT
LTOD_TO_UINT
LTOD_TO_ULINT
LTOD_TO_USINT
LTOD_TO_WORD
LTOD_TO_WSTRING
Converting to an integer
The data types DATE and DT use the same memory format internally, namely a
DWORD. The resolution for DATE is 1 day. The resolution for DT is 1 second. Both
start from January 1, 1970.
TOD is stored as DWORD with a resolution of 1 millisecond.
diReturn_0 := diReturn_0 = 0
DT_TO_DINT(DT#1970-1-1-0:0:0);
diReturn_1 := diReturn_1 = 0
DATE_TO_DINT(D#1970-1-1);
diReturn_2 := diReturn_2 = 0
TOD_TO_DINT(TOD#0:0:0);
diReturn_1 := diReturn_3 = 1
DT_TO_DINT(DT#1970-1-1-0:0:1);
diReturn_3 := diReturn_4 = 86400
DATE_TO_DINT(D#1970-1-2);
Converting to a string
String manipulation when converting to STRING or
Reference, programming
NOTICE
WSTRING
When converting the type to STRING or WSTRING, the
typed value is left-aligned as a character string and trun-
cated if it is too long. Therefore, declare the return var-
iable for the type conversion operators <>_TO_STRING
and <>_TO_WSTRING long enough that the character
string has enough space without any manipulation.
The operands of type DATE, DATE_AND_TIME, TIME_OF_DAY, DT or TOD, which
are passed to an operator for a date and time conversion, are converted in their
constant notation (literal notation). The generated string contains the keywords
D#, DT# or TOD# and then the quantity with its date and time unit as specified
in the IEC 61131-3 standard.
Examples
Examples
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
● ⮫ Chapter 32.3.50 Boolean conversion on page 478
● ⮫ Chapter 32.3.49 Overload on page 476
● ⮫ Chapter 32.3.51 Integer conversion on page 482
● ⮫ Chapter 32.3.52 Floating point number conversion on page 495
● ⮫ Chapter 32.3.53 String conversion on page 498
● ⮫ Chapter 32.3.54 Time conversion on page 506
Examples
Reference, programming
Result in diVar: 1
ST
diVar := TRUNC(1.9); (* Result: 1 *)
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
Examples
Result in iVAR: 1
ST:
iVar := TRUNC_INT(1.9); (* Result: 1 *)
Also refer to
● ⮫ Chapter 32.3.10 Type conversion operators on page 457
Examples
Result in i: 2
ST:
i := ABS(-2);
FBD:
Examples
Result in q: 4
ST:
q := SQRT(16);
FBD:
Examples
Result: 3.80666
ST:
q := LN(45);
FBD:
Examples
Result in q: 2.49762
ST:
q := LOG(314.5);
FBD:
Reference, programming
32.3.62 Operator 'EXP'
This IEC operator yields the exponential function.
Permitted data types for input variables: any numeric basic data type
Permitted data types for output variables: REAL and LREAL
Examples
Result in q: 7.389056099
ST:
q := EXP(2);
FBD:
Example
Power function with literals
Var1 := EXPT(7,2);
FBD:
Example
Power function with variables
PROGRAM PLC_PRG
VAR
lrPow : LREAL;
iBase : INT := 2;
iExponent : INT := 7;
END_VAR
Examples
Result in q: 0.479426
ST:
q := SIN (0.5);
FBD:
Examples
Result in q: 0.877583
ST:
q := COS(0.5);
FBD:
Examples
Result in q: 0.546302
ST:
Reference, programming
q := TAN(0.5);
FBD:
Examples
Result in q: 0.523599
ST:
q := ASIN(0,5);
FBD:
Examples
Result in q: 1.0472
ST:
q := ACOS(0.5);
FBD:
Examples
Result in q: 0.463648
ST:
q := ATAN(0.5);
FBD:
Examples
FUNCTION_BLOCK FBDynamic
VAR_INPUT
in1, in2 : INT;
END_VAR
VAR_OUTPUT
out : INT;
END_VAR
Reference, programming
VAR
test1 : INT := 1234;
_inc : INT := 0;
_dut : POINTER TO DUT;
neu : BOOL;
END_VAR
VAR_INPUT
bInCopyCode : BOOL;
END_VAR
__Delete(_dut);
VAR_INPUT
bInitRetains : BOOL;
bInCopyCode : BOOL;
END_VAR
_dut := __NEW(DUT);
VAR_INPUT
END_VAR
_inc := _inc + 1;
INC := _inc;
PLC_PRG(PRG)
VAR
pFB : POINTER TO FBDynamic;
bInit: BOOL := TRUE;
bDelete: BOOL;
loc : INT;
END_VAR
IF (bInit) THEN
pFB := __NEW(FBDynamic);
bInit := FALSE;
END_IF
IF (bDelete) THEN
__DELETE(pFB);
END_IF
If you change the data layout of the function block in online mode, then you
cannot execute a login with an online change afterwards. This is because the
memory area of the function block instance has been invalidated. You change
the data layout when you add new variables to the function block, delete
existing variables, or change the data types of variables.
Example
Array (DWORD):
PROGRAM PLC_PRG
Reference, programming
VAR
pdwScalar : POINTER TO DWORD; //Typed pointer
xInit : BOOL := TRUE;
xDelete : BOOL;
END_VAR
IF (xInit) THEN
pdwScalar := __NEW(DWORD, 16); // Allocates memory (16
dwords) and assigns them to pointer pdwScalar
END_IF
IF (xDelete) THEN
__DELETE(pdwScalar); // Frees memory of pointer
END_IF
Function block:
{attribute 'enable_dynamic_creation'}
FUNCTION_BLOCK FBComputeGamma
VAR_INPUT
iAlpha : INT;
iBeta : INT;
END_VAR
VAR_OUTPUT
iGamma : INT;
END_VAR
VAR
END_VAR
PROGRAM PLC_PRG
VAR
pComputeGamma : POINTER TO FBComputeGamma; // Typed pointer
xInit : BOOL := TRUE;
xDelete : BOOL;
iResult : INT;
END_VAR
IF (xInit) THEN
pComputeGamma := __NEW(FBComputeGamma); // Allocates memory
xInit := FALSE;
END_IF
pComputeGamma^.iAlpha := (pComputeGamma^.iAlpha + 1)MOD
100; // Sets first input of pComputeGamma
pComputeGamma^.iBeta := 10; // Sets second input of
pComputeGamma
{attribute 'enable_dynamic_creation'}
TYPE ABCDATA :
STRUCT
iA, iB, iC, iD : INT;
END_STRUCT
END_TYPE
PROGRAM PLC_PRG
VAR
pABCData : POINTER TO ABCDATA; // Typed pointer
xInit : BOOL := TRUE;
xDelete : BOOL;
END_VAR
IF (xInit) THEN
pABCData := __NEW(ABCDATA); // Allocates memory
xInit := FALSE;
END_IF
IF (xDelete) THEN
__DELETE(pABCData); // Frees memory
END_IF
Array (BYTE):
PROGRAM PLC_PRG
VAR
pbDataAlpha : POINTER TO BYTE;
pbDataBeta : POINTER TO BYTE;
xInit : BOOL := TRUE;
xDelete : BOOL;
usiCnt : USINT;
bTestC: BYTE;
END_VAR
IF (xInit) THEN
pbDataAlpha := __NEW(BYTE, 16); // Allocates 16 bytes for
pbDataAlpha
pbDataBeta := __NEW(BYTE); // Allocates memory for
pbDataBeta
xInit := FALSE;
FOR usiCnt := 0 TO 15 DO
pbDataAlpha[usiCnt] := usiCnt; // Writes to new array
END_FOR
pbDataBeta^:= 16#FF; // Writes to new data
END_IF
Reference, programming
extensively.
We recommend that you call __NEW operators in one task
only.
See also
● ⮫ Chapter Dialog 'Properties - Application Build Options' on page 1053
● ⮫ Chapter Object 'DUT' on page 815
● ⮫ Chapter ‘Function block’ object on page 823
● ⮫ Chapter Attribute 'enable_dynamic_creation' on page 614
● ⮫ Chapter 32.11.160 Compiler Error C0509 on page 732
Example
INTERFACE ItfBase EXTENDS __System.IQueryInterface
METHOD mbase : BOOL
END_METHOD
END_FUNCTION_BLOCK
PROGRAMM POU
VAR
inst1 : FB1;
inst2 : FB2;
itfbase1 : ItfBase := inst1;
itfbase2 : ItfBase := inst2;
itfderived1 : ItfDerived1 := 0;
itfderived2 : ItfDerived2 := 0;
xResult1, xResult2, xResult3, xResult4: BOOL;
END_VAR
__TRY
<statements_try>
__CATCH(exec)
<statements_catch>
__FINALLY
Reference, programming
<statements_finally>
__ENDTRY
<statements_next>
When a statement in the __Try operator throws an exception, the application
does not stop. Instead, the application executes the statements in __Catch,
starts the exception handling, and then executes the statements in __FINALLY.
The exception handling ends with __ENDTRY, and the application executes the
subsequent statements.
An IEC variable for an exception has the data type __System.ExceptionCode.
Example
If the statement in __TRY throws an exception, then program execution is
not stopped. Instead, the statement in __CATCH is executed. Therefore, in
this example, the application executes the exc function, then the statement in
__FINALLY, and finally the statement in __ENDTRY.
__TRY
Tester := tryFun(count := count, testcase := g_testcase); //
This statement is tested. If it throws an exception, then the
statement in __CATCH is executed first, and then the
statement in __FINALLY.
__CATCH(exc)
HandleException(exc, strExceptionText => strExceptionText);
__FINALLY
GVL.g_count := GVL.g_count + 2;
__ENDTRY
See also
● ⮫ Chapter Command 'Stop Execution on Handled Exceptions' on page 952
RTSEXCPT_NOEXCEPTION := 16#00000000,
RTSEXCPT_WATCHDOG := 16#00000010,
RTSEXCPT_HARDWAREWATCHDOG := 16#00000011,
RTSEXCPT_IO_CONFIG_ERROR := 16#00000012,
RTSEXCPT_PROGRAMCHECKSUM := 16#00000013,
RTSEXCPT_FIELDBUS_ERROR := 16#00000014,
RTSEXCPT_IOUPDATE_ERROR := 16#00000015,
RTSEXCPT_CYCLE_TIME_EXCEED := 16#00000016,
RTSEXCPT_ONLCHANGE_PROGRAM_EXCEEDED := 16#00000017,
RTSEXCPT_UNRESOLVED_EXTREFS := 16#00000018,
RTSEXCPT_DOWNLOAD_REJECTED := 16#00000019,
RTSEXCPT_BOOTPROJECT_REJECTED_DUE_RETAIN_ERROR :=
16#0000001A,
RTSEXCPT_LOADBOOTPROJECT_FAILED := 16#0000001B,
RTSEXCPT_OUT_OF_MEMORY := 16#0000001C,
RTSEXCPT_RETAIN_MEMORY_ERROR := 16#0000001D,
RTSEXCPT_BOOTPROJECT_CRASH := 16#0000001E,
RTSEXCPT_BOOTPROJECTTARGETMISMATCH := 16#00000021,
RTSEXCPT_SCHEDULEERROR := 16#00000022,
RTSEXCPT_FILE_CHECKSUM_ERR := 16#00000023,
RTSEXCPT_RETAIN_IDENTITY_MISMATCH := 16#00000024,
RTSEXCPT_IEC_TASK_CONFIG_ERROR := 16#00000025,
RTSEXCPT_APP_TARGET_MISMATCH := 16#00000026,
RTSEXCPT_ILLEGAL_INSTRUCTION := 16#00000050,
RTSEXCPT_ACCESS_VIOLATION := 16#00000051,
RTSEXCPT_PRIV_INSTRUCTION := 16#00000052,
RTSEXCPT_IN_PAGE_ERROR := 16#00000053,
RTSEXCPT_STACK_OVERFLOW := 16#00000054,
RTSEXCPT_INVALID_DISPOSITION := 16#00000055,
RTSEXCPT_INVALID_HANDLE := 16#00000056,
RTSEXCPT_GUARD_PAGE := 16#00000057,
RTSEXCPT_DOUBLE_FAULT := 16#00000058,
RTSEXCPT_INVALID_OPCODE := 16#00000059,
RTSEXCPT_MISALIGNMENT := 16#00000100,
RTSEXCPT_ARRAYBOUNDS := 16#00000101,
RTSEXCPT_DIVIDEBYZERO := 16#00000102,
RTSEXCPT_OVERFLOW := 16#00000103,
RTSEXCPT_NONCONTINUABLE := 16#00000104,
RTSEXCPT_PROCESSORLOAD_WATCHDOG := 16#00000105,
RTSEXCPT_FPU_ERROR := 16#00000150,
RTSEXCPT_FPU_DENORMAL_OPERAND := 16#00000151,
RTSEXCPT_FPU_DIVIDEBYZERO := 16#00000152,
RTSEXCPT_FPU_INEXACT_RESULT := 16#00000153,
RTSEXCPT_FPU_INVALID_OPERATION := 16#00000154,
RTSEXCPT_FPU_OVERFLOW := 16#00000155,
RTSEXCPT_FPU_STACK_CHECK := 16#00000156,
RTSEXCPT_FPU_UNDERFLOW := 16#00000157,
RTSEXCPT_VENDOR_EXCEPTION_BASE := 16#00002000
RTSEXCPT_USER_EXCEPTION_BASE := 16#00010000
) UDINT ;
END_TYPE
Example
Reference, programming
FUNCTION_BLOCK FB_Velocity
VAR_INPUT
rVelocity: REAL := 1.2;
END_VAR
VAR_OUTPUT
END_VAR
VAR
infoVelocity: __SYSTEM.VAR_INFO; //Info of Velocity
END_VAR
PROGRAM PLC_PRG
VAR
iCounter : INT := 0; // Counts the calls
infoCounter : __SYSTEM.VAR_INFO; //Info of Counter
arrA : ARRAY [1..2, 1..2, 1..2] OF INT := [0, 1, 2, 3, 4,
5, 6, 7]; // Stores the A data
infoA : __SYSTEM.VAR_INFO; //Info of A
fbVel : FB_Velocity;
END_VAR
iCounter := iCounter + 1;
infoCounter := __VARINFO(iCounter);
infoA := __VARINFO(arrA);
fbVel();
The iCounter and arrA variables are recognized in the application code.
The variable information is saved in the infoCounter and infoA variables.
Moreover, the FB_Velocity function block is instantiated.
Reference, programming
Requirement: The variable has the data
type ARRAY.
Example: 16 bits for arrA : ARRAY
[1..2,1..2,1..2] OF INT;
MemoryArea MEMORY_ARE MEM_MEMORY Information about the memory area
A ● MEM_GLOBAL: Global memory area
For example in Area 0
● MEM_LOCAL: Local memory area
in Area -1
● MEM_MEMORY: Marker memory area
%M
For example in 16#10 in Area 1
● MEM_INPUT: Input memory area %I
For example in 16#04 in Area 2
● MEM_OUTPUT: Output memory area
%Q
For example in 16#08 in Area 3
● MEM_RETAIN: Retain memory area
For example in 16#20 in Area 0
Example: MEM_GLOBAL
Note: The memory area configuration
is device-dependent.
Symbol STRING(39) '' Variable name as STRING(39)
Example: 'iCounter', 'arrA'
Comment STRING(79) '' Comment of the variable declaration
Example: 'Counts the calls' or
'Stores the A data'
Example
//Declaration
VAR
idx : INT;
pInfo : POINTER TO Task_Info2;
END_VAR
//Program code
idx := __CURRENTTASK.TaskIndex;
pInfo := __CURRENTTASK.pTaskInfo;
Example
The following example shows a typical usage. Exclusive access to a type
STRING variable, which is addressed via the pstrOutput pointer, should be
implemented.
The access to a string is not atomic. If multiple tasks write to the same string
at the same time, then the contents may be inconsistent.
With this function, it is now possible to write the same STRING variable in
different tasks.
FUNCTION ExclusiveStringWrite : BOOL
VAR_INPUT
strToWrite : STRING;
pstrOutput : POINTER TO STRING;
END_VAR
VAR_STAT
dwSynch : __XWORD;
END_VAR
VAR
bMutex: BOOL;
END_VAR
Also refer to
● ⮫ Chapter 32.3.13 Multicore operators on page 458
Reference, programming
● ⮫ Chapter 32.3.82 Operator 'TEST_AND_SET' on page 537
Example
The following example shows a typical usage. An array should be populated
from two tasks. In the process, all positions in the array should be used and
no position should be overwritten.
With this function, multiple tasks can populate a Boolean array.
FUNCTION WriteToNextArrayPosition : BOOL
VAR_EXTERNAL
g_diIndex : DINT; // Index and array are globally defined
and used by multiple tasks
g_boolArray : ARRAY [0..1000] OF BOOL;
END_VAR
VAR_INPUT
bToWrite : BOOL;
END_VAR
VAR
diIndex : DWORD;
END_VAR
unique index
WriteToNextArrayPosition := TRUE; // TRUE: Array
was not full yet
END_IF
Also refer to
● ⮫ Chapter 32.3.13 Multicore operators on page 458
Example
PROGRAM PROG1
VAR
strPOS : STRING := __POSITION(); //Yields the line number
of this declaration
strlocalPOS : STRING;
END_VAR
Example
PROGRAM PROG1
VAR
strPOU : STRING := __POUNAME(); //Yields 'PROG1'
strlocalPOU : STRING;
END_VAR
Reference, programming
For example, the call in the program is dwOldValue := TEST_AND_SET(dw);,
in which the variables dwOldValue and dw must be of data type DWORD.
Example
The following example shows a typical usage. An exclusive access to a variable
of type STRING is to be implemented, which is addressed via the pointer
pstrOutput. The access to a string is not atomic. If multiple tasks write to the
same string at the same time, then the contents may be inconsistent. With the
TEST_AND_SET function, it is now possible to write the same STRING variable
in different tasks.
FUNCTION ExclusiveStringWrite : BOOL
VAR_INPUT
strToWrite : STRING;
pstrOutput : POINTER TO STRING;
END_VAR
VAR_STAT
dwSynch : DWORD;
END_VAR
VAR
dwOldValue: DWORD;
END_VAR
Also refer to
● ⮫ Chapter 32.3.78 Operator '__COMPARE_AND_SWAP on page 534
● ⮫ Chapter 32.3.13 Multicore operators on page 458
Example
globlist1.varx := globlist2.varx;
The globlist1 and globlist2 global variables lists each contain a varx
variable. PLC Engineering copies the varx global variable from the globlist2
list to varx in the globlist1 list.
Example
A library is included in a project and contains the module FB_A. However,
the function block with the same name is already available locally in the
project. Identify the library module as LIB_A.FB_A in order to access the
library module, not the local function block.
You can define another identifier for the namespace. To do this, specify a name-
space in the project information (library developers: when creating a library
project). As an alternative, you can specify a specific namespace for a library
in the Library Manager in the “Properties” dialog (application developers: when
creating an application).
Also refer to
● ⮫ Chapter 27 Using libraries on page 329
● ⮫ Chapter 'Placeholder' command on page 1010
● ⮫ Chapter 33.2.19 "Library manager” object on page 780
Example
The constant Blue is a component of both the enumeration Colors and the
enumeration Feelings.
color := Colors.Blue; // Access to component blue in
enumeration Colors
Reference, programming
32.3.87 Operator '__POOL'
The operator is an extension of the IEC 61131-3 standard.
The operator is used to reference objects which are managed in the global
POU pool (in the “POUs” view). The operator directly accesses objects in the
“POUs” view.
Example
PROGRAM PLC_PRG
VAR
svar_pou : STRING;
END_VAR
svar_pou := __POOL.POU();
See also
● ⮫ Chapter 32.8 Shadowing rules on page 656
Examples
fbinst is the instance of the function block fb1, where the retain variable
retvar is defined.
ST:
Deklaration im Baustein:
VAR
fbinst : fb1;
b : BOOL;
END_VAR
Programmteil:
b := INI(fbinst, TRUE);
ivar := fbinst.retvar; (* => retvar is initialized *)
FDB
Also refer to
● ⮫ Chapter 32.10.1 Methods 'FB_Init', 'FB_Reinit', and 'FB_Exit' on page 660
● ⮫ Chapter 18.22 Data persistence on page 211
32.4 Operands
32.4.1 Operands – General information
Constants and literals
Constants are identifiers for unchanging values. You can declare constants
locally within a programming block or globally within a global variable list. The
declaration section is extended with the keyword CONSTANT for this purpose.
Constants are also strings that represent the value of a base type such as inte-
gers or floating point numbers, for example, 16#FFFF_FFFF, T#5s, or -1.234
E-5. To distinguish them, such constants are also called literals, literal con-
stants, or unnamed constants. There are logical (TRUE, FALSE) or numeric
literals(3.1415, T#5s), but also character literals ('Hello world!', "black").
Syntax Deklaration
<scope> CONSTANT
<identifier> : <data type> := <initial value> ;
END_VAR
Example
VAR_GLOBAL CONSTANT
Reference, programming
g_ciMAX_A : INT := 100;
g_ciSPECIAL : INT := g_ciMAX_A - 10;
END_VAR
Examples:
14 Decimal number
2#1001_0011 Binary number
8#67 octal number
16#A Hexadecimal number
DINT#16#A1 Combined typed data type DINT# and base 16#
The type of numeric value can be BYTE, WORD, DWORD, SINT, USINT, INT, UINT,
DINT, UDINT, REAL, or LREAL.
Implicit conversions from "larger" to "smaller" types are not permitted. You
cannot simply use a DINT variable as an INT variable. For this, you have to use a
type conversion function.
Also refer to
● ⮫ Chapter 32.3 Operators on page 454
● ⮫ Chapter 32.4.10 Typed Literals on page 549
<significand> e | E <exponent>
Example
Table 14: REAL literal
7.4 Decimal number. 7,4 with a comma returns a com-
piler error
1/3.0 Decimal fraction for 0.333333343
Note: In the case of division of integer types, the
result remains an integer type. In this case, the
value is rounded. For example, 1/3 yields 0 as the
result.
Reference, programming
1.64e+009 Exponential notation
-3.402823e+38 Smallest number
-1E-44 Largest negative number
1.0E-44 Smallest positive number
3.402823e+38 Largest number
Table 15: LREAL literal
-1.7976931348623157E+3 Smallest number
08
-4.94065645841247E-324 Largest negative number
4.94065645841247E-324 Smallest positive number
1.7976931348623157E+3 Largest number
08
See also
● ⮫ Chapter 32.5.7 Data Type 'REAL' / 'LREAL' on page 557
Example
Constant declaration
VAR CONSTANT
constA : STRING := 'Hello world';
constB : STRING := 'Hello world $21'; // Hello world!
END_VAR
TIME constant
Syntax
Examples
Correct time constants of an ST assignment
VAR
timLength : TIME := T#14ms;
timLength1 : TIME := T#100s12ms; // Overflow in the highest
unit is allowed.
timLength2 : TIME := T#12h34m15s;
timCompare : TIME;
xIsOK: BOOL;
Reference, programming
timLongest := T#49D17H2M47S295MS; // 4294967295
END_VAR
LTIME constant
Syntax
PROGRAM PLC_PRG
VAR
ltimLength := LTIME#1000d15h23m12s34ms2us44ns;
ltimLength1 := LTIME#3445343m3424732874823ns;
END_VAR
See also
● ⮫ Chapter 32.5.9 Data Type 'TIME' on page 559
● ⮫ Chapter 32.4.9 Date and Time Constants on page 546
<date keyword>#<year>-<month>-<day>
DATE literals are treated internally as data type DWORD, which corresponds to an
upper limit of DATE#2106-2-7.
Example
PROGRAM PRG_Date
VAR
dateStart : DATE := DATE#2018-8-8;
dateEnd : DATE := D#2018-8-31;
dateCompare: DATE := date#1996-05-06;
xIsDuringTheTime: BOOL;
<date keyword>#<year>-<month>-<day>
LDATE literals are treated internally as data type LWORD, which corresponds to
an upper limit of DATE#2554-7-21.
Example
PROGRAM PRG_Ldate
VAR
ldateStart : LDATE := LDATE#2018-8-8;
ldateEnd : LDATE := ldate#2018-8-31;
ldateCompare: LDATE := LD#1996-05-06;
xIsDuringTheTime: BOOL;
Reference, programming
ldateLatest : LDATE := LDATE#2262-4-10; // =
16#7FFF63888C620000
lwValue: LWORD;
END_VAR
Example
PROGRAM PLC_PRG
VAR
dtDate : DATE_AND_TIME := DATE_AND_TIME#1996-05-06-15:36:30;
dtDate1: DATE_AND_TIME := DT#1972-03-29-00:00:00;
dtDate2: DATE_AND_TIME := DT#2018-08-08-13:33:20.5;
dtEarliest : DATE_AND_TIME :=
DATE_AND_TIME#1979-1-1-00:00:00; // 0
dtLatest : DATE_AND_TIME :=
DATE_AND_TIME#2106-2-7-6:28:15; // 4294967295
END_VAR
Example
PROGRAM PLC_PRG
VAR
ldtDate : LDATE_AND_TIME :=
LDATE_AND_TIME#1996-05-06-15:36:30;
ldtDate1: LDATE_AND_TIME := LDT#1972-03-29-00:00:00;
ldtDate2: LDATE_AND_TIME := LDT#2018-08-08-13:33:20.5;
Examples
PROGRAM POU
Reference, programming
VAR
todClockTime : TIME_OF_DAY := TIME_OF_DAY#15:36:30.123;
todEarliest : TIME_OF_DAY := TIME_OF_DAY#0:0:0.000;
todLatest : TOD := TOD#23:59:59.999;
END_VAR
Examples
PROGRAM POU
VAR
ltodClockTime : LTIME_OF_DAY :=
TIME_OF_DAY#15:36:30.123456789;
todEarliest : TIME_OF_DAY := TIME_OF_DAY#0:0:0;
todLatest : TOD := TOD#23:59:59.999999999;
END_VAR
See also
● ⮫ Chapter 32.5.11 Date and Time Data Types on page 559
<type> defines the desired data type; possible values: BOOL, SINT, USINT,
BYTE, INT, UINT, WORD, DINT, UDINT, DWORD, REAL, LREAL. You must capitalize
the entire type name.
<literal> defines the constants. The entry must match the data type defined
in <Type>.
Example:
var1 := DINT#34;
If PLC Engineering cannot convert the constant into the target type without
data loss, then an error message is issued.
You can use typed constants wherever you can use normal constants.
Example
In the program, the third bit of the variable wA is set to the value of variable
xB. The constant c_usiENABLE acts as an index to access the third bit of the
variable iX.
Index access
PROGRAM PLC_PRG
VAR
wA : WORD := 16#FFFF;
Reference, programming
xB : BOOL := 0;
END_VAR
// GVL declaration
VAR_GLOBAL CONSTANT
gc_usiENABLE : USINT := 2;
END_VAR
PROGRAM PLC_PRG
VAR
iX : INT := 0;
END_VAR
// Constant as index
iX.gc_usiENABLE := TRUE; // Third bit in iX is set TRUE
Result: iX = 4
Example
Type declaration of the structure:
TYPE S_CONTROLLER :
STRUCT
bitOperationEnabled : BIT;
bitSwitchOnActive : BIT;
bitEnableOperation : BIT;
bitError : BIT;
bitVoltageEnabled : BIT;
bitQuickStop : BIT;
bitSwitchOnLocked : BIT;
bitWarning : BIT;
END_STRUCT
END_TYPE
PROGRAM PLC_PRG
VAR
ControlDriveA : S_CONTROLLER;
END_VAR
Example
FUNCTION_BLOCK FB_Controller
VAR_INPUT
bitSwitchOnActive : BIT;
bitEnableOperation : BIT;
bitVoltageEnabled : BIT;
bitQuickStop : BIT;
bitSwitchOnLocked : BIT;
END_VAR
VAR_OUTPUT
bitOperationEnabled : BIT;
bitError : BIT;
bitWarning : BIT;
END_VAR
VAR
END_VAR
;
PROGRAM PLC_PRG
VAR
fbController : FB_Controller;
END_VAR
// Symbolic bit access to bitSwitchOnActive
fbController(bitSwitchOnActive := TRUE);
See also
● ⮫ Chapter 32.5.6 Integer Data Types on page 556
● ⮫ Symbolic bit access in structure variables on page 585
● ⮫ Chapter 32.5.14 Data Type 'BIT' on page 565
32.4.13 Addresses
If you use pointers to addresses, then the contents of
CAUTION
addresses can be moved during an online change. If you
use absolute addresses, then the contents of addresses
does not change during an online change.
Syntax:
%<memory area prefix> ( <size prefix> )? <memory position>
<size prefix> : X | B | W | D
<memory position> : <number> ( .<number> )* // Depends on the
target system
When defining an address, you use specific character strings to express
memory position and size. An address is marked with the percent sign (%),
followed by the memory range prefix, the optional size prefix, and the memory
range position. The numbering that you use for addressing the memory position
depends on the target system.
Memory
Range
Reference, programming
Prefix
I Input memory range for "Inputs"
For physical inputs via input drivers, "Sensors"
Q Output memory range for "Outputs"
For physical outputs via output drivers, "Actuators"
M Flag memory range
Size Prefix Data Type Data Width
No size prefix Single bit
X Single bit
B BYTE 8 bits
W WORD 16 bits
D DWORD 32 bits
Examples
%QX7.5 Single bit address of the output bit 7.5
%Q7.5
%IW215 Word address of the input word 215
%QB7 Byte address of the output byte 7
%MD48 Address of a double word at memory position
48 in flag memory
%IW2.5.7.1 Word address of an input word; interpretation
dependent on the current controller configura-
tion
VAR wVar AT %IW0 : WORD; END_VAR Variable declaration with address information of
an input word
VAR xActuator AT %QW0 : BOOL; END_VAR Boolean variable declaration
Note: For Boolean variables, one byte is allo-
cated internally if a single bit address is not
specified. A change in the value of xActuator
affects the range from QX0.0 to QX0.7.
VAR xSensor AT IX7.5 : BOOL; END_VAR Boolean variable declaration with explicit speci-
fication of a single bit address. On access, only
the input bit 7.5 is read.
Memory position
Make sure that the address is valid as follows:
To map a valid address in an application, you must know the required posi-
tion (applicable memory range) in the process image: input memory range (I),
output memory range (Q), and flag memory range (M) — see above. Further-
more, you have to specify the required size prefix: bit, BYTE, WORD, DWord (see
above: X, B, W, D)
The current device configuration and device settings (hardware structure,
device description, I/O settings) play a decisive part. Note specifically the dif-
ferences in the interpretation of bit addresses for devices with "byte addressing
mode" and devices with "word-oriented IEC addressing mode". For example, in
a byte addressing device, the number before the point of bit address %IX5.5
addresses byte 5. On the other hand, in a word-addressed device, it addresses
word 5. In contrast, addressing with a word or byte address is independent of
the device type: with %IW5 always word 5 is addressed and with byte address
%IB5 always byte 5. Regardless of size and addressing mode, you can address
different memory cells therefore with the same address information.
The following table shows the comparison of byte addressing and word-ori-
ented IEC addressing for bits, bytes, words, and double words. It also shows
the overlapping memory ranges that are present in the case of byte addressing
(see also the example below the table).
Regarding syntax, note that the IEC addressing mode is always word-oriented.
In this case, the word number is located before the point and the bit number
ofter the point.
n = byte number
See also
● ⮫ Chapter 18.18.3 AT Declaration on page 200
32.4.14 Functions
In ST, you can use a function call as an operand.
Example:
Result := Fct(7) + 3;
TIME() function
This function yields the time (in milliseconds) that has elapsed since system
boot.
The data type is TIME.
Example in ST:
Reference, programming
systime := TIME();
See also
● ⮫ Chapter Object 'Function' on page 825
Reference, programming
LINT -263 263-1 64 bit
ULINT 0 264-1 64 bit
Information can be lost when converting from larger to
NOTICE
smaller types.
See also
● ⮫ Chapter 32.4.5 Numerical constants on page 542
Example
PROGRAM PLC_PRG
VAR
rMax: REAL := 3.402823E+38; // Largest number
rPosMin : REAL := 1.0E-44; // Smallest positive number
rNegMax: REAL := -1.0E-44; // Largest negative number
rMin: REAL := -3.402823E+38; // Smallest number
See also
● ⮫ Chapter 32.4.6 REAL/LREAL Constants on page 542
Declaration
<varible name> : STRING( <size> ) := ' <text> ';
<varible name> : STRING[ <size> ] := ' <text> ';
The memory size <size> and initialization are optional.
Example
sVar : STRING(46):= 'This is a string with memory for 46
characters.';
sVar_µ : STRING[10] := 'µ (Mü)';
sVar_ß : STRING[10] := 'Eszett';
A variable of the STRING data type can include any character string. The size
specification <size> for memory reservation in the declaration refers to the
number of bytes and is in round or square brackets. If no size is specified, 80
characters are reserved by default. If a variable is initialized with a literal that
is too long for the variable's data type, the literal is truncated accordingly from
the back.
However, the length of the strings is not limited in principle. If you run string
manipulations with the functions of the Standard library, strings up to a length
of 255 are processed correctly. If you run string manipulations with the func-
tions of the StringUtils library, you can also use longer strings (>255 charac-
ters).
Reference, programming
For further information, see: ⮫ Dialog 'Project Settings' - 'Static Analysis Light'
Add the pragma {attribute 'monitoring_encoding' := 'UTF8'} to the declaration of
a variable, you can monitor the content of the variable in UTF8 encoding.
For further information, see: ⮫ Attribute 'monitoring_encoding'
See also
● ⮫ Chapter 32.5.10 Data Type 'LTIME' on page 559
● ⮫ Chapter 32.4.8 TIME/LTIME Constant on page 544
● ⮫ Chapter 32.4.9 Date and Time Constants on page 546
Example:
LTIME1 := LTIME#1000D15H23M12S34MS2US44NS
See also
● ⮫ Chapter 32.5.9 Data Type 'TIME' on page 559
● ⮫ Chapter 32.3.54 Time conversion on page 506
The data types LDATE, LDATE_AND_TIME (LDT), and LTIME_OF_DAY (LTOD) are
treated internally like an LWORD (64-bit value).
The values of these data types are measured in seconds, milliseconds, and
nanoseconds since 01/01/1970.
Data Type Lower Limit Upper Limit Memory Resolution
DATE DATE#1970-01-01 DATE#2106-02-07 32-bit Seconds
D#1970-01-01 D#2106-02-07 (although
only the
day is dis-
played)
DATE_AND_TIME DATE_AND_TIME#1970- DATE_AND_TIME#2106- 32-bit Seconds
DT 1-1-0:0:0 02-07-06:28:15
DT#1970-1-1-0:0:0 DT#2106-02-07-06:28
:15
TIME_OF_DAY TIME_OF_DAY#0:0:0 TIME_OF_DAY#23:59:5 32-bit Millisec-
TOD TOD#0:0:0 9.999 onds
TOD#23:59:59.999
VAR
//Date
dateBottom : DATE := DATE#1970-1-1;
dateTop : DATE := DATE#2106-2-7;
dateAppointment : DATE := D#2020-2-7; // D prohibited
//Time of day
todBottom : TIME_OF_DAY := TIME_OF_DAY#0:0:0;
todTop : TOD := TIME_OF_DAY#23:59:59.999;
todAppointment : TOD := TOD#12:3:4.567;
// Long date
ldateBottom : LDATE := LDATE#1970-1-1;
ldateTop : LDATE := LDATE#2106-2-7;
Reference, programming
END_VAR
See also
● ⮫ Chapter 32.4.9 Date and Time Constants on page 546
TYPE AnyType :
STRUCT
// the type of the actual parameter
typeclass : __SYSTEM.TYPE_CLASS ;
// the pointer to the actual parameter
pvalue : POINTER TO BYTE;
// the size of the data, to which the pointer points
diSize : DINT;
END_STRUCT
END_TYPE
You can access the input variable within the POU via this structure by means of
this structure, and for example query the passed value.
Example
This compares whether or not two input variables have the same type and the
same value.
pTest := ADR(any1);
Generic_Compare := FALSE;
IF any1.typeclass <> any2.typeclass THEN
RETURN;
END_IF
IF any1.diSize <> any2.diSize THEN
RETURN;
END_IF
// Byte comparison
FOR iCount := 0 TO any1.diSize-1 DO
IF any1.pvalue[iCount] <> any2.pvalue[iCount] THEN
RETURN;
END_IF
END_FOR
Generic_Compare := TRUE;
RETURN;
// END_FUNCTION
Declaration
The syntax descriptions refer to a POU with exactly one parameter (an input
variable).
Syntax
Example
FUNCTION_BLOCK FB_ComputeAny
VAR_INPUT
Reference, programming
anyInput1 : ANY;
END_VAR
// END_FUNCTION_BLOCK
FUNCTION_BLOCK FB_ComputeMethod
METHOD methComputeAnny : BOOL
VAR_INPUT
anyInput1 : ANY_INT; // valid data types are SINT, INT,
DINT, LINT, USINT, UINT, UDINT, ULINT
END_VAR
//END_METHOD
With compiler versions > 3.5.1.0, the generic IEC data types in the table are
supported.
The table represents the hierarchy of the generic data types and provides infor-
mation as to which generic data type of the formal parameter (declaration)
allows which elementary data types of the argument (call).
Generic data type in the case of a Permitted elementary data type in the
formal parameter case of an actual parameter (argument)
ANY ANY_BIT ● BYTE
● WORD
● DWORD
● LWORD
ANY_DATE ● DATE
● DATE_AND_TIME, DT
● TIME_OF_DAY, TOD
● LDATE
● LDATE_AND_TIME, LDT
● LTIME_OF_DAY, LTOD
ANY_NUM ANY_REAL REAL, LREAL
ANY_INT USINT, UINT, UDINT, ULINT
SINT, INT, DINT, LINT
ANY_STRIN STRING, WSTRING
G
Call
The syntax descriptions refer to a POU with exactly one parameter, to which
an argument is passed. As a result, the data type of the argument specifies
the generic data type of the input variable. For example, arguments of the type
BYTE, WORD, DWORD, LWORD can be passed to a type ANY_BIT input variable.
Example
PROGRAM PLC_PRG
VAR
byValue : BYTE := 16#AB;
iValue : INT := -1234;
xResultByte : BOOL;
xResultInt : BOOL;
fbComputeAnyByte : FB_ComputeAny;
fbComputeAnyInt : FB_ComputeAny;
fbComputeM1 : FB_ComputeMethod;
fbComputeM2 : FB_ComputeMethod;
byN : BYTE := 1;
wBitField1 : WORD := 16#FFFF;
wBitField2 : WORD := 16#0001;
xInit : BOOL;
xResult : BOOL;
END_VAR
xResultByte := funComputeAny(byValue);
xResultInt := funComputeAny(iValue);
fbComputeAnyByte(anyInput1 := byValue);
fbComputeAnyInt(anyInput1 := iValue);
fbComputeM1.methComputeAnny(anyInput1 := byValue);
fbComputeM2.methComputeAnny(anyInput1 := iValue);
// END_PRG
Declaration
<variable name> : WSTRING( <size> ) := " <text> "
The size <size> determines the string length. The initialization is done with the
string " <text> ".
The marking of the string as WSTRING is done with double quotes. The size
specification and initialization are optional.
If a variable of the data type WSTRING is reinitialized by a reset of the applica-
tion, the byte pairs of the (old) string existing after the terminating null word
(WORD) of the initial value are not overwritten. This applies both to initialization
with the initialization value and to initialization with the default initialization
Reference, programming
value 0.
Example
Strings of the data type WSTRING require 2 bytes per character. With data type
STRING only 1 byte per character is reserved.
wsString : WSTRING := "This is a WSTRING";
sString : STRING := 'This is a STRING';
wsEmpty is the empty string. The variable wsMoney with the euro sign € has the
size 10. Cut off after 10 characters. The wsHan variable is assigned the Chinese
character (U+7BE6).
Example
PROGRAM PRG_Money
VAR
wsEmpty : WSTRING := ""; // The empty string
wsMoney : WSTRING(10) := "12345678 € 123"; // String will
be truncated
wsMoney_2 : WSTRING(10) := "12345678 €";
wsHan : WSTRING(10) := "篦"; // Chinese character U+/BE6
END_VAR
Also refer to
● ⮫ Chapter 32.5.8 “STRING” data type on page 558
● ⮫ Chapter 32.4.7 String Constants on page 543
PLC Engineering supports systems with address registers of 32-bit and 64-bit
widths. For making the IEC code as independent from the target system as
possible, you use the pseudo data types __UXINT, __XINT, and __XWORD. The
compiler checks which target system types are current and then converts these
data types into the appropriate standard data types.
Moreover, type conversion operators are provided for variables of these data
types.
Type conversion on 64-bit Type conversion on 32-bit
platforms platforms
__UXINT ULINT UDINT
__XINT LINT DINT
__XWORD LWORD DWORD
See also
● ⮫ Chapter 32.3.51 Integer conversion on page 482
● ⮫ Chapter 32.3.49 Overload on page 476
32.5.16 Pointers
A pointer stores the memory address of objects, such as variables or function
block instances, at runtime.
Syntax of the pointer declaration:
<pointer name>: POINTER TO <data type | data unit type |
function block>;
Example
FUNCTION_BLOCK FB_Point
VAR
piNumber: POINTER TO INT;
iNumber1: INT := 5;
iNumber2: INT;
END_VAR
Dereferencing a pointer means obtaining the value to which the pointer points.
A pointer is dereferenced by appending the content operator ^ to the
pointer identifier (for example, piNumber^ in the example above). To assign
the address of an object to a pointer, the address operator ADR is applied to
the object: ADR(iNumber1).
In online mode, you can click “Edit 🠂 Browse 🠂 Go to Reference” to jump from
a pointer to the declaration location of the referenced variable.
When a pointer points to an I/O input, write access
NOTICE
applies. This leads to the compiler warning “'<pointer
name >' is not a valid assignment target” when the code
is generated. Example: pwInput := ADR(wInput);
If you require a construct of this kind, you have to first
copy the input value (wInput) to a variable with write
access.
Reference, programming
Calculation: piData[i] := (piData + i * SIZEOF(INT))^;
This is not: piData[i] != (piData + i)^.
Index access STRING
When you use the index access with a variable of the type STRING, you get the
character at the offset of the index expression. The result is of type BYTE. For
example, sData[i] returns the i-th character of the character string sData as
SINT (ASCII).
Index access WSTRING
When you use the index access with a variable of the type WSTRING, you get the
character at the offset of the index expression. The result is of type WORD. For
example, wsData[i] returns the i-th character of the character string as INT
(Unicode).
Subtracting pointers
The result of the difference between two pointers is a value of type DWORD,
even on 64-bit platforms when the pointers are 64-bit pointers.
See also
● ⮫ Chapter Command 'Go To Reference' on page 893
● ⮫ Chapter 'Properties' dialog - 'Build' on page 1048
● ⮫ Chapter 32.3.46 Operator 'Content Operator' on page 475
● ⮫ Chapter 32.3.45 Operator 'ADR' on page 474
● ⮫ Chapter POU 'CheckPointer' on page 859
32.5.17 Reference
A reference implicitly refers to another object. When accessed, the reference is
implicitly dereferenced, and therefore does not need a special content operator
^ such as a pointer.
Syntax
<identifier> : REFERENCE TO <data type> ;
<data type>: base type of the reference
Example
PROGRAM PLC_PRG
VAR
rspeA : REFERENCE TO DUT_SPECIAL;
pspeA : POINTER TO DUT_SPECIAL;
speB : DUT_SPECIAL;
END_VAR
The readability of a program is made difficult when the same memory cell is
accessed simultaneously by means of an identifier and its alias (for example,
speB and rspeA).
With compiler version >= V3.3.0.0, references are initial-
NOTICE
ized (at 0).
If a reference refers to a device input, then the access
NOTICE
(for example, rInput REF= Input;) is applies as write
access. This leads to a compiler warning when the code
is generated: "...invalid assignment target".
If you require a construct of this kind, you have to first
copy the input value (rInput) to a variable with write
access.
Invalid declarations
Syntax
<Boolean variable name> := __ISVALIDREF( <reference name> );
<reference name>: Identifier declared with REFERENCE TO
The Boolean variable is TRUE when the reference points to a valid value. Other-
wise it is FALSE.
Example
PROGRAM PLC_PRG
VAR
Reference, programming
iAlfa : INT;
riBravo : REFERENCE TO INT;
riCharlie : REFERENCE TO INT;
bIsRef_Bravo : BOOL := FALSE;
bIsRef_Charlie : BOOL := FALSE;
END_VAR
iAlfa := iAlfa + 1;
riBravo REF= iAlfa;
riCharlie REF= 0;
bIsRef_Bravo := __ISVALIDREF(riBravo); (* becomes TRUE,
because riBravo references to iAlfa, which is non-zero
*)
bIsRef_Charlie := __ISVALIDREF(riCharlie); (* becomes FALSE,
because riCharlie is set to 0 *)
See also
● ⮫ Chapter Assignment Operator 'REF=' on page 384
● ⮫ Chapter POU 'CheckPointer' on page 859
bound>
<next dimension> : <next lower index bound>..<next upper index
bound>
<data type> : elementary data types | user defined data types
| function block types
// (...)+ : One or more further dimensions
// (...)? : Optional
The index limits are integers; maximum of the data type DINT.
Syntax for data access
Example
One-dimensional array of 10 integer elements
VAR
aiCounter : ARRAY[0..9] OF INT;
END_VAR
Lower index limit: 0
Upper index limit: 9
Initialization
aiCounter : ARRAY[0..9] OF INT := [0, 10, 20, 30, 40, 50, 60,
70, 80, 90];
Data access
iLocalVariable := aiCounter[2];
The value 20 is assigned to the local variable.
Example
2-dimensional array
VAR
aiCardGame : ARRAY[1..2, 3..4] OF INT;
END_VAR
1st dimension: 1 to 2
2nd dimension: 3 to 4
Initialization
Example
3-dimensional array
VAR
aiCardGame : ARRAY[1..2, 3..4, 5..6] OF INT;
END_VAR
1st dimension: 1 to 2
2nd dimension: 3 to 4
3rd dimension: 5 to 6
Reference, programming
2 * 2 * 2 = 8 array elements
Initialization
Example
3-dimensional arrays of a user-defined structure
TYPE DATA_A
STRUCT
iA_1 : INT;
iA_2 : INT;
dwA_3 : DWORD;
END_STRUCT
END_TYPE
PROGRAM PLC_PRG
VAR
aData_A : ARRAY[1..3, 1..3, 1..10] OF DATA_A;
END_VAR
The array aData_A consists of a total of 3 * 3 * 10 = 90 array elements of data
type DATA_A.
Initialize partially
Example
Array of a function block
PROGRAM PLC_PRG
VAR
aObject_A : ARRAY[1..4] OF FBObject_A;
END_VAR
The array aObject_A consists of 4 elements. Each element instantiates a
FBObject_A function block.
Function call
aObject_A[2]();
Example
Implementation of FB_Something with method FB_Init
FUNCTION_BLOCK FB_Something
VAR
_nId : INT;
_lrIn : LREAL;
END_VAR
...
Reference, programming
METHOD FB_Init : BOOL
VAR_INPUT
bInitRetains : BOOL;
bInCopyCode : BOOL;
nId : INT;
lrIn : LREAL;
END_VAR
_nId := nId;
_lrIn := lrIN;
The function block FB_Something has a method FB_Init that requires 2
parameters.
Instantiation of the array with initialization
PROGRAM PLC_PRG
VAR
fb_Something_1 : FB_Something(nId := 11, lrIn := 33.44);
a_Something : ARRAY[0..1, 0..1] OF FB_Something[(nId := 12,
lrIn := 11.22), (nId := 13, lrIn := 22.33), (nId := 14,
lrIn := 33.55),(nId := 15, lrIn := 11.22)];
END_VAR
Array of arrays
The declaration of an "array of arrays" is an alternative syntax for multidimen-
sional arrays. A collection of elements is nested instead of dimensioning the
elements. The nesting depth is unlimited.
Syntax for declaration
Example
PROGRAM PLC_PRG
VAR
aiPoints : ARRAY[1..2,1..3] OF INT := [1,2,3,4,5,6];
ai2Boxes : ARRAY[1..2] OF ARRAY[1..3] OF INT := [ [1, 2,
3], [ 4, 5, 6]];
ai3Boxes : ARRAY[1..2] OF ARRAY[1..3] OF ARRAY[1..4] OF
INT := [ [ [1, 2, 3, 4], [5, 6, 7, 8 ], [9, 10, 11, 12] ],
[ [13, 14, 15, 16], [ 17, 18, 19, 20], [21, 22, 23, 24] ] ];
ai4Boxes : ARRAY[1..2] OF ARRAY[1..3] OF ARRAY[1..4] OF
ARRAY[1..5] OF INT;
END_VAR
aiPoints[1, 2] := 1200;
ai2Boxes[1][2] := 1200;
The variables aiPoints and ai2Boxes collect the same data elements, how-
ever the syntax for the declaration differs from that of the data access.
Reference, programming
// (...)+ : One or more further dimensions
// (...)? : Optional
Syntax of the operators for calculating the limit index
Example
The SUM function adds the integer values of the array elements and returns
the calculated sum as a result. The sum is calculated across all array elements
available at runtime. As the actual number of array elements will only be
known at runtime, the local variable is declared as a one-dimensional array of
variable length.
diResult := 0;
FOR diCounter := LOWER_BOUND(aiData, 1) TO
UPPER_BOUND(aiData, 1) DO // Calculates the length of the
current array
diResult := diResult + A[i];
END_FOR;
SUM := diResult;
See also
● ⮫ Chapter 18.16.5 Declaring Arrays on page 166
● ⮫ Chapter POU 'CheckBounds' on page 848
The command set extensions of the processors are SIMD extensions. SIMD
(Single Instruction, Multiple Data) describes a computer architecture in which
multiple data sets of the same type are processed simultaneously in parallel
and therefore faster with one command call. In vector operations, for example,
4 pairs of numbers can then be added at the same time.
Syntax
<vector size> : 1 |2 | 3 | 4 | 5| 6 | 7| 8
<element type> : REAL | LREAL
// (...)? : Optional
A vector data type is an array of floating-point numbers with a maximum of
8 elements. The operators __vc<operator name> are available for this data
type. You can use these to implement vector operations without additional
function calls.
Syntax for index access
Example
PROGRAM PLC_PRG
VAR
vcA : __VECTOR[3] OF REAL;
END_VAR
vcA[0] := 1.1;
vcA[1] := 2.2;
vcA[2] := 3.3;
Example
PROGRAM PLC_PRG
VAR
iOVS_REAL : INT; // Optimal vector size for REAL elements
iOVS_LREAL : INT; // Optimal vector size for LREAL elements
END_VAR
iOVS_REAL := Constants.vcOptimalREAL;
iOVS_LREAL := Constants.vcOptimalLREAL;
Reference, programming
An application that is loaded on the PLC Engineering Control Win V3 x64
target system returns the following values at runtime:
Operator __VCADD
The operator calculates the sum of two vectors.
Syntax
Example of addition
FUNCTION_BLOCK FB_ADD
VAR
vcA : __VECTOR[3] OF REAL := __VCSET_REAL(3, 3, 3);
vcB : __VECTOR[3] OF REAL := __VCSET_REAL(1, 2, 3);
vcResult : __VECTOR[3] OF REAL;
END_VAR
Operator __VCSUB
The operator calculates the difference between two vectors.
Syntax
Example of subtraction
FUNCTION_BLOCK FB_SUB
VAR
vcA : __VECTOR[3] OF REAL := __VCSET_REAL(3, 3, 3);
vcB : __VECTOR[3] OF REAL := __VCSET_REAL(1, 2, 3);
vcResult0 : __VECTOR[3] OF REAL;
vcResult1 : __VECTOR[3] OF REAL;
END_VAR
Operator __VCMUL
The operator calculates the product of two vectors or a scalar (floating-point
number) and a vector.
Syntax
Example of multiplication
FUNCTION_BLOCK FB_MUL
VAR
rScalar : REAL := 1.1;
vcA : __VECTOR[3] OF REAL;
vcB : __VECTOR[3] OF REAL;
vcResult0 : __VECTOR[3] OF REAL;
vcResult1 : __VECTOR[3] OF REAL;
vcResult2 : __VECTOR[3] OF REAL;
END_VAR
Operator __VCDIV
The operator calculates the quotient of two vectors or a vector and a scalar.
Syntax
Example of division
FUNCTION_BLOCK FB_DIV
VAR
iScalar : INT := 3;
rScalar : REAL := 1.5;
vcA : __VECTOR[3] OF REAL := __VCSET_REAL(3, 3, 3);
vcB : __VECTOR[3] OF REAL := __VCSET_REAL(1, 2, 3);
vcResult0 : __VECTOR[3] OF REAL;
vcResult1 : __VECTOR[3] OF REAL;
Reference, programming
vcResult2 : __VECTOR[3] OF REAL;
END_VAR
Operator __VCDOT
The operator calculates the dot product (scalar product) of two vectors.
Syntax
FUNCTION_BLOCK FB_DOT
VAR
rResult : REAL;
vcA : __VECTOR[3] OF REAL := __VCSET_REAL(3, 3, 3);
vcB : __VECTOR[3] OF REAL := __VCSET_REAL(1, 2, 3);
END_VAR
Operator __VCSQRT
The operator calculates the square root of each element in the vector.
Syntax
FUNCTION_BLOCK FB_SQRT
VAR
vcA : __VECTOR[3] OF REAL := __VCSET_REAL(4, 9, 16);
vcResult0 : __VECTOR[3] OF REAL;
END_VAR
vcResult0 := __VCSQRT(vcA);
Operator __VCMAX
The operator calculates the maximum vector of two vectors. The maximum is
determined element by element.
Syntax
FUNCTION_BLOCK FB_MAX
VAR
vcA : __VECTOR[3] OF REAL := __VCSET_REAL(3, 3, 3);
vcB : __VECTOR[3] OF REAL := __VCSET_REAL(1, 2, 6);
vcResult0 : __VECTOR[3] OF REAL;
END_VAR
Operator __VCMIN
The operator calculates the minimum vector of two vectors. The minimum is
determined element by element.
Syntax
FUNCTION_BLOCK FB_MIN
VAR
vcA : __VECTOR[3] OF REAL := __VCSET_REAL(3, 3, 3);
vcB : __VECTOR[3] OF REAL := __VCSET_REAL(1, 2, 6);
vcResult0 : __VECTOR[3] OF REAL;
END_VAR
Operator __VCSET_REAL
The operator sets all elements of a vector in a statement. The elements have
the REAL data type.
Syntax
Example
FUNCTION_BLOCK FB_SET
VAR
vcA : __VECTOR[3] OF REAL := __VCSET_REAL(3, 3, 3);
vcB : __VECTOR[3] OF REAL := __VCSET_REAL(1, 2, 3);
END_VAR
Reference, programming
Operator __VCSET_LREAL
The operator sets all elements of a vector at once in a statement. The elements
have the LREAL data type.
They can be used wherever variables are valid, such as in assignments in imple-
mentations or as parameters in function calls.
Syntax
Example
FUNCTION_BLOCK FB_SET
VAR
vclA : __VECTOR[3] OF LREAL := __VCSET_LREAL(3, 3, 3);
vclB : __VECTOR[3] OF LREAL := __VCSET_LREAL(1, 2, 3);
END_VAR
Operator __VCLOAD_REAL
The operator interprets any arbitrary memory area as a vector. This is helpful
for connecting vector variables to existing code. The operator requires 2 param-
eters. The first parameter indicates the number of vector elements. The second
parameter is a pointer to the REAL data.
Syntax
Example of vectorization
FUNCTION_BLOCK FB_LOAD
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
rData0 : REAL := 1.234;
rData1: REAL := 5.678;
rData2 : REAL := 9.123;
pData: POINTER TO REAL := ADR(rData0);
Operator __VCLOAD_LREAL
The operator interprets any arbitrary memory area as a vector. This is helpful
for connecting vector variables to existing code. The operator requires 2 param-
eters. The first parameter indicates the number of vector elements. The second
parameter is a pointer to the LREAL data.
Syntax
Example of vectorization
FUNCTION_BLOCK FB_LOAD
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
lrData0 : LREAL := -1.7976931348623158E+308;
lrData1: LREAL := 1.6E+308;
lrData2 : LREAL := 1.7E+308;
lrData3 : LREAL := -1.6E+308;
plData: POINTER TO LREAL := ADR(lrData0);
Operator __VCSTORE
The operator saves/copies the contents of the vector to the specified memory
address. The number and the types of elements are automatically applied from
the vector variables.
Syntax
Example of storage
FUNCTION_BLOCK FB_STORE
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
rData0 : REAL := 3;
rData1: REAL := 3;
Reference, programming
rData2 : REAL := 3;
pData: POINTER TO REAL := ADR(rData0);
lrData0 : LREAL := 4;
lrData1: LREAL := 4;
lrData2 : LREAL := 4;
lrData3 : LREAL := 4;
plData: POINTER TO LREAL := ADR(lrData0);
__VCSTORE(pData, vcA);
__VCSTORE(plData, vclA);
See also
● ⮫ Chapter 18.16.5 Declaring Arrays on page 166
● ⮫ Chapter POU 'CheckBounds' on page 848
32.5.20 Structure
A structure is a user-defined data type, which combines multiple variables of
any data type into a logical unit. The variables declared within a structure are
called members.
You make the type declaration of a structure in a “DUT” object which you
create in the “Project 🠂 Add Object 🠂 DUT” menu or in the context menu of an
application.
Syntax
Structures can also be nested. This means that you declare a structure member
with an existing structure type. Then the only restriction is that you must not
assign any address to the variable (structure member). (The AT declaration is
not permitted here.)
Example
Type declaration
TYPE S_POLYGONLINE :
STRUCT
aiStart : ARRAY[1..2] OF INT := [-99, -99];
aiPoint1 : ARRAY[1..2] OF INT;
aiPoint2 : ARRAY[1..2] OF INT;
aiPoint3 : ARRAY[1..2] OF INT;
aiPoint4 : ARRAY[1..2] OF INT;
aiEnd : ARRAY[1..2] OF INT := [99, 99];
END_STRUCT
END_TYPE
Example
Type declaration
TYPE S_PENTAGON EXTENDS S_POLYGONLINE :
STRUCT
aiPoint5 : ARRAY[1..2] OF INT;
END_STRUCT
END_TYPE
Example
PROGRAM progLine
VAR
sPolygon : S_POLYGONLINE := (aiStart:=[1,1],
aiPoint1:=[5,2], aiPoint2:=[7,3], aiPoint3:=[8,5],
aiPoint4:=[5,7], aiEnd:=[1,1]);
sPentagon : S_PENTAGON := (aiStart:=[0,0], aiPoint1:=[1,1],
aiPoint2:=[2,2], aiPoint3:=[3,3], aiPoint4:=[4,4],
aiPoint5:=[5,5], aiEnd:=[0,0]);
END_VAR
You must not permitted to use initializations with variables. For an example of
initializing an array of a structure, see the help page for the data type ARRAY.
Example
PROGRAM prog_Polygon
VAR
sPolygon : S_POLYGONLINE := (aiStart:=[1,1],
aiPoint1:=[5,2], aiPoint2:=[7,3], aiPoint3:=[8,5],
aiPoint4:=[5,7], aiEnd:=[1,1]);
Reference, programming
iPoint: INT;
END_VAR
// Assigns 5 to aiPoint
iPoint := sPolygon.aiPoint1[1];
Result: iPoint = 5
Example
Type declaration
TYPE S_CONTROL :
STRUCT
bitOperationEnabled : BIT;
bitSwitchOnActive : BIT;
bitEnableOperation : BIT;
bitError : BIT;
bitVoltageEnabled : BIT;
bitQuickStop : BIT;
bitSwitchOnLocked : BIT;
bitWarning : BIT;
END_STRUCT
END_TYPE
Bit access
FUNCTION_BLOCK FB_Controller
VAR_INPUT
xStart : BOOL;
END_VAR
VAR_OUTPUT
END_VAR
VAR
ControlDriveA : S_CONTROL;
END_VAR
PROGRAM PLC_PRG
VAR
fbController : FB_Controller;
END_VAR
fbController();
fbController.xStart := TRUE;
See also
● ⮫ Chapter 32.5.18 Data Type 'ARRAY' on page 569
● ⮫ Chapter 32.5.14 Data Type 'BIT' on page 565
● ⮫ Chapter Object 'DUT' on page 815
32.5.21 Enumerations
An enumeration is a user-defined data type composed of a series of comma-
separated components (enumeration values) for declaring user-defined varia-
bles. Moreover, you can use the enumeration components like constants whose
identifier <enumeration name>.<component name> is known globally in the
project.
You declare an enumeration in a DUT object, which you have already created in
the project by clicking “Add Object”.
In the application code, you can use the enumeration components like con-
stants whose identifier <enumeration name>.<component name> is known
globally in the project.
Declaration
Syntax
{attribute 'strict'}
Type <enmeration name> :
(
<component deklaration> ,
<component deklaration>
)<basic data type> := <default variable initialization>
;
END_TYPE
Reference, programming
fixed initial values to the individual components.
Example: yellow := 1
<basic data type> Optional
You can explicitly declare one of the following basic
data types:
UINT | SINT | USINT | DINT | UDINT | LINT |
ULINT | BYTE | WORD | DWORD | LWORD
If no explicit basic data type is declared, the basic data
type INT is used automatically.
<default variable initi- Optional
alization> One of the components can be explicitly declared as
initial component. If no explicit initialization is speci-
fied, the system automatically initializes with the top-
most component.
{attribute 'qualified_only'}
{attribute 'strict'}
TYPE COLOR_BASIC :
(
yellow,
green,
blue,
black
) // Basic data type is INT, default initialization for all
COLOR_BASIC variables is yellow
;
END_TYPE
In an enumeration declaration, at least 2 components are usually declared.
However, you can declare as many as you want. Every single component can
be assigned its own initialization. Enumerations automatically have the basic
data type INT, but you can specify another basic data type. Moreover, you can
specify a component in the declaration with which an enumeration variable is
then initialized.
The pragma {attribute 'strict'} causes a strict type test to be performed
as described below.
Example
{attribute 'qualified_only'}
{attribute 'strict'}
TYPE COLOR_BASIC :
(
yellow,
green,
blue,
black
) // Basic data type is INT, default initialization for all
COLOR_BASIC variables is yellow
;
END_TYPE
Example
Enumeration mit Basisdatentyp DWORD
TYPE COLOR :
(
white := 16#FFFFFF00,
yellow := 16#FFFFFF00,
green := 16#FF00FF00,
blue := 16#FF0000FF,
black := 16#88000000
) DWORD := black
; // Basic data type is DWORD, default initialization for all
COLOR variables is black
END_TYPE
Reference, programming
Example
PROGRAM PLC_PRG
VAR
colorCar: COLOR;
colorTaxi : COLOR := COLOR.yellow;
END_VAR
The variable colorCar is initialized with COLOR.black. That is the default
initialization for all enumeration variables of type COLOR and defined this way
in the type declaration. The variable colorTaxi has its own initialization.
Example
PROGRAM PLC_PRG
VAR
cbFlower : COLOR_BASIC;
cbTree: COLOR_BASIC := COLOR_BASIC.green;
END_VAR
The variable cbFlower is initialized with COLOR_BASIC.yellow. That is the
default initialization for all enumeration variables of type COLOR_BASIC.
Because the enumeration declaration does not specify a component for initial-
ization, the system automatically initializes with the component that has the
value 0. This is usually the first of the enumeration components. However, it
can also be another component that is not in the first position but explicitly
initialized with 0.
The variable cbTree has an explicit initialization.
If no value is specified for both the type and the variable, then the following
rule applies: If an enumeration contains a value for 0, then this value is the
default initialization, and if not, then the first component in the list.
Example
Initialisierung mit der 0-Komponente
TYPE ENUM :
(
e1 := 2,
e2 := 0,
e3
)
;
END_TYPE
PROGRAM PLC_PRG
VAR
e : ENUM;
END_VAR
The variable e is initialized with ENUM.e2.
Initialisierung mit der ersten Komponente
TYPE ENUM2 :
(
e1 := 3,
e2 := 1,
e3
)
;
END_TYPE
PROGRAM PLC_PRG
VAR
e2 : ENUM2;
END_VAR
Example
Komponente blue
PROGRAM PLC_PRG
VAR
cbFlower : COLOR_BASIC;
colorCar : COLOR;
END_VAR
Reference, programming
identical *)
cbFlower := COLOR_BASIC.blue;
colorCar := COLOR.blue;
(* invalid code *)
cbFlower := blue;
colorCar := blue;
Also refer to
● ⮫ Chapter 32.3.86 Operator - Enumeration Namespace on page 538
32.5.22 Alias
A data type alias is the declaration of a user-defined data type that is used to
create an alternate name for a base type, data type, or function block.
You make the type declaration of an alias in a “DUT object”, which you can
create via the menu “Project 🠂 Add object 🠂 DUT” menu or via the context
menu of an application.
Syntax
TYPE <DUT name> : <type name> ;
END_TYPE
Permitted types
<type name> <basic type name>
<data type name>
<function block name>
Example
Alias data type for variables of type STRING or ARRAY, if they need a certain
length.
Deklaration
Example
Alias data type for variables that require a different initial value than the one
provided by the compiler.
Example
Alias data type for variables of a specific type that are to hold only a specific
subset of values of the original type.
{attribute 'qualified_only'}
VAR_GLOBAL CONSTANT
c_diMaxRune : DINT := DINT#16#0010FFFF;
END_VAR
TYPE RUNE : DINT(0..GVL.c_diMaxRune); END_TYPE
Example
Alias data type for types from another namespace, for example, for types from
a subordinate library that should be available in the current namespace.
Example
TYPE name:
UNION
a : LREAL;
b : LINT;
END_UNION
END_TYPE
Examples:
Reference, programming
VAR
i : INT (-4095..4095);
ui : UINT (0..10000);
END_VAR
Redundancy Description
Area Type
AREA_NONE No synchronization
Assigned by function call
Hint: In the “Redundancy Configuration” object, on the
“Registered Areas” tab, you can assign this redundancy area type
by deactivating variables or addresses.
AREA_OUTPU No synchronization, but a CRC is performed.
T
AREA_PASSI Synchronizes before writing of the outputs (limited data size)
VE Assigned by function call
AREA_SYNCH Synchronizes at each task cycle start (limited data size)
RO Configuration in the CFG file of the RTS
Assigned by function call
See also
● ⮫ Chapter 32.5.26 Redundancy State on page 594
Reference, programming
“Simulation RS_SIMULAT If not configured
” ION Works in standalone mode, not
synchronized with the other PLC
Fieldbus deactivated
RS_BOOTUP_ If in state RS_CYCLE_ACTIVE
ERROR The other PLC will become active
because the PROFIBUS displays a
problem with the active PLC (us).
Fieldbus deactivated
RS_SHUTDOW Ends the runtime systems in state
N_ACTIVE RS_CYCLE_STANDALONE
Note: Leave the fieldbus activated on
download.
RS_SHUTDOW Ends the runtime systems in state
N_STANDBY RS_CYCLE_STANDBY
Note: Deactivate the fieldbus on down-
load.
RS_SYNCHRO Error occurred during the state
_ERROR RS_SYNCHRO
Fieldbus deactivated
RS_SIMULAT With setting Simulation=1
ION_START Works in standalone mode after the
start, not synchronized with the other
PLC
Fieldbus deactivated
Note: A synchronization can be trig-
gered later with library functions.
RS_NO_LICE If no license is installed and the demo
NCE time has expired.
No operation
“Unknown” No assign- Indicates that the connection to the
ment PLC is not online
See also
● ⮫ Chapter 32.5.25 Redundancy Area Types on page 593
32.6 Pragmas
32.6.1 Pragmas – General information
Pragma statements affect the properties of one or multiple variables with
regard to the compilation or pre-compilation. Various categories of pragmas
are available.
Example
VAR
var : INT; {info 'TODO: should get another name'}
bvar : BOOL;
arrTest : ARRAY [0..10] OF INT;
i:INT;
END_VAR
arrTest[i] := arrTest[i]+1;
ivar:=ivar+1;
Reference, programming
See also
● ⮫ Chapter 32.6.3 Conditional pragmas on page 597
Also refer to
● ⮫ Chapter 32.1.4 Structured text and Extended Structured text (ExST)
on page 379
Example
Prerequisite: There are the applications App1 and App2. The variable pdef1 is
defined by a {define} instruction in App1, but not in App2.
Example
Prerequisite: There are two applications App1 and App2. The variable g_bTest
is declared in App1, but not in App2.
Example
Prerequisite: There are two applications App1 and App2. Data type DUT is
declared in App1, but not in App2.
Reference, programming
Otherwise, the expression FALSE is returned.
Example
Prerequisite: There are two applications App1 and App2. The CheckBounds
function block is present in App1, but not in App2.
Example
Prerequisite: There are two applications App1 and App2. Task PLC_PRG_Task
is defined in App1, but not in App2.
Example
Prerequisite: There are the two applications App1 and App2. There is a
resource object glob_var1 of the Global Variable List App1, but not for App2.
Example
Prerequisite: There are the two applications App1 and App2. The function
fun1 is declared in App1 and App2, but it is additionally provided with the
pragma {attribute 'vision'} in App1.
In App1:
{attribute 'vision'}
FUNCTION fun1 : INT
VAR_INPUT
Reference, programming
i : INT;
END_VAR
VAR
END_VAR
In App2:
Pragmaanweisung:
Also refer to
● ⮫ Chapter User-defined attributes on page 605
Example
Prerequisite: There are the two applications App1 and App2. The variable
g_globalInt is used in App1 and App2, but the attribute 'DoCount' is
assigned additionally in App1.
Deklaration g_GlobalInt in App1
VAR_GLOBAL
{attribute 'DoCount'}
g_globalInt : INT;
g_multiType : STRING;
END_VAR
VAR_GLOBAL
g_globalInt : INT;
g_multiType : STRING;
END_VAR
Pragmaanweisung:
Also refer to
● ⮫ Chapter User-defined attributes on page 605
Example
Prerequisite: There are two applications, App1 and App2. The variable
g_multitype is declared in App1 with data type LREAL, in App2 with data
type STRING.
Reference, programming
g_multitype := 'this is a multitalent';
{END_IF}
Example
Prerequisite: There are the two applications App1 and App2. The variable test
is used in the applications App1 and App2. In App1, it obtains 1, in App2 , it
obtains 2.
{IF hasvalue(test,'1')}
(* the following code is only processed in App1 *)
x := x + 1;
{ELSIF hasvalue(test,'2')}
(* the following code is only processed in App2 *)
x := x + 2;
{END_IF}
Example
Voraussetzung:
{IF hasconstantvalue(test,'1')}
(* the following code is only processed in App1 *)
x := x + 1;
{ELSIF hasconstantvalue(test,'2')}
(* the following code is only processed in App2 *)
x := x + 2;
{END_IF}
Example
Prerequisite: There are two applications, App1 and App2. PLC_PRG1 exists in
App1 and App2, and the POU CheckBounds exists only in App1.
Example
Prerequisite: There are the applications, App1 and App2. PLC_PRG1 exists in
App1 and App2, the POU CheckBounds only in App1.
Example
Prerequisite: There are two applications, App1 and App2. The POU PLC_PRG1
exists in App1 and App2, and the POU CheckBounds exists only in App1.
Operator (<operator>)
() parenthesizes the operators.
Also refer to
● ⮫ Chapter 18.6 Using pragmas on page 134
● ⮫ Chapter User-defined attributes on page 605
The pragma can be used in the ST editor and all declaration editors. Syntax
highlighting can be customized in the options.
See also
● ⮫ Chapter Command 'Collapse All Folds' on page 886
Reference, programming
● ⮫ Chapter Command 'Expand All Folds' on page 886
User-defined attributes
User-defined attributes are any application-defined or user-defined attributes
that you can apply to POUs, actions, data type definitions and variables. You
can query a user-defined attribute with the help of conditional pragmas before
the compilation of the application.
You can query user-defined attributes with conditional pragmas with the oper-
ator hasattribute.
More detailed information and examples can be found in the chapter 'Condi-
tional pragmas'.
Syntax:
{attribute 'attribute'}
See also
● ⮫ Chapter 32.6.3 Conditional pragmas on page 597
Attribute 'call_after_global_init_slot'
VAR_INPUT declarations in functions or methods that
NOTICE
use the attribute lead to compile errors. Reason: Input
variables are unknown in this case at the time of the call,
which occurs implicitly during the online change.
The effect of this pragma is that all functions and programs containing this
attribute are called after the global initialization. You define the order of calling
by means of the attribute value.
Syntax:
{attribute 'call_after_global_init_slot' := '<slot>'}
<slot>: Integer value that defines the ranking in the order of the calls; the
lower the value, the earlier the call takes place. If several function blocks have
the same ranking for the attribute, then the order of their calls remains indefi-
nite.
Insert location: First line above the declaration part of functions and programs
If a method possesses the attribute, PLC Engineering determines all instances
of the corresponding function block and calls all instances in the specified
slot. In this case you have no influence on the order of the instances among
themselves.
See also
● ⮫ Chapter 32.10.1 Methods 'FB_Init', 'FB_Reinit', and 'FB_Exit' on page 660
Attribute 'call_after_init'
VAR_INPUT declarations in functions or methods that
NOTICE
use the attribute lead to compile errors. Reason: Input
variables are unknown in this case at the time of the call,
which occurs implicitly during the online change.
The effect of this pragma is that a method is called implicitly after the initializa-
tion of a function block instance. For reasons of performance you must add
the attribute both to the function block and to the method in its own first line
above the declaration part.
Syntax:
{attribute 'call_after_init'}
Call: First line above the declaration part of the method and the function block.
PLC Engineering calls the method after the method FB_init and after the var-
iable values of an initialization expression in the instance declaration have
become valid.
Reference, programming
This functionality is supported from compiler version 3.4.1.0.
Example
Definition:
{attribute 'call_after_init'}
FUNCTION_BLOCK FB
... <function block definition>
{attribute 'call_after_init'}
METHOD FB_AfterInit
... <method definition>
The definition implements, for example, the following declaration in the sub-
sequent code processing:
inst : FB := (in1 := 99);
Code processing:
inst.FB_Init();
inst.in1 := 99;
inst.FB_AfterInit();
This allows a reaction to the user-defined initialization in FB_AfterInit.
See also
● ⮫ Chapter 32.10.1 Methods 'FB_Init', 'FB_Reinit', and 'FB_Exit' on page 660
Attribute 'call_after_online_change_slot'
VAR_INPUT declarations in functions or methods that
NOTICE
use the attribute lead to compile errors. Reason: Input
variables are unknown in this case at the time of the call,
which occurs implicitly during the online change.
The effect of this pragma is that all functions and programs containing this
attribute are called after an online change. You define the order of calling by
means of the attribute <slot>.
Syntax:
{attribute 'call_after_online_change_slot' := '<slot>'}
<slot>: Integer value that defines the ranking in the order of the calls; the
lower the value, the earlier the call takes place. If several function blocks have
the same ranking for the attribute, then the order of their calls remains indefi-
nite.
Call: First line above the declaration part of functions and programs.
If a method possesses the attribute, then PLC Engineering determines all
instances of the function block concerned. PLC Engineering calls all instances
in the specified slot. In this case you have no influence on the order of the
instances among themselves.
Attribute 'call_before_global_exit_slot'
VAR_INPUT declarations in functions or methods that
NOTICE
use the attribute lead to compile errors. Reason: Input
variables are unknown in this case at the time of the call,
which occurs implicitly during the online change.
The effect of this pragma is that all functions and programs containing this
attribute in a dedicated first line of their declaration are called before the Glob-
alExit. The GlobalExit takes place before a new download or a reset. Function
blocks provided with an FB_Exit method are affected. The order of calling is
defined by means of the attribute value.
Syntax:
{attribute 'call_before_global_exit_slot' := '<slot>'}
Insert location: First line above the declaration part of functions and programs.
<slot>: Integer value that defines the ranking in the order of the calls; the
lower the value, the earlier the call takes place. If several function blocks have
the same ranking for the attribute, then the order of their calls remains indefi-
nite.
If a method possesses the attribute, then the method is called for all instances
of the function block concerned. PLC Engineering calls all instances in the
specified slot. In this case you have no influence on the order of the instances
among themselves.
See also
● ⮫ Chapter 32.10.1 Methods 'FB_Init', 'FB_Reinit', and 'FB_Exit' on page 660
Attribute 'call_on_type_change'
With this pragma, you can mark a method of a function block A that should be
called when the data type changes for one or more function blocks B, C, etc.
that are referenced by A. The referencing can be defined by a pointer variable
or a REFERENCE variable.
Syntax:
{attribute 'call_on_type_change':= '<name of the first
referenced function block>|<name of the second referenced
function block>|<name of the ... referenced function block>'}
Insert location: Line above the first line in the method declaration.
Example
Function blocks with references
FUNCTION_BLOCK FB_A
...
VAR
var_pt: POINTER TO FB_B;
var_ref: REFERENCE TO FB_C;
END_VAR
...
Reference, programming
Method for reaction to a type change in the references FB_B and FB_C
Attribute 'conditionalshow'
The pragma has the effect that the identifiers of an integrated compiled library
<library name> .compiled-library, which are decorated with the pragma,
are hidden before programming an application. The POUs can be called but the
variables are invisible in the PLC Engineering user interface.
Affected features
● Library management
● Debugging
● Input Assistant
● Function "List components"
● Monitoring
● Symbol configuration
This is useful when you develop libraries. As the library developer, you decorate
function blocks or variables with the pragma. As a result, you determine which
identifiers are hidden in an application after integration. If you want to show
the hidden identifiers later, for example for debugging or further development
of the library, you can reactivate its visibility.
Syntax
{attribute 'conditionalshow' ( := ' <some text> ' )? }
<some text>: Optional string literal to control the visibility of the identifiers
decorated with this kind of pragma by means of a command-line command
and this literal. When the pragma is specified without a literal, the variables in
the PLC Engineering development environment are always hidden, regardless of
how PLC Engineering was started. For more help about this, see the document
"Library Development Summary".
Insert location: Top line in the declaration part of a function block, above a
variable
Example
For more examples, see the document "Library Development Summary".
Hiding a variable
FUNCTION_BLOCK FB_DataManager
VAR
{attribute 'conditionalshow' := 'Library_Developer'}
iLocal : INT;
iCounter : INT;
END_VAR
The variable iLocal is invisible.
Hiding a function block
{attribute 'conditionalshow' := 'Library_Developer'}
FUNCTION_BLOCK FB_DataManager
VAR
iLocal : INT;
iCounter : INT;
END_VAR
The identifiers FB_DataManager, iLocal, and iCounter are invisible.
Example
codesys.exe --conditionalshowsymbols="Library_Developer"
codesys.exe --conditionalshowsymbols="Group_A,Group_B"
See also
● ⮫ Chapter Attribute 'hide' on page 620
● ⮫ Chapter Attribute 'conditionalshow_all_locals' on page 610
● "Library Development Summary", "Visibility Control" Chapter
Attribute 'conditionalshow_all_locals'
The pragma has the effect that all local variables of a library POU decorated
with the pragma are hidden from application programmers. The POUs of an
integrated compiled library <library name> .compiled-library can be
called, but the variables are invisible in the PLC Engineering user interface.
Affects features:
● Library management
● Debugging
● Input Assistant
● Function "List components"
● Monitoring
● Symbol configuration
This is useful when you develop libraries. As the library developer, you deco-
rate function blocks with the pragma. As a result, you determine that their
identifiers are hidden in an application after integration. If you want to show
these identifiers later, for example for debugging or further development of the
library, you can reactivate its visibility.
Syntax
Reference, programming
{attribute 'conditionalshow_all_locals' ( := ' <some text>
' )? }
<some text>: Optional string literal to control the visibility of the identifiers
decorated with this kind of pragma by means of a command-line command
and this literal. When the pragma is specified without a literal, the variables in
the PLC Engineering development environment are always hidden, regardless of
how PLC Engineering was started. For more help about this, see the document
"Library Development Summary".
Insert location: Top line in the declaration part of the function block.
Example
Hiding all local variables
{attribute 'conditionalshow_all_locals' :=
'Library_Developer'}
FUNCTION_BLOCK FB_DataManager
VAR
iLocal : INT;
iCounter : INT;
END_VAR
For more examples, see the document "Library Development Summary".
Example
codesys.exe --conditionalshowsymbols="Library_Developer"
codesys.exe --conditionalshowsymbols="Group_A,Group_B"
See also
● ⮫ Chapter Attribute 'hide_all_locals' on page 622
● ⮫ Chapter Attribute 'conditionalshow' on page 609
● "Library Development Summary", chapter "Visibility Control"
Example
The constants iTestCon and xTestCon are available in the symbol configura-
tion because the “Replace constants” option deactivated.
{attribute 'qualified_only'}
VAR_GLOBAL CONSTANT
{attribute 'const_non_replaced'}
iTestCon : INT := 12;
{attribute 'const_non_replaced'}
xTestCon : BOOL := TRUE;
rTestCon : REAL := 1.5;
END_VAR
VAR_GLOBAL
iTestVar : INT := 12;
xTestVar : BOOL := TRUE;
END_VAR
See also
● ⮫ Chapter 'Project settings' dialog - 'Compiler options' on page 1062
● ⮫ Chapter 19.2 Symbol Configuration on page 229
Attribute 'dataflow'
With this pragma you control the data flow in the processing of function blocks
in the FBD/LD/IL editor. The attribute defines the input or output of a function
block to which the continuing connection to the next or previous function block
is connected.
You may provide only 1 input and 1 output with the attribute in the declaration
of a function block.
Syntax:
{attribute 'dataflow'}
Insertion position: line above the line with the declaration of the corresponding
variables.
In the case of function blocks without the attribute 'dataflow', PLC Engi-
neering determines the data flow as follows: first of all the connection is placed
between an output and an input of same data type. The highest input or output
variable of the function blocks is always taken. If there are no variables of a
corresponding data type, PLC Engineering connects the highest output with the
highest input of the neighboring function blocks.
Example
The connection between FB and the preceding function block is established
Reference, programming
via the input variable i1. The connection between FB and the following func-
tion block is established via the output variable outRes1.
FUNCTION_BLOCK FB
VAR_INPUT
r1 : REAL;
{attribute 'dataflow'}
i1 : INT;
i2 : INT;
r2 : REAL;
END_VAR
VAR_OUTPUT
{attribute 'dataflow'}
outRes1 : REAL;
out1 : INT;
g1 : INT;
g2 : REAL;
END_VAR
See also
● ⮫ Chapter Programming in a function block diagram (FBD) on page 174
Attribute 'displaymode'
With this pragma you define the display mode of an individual variable. This
definition overwrites the global setting for the display of the monitoring var-
iable, which takes place via the commands in the menu “Debug 🠂 Display
Mode”.
Syntax:
{attribute 'displaymode':=<displaymode>}
The following definitions are possible
● Binary format
– {attribute 'displaymode':='bin'}
– {attribute 'displaymode':='binary'}
● Decimal format
– attribute 'displaymode':='dec'}
– {attribute 'displaymode':='decimal'}
● Hexadecimal format
– {attribute 'displaymode':='hex'}
– attribute 'displaymode':='hexadecimal'}
Insertion position: line above the line with the declaration of the corresponding
variables.
Example
VAR
{attribute 'displaymode':='hex'}
dwVar1: DWORD;
END_VAR
See also
● ⮫ Chapter Command 'Display Mode' - 'Binary', 'Decimal', 'Hexadecimal'
on page 961
Attribute 'enable_dynamic_creation'
The pragma enable_dynamic_creation is needed for using the __NEW oper-
ator for function blocks.
Syntax:
{attribute 'enable_dynamic_creation'}
Insert location: First line in the declaration of the function block.
See also
● ⮫ Chapter 32.3.72 Operator '__NEW' on page 524
Attribute 'estimated-stack-usage'
The pragma provides an estimated value for the stack size requirement.
Methods with recursive calls cannot pass a stack check because stack usage
cannot be determined. As a result, a warning is issued. To prevent this warning,
you can give the method an estimated value (in bytes) for the stack size
requirement. Then the method passes the stack check successfully.
Syntax
Example
Insertion position: First line above the declaration part of the method
The "Method call" chapter includes an example that uses this pragma.
Example
Reference, programming
A warning is issued for the m_Recursive method only.
PROGRAM PLC_PRG
VAR
fb_Factorial_A : FB_Factorial;
factorial_A : FACTORIAL_RESULT := (uiNumber := 9,
udiIterative := 0, udiRecursive := 0, udiPragmaed := 0 );
END_VAR
fb_Factorial_A.p_Number := factorial_A.uiNumber;
factorial_A.udiIterative := fb_Factorial_A.m_Iterative();
factorial_A.udiRecursive := fb_Factorial_A.m_Recursive(uiN :=
factorial_A.uiNumber);
// Iterative calculation
METHOD PUBLIC m_Iterative : UDINT
VAR
uiCnt : UINT;
END_VAR
m_Iterative := 1;
IF uiN > 1 THEN
FOR uiCnt := 1 TO uiN DO
m_Iterative := m_Iterative * uiCnt;
END_FOR;
RETURN;
ELSE
RETURN;
END_IF;
//Recursive calculation
METHOD PUBLIC m_Recursive : UDINT
VAR_INPUT
uiN : UINT;
END_VAR
VAR
END_VAR
ctrlX PLC Engineering 617 / 1158
Pragmas
m_Recursive := 1;
IF uiN > 1 THEN
m_Recursive := uiN * THIS^.m_Recursive(uiN := (uiN - 1) );
RETURN;
ELSE
RETURN;
END_IF;
Reference, programming
METHOD PUBLIC m_Temp : UDINT
VAR_INPUT
uiN : UINT;
END_VAR
VAR
fb_Temp : FB_Factorial;
END_VAR
m_Temp := 1;
IF uiN > 1 THEN
m_Temp := uiN * fb_Temp.m_Temp(uiN := (uiN - 1));
RETURN;
ELSE
RETURN;
END_IF;
Also refer to
● ⮫ Chapter 18.24.5 Calling Methods on page 224
● ⮫ Chapter 18.24 Object-oriented programming on page 219
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Property' on page 839
Attribute 'ExpandFully'
The effect of this pragma is that the components of an array used as an input
variable for referenced visualizations are made visible in the Properties dialog
box of the visualization.
Syntax:
{attribute 'ExpandFully'}
Insertion position: the line above the line with the declaration of the array.
Example
The visualization “visu” is to be inserted into a frame inside the visualization
“visu_main”. arr is defined as an input variable in the interface editor of
“visu” and will thus be available later for assignments in the Properties dialog
box of the frames in “visu_main”. In order to also make the individual com-
ponents of arr available in this Properties dialog box, you must insert the
attribute 'ExpandFully' directly before arr in the interface editor of visu.
Declaration in the interface editor of “visu”:
VAR_INPUT
{attribute 'ExpandFully'}
arr : ARRAY[0..5] OF INT;
END_VAR
Attribute 'global_init_slot'
The pragma defines the initialization order of programming blocks and global
variable lists.
Variables in a list (GVL or POU) are initialized from top to bottom.
If there are several global variable lists, then the initialization order is not
defined.
The initialization does not apply for the initialization of literal values, for
example 1, 'hello', 3.6, or constants of base data types. However, you must
define the initialization order yourself if there are dependencies between the
lists. You can assign a defined initialization slot to a GVL or POU with the
'global_init_slot' attribute.
Constants are initialized before the variables and in the same order as the
variables. During initialization, the POUs are sorted according to the value for
<slot>. Then the code for initializing the constants is generated and afterwards
the code for initializing the variables.
Syntax:
Reference, programming
{attribute 'global_init_slot' := '<slot>'}
<slot>: Integer value that defines the position in the call order. The default
value for a POU (program, function block) is 50000. The default value for a GVL
is 49990. A lower value means an earlier initialization. Caution: If several blocks
or GVLs receive the same value for the 'global_init_slot' attribute, then
the initialization order remains undefined.
Insert location: The pragma always affects the entire GVL or POU and therefore
it must be located above the VAR_GLOBAL or POU declaration.
If several programming blocks have got assigned the same value for the
attribute 'global_init_slot', the order of their initialization remains unde-
fined.
Example
The program includes two global variable lists GVL_1 and GVL_2, as well as a
PLC_PRG program that uses variables from both lists. GVL_1 uses the variable
B for initializing a variable A, which is initialized in GVL_2 with a value of 1000.
GVL_1
VAR_GLOBAL //49990
A : INT := GVL_2.B*100;
END_VAR
GVL_2
VAR_GLOBAL //49990
B : INT := 1000;
C : INT := 10;
END_VAR
PLC_PRG
PROGRAM PLC_PRG //50000
VAR
ivar: INT := GVL_1.A;
ivar2: INT;
END_VAR
ivar:=ivar+1;
ivar2:=GVL_2.C;
In this case, the compiler prints an error because GVL_2.B is used for initi-
alizing GVL_1.A before GVL_2 has been initialized. You can prevent this by
using the global_init_slot attribute to position GVL_2 before GVL_1 in the
initialization sequence.
In this example, GVL_1 must have at least one slot value of 49989 in order to
achieve the earliest initialization within the program. Every lower value has the
same effect:
GVL_2
{attribute 'global_init_slot' := '100'}
VAR_GLOBAL
B : INT := 1000;
END_VAR
Using GVL_2.C in the implementation part of PLC_PRG is also not critical even
without using a pragma because both GVLs are initialized before the program
in either case.
Attribute 'hide'
Using the pragma {attribute 'hide'} to hide variables and POUs does not
have the desired effect in most cases. Instead, you should use the pragma
{attribute 'conditionalshow'}.
The pragma prevents the variables and POUs defined with it from being shown
in the PLC Engineering user interface. As a result, you can intentionally hide
these identifiers without restricting the access. This can be useful when you
develop libraries.
Affected features:
● Library management
● Debugging
● Input Assistant
● Function "List components"
● Monitoring
● Symbol configuration
The variables or POUs defined with the pragma are neither visible in the
Library Manager nor are they suggested in the Input Assistant or in the "List
components" function. The pragma prevents those marked variables from being
displayed in the symbol configuration. As a result, you cannot export these
kinds of variables as symbols. The variables are also invisible in online mode,
and therefore their values cannot be monitored. Moreover, you cannot use any
debugging functionalities and you do not have any support when checking for
bugs.
Syntax:
{attribute 'hide'}
Insert location: For variables, above the line with the declaration of the varia-
bles. For POUs, in the first line.
If you, the application developer, know the exact instance path of the hidden
POUs and variables, then you can access them in the code.
Reference, programming
VAR_OUTPUT
iOutA : INT;
END_VAR
VAR
iCounter : INT;
END_VAR
Two instances of the function block FB_MyA are defined in the main program.
PROGRAM PLC_PRG
VAR
fbMyA1, fbMyA2 : FB_MyA;
xVar2 : BOOL;
iVar1 : INT;
iVar2 : INT;
END_VAR
fbMyA1(iInA := 1, xInit := TRUE, xInvisibleIn := TRUE, iOutA
=> iVar1);
fbMyA2(iInA := 1, xInit := TRUE, iOutA => iVar2);
When the input value for fbMyA1 is implemented, the "List components" func-
tion, which opens when you type fbMyA1. (in the implementation part of
PLC_PRG), displays the variables iInA, xInit, and iOutA, but not the hidden
variable xInvisibleIn.
{attribute 'hide'}
METHOD METH_Count : INT
VAR_INPUT
END_VAR
iCount := iCount + 1;
{attribute 'hide'}
METHOD METH_Invisible : BOOL
VAR_INPUT
END_VAR
iInvisible := iInvisible + 1;
{attribute 'hide'}
PROPERTY PUBLIC prop_iA : INT
For you as the application developer, all POUs are invisible. You can use them
only if you know the instance path.
PROGRAM PLC_PRG
VAR
fbHidden : HIDDEN.FB_A; // Hidden function block from
library HiddenFunctionality
iCounter : INT;
END_VAR
fbHidden.METH_Invisible();
iCounter := fbHidden.iInvisible;
In online mode, no monitoring is performed.
With the pragma hide_all_locals you can hide all local variables of a POU.
See also
● ⮫ Chapter Attribute 'hide_all_locals' on page 622
● ⮫ Chapter Attribute 'conditionalshow' on page 609
● ⮫ Chapter Attribute 'conditionalshow_all_locals' on page 610
Attribute 'hide_all_locals'
The pragma prevents all local variables of a signature from being visible in the
display of the 'List components' function, in the Input Assistant or in the decla-
ration part in online mode. Moreover, these variables are hidden in the symbol
configuration and therefore cannot be exported as symbols. The pragma is
especially useful in library POUs to hide POU variables from users.
Affected features
● Library management
● Debugging
● Input Assistant
● Function "List components"
● Monitoring
● Symbol configuration
Syntax:
{attribute 'hide_all_locals'}
Reference, programming
Insert location: First line above the declaration part of the POU
Example
The function block FB_MyB uses the attribute:
{attribute 'hide_all_locals'}
FUNCTION_BLOCK FB_MyB
VAR_INPUT
iInB : INT;
{attribute 'hide'}
xInvisibleIn : BOOL;
xInit: BOOL;
END_VAR
VAR_OUTPUT
iOutB : INT;
END_VAR
VAR
iCounter : INT;
xVar : BOOL;
END_VAR
Two instances of the function block FB_MyB are defined in the main program.
PROGRAM PLC_PRG
VAR
fbMyB1, fbMyB2: FB_MyB;
iVar3: INT;
iVar4: INT;
END_VAR
See also
● ⮫ Chapter Attribute 'hide' on page 620
Attribute 'initialize_on_call'
The pragma causes input variables of a function block to be initialized on
each call of the function block. If an input variable is affected which expects
a pointer and this pointer has been removed during an online change, then the
variable is initialized to zero.
Syntax:
{attribute 'initialize_on_call'}
Insert location: Always in the first line of the declaration part for the entire
function block, and also in a line above the declaration of the individual input
variable.
Example
{attribute 'initialize_on_call'}
FUNCTION_BLOCK fb
VAR_INPUT
{attribute 'initialize_on_call'}
pInt : POINTER TO INT := 0;
{attribute 'initialize_on_call'}
iVal : INT := 0;
END_VAR
Attribute 'init_namespace'
The effect of this pragma is that a variable of the type STRING or WSTRING,
which is declared in a library function block with this pragma, is initialized
when used in the project with the current namespace of the library.
Syntax
{attribute 'init_namespace'}
Insertion position: the line above the line with the declaration of the variables
in a library function block.
Example
The function block “POU” is provided with the necessary attributes:
FUNCTION_BLOCK POU
VAR_OUTPUT
{attribute 'init_namespace'}
myStr: STRING;
END_VAR
An instance fb of the function block POU is defined within the main program
PLC_PRG:
PROGRAM PLC_PRG
VAR
fb:POU;
newString: STRING;
END_VAR
newString := fb.myStr;
The variable myStr is initialized with the current namespace, for example
MyLib. This value is assigned to newString in the main program.
See also
● ⮫ Chapter 33.2.19 "Library manager” object on page 780
Attribute "init_on_onlchange"
No initialization code with fast online change
NOTICE
Since compiler version>=3.5.0.0, a "fast online change" is
performed for small changes. With a fast online change,
only the changed block is compiled and reloaded. In par-
ticular, no initialization code is generated.
For variables with the init_on_onlchange attribute,
this also results in no initialization code being gener-
ated. In the usual scenarios this will have no effect:
The attribute is usually used to initialize variables with
Reference, programming
addresses. However, the fast online change does not
cause a variable to change its address.
To ensure the effect of the init_on_onlchange
attribute on the entire application code nevertheless,
you can generally switch off the fast online change
for the application with the help of the compiler
define no_fast_online_change. To do this, select your
application object in the device tree and choose the
Properties context command. Add the compiler define
no_fast_online_change under the Build tab.
For further information, see: ⮫ 'Properties' dialog - 'Build'
The effect of this pragma is that the variable to which the pragma is applied is
initialized with each online change.
Syntax:
{attribute 'init_on_onlchange' }
Insertion position: The line above the line with the declaration of the variables.
Example
VAR_GLOBAL
{attribute 'init_on_onlchange'}
g_fastOnlineChange : BOOL := FALSE;
END_VAR
{attribute 'call_after_online_change_slot' := '4567'}
FUNCTION FUNC_OnlineChangeDetection : BOOL
VAR_INPUT
END_VAR
VAR
END_VAR
IF GVL_OnlineChangeDetection.g_fastOnlineChange THEN
// here you know that you are inside a FastOnlineChange
END_IF
// reset for next detection
GVL_OnlineChangeDetection.g_fastOnlineChange := TRUE;
Also refer to
● ⮫ Chapter 'Properties' dialog - 'Build' on page 1048
Attribute 'instance-path'
This pragma can be applied to a local STRING variable and causes this local
STRING variable to be initialized in sequence with the device tree path of the
POU to which it belongs. This can be useful for error messages. The application
of the pragma requires the application of the attribute 'reflection' to the
associated POU, as well as the application of the additional attribute 'noinit'
to the STRING variable.
Syntax:
{attribute 'instance-path'}
Insertion position: the line above the line with the declaration of the STRING
variable.
Example
The following function block contains the attributes 'reflection',
'instance-path' and 'noinit'.
{attribute 'reflection'}
FUNCTION_BLOCK POU
VAR
{attribute 'instance-path'}
{attribute 'noinit'}
str: STRING;
END_VAR
An instance “myPOU” of the function block “POU” is defined within the main
program “PLC_PRG”:
PROGRAM PLC_PRG
VAR
myPOU:POU;
myString: STRING;
END_VAR
myPOU();
myString:=myPOU.str;
Following the initialization of the instance myPOU, the path of the
instance myPOU is assigned to the string variable str, in the example
PLCWinNT.Application.PLC_PRG.myPOU. This path is assigned in the main
program to the variable myString.
Example
{attribute 'io_function_block'}
FUNCTION_BLOCK Scale_Output_Int
VAR_INPUT
iInput : INT;
iNumerator : INT;
iDenominator : INT :=1;
iOffset : INT := 0;
END_VAR
VAR_OUTPUT
Reference, programming
{attribute 'io_function_block_mapping'}
iOutput : INT;
END_VAR
VAR
See also
● ⮫ Chapter 33.4.7 Dialog 'Select Function Block' on page 1039
● ⮫ Linking a device with a function block instance on page 122
Attribute 'is_connected'
You use the pragma 'is_connected' to mark a Boolean function block vari-
able which, when a function module instance is called, provides information
about whether the associated input of the POU has an assignment.
The use of the pragma requires the use of the attribute 'reflection' on the
affected function block.
Syntax:
{attribute 'is_connected' := '<input variable>'}
Example
In the function block FB, a local variable is declared for each input variable
(in1 and in2) and the attribute 'is connected' is prepended to it each
time with the name of the input variable. The func itself gets the pragma
attribute 'reflection'.
When an instance of the function block is called, the local variable is TRUE in
the case that the input assigned to it has received an assignment.
{attribute 'reflection'}
FUNCTION_BLOCK FB
VAR_INPUT
in1: INT;
in2: INT;
END_VAR
VAR
{attribute 'is_connected' := 'in1'}
in1_connection_info: BOOL;
{attribute 'is_connected' := 'in2'}
in2_connection_info: BOOL;
END_VAR
Assumption: When the function block instance is called, in1 receives an
external assignment and in 2 does not receive an assignment. This results
in the following code:
in1_connection_info := TRUE;
in2_connection_info := FALSE;
See also
● ⮫ Chapter Attribute 'reflection' on page 645
● ⮫ Chapter ‘Function block’ object on page 823
Attribute 'linkalways'
The pragma {attribute 'linkalways'} instructs the compiler to always
include a POU or a library POU in the compile information. During the build,
the POU is compiled and is part of the application code. During the download,
the POU is downloaded to the PLC.
Syntax:
{attribute 'linkalways'}
Insertion location: The first line in the declaration part of the POU or library
POU
The POU may be valid throughout the project (saved in the “POUs” view) or
throughout the application (saved in the “Devices” view).
You can also select the “Link always” option in the “Build” tab of a POU's
object properties.
Example
The “MoreSymbols” GVL contains the pragma {attribute 'linkalways'}.
The variables declared there are also part of the application code, regardless
of any access.
GVL MoreSymbols
{attribute 'linkalways'}
VAR_GLOBAL
g_iAlpha: INT;
g_iBravo: INT;
g_iCharlie: INT;
END_VAR
The symbol configuration also accesses the compile information. As a result,
the variables of the MoreSymbols GVL are always provided for selection in the
“Symbol Configuration” editor.
See also
● ⮫ Chapter 'Properties' dialog - 'Build' on page 1048
● ⮫ Chapter 19.2 Symbol Configuration on page 229
Attribute 'monitoring'
The effect of this pragma is that you can monitor values of properties or func-
tion calls in the online view of the IEC editor or in a watch list. There are two
possible attribute values for this: 'variable' and 'call'
Syntax
Reference, programming
{attribute 'monitoring' := 'variable'}
{attribute 'monitoring' := 'call'}
Example
In online mode, the PLC_PRG object shows the value of the Minutes prop-
erty at the call location inline in the ST editor. This is because the pragma
{attribute 'monitoring' := 'variable'} is located in the declaration
of the Minutes property.
Check carefully for each application which attribute pragma is suitable for dis-
playing the desired value. This depends on whether further operations with the
variables are implemented within the property.
1. Pragma {attribute 'monitoring':='variable'}:
An implicit variable is created for the property, which is then always given the
current property value when the application calls the Set or Get method. The
value stored last in this variable is displayed in the monitoring.
2. Pragma {attribute 'monitoring':='call'}:
You can use this attribute only for properties that return simple data types or
pointers, but not for structured types. The value to be monitored is read or
written by calling the property directly. This means that the monitoring service
of the runtime executes the Get or Set method of the property.
When you insert the pragma {attribute
NOTICE
'monitoring':='call'} for monitoring, you have to
pay attention to possible side effects. These kinds of
side effects can occur if additional operations are imple-
mented in the property.
The pragma {attribute 'monitoring'} is also evalu-
NOTICE
ated for the symbol configuration. Only read access is
possible for the value 'variable'.
With the context menu command “Add Watch”, a variable on which the cursor
is currently positioned is applied directly into the monitoring list in online
mode.
The forcing or writing of functions is not supported. However, you can implicitly
implement forcing by adding an additional input parameter for the respective
function, which serves as an internal force flag.
Function monitoring is not possible in the compact runtime.
See also
● ⮫ Chapter Object 'Property' on page 839
Attribute 'monitoring_display'
The pragma in the declaration of a function module or a structure causes the
current value of the specified component (property or variable) to be displayed
in the monitoring as well.
The value of the module or structure component is then displayed in the top
line of the monitoring for variables of the type of the function module or struc-
ture.
Syntax
Example
Reference, programming
{attribute 'monitoring_display' := 'stMonitoring'}
TYPE ADUT :
STRUCT
val1: INT;
val2: INT;
stMonitoring: STRING := 'to be monitored';
END_STRUCT
END_TYPE
PROGRAM PLC_PRG
VAR
mydut: ADUT;
nTest: INT;
END_VAR
nTest:= iCounter + 1;
mydut.stMonitoring := INT_TO_STRING(nTest);
Attribute 'monitoring_encoding'
The attribute pragma is allowed for string variables and aliases. The attribute
causes the values of the variables marked with it to be decoded in UTF-8
format during monitoring.
Syntax
Example
PROGRAM PLC_PRG
VAR
{attribute 'monitoring.encoding' := 'UTF8'}
strDat : STRING := 'abc';
attribute 'monitoring_encoding' := 'UTF-8'}
strVarUtf8: STRING := UTF8#'你好,世界!ÜüÄäÖö';
{attribute 'monitoring_encoding' := 'UTF-8'}
str1: STRING := UTF8#'AÄyyy';
{attribute 'monitoring_encoding' := 'UTF-8'}
str2: STRING := UTF8#'AÄxxxÜÜÜ';
Example
Assignment of function block instances containing pointers.
In this example the value assignment of the function block instances will lead
to problems during the execution of fb_exit:
VAR_GLOBAL
inst1 : TestFB;
awsBufferLogFile : ARRAY [0..9] OF WSTRING(66);(* Area: 0,
Offset: 0x1304 (4868)*)
LogFile : SEDL.LogRecord := (sFileName := 'LogFile.log',
Reference, programming
pBuffer := ADR(awsBufferLogFile), udiMaxEntriesFile :=
UDINT#10000, udiMaxBuffered := UDINT#10, uiLineSize :=
UINT#64, wsSep := " ", xCircular := TRUE, siDateFormat :=
SINT#0, siTimeFormat := SINT#0);
END_VAR
PROGRAM PLC_PRG
VAR
inst2 : TestFB := inst1;
LogFileNew
END_VAR
In this case LogRecord manages a list of pointers, for which various actions
are executed in the case of fb_exit. Problems result due to the assignment,
because fb_exit will be executed twice. You should prevent this by adding
the attribute 'no_assign' in the declaration of the function block “TestFB”:
{attribute 'no_assign'}
FUNCTION_BLOCK TestFB
VAR_INPUT
...
The following compiler errors are then displayed:
C0328: Assignment not allowed for type TestFB
C0328: Assignment not allowed for type LogRecord
If the pragma no_assign_warning is used instead of the pragma no_assign
for the function block “TestFB ”, then the C0328 message is issued as com-
piler warning, not as a compiler error.
Attribute 'no_check
The pragma causes no check function (POUs for implicit checks) to be called
for the POU. Since the check functions can affect the processing speed of the
program, it can be useful to apply the attribute to function blocks that have
already been checked or are frequently called.
You add the pragma to the declaration of a POU.
Syntax:
{attribute 'no_check'}
Insertion position: first line in the declaration part of the POU.
The attribute also automatically affects the child objects
NOTICE
of a POU!
Example: If the attribute is entered in a program, check
functions will also not be performed for actions that are
assigned to this program.
Also refer to
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
Attribute 'no_copy'
In general an online change requires a re-allocation of instances, for example
of a POU. In the process, the value of the variable contained in the instance is
copied.
The pragma prevents the value of the variable contained in the instance from
being copied in the course of an online change; instead, the variable is re-ini-
tialized in the course of an online change. This can be useful for a local pointer
variable that points to a variable that has just been shifted by the online change
and thus has a changed address.
You insert the attribute in the declaration part above the line of the declaration
of the variables concerned.
Syntax:
{attribute 'no_copy'}
Attribute 'no-exit'
This attribute suppresses the call of the FB_exit method of a function block for
a certain one of its instances. To do this you insert the attribute in the line
before the declaration of the function block instance.
Syntax:
{attribute 'no-exit'}
Example
The method “FB_exit” is added to the function block “POU_ex”. Two instances
of the function block “POU_ex” are created in the main program “PLC_PRG”.
PROGRAM PLC_PRG
VAR
POU1 : POU_ex;
{attribute 'no-exit'}
POU2 : POU_ex;
END_VAR
POU1 is called, POU2 is not called.
See also
● ⮫ Chapter 32.10.1 Methods 'FB_Init', 'FB_Reinit', and 'FB_Exit' on page 660
Attribute 'noinit'
This pragma is applied to variables that should not be implicitly initialized.
Syntax:
{attribute 'no_init'}
{attribute 'no-init'}
{attribute 'noinit'}
Insertion position: line above the declaration line of the variables concerned in
the declaration part.
Example
PROGRAM PLC_PRG
VAR
A : INT;
{attribute 'no_init'}
B : INT;
END_VAR
When the associated application is reset, the integer variable A is implicitly
re-initialized with 0, whereas the variable B retains its current value.
Reference, programming
Attribute 'no_instance_in_retain'
This pragma allows you to prevent the instance of a function block from being
stored in the retain memory area.
Syntax:
{attribute 'no_instance_in_retain'}
Insertion position:
Line above the FUNCTION_BLOCK declaration in the declaration part of the
function block.
If you now declare an instance declaration of the function module as a RETAIN
variable, an error message is reported.
Also refer to
● ⮫ Chapter 18.22 Data persistence on page 211
Attribute 'no_virtual_actions'
The pragma is used for function blocks that are derived from a function block
implemented in SFC and use the fundamental SFC sequence of this base
class. The actions called from it exhibit the same virtual behavior as methods.
This means that the implementations of the actions in the base class can be
replaced by the derived class with its own specific implementations.
If you apply the pragma to the base class, then its actions are protected against
overloading.
Syntax:
{attribute 'no_virtual_actions'}
Insert location: Top line in the declaration part of the function block
Example
The function block POU_SFC is the base class for the derived function block
POU_child. The derived class POU_child calls the sequence of the base class
written in SFC with the special variable SUPER.
FUNCTION_BLOCK POU_SFC...
This changes the behavior: While the implementation of the derived class is
still used for the method METH, the call of the step action now results in a
call of the action ActiveAction of the base class. Therefore test_act is now
given the value 'father_action':
Reference, programming
Attribute 'pingroup'
The effect of this pragma is that the input pins or output pins (parameters)
are grouped in the declaration of a function block. In the FBD/LD editor a pin
group defined in this way can be displayed as an enlarged or reduced unit on
the inserted function block. Several groups are possible and are distinguished
by their names. PLC Engineering saves the respective state (reduced) per func-
tion block box with the project options.
Syntax:
{attribute 'pingroup' := '<group name>'}
Insertion position: line above the declaration of the input or output variables
concerned in the declaration part of a function block.
Example
Two groups are defined: general (i1, out1) and group1 (i2, g1). r1,
r2, outRes1 and g2 are always displayed
FUNCTION_BLOCK FB
VAR_INPUT
r1 : REAL;
{attribute 'pingroup' := 'general'}
i1 : INT;
{attribute 'pingroup' := 'group1'}
i2 : INT;
r2 : REAL;
END_VAR
VAR_OUTPUT
outRes1 : REAL;
{attribute 'pingroup' := 'general'}
out1 : INT;
{attribute 'pingroup' := 'group1'}
g1 : INT;
g2 : REAL;
END_VAR
Attribute 'pin_presentation_order_inputs/outputs'
The pragmas are evaluated in the CFC, FBD, and LD graphical editors, causing
the order of inputs/outputs of the affected function block to be displayed as
specified. You program the order by assigning the names of the inputs/outputs
to the attribute in the desired order.
Syntax
{attribute 'pin_presentation_order_inputs' :=
'<First_Input_Name>, (<Next_Input_Name>, )* ( *, )?
(<Next_Input_Name>,)* <Last_Input_Name>'}
{attribute 'pin_presentation_order_outputs' :=
'<First_Output_Name>, (<Next_Output_Name>,)* ( *, )?
(<Next_Output_Name>,)* <Last_Output_Name>'}
● *
The terminal character serves as a wildcard for all inputs/outputs that are
not specified in the display order. If the terminal character is missing, then
the missing inputs/outputs are appended at the end.
● ( ... )?
The contents of the parentheses are optional.
● ( ... )*
The contents of the parentheses are optional again and can therefore occur
not at all, one time, or several times.
● Insert location: First line in the declaration part of a function block.
This pragma is not evaluated when pragma {attribute
NOTICE
'pingroup' := '<Group_Name>'} is used.
Example
{attribute 'pin_presentation_order_inputs' :=
'input_2,*,input_1'}
{attribute 'pin_presentation_order_outputs' := 'output_2,
output_1'}
FUNCTION_BLOCK POU_BASE
VAR_INPUT
input_1 : BOOL;
input_2 : INT;
input_3 : INT;
input_4 : INT;
END_VAR
VAR_OUTPUT
output_1 : BOOL;
output_2 : INT;
output_3 : INT;
output_4 : BOOL;
END_VAR
FUNCTION_BLOCK PLC_PRG
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
pouBase_A: POU_BASE;
END_VAR
In the representation of function module instance pouBase_A, the pragmas
result in the following arrangement of input and output pins:
Reference, programming
See also
● ⮫ Chapter Attribute 'pingroup' on page 637
Attribute 'obsolete'
The effect of this pragma is that a defined warning is displayed for a data type
definition during compilation if the data type (structure, function block, etc.)
is used in the project. This enables you, for example, to draw attention to the
fact that a data type is no longer valid because, for example, an interface has
changed and this should also be implemented in the project.
In contrast to a message pragma this warning is defined centrally for all
instances of a data type.
Syntax:
{attribute 'obsolete' := 'user defined text'}
Insertion position: line of the data type definition or in a line above it.
Example
The pragma is inserted in the definition function block fb1:
{attribute 'obsolete' := 'datatype fb1 not valid!'}
FUNCTION_BLOCK fb1
VAR_INPUT
i:INT;
END_VAR
If you use fb1 as a data type, for example in fbinst:fb1, the following
warning will be displayed when compiling the project: "datatype fb1 not
valid".
See also
● ⮫ Chapter 32.6.2 Message Pragmas on page 596
Attribute 'pack_mode'
The pragma defines how a data structure is packed during the allocation. The
attribute has to be inserted above the data structure and affects the packing of
the entire structure.
Syntax:
{attribute 'pack_mode' := ' <pack mode value>' }
Insert location: above the declaration of the data structure
Example 1
Example
{attribute 'pack_mode' := '1'}
TYPE myStruct:
STRUCT
Enable: BOOL;
Counter: INT;
MaxSize: BOOL;
MaxSizeReached: BOOL;
Reference, programming
END_STRUCT
END_TYPE
The memory range for a variable of the data type myStruct is allocated
'aligned'. If the storage address of its component Enable is 0x0100, for
example, then the component Counter follows at the address 0x0101,
MaxSize at address 0x0103 and MaxSizeReached at address 0x0104. In the
case of 'pack_mode':=2, Counter would be at 0x0102, MaxSize at 0x0104
and MaxSizeReached at 0x0106.
Example 2
Example
STRUCT
Var1 : BOOL := 16#01;
Var2 : BYTE := 16#11;
Var3 : WORD := 16#22;
Var4 : BYTE := 16#44;
Var5 : DWORD := 16#88776655;
Var6 : BYTE := 16#99;
Var7 : BYTE := 16#AA;
Var8 : DWORD := 16#AA;
END_TYPE
pack_mode = 0 pack_mode = 1 pack_mode = 2 pack_mode = 4 pack_mode = 8
Variable Value Variable Value Variable Value Variable Value Variable Value
0 Var1 01 Var1 01 Var1 01 Var1 01 Var1 01
1 Var2 11 Var2 11 Var2 11 Var2 11 Var2 11
2 Var3 22 Var3 22 Var3 22 Var3 22 Var3 22
3 ... 00 ... 00 ... 00 ... 00 ... 00
4 Var4 44 Var4 44 Var4 44 Var4 44 Var4 44
5 Var5 55 Var5 55
6 ... 66 ... 66 Var5 55
7 ... 77 ... 77 ... 66
8 ... 88 ... 88 ... 77 Var5 55 Var5 55
9 Var6 99 Var6 99 ... 88 ... 66 ... 66
10 Var7 AA Var7 AA Var6 99 ... 77 ... 77
11 Var8 AA Var8 AA Var7 AA ... 88 ... 88
12 ... 00 ... 00 Var8 AA Var6 99 Var6 99
13 ... 00 ... 00 ... 00 Var7 AA Var7 AA
14 ... 00 ... 00 ... 00
15 ... 00
16 Var8 AA Var8 AA
17 ... 00 ... 00
18 ... 00 ... 00
19 ... 00 ... 00
20
21
22
23
24
25
26
27
28
29
30
31
Example 3
Example
STRUCT
Var1 : BYTE := 16#01;
Var2 : LWORD := 16#11;
Var3 : BYTE := 16#22;
Var4 : BYTE := 16#44;
Var5 : DWORD := 16#88776655;
Var6 : BYTE := 16#99;
Reference, programming
Var7 : BYTE := 16#AA;
Var8 : WORD := 16#AA;
END_TYPE
pack_mode = 0 pack_mode = 1 pack_mode = 2 pack_mode = 4 pack_mode = 8
Variable Value Variable Value Variable Value Variable Value Variable Value
0 Var1 01 Var1 01 Var1 01 Var1 01 Var1 01
1 Var2 11 Var2 11
2 ... 00 ... 00 Var2 11
3 ... 00 ... 00 ... 00
4 ... 00 ... 00 ... 00 Var2 11
5 ... 00 ... 00 ... 00 ... 00
6 ... 00 ... 00 ... 00 ... 00
7 ... 00 ... 00 ... 00 ... 00
8 ... 00 ... 00 ... 00 ... 00 Var2 11
9 Var3 22 Var3 22 ... 00 ... 00 ... 00
10 Var4 44 Var4 44 Var3 22 ... 00 ... 00
11 Var5 55 Var5 55 Var4 44 ... 00 ... 00
12 ... 66 ... 66 Var5 55 Var3 22 ... 00
13 ... 77 ... 77 ... 66 Var4 44 ... 00
14 ... 88 ... 88 ... 77 ... 00
15 Var6 99 Var6 99 ... 88 ... 00
16 Var7 AA Var7 AA Var6 99 Var5 55 Var3 22
17 Var8 AA Var8 AA Var7 AA ... 66 Var4 44
18 ... 00 ... 00 Var8 AA ... 77
19 ... 00 ... 88
20 Var6 99 Var5 55
21 Var7 AA ... 66
22 Var8 AA ... 77
23 ... 00 ... 88
24 Var6 99
25 Var7 AA
26 Var8 AA
27 ... 00
28
29
30
31
Example
{attribute 'pack_mode':=1}
TYPE DUT
STRUCT
by1 : BYTE;
dw1 : DWORD;
END_STRUCT
END_TYPE
On an ARM platform, the value dw1 cannot be read with a single access. When
an attempt is made to access this element directly, the ARM processor will
throw an exception.
Assumption: The following read access is performed: dwTest := dut1.dw1;
For this access to the DWORD dw1, four memory accesses are required
because each byte is read, shifted, and disjuncted individually. The flow is
somewhat the same as in the following example in which a DWORD is generated
from an array of four bytes:
dwHelp := bytes[0];
dwResult := dwHelp;
dwHelp := bytes[1];
dwHelp := SHL(dwHelp, 8);
dwResult := dwResult OR dwHelp;
dwHelp := bytes[2];
dwHelp := SHL(dwHelp, 16);
dwResult := dwResult OR dwHelp;
dwHelp := bytes[3];
dwHelp := SHL(dwHelp, 24);
dwResult := dwResult OR dwHelp;
Obviously, this kind of access is much slower than access to a DWORD, which is
aligned appropriately in the memory.
pdw := ADR(dut1.dw1);
dwTest := pdw^;
However, the compiler will not generate the access of the example when this
kind of member is accessed by means of a pointer. This means that the fol-
lowing code results in an exception on an ARM platform.
pdw := ADR(dut1.dw1);
dwTest := pdw^;
For performance reasons, you should therefore avoid working with structures
which are not naturally aligned.
A packed structure must not contain an unpacked structure.
Attribute 'ProcessValue'
With the 'ProcessValue' attribute, you mark a component of a structure. In
the CFC editor, you can then use the command “Use attributed member as
input” in order to connect this structure to an input of scalar type.
Syntax:
{attribute 'ProcessValue'}
Reference, programming
Insert location: Line above the affected structure variable.
Example
TYPE QINT :
STRUCT
Status : STRING;
{attribute 'ProcessValue'}
Value1 : INT;
Value2 : INT;
END_STRUCT
END_TYPE
See also
● ⮫ Chapter Command 'Use Attributed Member as Input' on page 996
Attribute 'qualified_only'
The effect of this pragma is that variables of a global variable list are only
addressed by specifying the global variable name, for example gvl.g_var. This
also applies to variables of the type Enumeration and can be helpful in avoiding
being mistaken for local variables.
Syntax:
{attribute 'qualified_only'}
Insertion position: line above VAR_GLOBAL in a GVL
Example
Global Variable List “GVL”:
{attribute 'qualified_only'}
VAR_GLOBAL
iVar:INT;
END_VAR
Within a POU, for example “PLC_PRG”, the global variable iVar can only be
addressed using the prefix GVL:
GVL.iVar:=5;
Conversely, the following incomplete call of the variable will create an error:
iVar:=5;
Attribute 'reflection'
The pragma is used to identify POUs in which some variables require spe-
cial treatment and are tagged with a specific attribute for this purpose. Cur-
rently, this applies to the attributes 'instance-path' and 'is-connected'
for function block variables. The compiler searches only blocks marked with
'reflection' for variables with these attributes and therefore needs less
time.
Syntax:
{attribute 'reflection'}
For examples, see the description of the attributes 'instance-path' and 'is-
connected'.
See also
● ⮫ Chapter Attribute 'instance-path' on page 625
● ⮫ Chapter Attribute 'is_connected' on page 627
Attribute 'subsequent'
The pragma is used to allocate consecutive variables in memory. When the list
changes, the entire variable list is allocated to a new memory area. This pragma
is used in programs and global variable lists.
Syntax:
{attribute 'subsequent'}
VAR_TEMP in a program with attribute 'subsequent'
NOTICE
leads to a compiler error.
When a variable in the list is qualified with RETAIN, all variables of the declara-
tion part are stored in the memory area for RETAIN.
Attribute 'symbol'
The pragma {attribute 'symbol'} defines which variables of a program or a
global variable list are to be adopted into the symbol configuration. This means
that the variables are exported as symbols to a symbol list. This symbol list is
then available for external access both as an XML file in the project directory
and as a file that is invisible to the user on the target system. For example,
the symbol list is then available for access by an OPC server. The variables
thus equipped with a symbol are loaded by PLC Engineering to the controller,
even if they are not explicitly configured or visible in the editor of the symbol
configuration.
In any case, however, an object “Symbol configuration” must be created below
the application concerned in the device tree.
Syntax:
{attribute 'symbol' := '<access possibilities>'}
<access possibilities>: none, read, write, readwrite. The default value
readwrite applies if no parameter is specified.
Insertion position:
● in order to affect only an individual variable, you must place the pragma in
the line before the variable declaration.
● In order to be effective for all variables in the declaration part of a program,
you must place the pragma in the first line of the declaration editor. In this
case, too, you can still set instructions for individual variables explicitly in
the respective line.
Example
With the following configuration the variables A and B are exported with read
and write permission. Variable D is exported with read permission.
{attribute 'symbol' := 'readwrite'}
PROGRAM PLC_PRG
VAR
A : INT;
B : INT;
{attribute 'symbol' := 'none'}
C : INT;
Reference, programming
{attribute 'symbol' := 'read'}
D : INT;
END_VAR
See also
● ⮫ Chapter 18.6 Using pragmas on page 134
● ⮫ Chapter 19.2 Symbol Configuration on page 229
Attribute 'to_string'
The pragma affects how the result of converting an enumeration component
with the TO_STRING operator is output. If the enumeration declaration has the
pragma, then the name of the enumeration component appears as a string
instead of the numeric value.
Syntax:
{attribute 'to_string'}
Insert location: First line above the declaration part of the enumeration.
Example
Declaration of the enumeration color:
{attribute 'to_string'}
TYPE color :
(
red := 0,
blue := 1,
green := 2
);
END_TYPE
Conversion with TO_STRING:
PROGRAM PLC_PRG
VAR
i_color: Color;
s_show_color: STRING;
END_VAR
i_color := 1;
s_show_color := TO_STRING(i_color);
In this case, str_show_color gets the value 'blue' instead of '1' as the
conversion result.
See also
● ⮫ Chapter 32.5.21 Enumerations on page 586
Syntax:
{warning disable <compiler ID>}
{warning restore <compiler ID>}
<compiler ID>: ID located at the beginning of an error or a warning message.
Example
Compiler message:
typify code ...
C0196: Implicit conversion from unsigned Type 'UINT' to
signed Type 'INT' : possible change of sign
Compile complete -- 0 errors
Applying the pragma to a variable declaration:
VAR
{warning disable C0195}
test1 : UINT := -1;
{warning restore C0195}
test2 : UINT := -1;
END_VAR
test1 does not generate an error message, test2 generates an error mes-
sage.
Reference, programming
the marked variables are visible er
{attribute
despite the pragma. Attribut
'conditionalshow_all_locals
e 'con-
'}
ditional-
show_al
l_locals'
on page 610
{attribute Replaced constants are not avail- ⮫ Chapt
'const_replaced'} able in the symbol configuration er
{attribute editor and therefore cannot be Attribut
'const_non_replaced'} exported. e
A constant being replaced 'const_r
depends on whether or not epla-
the “Replace constants” compiler ced',
option has been selected for all Attribut
constants and whether or not e
pragmas overwrite the compiler 'const_n
option for individual constants. on_repl
aced'
on page 612
{attribute 'dataflow'} None
{attribute 'displaymode':= None
<displaymode> }
{attribute None
'enable_dynamic_creation'}
{attribute 'estimated- None
stack-usage' := '
<estimated stack size in
bytes> '}
{attribute 'ExpandFully'} None
{attribute None
'global_init_slot' :=
'<slot>'}
{attribute 'hide'} Variables are hidden and therefore ⮫ Chapt
cannot be exported. er
Attribut
e 'hide'
on page 620
{attribute Variables are hidden and therefore ⮫ Chapt
'hide_all_locals'} cannot be exported. er
Attribut
e
'hide_all
_locals'
on page 622
{attribute None
'io_function_block'}
{attribute
'io_function_block_mapping'
}
{attribute None
'is_connected' := ' <input
variable> '}
{attribute 'linkalways'} POUs and library POUs are inte- ⮫ Chapt
grated in the compile list and er
therefore cannot be exported. Attribut
e 'linkal-
ways'
on page 628
{attribute 'monitoring' := Properties PROPERTY or functions ⮫ Chapt
'variable'} (FUNCTION) are provided as sym- er
{attribute 'monitoring' := bols. Attribut
'call'} e 'moni-
toring'
on page 629
{'no_assign' } None
{'no_assign_warning' }
{attribute 'no_check'} None
{attribute 'no_copy'} None
{attribute 'no-exit'} None
{attribute 'no_init'} None
{attribute 'no-init'}
{attribute 'noinit'}
{attribute None
'no_instance_in_retain'}
{attribute None
'no_virtual_actions'}
{attribute 'pingroup' := ' None
<group name> '}
Reference, programming
name> )* }
{attribute 'obsolete' := None
'user defined text'}
{attribute 'pack_mode' := ' Can lead to intentional memory ⮫ Chapt
<pack mode value> '} misalignment er
33.2.25
"Symbo
l config-
uration”
object
on page 788
{attribute 'ProcessValue'} None
{attribute None
'qualified_only'}
See also
● ⮫ Chapter 19.2 Symbol Configuration on page 229
● ⮫ Chapter 33.2.25 "Symbol configuration” object on page 788
32.7 Identifier
Rules for identifier specification
Rules for identifiers of variables
● An identifier may not contain any spaces or special characters.
● Capitalization is ignored. For example, VAR1 and var1 refer to the same
variable.
● The underscore is recognized. For example, A_BCD and AB_CD are treated
as two different identifiers. Multiple consecutive underscores are not per-
mitted.
● The length of an identifier is unlimited.
Rules for multiple use of identifiers (namespaces)
● An identifier must not be declared two times locally.
● An identifier can be used more than one time globally. If a local variable has
the same name as a global variable, the local variable has priority within the
POU.
● An identifier must not be identical to a keyword, such as the VAR_Global
scope.
● A variable declared in a global variable list can have the same name as
a variable defined in another GVL. PLC Engineering provides the following
standard-extending functionalities regarding the namespace or scope of vari-
ables:
– Global namespace operator:
An instance path that begins with a dot always opens a global name-
space. If there is a local variable (e.g. ivar) that has the same name as a
global variable, address the global variable with .ivar.
– The name of a Global Variable List can define the namespace uniquely
for the included variables. Thus, variables with the same name can be
declared in different Global Variable lists, but still be uniquely addressed
by preceding the list name.
For example, globlist1.ivar := globlist2.ivar; (* ivar from
GVL globlist2 is copied to ivar in GVL globlist1 *)
– Variables that are defined in the global variable list of a library included
in the project can be addressed uniquely according to the following
syntax:
<name scope library>.< GVL name>.<variable name>
For example, globlist1.ivar := lib1.globlist1.ivar (* ivar
from GVL globlist1 in library lib1 is copied to ivar in GVL
globlist1 *)
● When inserting a library using the library manager, a namespace is also
defined. This allows you to uniquely address a library function block
or a library variable via <Namenspace library>.<Fuction block name|
Variable name> Note that when libraries are nested, the namespaces of all
libraries involved, have to be specified successively.
Example: If Lib1 is referenced by Lib0, the block func contained in
Lib1 is addressed via Lib0.Lib 1.fun: ivar := Lib0.Lib1.fun(4, 5);
(* return value of func is copied to variable ivar in the
project *)
We recommend to apply the following rules in addition to the items considered
specifically for the variables declaration. Thereby, the name specification is
standardized the best possible.
Reference, programming
LWORD lw Bit string; not for arithmetic operations
POINTER p
ARRAY a
Enumeration e
Example
VAR
bySubIndix: BYTE;
xFlag: BOOL;
udiCounter: UDINT;
END_VAR
Reference, programming
ment directly after the
colon. END_STRUCT
END_TYPE
Enumerations Library prefix followed TYPE CAL_Day :
by an underscore and (
the identifier in upper-
ᅠCAL_MONDAY,
case letters.
ᅠCAL_TUESDAY,
Please note: In past PLC
Engineering versions, ᅠCAL_WEDNESDAY,
enumeration values > ᅠCAL_THURSDAY,
16#7FFF caused errors
ᅠCAL_FRIDAY,
because they were not
automatically converted ᅠCAL_SATURDAY,
to INT. For this reason, ᅠCAL_SUNDAY
enumerations should );
always be declared with
Declaration:
correct INT values.
eToday: CAL_Day;
Recommendations for identifiers for user-defined data types (DUT) in PLC Engineering V3 libraries
Identifier for Description Example
DUT names in PLC Engi- The namespace Library with namespace CAL
neering V3 libraries replaces the function TYPE DAY :
of the library prefix.
(
Therefore, it is omitted.
Enumeration values are ᅠMONDAY
also defined without a ᅠTUESDAY,
library prefix. ᅠWEDNESDAY,
ᅠTHURSDAY,
ᅠFRIDAY,
ᅠSATURDAY,
ᅠSUNDAY
);
Declaration:
eToday: CAL.Day;
Use in the application
IF eToday = CAL.Day.MONDAY THEN
Recommendations for identifiers for POUs Functions, function blocks and programs
Identifier for Description Example
POUs: Func- Library prefix followed by an underscore FUNCTION_BLOCK CAN_SendTelegram
tions, func- and a short, informative POU name. As (* prefix: canst *)
tion blocks for variables, the first letter of each word
and pro- should be in uppercase letters, all others,
grams in lowercase letters. It is recommended to
use a combination of a verb and a noun in
the POU name.
For function blocks, the respective prefix
for created instances should follow the
name as a comment.
Actions Only actions called by the function block
beginning with prv_. Otherwise, actions
do not contain prefixes
Also refer to
● ⮫ Chapter 18.16 Declaring variables on page 160
● ⮫ Chapter 32.5 Data types on page 555
● ⮫ Chapter 32.2 Variables on page 438
Negative example
In the following code section, a local function block instance has the same
name as a function. In such a case as this, it is unclear whether the instance or
the function is called in the program.
Example
FUNCTION YYY : INT
;
END_FUNCTION
FUNCTION_BLOCK XXX
;
END_FUNCTION_BLOCK
PROGRAM PLC_PRG
Reference, programming
VAR
YYY : XXX;
END_VAR
YYY();
END_PROGRAM
Avoiding shadowing
To make sure that names are always unique, you should follow naming conven-
tions, such as certain prefixes for variables. Rules for assigning identifiers can
be found in the "Identifiers" chapter of the help.
Naming conventions can be checked automatically using the static code anal-
ysis of PLC Engineering. Static code analysis could also detect the duplicate
use of the name YYY and report it as an error.
The consistent use of the attribute qualified_only for enumerations and
global variable lists and the use of qualified libraries can also prevent ambig-
uous situations.
To ensure that when a programming function block of the “POUs” view is
called, a programming block of the same name of the “Devices” view is
not called, the operator __POOL should be prefixed to the name of the
programming function block when it is called, for example svar_pou :=
__POOL.POU();
2. Global variables
● Global variables in the application if the qualified_only attribute is not
set in the variable list in which the global variables are declared.
● Global variables in a parent application if the qualified_only attribute is
not set in the variable list in which the global variables are declared.
● Global variables in referenced libraries when neither the library nor the
variable list requires qualified access.
3. Function blocks or type names
● POU or type names of the application (i.e. Names of global variable lists,
function blocks, etc.).
● Function block or type names from a parent application.
● Function block or type names from a library.
4. Libraries
● Namespaces of locally referred libraries and libraries that are published by
libraries.
5. View POUs
● Global variables in the “POUs” view, unless the qualified_only attribute is
not set in the variable list in which they are declared.
● POU or type names of the “POUs” view (i.e. Names of global variable lists,
function blocks, etc.).
● Libraries from POUs.
Libraries that are inserted in the Library Manager of the “POUs” view are mir-
rored in the Library Manager in all applications in the project with the appro-
priate placeholder resolution. These libraries then form a common namespace
with the libraries in the application. Therefore, there is no shadowing of libra-
ries in the pool by libraries in the application.
This kind of ambiguous use can be made unique by means of qualified access,
for example by accessing via the name of the global variable list (example:
GVL.XXX).
Qualified access can also always be used to avoid shadowing rules.
● The name of the global variable list can be used to uniquely access a vari-
able in the list.
● The name of a library can be used to uniquely access elements in the library.
● The THIS pointer be used to uniquely access variables in a function block,
even if a local variable with the same name exists in a method of the func-
tion block.
Reference, programming
To find the declaration location of an identifier at any time, use the command
“Edit 🠂 Browse 🠂 Go to Definition”. This can be especially helpful if the com-
piler produces an apparently obscure error message.
Also refer to
● ⮫ Chapter 32.7 Identifier on page 651
● ⮫ Chapter Attribute 'qualified_only' on page 645
● ⮫ Chapter 32.2.16 THIS on page 451
● ⮫ Chapter 32.3.87 Operator '__POOL' on page 539
32.9 Keywords
In all editors, you must capitalize keywords that for example denote scopes,
data types, or operators.
Keywords cannot be used as variable names.
Examples
VAR
END_VAR
BOOL_TO_INT
IF
THEN
ELSE
LTIME
MUL
XOR
PERSISTENT
PROGRAM
PLC Engineering checks the correct use of keywords automatically and high-
lights errors immediately during input with a wavy underline.
When PLC Engineering creates implicit code, variables and functions are gen-
erally given a name that is prepended with two underscores (__). The use of
double underscores in the implementation code is prevented automatically.
This eliminates conflicts between internal system identifiers and identifiers
assigned by the programmer.
The following keywords are used in the PLC Engineering export format. There-
fore, you may not use them as identifiers:
● ACTION
● END_ACTION
● END_FUNCTION
● END_FUNCTION_BLOCK
● END_PROGRAM
Other valid keywords:
● VAR_ACCESS
● READ_ONLY
● READ_WRITE
● PARAMS
32.10 Methods
32.10.1 Methods 'FB_Init', 'FB_Reinit', and 'FB_Exit'
You can declare the methods explicitly in order to influence the initialization of
function block variables, as well as the behavior when exiting function blocks.
The type of the return value for the implicit methods is BOOL. The value is not
evaluated by the system, but the type should not be changed.
FB_Init is always available implicitly and it is used primarily for initialization.
For a specific influence, you can also declare the methods explicitly and pro-
vide additional code there with the standard initialization code.
FB_Reinit must be implemented explicitly. If this method exists, then it is
called after the instance of the affected function block is copied. That happens
during an online change after changes to the function block declaration (signa-
ture change) in order to reinitialize the new instance module. To reinitialize the
basic implementation of the function block, you must call FB_Reinit explicitly.
FB_Exit must be implemented explicitly. If there is an implementation, then
the method is called before the controller removes the code of the function
block instance (implicit call).
The following shows some use cases of these methods for different operating
conditions.
Reference, programming
this operating condition clearly. (See "Operating condition "Online Change""
and "Operating condition "Re-download"".)
Example
T1 : TON := (PT:=t#500ms);
These kinds of assignments are executed only after calling FB_Init. In order
to control the effects of these assignments, you can provide a function block
or a method of a function block with the {attribute ‘call_after_init‘}
attribute. You must add the attribute above the declaration part of the
function block body and above the declaration part of the corresponding
method. A POU that extends another POU which uses the {attribute
'call_after_init'} attribute must also have the attribute. For the benefit
of clarity, we recommend that the corresponding methods are overwritten with
the same name, the same signature, and the same attribute. This requires
calling SUPER^.MyInit. The name of the method can be chosen without
restriction. (Exceptions: FB_Init, FB_Reinit, and FB_Exit). The method is
called after processing the initial assignments and before starting the applica-
tion tasks. Therefore, the method can react to user input.
When using FB_Init or {attribute 'call_after_init'}, remember that
detecting errors in the FB_Init method or in methods decorated with the
{attribute 'call_after_init'} attribute is tedious, because the setting of
breakpoints may not have the expected effect.
Reference, programming
Interface of method FB_Init
METHOD FB_Init : BOOL
VAR_INPUT
bInitRetains : BOOL; // TRUE: the retain variables are
initialized (reset warm / reset cold)
bInCopyCode : BOOL; // TRUE: the instance will be copied to
the copy code afterward (online change)
END_VAR
You can declare additional function block inputs in an FB_init method. Then
you have to set these inputs in the declaration of the function block instance.
Example
Method FB_Init for the serialdevice function block
com1: serialdevice(iCOMnum:=1);
com0: serialdevice(iCOMnum:=0);
Example
The function blocks MainFB, SubFB, and SubSubFB are derived from each
other. Therefore, SubFB EXTENDS MainFB and SubSubFB EXTENDS SubFB
apply.
Calling order of methods FB_Exit and FB_Init:
1. fbSubSubFb.FB_Exit(...);
2. fbSubFb.FB_Exit(...);
3. fbMainFb.FB_Exit(...);
4. fbMainFb.FB_Init(...);
5. fbSubFb.FB_Init(...);
6. fbSubSubFb.FB_Init(...);
See also
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Attribute 'call_after_init' on page 606
● ⮫ Chapter Attribute 'no_copy' on page 634
● ⮫ Chapter 32.2.15 SUPER on page 450
Reference, programming
32.11.33Compiler Error C0044 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
32.11.34Compiler error C0045 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
32.11.35Compiler Error C0046 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
32.11.36Compiler Error C0047 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
32.11.37Compiler Error C0048 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
32.11.38Compiler Error C0049 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
32.11.39Compiler Error C0050 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
32.11.40Compiler Error C0051 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
32.11.41Compiler Error C0053 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
32.11.42Compiler Error C0061 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
32.11.43Compiler Error C0062 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
32.11.44Compiler Error C0064 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
32.11.45Compiler Error C0065 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
32.11.46Compiler Error C0066 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
32.11.47Compiler Error C0068 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
32.11.48Compiler Error C0069 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
32.11.49Compiler Error C0070 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
32.11.50Compiler Error C0072 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
32.11.51Compiler Error C0074 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
32.11.52Compiler Error C0075 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
32.11.53Compiler Error C0076 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
32.11.54Compiler Error C0077 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
32.11.55Compiler Error C0078 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
32.11.56Compiler Error C0080 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
32.11.57Compiler Error C0081 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
32.11.58Compiler Error C0082 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
32.11.59Compiler Error C0084 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
32.11.60Compiler Error C0085 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
32.11.61Compiler Error C0086 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
32.11.62Compiler Error C0087 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
32.11.63Compiler Error C0089 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
32.11.64Compiler Error C0090 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
32.11.65Compiler Error C0091 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
32.11.66Compiler Error C0094 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
32.11.67Compiler Error C0096 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
32.11.68Compiler Error C0097 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
32.11.69Compiler Error C0098 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
32.11.10
9 Compiler Error C0178 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
32.11.11
0 Compiler Error C0179 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
32.11.11
1 Compiler Error C0180 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
32.11.11
2 Compiler Error C0182 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
32.11.11
3 Compiler Error C0183 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
Reference, programming
32.11.11
4 Compiler Error C0185 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
32.11.11
5 Compiler Error C0186 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
32.11.11
6 Compiler Error C0188 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
32.11.11
7 Compiler Error C0189 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
32.11.11
8 Compiler Error C0190 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
32.11.11
9 Compiler Error C0191 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
32.11.12
0 Compiler Error C0195 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
32.11.12
1 Compiler Error C0196 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
32.11.12
2 Compiler Error C0197 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
32.11.12
3 Compiler Error C0198 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
32.11.12
4 Compiler Error C0199 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
32.11.12
5 Compiler Error C0201 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
32.11.12
6 Compiler Error C0203 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
32.11.12
7 Compiler Error C0204 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
32.11.12
8 Compiler Error C0205 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
32.11.12
9 Compiler Error C0206 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
32.11.13
0 Compiler Error C0207 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
32.11.13
1 Compiler Error C0208 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
32.11.13
2 Compiler Error C0209 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
32.11.13
3 Compiler Error C0211 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
32.11.13
4 Compiler Error C0212 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
32.11.13
5 Compiler Error C0215 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
32.11.13
6 Compiler Error C0216 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
32.11.13
7 Compiler Error C0217 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
32.11.13
8 Compiler Error C0218 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
32.11.13
9 Compiler Error C0219 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
32.11.14
0 Compiler Error C0221 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
32.11.14
1 Compiler Error C0222 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
32.11.14
2 Compiler Error C0224 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
32.11.14
3 Compiler Error C0225 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
32.11.14
4 Compiler Error C0227 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
32.11.14
5 Compiler Error C0228 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
32.11.14
6 Compiler Error C0230 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
32.11.14
7 Compiler Error C0232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
32.11.14
8 Compiler Error C0233 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
32.11.14
9 Compiler Error C0234 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
32.11.15
0 Compiler Error C0235 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
32.11.15
1 Compiler Error C0236 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
32.11.15
2 Compiler Error C0237 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
32.11.15
3 Compiler Error C0238 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
32.11.15
4 Compiler Error C0239 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
32.11.15
5 Compiler Error C0240 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
32.11.15
6 Compiler Error C0241 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
32.11.15
7 Compiler Error C0242 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
32.11.15
8 Compiler Error C0243 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
32.11.15
9 Compiler Error C0380 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
32.11.16
0 Compiler Error C0509 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
32.11.16
1 Compiler Error C0511 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
32.11.16
2 Compiler Error C0542 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
32.11.16
3 Compiler Error C0543 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
Reference, programming
constant is too large for each possible data type.
Error correction: Use smaller constants or an appropriate data type for a typed
constant.
test1 := 12345678912345566991923939292939911;
test2 := INT#123456;
test3 := 10E500;
test2: BOOL;
END_VAR
test1 := test2.17;
PROGRAM PLC_PRG
VAR
test1 : DUT;
test2 : INT;
END_VAR
test2 := test1.z;
X := %QB5555555555;
IF bTest
x := 9;
END_IF
Reference, programming
--> C0006: 'THEN' expected instead of 'x'
IF THEN
x := 9;
END_IF
IF bTest THEN
x := 9;
END_FOR;
FOR i := 0 TO 2 DO
;
CASE i OF
x := 9;
END_CASE
Reference, programming
END_VAR
IF bTest THEN
END_IF
FOR i TO 10 DO
;
END_FOR
j: INT := 0;
END_VAR
j := i;
x = 2;
pt := ADR(i,1);
i := MUX(30,40);
Reference, programming
Example:
i := MUX(30,40,50);
test1 := test2;
Reference, programming
PROGRAM PLC_PRG
VAR
ptr : POINTER TO INT;
dw : DWORD;
END_VAR
dw := ptr;
PLC_PRG.METH1();
METHOD METH
VAR_INPUT
END_VAR
Error correction:
Example:
VAR_OUTPUT
iVar : INT;
END_VAR
Reference, programming
requires an IN_OUT variable.
Error correction: Assign the IN_OUT variable.
FUNCTION_BLOCK FB
VAR_IN_OUT
inout : INT;
END_VAR
Error correction:
Example:
i := Test(1);
Reference, programming
i : INT;
END_VAR
i := Test(iPar2 := 2, 5);
FUNCTION_BLOCK FB
VAR_INPUT
END_VAR
Error correction:
Example:
VAR_INPUT
in : INT;
END_VAR
THIS^.test1 := 19;
END_VAR
i := 1;
Reference, programming
Message: Array requires exactly '<number>' indexes
Possible error cause: Too many or too few indexes are specified when using an
array.
Error correction: Specify as many indexes as there are dimensions assigned to
the array.
--> C0049: The constant index '3' is not within the range from
'1' to '2'
Error correction:
Example:
arr1[2] := 1;
i.x := FALSE;
Test().2;
Reference, programming
END_VAR
i.x := 1024;
TYPE Punkt :
STRUCT
x : REAL;
y : REAL;
END_STRUCT
END_TYPE
pi : POINTER TO INT;
END_VAR
i^:=1;
b := i > str;
Reference, programming
VAR
b : BOOL;
arr1 : ARRAY [1..2] OF INT;
arr2 : ARRAY [1..2] OF INT;
END_VAR
inst : FB;
END_VAR
b := INI(b, TRUE);
FUNCTION_BLOCK FB
VAR
END_VAR
str := ABS(str);
Error correction:
Example:
arr1 : ARRAY [1..6] OF INT := [1,2,3,4,5,6];
Reference, programming
Example of the error:
PROGRAM PLC_PRG
VAR
arr1 : ARRAY [1..5] OF INT := [1,2,3,4,5,6];
END_VAR
FB();
FUNCTION_BLOCK FB
VAR
END_VAR
Error correction:
Example:
VAR
inst : FB;
END_VAR
inst();
Reference, programming
Error correction: Complete the IF condition of the pragma.
i := 5;
{END_IF}
{IF abc}
i := 5;
{END_IF}
{IF defined(0)}
{END_IF}
FUNCTION_BLOCK FB IMPLEMENTS XY
VAR
END_VAR
Reference, programming
interface '<interface name>'.
Possible error cause: One of the methods specified by the interface has not be
provided by the implemented function block.
Error correction: Implement all methods that are specified by the interface.
INTERFACE XY
METHOD METH1
VAR_INPUT
END_VAR
FUNCTION_BLOCK FB IMPLEMENTS XY
VAR
END_VAR
METHOD METH2
VAR_INPUT
END_VAR
INTERFACE XY
METHOD METH1
VAR_INPUT
iPar : INT;
END_VAR
FUNCTION_BLOCK FB IMPLEMENTS XY
VAR
END_VAR
METHOD METH1
VAR_INPUT
END_VAR
FUNCTION POU
VAR
END_VAR
FUNCTION_BLOCK FB EXTENDS FB
VAR
END_VAR
Reference, programming
PROGRAM PLC_PRG
VAR
xyz : XY2;
END_VAR
FUNCTION_BLOCK XY
METHOD METH1
VAR_INPUT
END_VAR
FUNCTION_BLOCK FB2
VAR
END_VAR
FUNCTION_BLOCK FB3
VAR
END_VAR
FUNCTION_BLOCK FB2
VAR
i : INT;
END_VAR
FUNCTIONBLOCK FB
VAR
END_VAR
Possible error cause: A local enumeration declaration was used together with a
compiler version that does not support this.
Error correction: Use a later compiler version, or define the enumeration in a
DUT.
Reference, programming
--> C0099: Local defined enumeration are no longer supported.
Use datatype definition instead.
FUNCTION_BLOCK FB1
VAR
inst1 : FB2;
END_VAR
FUNCTION_BLOCK FB2
VAR
inst2 : FB1;
END_VAR
Error correction: Use the “Clean” for fragmenting the memory. This will force
the reallocation of all data at the next build.
label:
Reference, programming
32.11.78 Compiler Error C0117
Message: No such label '<jump label>' within the scope of the 'JMP' statement
Possible error cause: A jump is made to a label that does not exist.
Error correction: Define the label that you specify as the destination.
--> C0117: No such label 'A' within the scope of the 'JMP'
statement
--> C0118: The label ' LABEL' has not been referenced
FUNCTION_BLOCK FB
METHOD FB_init
VAR_INPUT
END_VAR
FUNCTION_BLOCK FB
METHOD FB_exit
VAR_INPUT
END_VAR
SUPER^.METH(TRUE, TRUE);
Reference, programming
Error correction: Use only ANY_INT for enum initializations.
TYPE DUT :
(
enum_member := 1.5
) DWORD;
END_TYPE
TYPE DUT :
(
enum_member := 0,
enum_member2 := 0
);
END_TYPE
Possible error cause: Multiple indexes are assigned to a variable with one
index.
Error correction: Assign only one index.
pt := ADR(1);
Error correction:
Example:
pt := ADR(i);
Reference, programming
Example of the error:
PROGRAM PLC_PRG
VAR
END_VAR
EXIT
;
GVL1:
VAR_GLOBAL
g_i : INT;
END_VAR
GVL2:
VAR_GLOBAL
g_i : INT;
END_VAR
i;
--> C0139: The code 'i;' has no effect. Is this the intent?
I_r REF= i;
Reference, programming
Error correction:
Example:
I_r REF= i;
i := inst.Prop;
FUNCTION_BLOCK FB
VAR
END_VAR
TYPE DUT:
(
enum_member := 0
);
END_TYPE
POU();
INTERFACE ITF
VAR_INPUT
i : INT;
END_VAR
Reference, programming
--> C0149: Variable declarations are not allowed in interfaces
32.11.10
0 Compiler Error C0162
Message: Number <number of array values> of array initialisations is no con-
stant value
Possible error cause: The initialization [Wert1,AnzahlWert2(Wert2)] works
only with a constant for AnzahlWert2.
Error correction: Use constants only.
32.11.10
1 Compiler Error C0164
Message: POU <name> writes to output <name> and is called in several tasks.
Possible error cause: The device setting codegenerator\check-multiple-
task-output-write is set and multiple tasks access the same output.
Error correction: Do not call a program that changes outputs in multiple tasks.
PROGRAM PLC_PRG
VAR
Output AT %QB7 : BYTE
END_VAR
Output := 0;
32.11.10
2 Compiler Error C0165
Message: Variable '<variable name>‘, which is mapped on address
'<address>‘ is written in different tasks.
Possible error cause: The device setting codegenerator\check-multiple-
task-output-write is set and multiple tasks access the same output.
Error correction: Write an output in one fixed task only. If multiple tasks need
to calculate data for one output, then you should try to transfer this information
by means of global variables to one fixed task, which then writes the data to
one output.
Reference, programming
Example of the error:
PROGRAM PLC_PRG_1
VAR
Output AT %QB7 : BYTE;
END_VAR
Output := 0;
PROGRAM PLC_PRG_2
VAR
Output AT %QB7 : BYTE;
END_VAR
Output := 1;
32.11.10
3 Compiler Error C0168
Message: 'VAR_CONFIG' declaration only allowed in VAR_CONFIG - list
Possible error cause: 'VAR_CONFIG' is used outside of a VAR_CONFIG list.
Error correction: Use 'VAR_CONFIG' only in VAR_CONFIG lists.
32.11.10
4 Compiler Error C0169
Message: 'VAR_GLOBAL' declaration only allowed in Global variable list
Possible error cause: 'VAR_GLOBAL' is used outside of global variable lists.
Error correction: Use 'VAR_GLOBAL' in global variable lists only.
32.11.10
5 Compiler Error C0173
Message: '<keyword>' not allowed in this place
Possible error cause: A declaration keyword (example: VAR_INPUT,
VAR_OUTPUT, or VAR) is not allowed at this location.
Error correction: Correct the declaration: Inputs and outputs are not useful or
necessary in type definitions or global variable lists.
TYPE DUT :
STRUCT
member : INT;
END_STRUCT
END_TYPE
32.11.10
6 Compiler Error C0174
Message: 'VAR_TEMP' declaration not allowed in this place
Possible error cause: 'VAR_TEMP' is used outside of a program or function
block.
Error correction: Use 'VAR_TEMP' inside of programs and function blocks only.
FUN();
FUNCTION FUN
VAR_TEMP
END_VAR
32.11.10
7 Compiler Error C0175
Reference, programming
Message: 'RETAIN' or 'PERSISTENT' not allowed in this place
Possible error cause: 'RETAIN' or 'PERSISTENT' is used in a function.
Error correction: Use 'RETAIN' or 'PERSISTENT' at the intended locations.
POU_1();
FUNCTION POU_1
VAR RETAIN
END_VAR
32.11.10
8 Compiler Error C0177
Message: '<object>' is of type 'type' and cannot be instantiated
Possible error cause: An attempt is made to instantiate a function.
Error correction: Instantiate only objects that can be instantiated.
FUNCTION POU
VAR
END_VAR
32.11.10
9 Compiler Error C0178
Message: No external access to 'VAR_IN_OUT' parameter '<parameter name>' of
'<object name>'
FUNCTION_BLOCK FB
VAR_IN_OUT
in_out : INT;
END_VAR
32.11.11
0 Compiler Error C0179
Message: '<identifier>' is no output of 'Function block'
Possible error cause: The initialization of a function block instance must not
contain VAR_IN_OUT variables.
Error correction: Use VAR_IN_OUT variables in function block calls only. When
initializing a function block instance, only assign the inputs of a function block.
PROGRAM PLC_PRG
VAR
iValue : INT;
fb : MyFB := (inOut := iValue);
END_VAR
32.11.11
1 Compiler Error C0180
Message: Ambiguous namespace '<library 1>' defined by library '<library 2>'
Possible error cause: The namespace of the library <library 1> is not unique. It
is already used for <library 2>.
Error correction: Change the namespace of the library accordingly
(“Properties” button in the Library Manager).
32.11.11
2 Compiler Error C0182
Reference, programming
Message: Return type is only possible for POUs of Type FUNCTION and
METHOD
Possible error cause: An attempt is made to define a return value in a program.
Error correction: Define a return value only in methods and functions.
32.11.11
3 Compiler Error C0183
Message: Global scope operation '.' is not valid on expression '<expression>'
Possible error cause: The '.' operator is used to access a global variable. How-
ever, at this location it is not followed by a valid IEC identifier, but for example
a character such as ";" or a reserved identifier such as FUNCTION, or an oper-
ator such as TO_STRING.
Error correction: Use a valid IEC identifier for a global variable.
32.11.11
4 Compiler Error C0185
Message: It is not possible to perform component access '.', index access '[]' or
call '()' on result of function call. Assign result to help variable first.
Possible error cause: Component or index access to the result of a function call
is performed.
POU_1()[0].METH1();
INTERFACE ITF
METHOD METH1
32.11.11
5 Compiler Error C0186
Message: It is not possible to compare interface that is return value of call.
Assign to variable first.
Possible error cause: A comparison operation is applied to an interface that is
returned by a function.
Error correction: First assign the result of the function call to a variable and
then compare the value of the variable. This will also reduce the number of
function calls that are required.
PROGRAM PLC_PRG
IF GetInterface() <> 0 THEN
// ...
END_IF
32.11.11
6 Compiler Error C0188
Message: Device not installed to the system. No code generation possible.
Possible error cause: The desired device is not installed.
Reference, programming
Error correction: Install the missing device in the device repository, or replace
the existing device already inserted in the device tree with another existing
device (“Update Device”).
32.11.11
7 Compiler Error C0189
Message: ';' expected instead of '<token>'
Possible error cause: Syntax error
Error correction: Make sure that the syntax is correct.
32.11.11
8 Compiler Error C0190
Message: ';' expected instead of end of POU
Possible error cause: Syntax error in the POU
Error correction: Make sure that the syntax is correct.
32.11.11
9 Compiler Error C0191
Message: The operator 'INDEXOF' is no longer supported. Use ADR instead.
ADR on a POU-Name returns a Pointer to a Pointer to the function code.
Possible error cause: The outdated operator 'INDEXOF' is used.
Error correction: Use the operator 'ADR'.
32.11.12
0 Compiler Error C0195
Message: Implicit conversion from signed Type '<data type 1>' to unsigned Type
'<data type 2>' : possible change of sign
Possible error cause: A sign conflict may have been missed in the implicit
conversion.
Error correction: Convert only data types with the same sign implicitly.
b := i;
32.11.12
1 Compiler Error C0196
Message: Implicit conversion from unsigned Type '<data type 1>' to signed type
'<data type 2>' : possible change of sign
Possible error cause: A sign conflict may have been missed in the implicit
conversion.
Error correction: Use explicit conversions.
i := b;
32.11.12
2 Compiler Error C0197
Message: Implicit conversion from '<data type 1>' to '<data type 2>': possible
loss of information
Possible error cause: An attempt is made to convert a variable from data type
DINT or LINT to data type REAL.
Error correction: For DINT, use the data type LREAL, and when converting from
LINT to LREAL make sure that the value of LINT does not exceed the capacity of
LREAL.
Reference, programming
b := i;
32.11.12
3 Compiler Error C0198
Message: String constant '<string value>' too long for destination type '<data
type>'
Possible error cause: The string constant has too many characters.
Error correction: Use shorter string constants or declare larger strings.
32.11.12
4 Compiler Error C0199
Message: Interface '<interface name>' must be instantiated to be accessed
Possible error cause: An attempt is made to access an interface method
without the interface being instantiated.
Error correction: Instantiate the interface.
ITF.METH();
INTERFACE ITF
METHOD METH
VAR_INPUT
END_VAR
Error correction:
Example:
itest: ITF;
32.11.12
5 Compiler Error C0201
Message: Type '<data type 1>' is not equal to type '<data type 2>' of
VAR_IN_OUT 'Variable'
Possible error cause: The data type that is passed to the function as a
VAR_IN_OUT parameter does not match the data type defined in it.
Error correction: Pass a variable with the correct data type.
inst(in_out := b);
FUNCTION_BLOCK POU
VAR_IN_OUT
in_out : INT;
END_VAR
32.11.12
6 Compiler Error C0203
Message: Only Structures and Function Blocks can contain variables of type
BIT.
Possible error cause: An attempt is made to declare a variable of type BIT
outside of structures and function blocks.
Error correction: Declare variables of type BIT only in structures and function
blocks.
32.11.12
7 Compiler Error C0204
Message: Variables of type BIT must be declared within a VAR_INPUT-,
VAR_OUTPUT or VAR-block
Possible error cause: An attempt is made to define a variable of type BIT or as a
VAR_IN_OUT parameter.
Reference, programming
FUNCTION_BLOCK FB
VAR_IN_OUT
b : BIT;
END_VAR
32.11.12
8 Compiler Error C0205
Message: POINTER TO BIT is not allowed
Possible error cause: An attempt is made to declare a POINTER TO BIT.
Error correction: Do not declare POINTER TO BIT.
32.11.12
9 Compiler Error C0206
Message: BIT is not allowed as base type of an array
Possible error cause: An attempt is made to declare a BIT array.
Error correction: Do not declare BIT arrays.
32.11.13
0 Compiler Error C0207
Message: There is no system definition for '<identifier>'
Possible error cause: An attempt was made to access a variable in __SYSTEM
that does not exist.
Error correction: Check and correct the specified identifier of the respective
variable.
32.11.13
1 Compiler Error C0208
Message: 'MOD' is not defined for 'REAL'
Possible error cause: An attempt is made to perform a modulo operation with a
variable of type REAL.
Error correction: Modulo operations are only possible with variables of type
ANY_INT.
32.11.13
2 Compiler Error C0209
Message: You have defined '<number>' applications for device '<device name>'.
The maximum number is '<number>'. So you will not be able to download all
applications.
Possible error cause: Some devices only support a specific number of applica-
tions (device description). If a project contains more applications, then not all
will be downloaded to the device.
Error correction: Remove applications from your project or use another device.
32.11.13
3 Compiler Error C0211
Message: Variable declaration expected instead of <expression>
Possible error cause: Syntax error
Error correction: Make sure that the syntax is correct.
END_VAR
END_VAR
32.11.13
4 Compiler Error C0212
Message: VAR, VAR_INPUT, VAR_OUTPUT or VAR_INOUT expected instead of
<expression>
Possible error cause: Syntax error
Error correction: Make sure that the syntax is correct.
Reference, programming
i : INT;
32.11.13
5 Compiler Error C0215
Message: Direct address declaration is not possible in persistent list
Possible error cause: Persistent variables are not allowed to have a direct
address.
Error correction: Remove the direct address assignment in the persistent vari-
able list.
32.11.13
6 Compiler Error C0216
Message: Case label duplicate
Possible error cause: A CASE label is used multiple times.
Error correction: Use each CASE label only one time.
CASE i OF
1: i := i+1;
1: i := i+2;
ELSE
i := i+10;
END_CASE;
32.11.13
7 Compiler Error C0217
Message: Case label <case label> also contained in range <case range begin> ..
<case range end>
Possible error cause: A CASE label is part of the range of another CASE label.
Error correction: Make sure that there is no intersecting.
32.11.13
8 Compiler Error C0218
Message: Case label requires literal or symbolic integer constant
Possible error cause: An attempt is made to use a variable as a CASE label.
Error correction: Use only literals and symbolic integer constants.
CASE i OF
1: i := i+1;
a: i := i+2;
ELSE
i := i+10;
END_CASE;
32.11.13
9 Compiler Error C0219
Message: Case contains overlapping range <case range 1 begin> .. <case range
1 end> and <case range 2 begin> .. <case range 2 end>
Possible error cause: Two branches of CASE markers have the same elements
or subsets.
Error correction: Make sure that there is no intersecting.
Reference, programming
END_CASE;
32.11.14
0 Compiler Error C0221
Message: Direct Address '<address>' malformed
Possible error cause: An address is not displayed completely.
Error correction: Make sure that the address is displayed correctly.
32.11.14
1 Compiler Error C0222
Message: Outputs can't be of type 'REFERENCE TO'
Possible error cause: An attempt is made to define REFERNCE TO as an output
parameter.
Error correction: Do not use REFERENCE TO as an output parameter.
FUNCTION_BLOCK FB
VAR_OUTPUT
re : REFERENCE TO INT;
END_VAR
32.11.14
2 Compiler Error C0224
Message: Call Recursion: <recursion>
Possible error cause: A function calls itself.
Error correction: Make sure that functions are not recursive.
POU();
FUNCTION POU
VAR
END_VAR
POU();
32.11.14
3 Compiler Error C0225
Message: '<name>' is not an instance of '<name>'
Possible error cause: A function block in a graphical programming language
has been assigned with an explicitly specified type that does not match the
declared type.
Error correction: Replace the explicit type with the one used in the declaration
part, or remove the specification of the explicit type from the POU.
PROGRAM PLC_PRG
VAR
fbVar : MyFB;
END_VAR
or
32.11.14
4 Compiler Error C0227
Reference, programming
Message: Initialisation of constant variable <constant name> not constant
Possible error cause: A constant is initialized with a variable.
Error correction: Initialize constants only with constant values.
32.11.14
5 Compiler Error C0228
Message: No initial value for constant variable '<constant name>'
Possible error cause: A constant is not initialized.
Error correction: Initialize the constants.
32.11.14
6 Compiler Error C0230
Message: Type name '<data type>' not expected in this place
Possible error cause: The data type name of an enumeration is used at an
invalid position.
Error correction: Check whether the data type name is used correctly at this
location. Maybe there is a spelling error.
PROGRAM PLC_PRG
VAR
value : INT;
END_VAR
value := MyEnum;
MyEnum := value;
32.11.14
7 Compiler Error C0232
Message: Array initialisation expected
Possible error cause: An array of arrays is initialized, but the initialization values
are not nested.
Error correction: Use a nested array initialization as shown in the example
below.
32.11.14
8 Compiler Error C0233
Message: Initialisation list for {0} <data type> expected
Possible error cause: An array of the type of a structure is initialized with
elements that are not structure initializations or variables.
Error correction: As shown in the example below, use structure initializations or
existing variables to initialize arrays of structures.
Reference, programming
PROGRAM PLC_PRG
VAR
colorVariable : COLOR := (red:=0, green:=0, blue:=255);
value : ARRAY[0..2] OF COLOR := [
colorVariable,
(red:=255, green:=0, blue:=0),
(red:=0, green:=255, blue:=0)];
END_VAR
32.11.14
9 Compiler Error C0234
Message: First Operand of __QueryInterface must be an interface reference or
the instance of a function block
Possible error cause: Incorrect operands are passed to the operator
__QueryInterface.
Error correction: Pass an interface reference or the instance of a function
block.
__QueryInterface(a ,ITFref);
32.11.15
0 Compiler Error C0235
Message: Second Operand of __QueryInterface must be an interface reference
Possible error cause: Incorrect operands are passed to the operator
__QueryInterface.
Error correction: Pass an interface reference.
__QueryInterface(ITFref2, a);
32.11.15
1 Compiler Error C0236
Message: Wrong type definition for VAR_EXTERNAL <variable name>
Possible error cause: The variable is declared in VAR_GLOBAL / VAR_EXTERNAL
as different types.
Error correction: Use the same type definition in VAR_GLOBAL and
VAR_EXTERNAL.
VAR_GLOBAL
ig : INT;
END_VAR
32.11.15
2 Compiler Error C0237
Message: No global definition found for VAR_EXTERNAL '<variable name>'
Possible error cause: An attempt is made to declare a variable in
VAR_EXTERNAL which does not exist in VAR_GLOBAL.
Error correction: Make sure that the identifiers match.
VAR_GLOBAL
ig : INT;
END_VAR
32.11.15
3 Compiler Error C0238
Message: No initial value allowed for VAR_EXTERNAL <variable name>
Possible error cause: An attempt is made to initialize a variable in
VAR_EXTERNAL.
Reference, programming
Error correction: Do not initialize variables in VAR_EXTERNAL.
VAR_GLOBAL
ig : INT;
END_VAR
32.11.15
4 Compiler Error C0239
Message: Interface <interface name 1> does not extend <interface name 2>
Possible error cause: The used interface does not extend another interface.
Error correction: Extend the interface.
__QueryInterface(ITFref2,ITFref);
INTERFACE ITF
INTERFACE ITF2 EXTENDS ITF
32.11.15
5 Compiler Error C0240
Message: First Operand of __QueryPointer must be an interface reference or
the instance of a function block
__QueryPointer(a,pt);
32.11.15
6 Compiler Error C0241
Message: Second Operand of __QueryPointer must be pointer
Possible error cause: Incorrect operands are passed to the operator
__QueryPointer.
Error correction: Pass a pointer.
__QueryPointer(ITFref,b);
32.11.15
7 Compiler Error C0242
Message: Operand of __DELETE must be pointer
Possible error cause: An incorrect operand is passed to the operator __DELETE.
Error correction: Pass a pointer.
__DELETE(a);
Reference, programming
Error correction:
Example:
__DELETE (pt);
32.11.15
8 Compiler Error C0243
Message: The name used in the signature is not identical to the object name
Possible error cause: The object name differs from the name used in the code.
Error correction: make sure that the names are the same.
32.11.15
9 Compiler Error C0380
Message: The Operators LOWER_BOUND and UPPER_BOUND are only sup-
ported for arrays of variable length.
Possible error cause: One of the two operators LOWER_BOUND or
UPPER_BOUND is not used for an array of variable length.
Error correction: Use the operators LOWER_BOUND and UPPER_BOUND only
for an array of variable length.
For compiler version 3.5.14.0 and higher, the operators can also be used for
static arrays. As a result, the error C0380 occurs only in the case of earlier
compiler versions.
test2: DINT;
END_VAR
32.11.16
0 Compiler Error C0509
Message: Multiple assignments for operator '__New' not allowed
Possible error cause: In one line of code, the assignment operator ":=" is called
a multiple number of times with the __New operator.
Error correction: Program the memory allocation with the __New operator in
a separate line of code for each pointer that points to dynamically allocated
memory.
IF (xInit) THEN
pbBeta := pbAlpha := __NEW(BYTE); // Incorrect code for
memory allocation
END_IF
IF (xDelete) THEN
__DELETE(pbAlpha); // Frees memory of pointer
END_IF
PROGRAM PLC_PRG
VAR
pbAlpha : POINTER TO BYTE; // Pointer to Alpha
pbBeta: POINTER TO BYTE; // Pointer to Beta
xInit : BOOL := TRUE;
xDelete : BOOL;
END_VAR
IF (xInit) THEN
pbAlpha := __NEW(BYTE); // Allocates memory for Alpha
pbBeta := __NEW(BYTE); // Allocates memory for Beta
END_IF
IF (xDelete) THEN
__DELETE(pbAlpha); // Frees memory of pointer
END_IF
See also
● ⮫ Chapter 32.3.72 Operator '__NEW' on page 524
● ⮫ Chapter Attribute 'enable_dynamic_creation' on page 614
32.11.16
Reference, programming
1 Compiler Error C0511
Message: The function block '<function block name>' is ABSTRACT and cannot
be used as a target for an assignment.
Possible error cause: A value was assigned to an abstract function block. The
concrete function blocks may have different types and therefore cannot be
copied.
Error correction: In order to copy the data of the function block, concrete
function blocks have to be used.
refAbstract1 := refAbstract2;
--> C0511: The function block 'refAbstract1' is ABSTRACT and
cannot be used as a target for an assignment.
Error correction:
Use the reference assignment REF= to assign the reference refAbstract1 to
the same function block as refAbstract2.
32.11.16
2 Compiler Error C0542
Message: Inheritance is not intended for the data type "UNION" <data type
name>.
Possible error cause: A structured data type (DUT) is derived from a UNION by
extending with EXTENDS, or a UNION is derived from a DUT. This kind of deriva-
tion is not permitted. However, for reasons of compatibility only a warning is
issued.
uStringExt : U_StringExt;
END_VAR
32.11.16
3 Compiler Error C0543
Message: The name <keyword> is a reserved keyword in the IEC 1131-3
standard. An error will be issued in future versions.
Possible error cause: A reserved keyword was assigned as the name of a vari-
able.
Error correction: Rename the variable.
See also
● ⮫ Chapter 32.9 Keywords on page 659
33 User interface
33.1 Generic Device Editor
33.1.1 Tab “Communication”
The tab “Communication” is used to configure the communication settings to
the ctrlX device and provides the following functions:
● Scan the network for reachable ctrlX devices.
● Configuring network communication settings to the ctrlX device.
● Executing communication test.
● Displaying device information.
User interface
● Configuring the gateway settings (only for ctrlX PLC Engineering).
Call
The tab can be called as follows:
● By double-clicking on the control node in the device tree.
● Via the command “Communication settings...” in the context menu of the
control node, also refer to:
⮫ Command “Communication settings...”
Alternatively, execute the command from the “Project” menu if the control
node is selected in the device tree, also refer to:
⮫ Menu “Project”
Description
The tab is in ctrlX PLC Engineering and ctrlX I/O Engineering and consists of a
toolbar and an overview of the communication settings of the ctrlX device. For
ctrlX PLC Engineering, the gateway settings can be configured additionally.
Toolbar Description
“Scanning network...” The command scans the network for ctrlX devices and
lists accessible devices in a selection dialog.
“Device” Contains option settings of the ctrlX device:
Options:
● “Save communication settings to the project” (non-
deselectable)
● “Edit communication port” disabled in factory set-
ting)
If this option is enabled, the communication port
can be set in the configuration window.
Communication over- Description
view
Field to configure the PLC gateway.
“PLC gateway” GUI elements:
● Combobox to select the PLC gateway.
● Display of the configured IP address and port
number.
● Icon to display the communication state:
– : Communication OK
– : Communication not determined
– : Communication disturbed
● Device designation
● Vendor
● Device category
● Version
● Order number
● Description
● Device illustration
User interface
The “DataLayerNode I/O Mapping” tab maps the data and values of an I/O real
time device which can be transferred from the control to the Engineering PC
via the Data Layer. The displayed data may vary and depend on the respective
object node or the real time object type. All other functions in the tab corre-
spond to the following description, see:
⮫ Tab '<Device name> I/O mapping'
Call
By double-clicking on an I/O device below the “DataLayer_Realtime” object
node in the device tree.
User interface
If an I/O channel is not referenced in the application, its value is not refreshed.
To monitor non-referenced I/O channels, select the option "Always update vari-
ables" in the tab: Enabling PLC settings. Alternatively, also enable this option in
the “I/O mapping” tab of a device. Enabling is valid only for this one device and
its children.
Mapping 'too large' data types
NOTICE
If a variable of a data type that is larger than a byte is
mapped to a byte address, the value of the variable will
be truncated to byte size there. For the monitoring of the
variable value in the dialog “I/O mapping”, this means:
The value that the variable presently has in the project
is displayed in the root element of the address. The indi-
vidual present bit values of the byte are displayed in suc-
cession in the bit elements below that, but this may not
be sufficient for the entire variable value.
Example of the tab “<Device name> I/O mapping” for a CAN bus slave:
The tab contains a table for the editing of the I/O mapping. The information
displayed for the inputs and outputs originates from the device description.
“Find” (1) Input field for a character string to search for the mapping table. The
search results are marked in yellow.
“Filter” (2) Selection list with filters for the I/O assignments shown in the map-
ping table:
● “Show all”
● “Show only outputs”
● “Show only inputs”
● “Show only unmapped variables”
● “Show only mapped variables”
● “Show only mappings to existing variables”
● “Show only mappings to new variables”
“Add FB for I/O Channel” Depending on the device, available if the channel entry is selected
(11) in the mapping table. Opens the “Select Function Block” dialog for
selecting the function block that should be linked directly to the
channel.
“Go to Instance” (12) Available if the entry is selected in the mapping table. Jumps to the
corresponding entry in the tab “<Device name> IEC objects”.
“Variable” Depending on the device, the inputs and outputs of the device appear
as nodes and below them, indented, the associated channels or,
depending on the device, only the implicitly created device instance.
The symbol indicates the channel type:
: Input
: Output
A double-click on the cell opens an input field.
● Option 1: The variable already exists; enter complete path:
<Application name>.<Module name>.<Variable name>, example:
app1.plc_prg.ivar; input help via .
● Option 2: The variable does not exist yet; enter a simple name;
automatically created internally as a global variable.
Depending on the device, inputs or outputs can be linked directly to
a function block. In this case, the “Add FB for I/O Channel” button
can be clicked. See above.
“Mapping” (3) Mapping type:
● : Already existing variable
● : New variable
● : Mapping on the function block instance
“Channel” (4) Symbolic channel name.
“Address” (5) Address of the channel, e.g. %IW0.
Struck-through address: Indicates not to assign any further variables
to this address. Reason: Although the variable specified here – as an
already existing variable – is managed at a different memory location,
ambiguities could result during the writing of the values, particularly
with outputs.
: Indicates that this address was edited and specified. If the arrange-
ment of the device objects in the device tree changes, PLC Engineering
does not adapt this address automatically.
User interface
“Default value” Default value of the parameter applied to the channel: Appears only if
the option “Set all outputs to default value” is activated in the “PLC
settings” for the behavior of the outputs at stop.
Note: As of compiler version V3.5 SP11, the initialization value of the
variable is automatically used as the default value for a mapping to an
existing variable. In the “Default value”, editing is only possible a newly
generated variable is mapped or if no mapping is entered. In previous
versions, the user had to ensure that default value and initialization
value are identical.
“Unit” (7) Unit for the parameter value, for example ms for milliseconds.
“Description” (8) Brief description of the parameter.
“Current value” Actual value of the parameter applied to the channel; displayed in
online mode only.
Changing the default value by an online change is allowed, but the value is only
applied after a "Reset cold" or "Reset warm".
“Reset mapping” (9) PLC Engineering resets the mapping settings to the default values
defined by the device description file.
“Update Variables” (10) Definition for the device object about updating I/O variables. The
default value is defined in the device description:
● “Use parent device setting”: Update according to the settings of the
superordinate device.
● “Enabled 1 (use bus cycle task if not used in any task)”: PLC Engi-
neering updates the I/O variables in the bus cycle task if they are
not used in any other task.
● “Enabled 2 (always in bus cycle task)”: PLC Engineering updates all
variables in each cycle of the bus cycle task, regardless of whether
they are used and whether they are mapped to an input or output
channel.
If a UNION is represented by I/O channels in the mapping dialog, it depends on
the device whether mapping to the root element is also possible.
Also refer to
● ⮫ Chapter 17.4 Configuring Devices and I/O Mapping on page 118
● ⮫ Chapter 33.1.2 Generic Device Editor on page 736
● ⮫ Chapter "Edit I/O mapping" command on page 927
● ⮫ Chapter 33.1.8 Tab '<device name> IEC Objects' on page 738
● ⮫ Chapter 33.4.7 Dialog 'Select Function Block' on page 1039
● ⮫ Chapter Command 'Online Config Mode' on page 930
● ⮫ Chapter 33.1.18 Tab 'PLC Settings' on page 758
User interface
In order to minimize the risk of data security violations,
we recommend the following organizational and tech-
nical actions for the system where your applications are
running. Whenever possible, avoid exposing the PLC and
control networks to open networks and the Internet.
Use additional data link layers for protection, such as
a VPN for teleaccess, and install firewall mechanisms.
Restrict access to authorized persons only, and change
any existing default passwords during the initial commis-
sioning, and change them regularly.
Detailed information on the concept and use of device
NOTICE
user management is provided in "Handling of Device User
Management".
There you will also find the following instructions on how
to use the editor:
− First-time login to the controller for editing and
viewing its user management
− Setting up a new user in the user management of the
controller
− Changing of access rights to controller objects in the
user management of the controller
− Loading user management from a *.dum file, modi-
fying it, and downloading it to the controller in offline
mode
On this tab of the device editor, you define the device access rights of device
users to objects on the controller. As in the project user management, users
must be members of at least one user group and only user groups can be
granted certain access rights.
Requirements for the “Access Rights” tab to be displayed:
● In the PLC Engineering options, in the “Device Editor” category, the “Show
access rights page” option has to be selected.
Note that this PLC Engineering option can be overwritten by the device
description.
Requirements for the access rights to be granted to user groups
● A component for the user management has to be available on the controller.
That is the primary requirement.
● Users and user groups have to be configured on the “Users and Groups” tab.
User interface
Example: “Device” with child nodes “Logger”, “PlcLogic”, “Settings”, “UserManagement”.
Table 25: “Rights”
In general, the access rights are inherited from the root object (also “Device” or “/” to the subob-
jects. This means that if a permission of a user group is denied or explicitly granted to a parent
object, then this first affects all child objects.
The table applies for the object that is currently selected in the tree. For every user group, it shows
the rights currently configured for the possible actions on this object.
When an object is clicked, a table on the right side shows the access rights of the available user
groups for the selected object.
This allows you to quickly see:
● Which access rights are evaluated by an object
● Which user group has which effective rights to which object
Meanings of the symbols
● : Access right granted explicitly
● : Access right denied explicitly
● : Access right granted through inheritance
● : Access right denied through inheritance
● : The access right was not granted or denied explicitly and also not inherited by the parent
object. Access is not possible.
● No symbol: Multiple objects are selected that have different access rights.
Change the permission by clicking the symbol.
Example
The “Logger” object on the “Access Rights” tab was created by the "Logger"
component and controls its access rights. It is located directly below the
“Device” runtime object.
The possible access rights for this object can be granted only for the “View”
action.
Initially, each object has a read access. This means that every user can read
the "Logger" of a controller. If this access right should be denied for a single
user group (“Service” in the example), then the read access to the logger
object has to be denied explicitly.
The following table shows which action is affected in particular when a specific
access right is granted for an IEC application.
x : The right has to be set explicitly.
- : The right is not relevant.
“Application” Operation Access Rights
“Add/ “Execute” “Modify” “View”
Remove”
Login - - - x
Create x - - -
Create child x - - -
object
User interface
Delete x - - -
Download / x - - -
online
change
Create Boot x - - -
Application
Read vari- - - - x
able
Write Vari- - - x x
able
Force vari- - - x x
able
Set and - x x -
delete break-
point
Set Next - x x -
Statement
Read call - - - x
stack
Single cycle - x - -
Switch on - x x -
flow control
Start / Stop - x - -
Reset - x - -
Restore - x - -
retain varia-
bles
Save retain - - - x
variables
“PlcShell” Only the “Modify” permission is evaluated at this time. This means that only
when the “Modify” permission has been granted to a user group can PLC shell
commands also be evaluated.
“RemoteConnec Additional external connections to the controller can be configured below this
tions” node. Currently, access to the OPC UA server can be configured here.
“Settings” This is the online access to the configuration settings of a controller. By default,
access to “Modify” is granted only to the administrator.
“UserManageme This is the online access to the user management of a controller. By default, read/
nt” write access is granted only to the administrator.
“X509” This controls the online access to the X.509 certificates. Two types of access are
distinguished here:
● Read (“View”)
● Write (“Modify”)
Every operation is assigned to one of these two access rights. Each operation is
inserted as a child object below X509. Therefore, access per operation can now
be fine-tuned even more.
See also
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
● ⮫ Chapter 33.1.2 Generic Device Editor on page 736
● ⮫ Chapter 33.1.16 "Users and groups” tab on page 754
“Applications on the PLC” List of the applications found via “Refresh list” during the last scan of
the control device.
“Delete” Deletes the application selected in the list or all listed applications on
“Delete All” the controller
Note: If a safety controller is inserted below a PLC, then this command
can permanently interrupt the communication links of the safety con-
troller to other safety controllers (via safety network variables), to field
devices, and to the development system. The safe field devices and
the other safety controller can enter the safe state as a reaction. The
connection to the development system is affected only in the case of a
safety controller that is connected to the main controller via a fieldbus.
For more information, refer to the section "Subordinate Safety Con-
troller".
“Details” Opens the dialog box “Details”. It displays information defined for the
application on the “Information” tab of the dialog box “Properties”.
“ Contents” Requirement: The “Download the application info” option is activated
in the “Properties” of the application object on the “Application
generation options” tab. This causes information about the contents
of the application to be additionally loaded to the PLC.
The “Contents” button opens a dialog box with additional information
about the differences between the latest generated code and the
application code that exists on the controller. The different modules
are displayed in a comparison view.
“Refresh List” The controller is scanned for applications and the list is refreshed
accordingly
You can configure the commands “Remove Application from Device” and
“Remove Applications from Device” by means of the dialog box form “Tools
🠂 Customize”. These commands correspond to the “Delete” and “Delete All”
buttons.
Also refer to
● ⮫ Chapter 33.1 Generic Device Editor on page 735
● ⮫ Chapter 33.2.6 “Application” object on page 763
● ⮫ Chapter 33.1.2 Generic Device Editor on page 736
● ⮫ Chapter 33.1.4 'Information' tab on page 736
● ⮫ Chapter Dialog 'Properties - Application Build Options' on page 1053
● ⮫ Chapter Command 'Login' on page 939
● ⮫ Chapter 19.3 Subordinate Safety Controller on page 232
User interface
the application-specific file on the PLC by saving and reading a zip archive.
Requirement: The communication settings are correct for connection to the
device. The application for backup is available on the PLC.
Table 26: Menu Bar
“Backup” This button opens a menu with the following commands:
● “Read Backup Information from Device”: This command searches
for application-specific files from the $PlcLogic$ directory of the
PLC and lists them in a table in the lower part of the tabbed page.
● “Create Backup File and Save to Disk”:
Requirement: The “Read Backup Information from Device” com-
mand was used for determining the backup-related files. These files
are located in the table in the lower part of the tabbed page.
This command compresses the files in the table set as “Active”
and the meta.info information file into a backup zip file. The file
extension is tbf (="Target Backup File").
● “Save Backup File to Device”:
Requirement: The backup file has been saved to the disk. This com-
mand saves the backup file to the TBF directory of the PLC.
“Restore” This button opens a menu with the following commands:
● “Load Backup File from Disk”: This command opens the “Open”
dialog box for navigating the file system for a saved backup file. The
included files are listed in a table in the lower part of the tabbed
page.
● “Load Backup File from Device”: This command generates a list
of all backup files found on the PLC. Select one of these files to
view its contents in a table on the tabbed page. For the restore
operation, you can deactivate optional components and edit the
comments.
● “Restore on Device”: This command is available if at least one
component of the backup file that is currently loaded in the tabbed
page is set to active. It prompts for restoring the application status
on the device. The user interface is blocked during restore. You can
cancel the operation.
Table 27: “Target Information”
“ID” ID of the PLC (example: 0000 0001)
“Type” Device type (example: 4096)
“Version” Device version (example: 3.5.8.0)
See also
● ⮫ Chapter 33.1.2 Generic Device Editor on page 736
● ⮫ Chapter 24 Copying Files to/from PLC on page 319
User interface
● Log entries from I/O drivers
● Log entries of data sources
The “Log” tab also opens when you click “Open Log Page”. You can configure
this as a menu command in the “Customize” dialog.
“UTC time” : Converts the times displayed below “Timestamp” to the local time
of the development system. The conversion is based on the time zone
of the operating system where the PLC Engineering is running. (default
setting)
: Displays the original time stamp of the runtime system
If you change the option, then the displayed time stamp is converted
automatically.
Exports the list contents to an xml file. You can select the file name
and location.
Imports an XML file with log messages stored in the file system . A
separate window opens to display the log messages.
Table 32: Display window with log file
Tabular display of the log messages
Ten thousand log messages are displayed per page.
“Severity” ● : Warning
● : Error
● : Exception
● : Information
● : Debug message
“Time Stamp” Date and time of the development system or of the runtime system)
Example: 01/12/07 09:48
“Description” Description of the event
Example: PLC started
“Component” Runtime component where the reported event occurred
Table 33: Status bar
“Auto-Scroll” Displays whether auto-scrolling is enabled (“ON”) or disabled (“OFF”)
Hint: Click the button to enable “Auto-Scroll”.
● “ON”: The log list is refreshed automatically when changes occur.
● “OFF”: When a new log event occurs, it is displayed next to “Off”.
Moreover, the button is decorated on the menu bar: .
Note for error checking
For exceptions with the description *SOURCEPOSITION*, the affected function
opens in the editor by double-clicking it or by means of the “Display Source
Code in Editor” command in the context menu. The cursor jumps to the line
that is causing the error. You can also perform this diagnosis when you have
the PLC Engineering project archive, including the download information files
and the exported log file. When the affected function is protected, then the
following message appears: "The source code is not available for
<function name>".
If a VendorException is reported, then a manufacturer-specific exception
error has occurred in the PLC Engineering runtime. Contact the PLC manufac-
turer for more information.
Also refer to
● ⮫ Chapter 33.1.2 Generic Device Editor on page 736
● ⮫ Chapter 22.5.5 Reading the PLC on page 309
● ⮫ Chapter Dialog 'Customize' - 'Menu' on page 1094
User interface
Table 34: “I/O Deployment for Tasks” (1)
“I/O Channels” (2) All inputs and outputs of the linked devices. The display corresponds
to that in the dialog box “I/O Mapping” of the device editor.
By double-clicking on an input or output you can open the associated
I/O mapping editor.
“<task name>” (3) A column appears for every task defined in the task configuration. The
title contains the task name and priority.
The priority of the tasks decreases from first to the last column. A red
cross appears in the box for inputs and outputs that are written or
read by a task: . In addition, the task defined as a “Bus cycle task” in
the “PLC Settings” of the device editor is marked at these points with
a blue double arrow symbol .
Following a mouse-click on the title cell, only the I/Os assigned to this
task are displayed.
Following a mouse-click on the “I/O Channels” cell, all channels are
shown again.
See also
● ⮫ Chapter 33.1.2 Generic Device Editor on page 736
● ⮫ Chapter 33.1.9 Tab '<Device name> I/O mapping' on page 739
● ⮫ Chapter 33.1.18 Tab 'PLC Settings' on page 758
● ⮫ Chapter 18.21.2 Creating a Task Configuration on page 208
User interface
configuration on the device is loaded into the editor, overwriting
the current contents.
● “Download the editor content to the device and overwrite the user
management there”: The configuration in the editor is transferred to
the device and applied there.
Import from disk CAUTION: The import of a device user management by means of a
*.dum2 file completely overwrites the existing user management on
the device. In order to log in to the device again afterwards, you need
authentication data from the new user management. This means that
you have to log in as a user from the imported user management after
the import.
● When you click the button on the “Users and Groups” tab to import
a “Device user management file *.dum2”, the default dialog for
selecting a file opens to select a device user management file from
the hard drive. After you select the file, the “Enter Password” dialog
opens. You have to specify the password that was assigned when
the file was exported. Then the user management is enabled.
Note: Before V3.5 SP16, the “Device user management files
(*.dum)” file type was used which did not require any encryption.
● When you click the button on the “Access Rights” tab to import
a “Device rights management file *.drm”, the default dialog for
selecting a file opens to select a corresponding file from the hard
drive. The existing configuration in the dialog is overwritten by the
imported file.
Export to disk ● When you click the button on the “Users and Groups” tab, first
the “Enter Password” dialog opens for assigning a password to
the device user management file. Note: This password has to be
repeated later when this file is imported to enable this user man-
agement on the controller.
After the password assignment dialog is closed, the default dialog
for selecting and importing a user management configuration from
the hard disk opens. In this case, the file type is “Device user
management files (*.dum2)”.
Note: Before V3.5 SP16, the “Device user management files
(*.dum)” file type was used which did not require any encryption.
● When you click the button on the “Access Rights” tab, the file type
is “Device rights management files (*.drm)”. In this case, a pass-
word does not have to be assigned for the file before saving.
“Device user” User name of the user currently logged in on the device
Also refer to
● ⮫ Chapter 33.1.2 Generic Device Editor on page 736
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
● ⮫ Chapter 33.1.10 Tab 'Access Rights' on page 743
● ⮫ Chapter Command 'Add Device User' on page 951
User interface
The order in the list defines the application index beginning
with 0.
pid [<application name>| Provides the GUID (application index) of one or all loaded
<application index>] * applications
pinf [<application name>| Provides the contents of the following fields from the
<application index>] * project information: title, version, author, and description.
Requirement: The option “Create POU for properties
access automatically” in the “Project Information” dialog is
activated.
startprg [<application name>| Starts the given application, or all loaded applications if no
<application index>] * application is given
stopprg [<application name>| Stops the given application, or all loaded applications if no
<application index>] * application is given
resetprg [<application name>| Resets the given application, or all loaded applications if
<application index>] * no application is given
resetprgcold [<application Executes a cold boot of the given application, or all loaded
name>|<application index>] * applications if no application is given
reload[<application name>| Loads the boot application of the given application, or the
<application index>] * boot projects of all loaded applications if no application is
given
getprgstat [<application name>| Provides the program status of the given application, or the
<application index>] * program status of all loaded applications if no application
is given
plcload Shows the processor load of the controller (in percent)
rtsinfo Provides information about the runtime system, for
example the processor and version of the runtime system
channelinfo Provides information about the communication channel
rtc-get Provides the universal time (UTC) via the DataTime string
rtc-set Sets the universal time (UTC) via the DataTime string (see
ISO 8601)
listpcicards [<VendorID>] Provides a list of PCI adapters (all or by <VendorID>)
gettaskgroups Provides a list of all task groups, their tasks, and the CPU
core binding
cert-getapplist Provides all registered and used certificates (ID of the com-
ponent and usage).
cert-genselfsigned [<number Generates self-signed certificates
for search result by "cert- The validity period of the certificate can be specified by
getapplist"> <expdays=>] means of expdays=.
Default value: 365 days
Also refer to
● ⮫ Chapter 22.5.7 Using PLC Shell for requesting Information on page 311
● ⮫ Chapter 33.1.2 Generic Device Editor on page 736
User interface
values via a program contained in the project, which PLC Engi-
neering executes at "STOP". Enter the name of the program in the
field on the right.
“Always update variables” Global setting that defines whether or not PLC Engineering updates
the I/O variables in the bus cycle task. This setting is effective for I/O
variables of the slaves and modules only if 'deactivated' is defined in
their update settings.
● “Deactivated (update only if used in a task)”: PLC Engineering
updates the I/O variables only if they are used in a task.
● “Activates 1 (use bus cycle task if not used in another task)”: PLC
Engineering updates the I/O variables in the bus cycle task if they
are not used in any other task.
● “Activate 2 (always in bus cycle task)”: PLC Engineering updates all
variables in each cycle of the bus cycle task, regardless of whether
they are used and whether they are mapped to an input or output
channel.
Table 41: “Bus Cycle Options”
“Bus cycle task” Task that controls the bus cycle. By default the task defined by the
device description is entered.
By default the bus cycle setting of the superordinate bus device (use
cycle settings of the superordinate bus) applies, i.e. the device tree is
scanned upwards for the next valid bus cycle task definition.
Pay strict attention to the following notes!
Before you select the “<unspecified>” setting for the
NOTICE
bus cycle task, you should be aware that "<unspeci-
fied>" means that the default setting given in the device
description goes into effects. You should therefore check
this description. Use of the task with the shortest cycle
time may be defined as the default there, but use of the
task with the longest cycle time could equally well be
defined!
For fieldbuses, a fixed cycle matrix is necessary to
NOTICE
assure a determined behavior. Therefore, do not use the
type 'free-running' for a bus cycle task.
The tab can only display data if a connection is established to the control or if a
real time configuration is available in the project.
− When no communication to the control is established, the right display
window remains empty
− If no real time configuration is created in the project, the left display
window remains empty
User interface
Call
The tab can be called as follows:
● Via the “Show status” command, see:
⮫ Chapter Command “Show status” on page 884
● In the device editor, by double-clicking on the DataLayer_Realtime object
node or by double-clicking on the subordinate object node.
33.2 Objects
33.2.1 Objects – General information
Objects in PLC Engineering provide certain functionalities to create your
application. Examples: Application, program, function, library manager, device,
image pool. Objects are managed in the views Devices, POUs, Modules in tree
structures.
Insert an object into the respective "tree" using the command “Project 🠂 Add
object”. The inserting options depend on the position in the tree.
Properties of each object can be seen and edited via the context menu of the
object.
Also refer to:
● ⮫ Command 'Properties'
Call
In the ctrlX PLC Engineering device tree below the project node, see ⮫ Chapter
17.2 Device tree and device editor on page 111
Function
The “device (ctrlX CORE)” object node symbolizes the control in your PLC
project and provides all elements and tools required to configure the PLC
project.
In the initial state, the control object node contains the following child nodes:
Child nodes Function
PLC Logic The PLC Logic child node is part of the control
object node and contains the following objects
to create a PLC control program
Application The “Application” node contains the objects
required for an executable control program,
see ⮫ Chapter 33.2.6 “Application” object
on page 763
Library Manager The Library Manager lists all libraries that were
integrated in the project for creating applica-
tions, see ⮫ Chapter 33.2.19 "Library manager”
object on page 780
PLC_PRG (PRG) Program function block (structured text)
The program function block “PLC_PRG (PRG)”
is automatically created when creating a ctrlX
project template and does not yet contain any
program code.
Task Configuration The “Task Configuration” object is used to
define and display the basic settings for the
task configuration, see ⮫ Chapter 33.2.31
"Task configuration" object on page 860
Main Task In the “Main Task” object, define the con-
ditions for task start and calls within the
task, see ⮫ Chapter 33.2.32 "Task" object
on page 865
PLC_PRG Program function block “PLC_PRG (PRG)” with
call in Main Task
Further documentation
● ⮫ Chapter 8.2 Creating a new project on page 53
● ⮫ Chapter 8.2.1 Creating a project on the basis of a template for ctrlX CORE
Creating devices on page 54
User interface
33.2.4 Object “DataLayer_Realtime”
The object node “DataLayer_Realtime” facilitates the mapping of real time data
channels in the ctrlX Data Layer in the I/O image of the current PLC project,
e.g. EtherCAT device (master/slave).
To facilitate mapping, the configuration of the real time data channels has to be
transferred to the ctrlX PLC Engineering project. There are several options to
transfer the configuration, e.g. by downloading the configuration from the ctrlX
device or by loading a description file.
Depending on the use case, the context menu node “Select realtime data”
provides the following commands to transfer the configuration:
● “Selectively from ctrlX CORE..”
The command facilitates the application of real time data via download
directly from the ctrlX device.
For this process, a connection to the communication from the Engineering
PC to the control is required.
Refer to: ⮫ Command “Selectively from ctrlX CORE..”
● “All data from ctrlX CORE..”
By using this command, all data currently configured in the DataLayer_Real-
time node is discarded. Subsequently, all real time data channels that
can be contacted by the PLC via the Data Layer of the ctrlX device are
re-inserted.
For this process, a connection to the communication from the Engineering
PC to the control is required.
Refer to: ⮫ Command “All data from ctrlX CORE..”
● “Selectively from file..”
By using the command, a description file created in ctrlX IO Engineering can
be read in and used to configure the I/O image.
For this process, no connection to the communication from the Engineering
PC to the control is required.
Refer to: ⮫ Command “Selectively from file..”
You can mount an application object below a “PLC logic” node, i.e. below a
programmable device.
Under each application there has to be a “task configuration” in which you
configure which program of the application is called by which task with which
settings.
Furthermore, under the application you hang the blocks of your control pro-
gram, such as POUs, global variable lists, library managers.
In addition, the application can also use instances of project-global function
blocks. Project-global function blocks are managed in the “POUs” view. The use
of such instances corresponds to the object-oriented programming.
An application can be provided with specific properties in the “Properties”
dialog of the application object, in the tab “Application build options”.
Example: Enabling dynamic memory allocation.
When downloading the application to the PLC, it is possible to provide informa-
tion on the application content. This is also a setting in the “Application build
options” tab. The application on the control can subsequently be compared to
the active application in PLC Engineering.
To provide additional information on the application such as author, version
and an individual brief description, modify the information from the gen-
eral“Project info” in the “Properties” dialog under the “Information” tab.
When logging into the target device (PLC or simulation), it is first checked
which application is currently on the PLC and whether the application param-
eters on the control match those in the project configuration. Respective
messages show possible mismatchings and options for further actions. Applica-
tions on the PLC can be deleted.
Go to the “Application” tab of the device editor for the applications currently
located on the device. There, the application can also be deleted from the
target system. There can also be additional applications in the list without a
separate object in the device tree, such as <Application>_symbols.app con-
taining a symbol list created for the application (refer to symbol configuration).
Also refer to
● ⮫ Chapter 17.2 Device tree and device editor on page 111
● ⮫ Chapter 33.2.31 "Task configuration" object on page 860
● ⮫ Chapter Dialog 'Properties - Application Build Options' on page 1053
● ⮫ Chapter 20 Transferring the application to the PLC on page 257
● ⮫ Chapter 33.1.18 Tab 'PLC Settings' on page 758
● ⮫ Chapter 19.2 Symbol Configuration on page 229
● ⮫ Chapter 23.2 Executing the Online Change on page 315
areas and you can change them specifically. Especially in the case of a safety
application, this may be necessary for getting all safe POUs into the safe
internal memory area.
User interface
first have to “Clean” and then “Generate Code” again.
Make sure to pay attention to the messages in the category “POU Locations”.
This also shows when a code POU cannot be moved as expected.
“Clean” Deletion of the compile information for the application. Corresponds
to the menu command “Build 🠂 Clean”. Requirement for moving the
POUs to the configured memory locations.
“Generate code” Starting of the code generation for the application. Corresponds to the
menu command “Build 🠂 Generate Code”. Requirement for moving the
POUs to the configured memory locations.
“Objects” Objects of the application, including the objects from the referenced
libraries
“Type” Object type; examples: “Function block”, “Method”, “Library”
“Current location” Current memory location of the POU: area_<n>.
“Configured location” Configured memory location where the POU is moved at the next code
generation. Possible values:
● “default”: Automatically assigned area.
● “area_<n>”: Explicitly assigned memory area (n=number)
“Code size” Code size of the POU (in bytes)
● ⮫ Chapter Command 'Clean' on page 932
● ⮫ Chapter Command 'Generate Code' on page 932
Alarm status:
● ① Normal: No alarm situation
● ‚ Active: Alarm situation has occurred
● ➂ Wait for confirmation: there is no longer an alarm;
acknowledgement has not taken place yet
● ➃ Active, Acknowledged: Alarm still exists; acknowl-
edgement already completed
Status transitions:
● ⑤ Activate: Alarm situation occurs ("alarm coming")
● ⑥ Deactivate: Alarm situation ended ("alarm going")
● ⑦ Confirm: Acknowledgement of an alarm that is
already ended
● ⑧ ACK: Acknowledgement of an alarm that still exists
User interface
Table 44: “Notification Actions”
You can assign a list of actions to each alarm class that are to be executed as
soon as the alarm is subject to a status transition.
“Action” Select one of the following actions by double-clicking the
action column:
● “Variable”: Value assignment of a variable
● “Execute”: Execution of a program
● “Call”: Call a function block instance
“Activate” The available status transitions depend on the selected
“Deactivate” “acknowledgement method”.
“Confirm” : The action is executed with the status transition.
“ACK”
“Details” Displays a summary of the action. You define the action
below the table or edit the action directly in this row.
“Deactivation”: Variable via which an application can deactivate the action.
Table 45: “Variable/Execute/Call”
You define the parameters of the action in the field below the table. The
parameters depend on the selected action:
● Variable:
“Variable”: Variable to which you assign a value or an
expression.
In the field on the right: Assigned variable or expres-
sion. You can select the variables via the input assistant
( ).
In the case of boolean variables you can use the place-
holder ALARM, in the case of integer variables the place-
holder STATE. In the case of string variables you can
enter any IEC literal (e.g. 'too high!').
– ALARM: Status (TRUE or FALSE) of the alarm of this
alarm class that was last activated/deactivated
– STATE: Status of the alarm of this alarm class that
last changed its status. (0: Normal, 2: Active, 3: Wai-
tingForConfirmation, 4: ActiveAcknowledged)
● Execute:
“Executable file”: Path and file name of the executable
file on the controller.
“Parameter”: One or more parameters that you add to
the call. You separate several parameters by a space.
● Call:
The dialog of the alarm group editor includes a table listing all alarms of the
group. The dialog displays the basic settings for the entire group, such as
deactivation, archiving, and associated text list, as well as the properties of
the individual alarms. You can edit the values in the list. Note the option of
exporting and importing alarms to and from a CSV file (see below).
User interface
When you specify an alarm storage object, PLC Engi-
neering activates the alarm storage.
“Deactivation” Boolean variable that deactivates all alarms in this group.
PLC Engineering does not trigger these alarms any longer,
even if the alarm condition is fulfilled. Alarms that are
already active are not affected by this.
Table 47: Table of alarms
You enter the properties of the individual alarms in the corresponding table
columns. Depending on the selected observation type, PLC Engineering sets
additional parameters in input fields below the table.
“ID” This unique ID corresponds to the ID of the associated text
list. You can change the ID in the “ID” field of the table.
The ID must always be unique within the alarm group. A
change of the ID in the alarm table also directly causes a
change in the text list, and the other way around.
“Observation Drop-down list of observation types. Depending on the
type” type, different editing fields are available below the table
that define the condition for the alarm. The fields define an
expression that triggers the alarm. See the following table.
“Details” This field shows the configuration settings (defined in the
fields below the table) for the selected alarm type.
You can also enter the condition directly into the field.
If you input an expression that does not match the cur-
rently selected observation type, the type is automatically
adapted.
“Deactivation” Variable for deactivating the alarm (optional).
“Class” Assigned alarm class.
“Message” Required entry of a message text (message) that PLC
Engineering will display in the “Alarm Table” visualization
element when the alarm occurs. The text entered here
is transferred automatically by PLC Engineering to the
text list for the alarm group. You can insert line breaks
by pressing [Ctrl]+[Enter].PLC Engineering supports the
following placeholders, which are replaced by the actual
value at runtime:
<DATE> Date of the change to the present
status.
<TIME> Time of the last status change.
<EXPRESSION> Expression (defined within the alarm)
that triggered the alarm.
“Latch var 1”, The latch variables are used to record additional values
“Latch var 2” when the alarm becomes active. A latch variable has to be
a scalar type (8-byte) or a STRING or WSTRING type.PLC
Engineering records a latch variable or a latch expression
when the alarm becomes active. In this way, it allows addi-
tional information about the alarm to be provided.
Note: With the respective configuration of the “Alarm
table” element or “Alarm banner” element, you can filter
the occurring alarms in the visualization by the contents of
the latch variable.
Example: When monitoring a motor speed, the temperature
and the current are additionally recorded.
User interface
By default, columns are available for two latch variables.
You can add more columns from the context menu which
will be available in the “Data type” property for column
configuration of the “Alarm table” and “Alarm banner” visu-
alization elements.
“Higher prio. When the alarm is triggered, it can be acknowledged by
alarm” triggering another alarm.
Example: A temperature monitor should issue a warning
at > 60 °C and an error at > 90 °C. If the temperature
rises, then the warning is displayed starting at 60 °C. At
90 °C and higher, the alarm for the error is triggered (this
automatically acknowledges the 60 °C warning).
Table 48: Monitoring types
“Digital”: “Expression”: Expression to be monitored. On the right
side of the expression for the comparison. In the center,
you select the desired comparison operator (“=” or <>).
“Upper limit”1): “Expression”: As described for “Digital”, but with the com-
pare options “>” or >= and optionally a “Hysteresis in %”.
“Lower limit”1): “Expression”: As described for “Digital”, but with the com-
pare options “<” or <= and optionally a “Hysteresis in %”.
“Inside range”1): “Expression”: Expression to be monitored.
“Range”: PLC Engineering triggers the alarm when the
monitored expression is within the range defined here. The
left field defines an expression for the lower limit of this
range. The right field defines an expression for the upper
limit. The expression to be monitored is displayed in the
field in-between. You have to set the comparison operators
accordingly. You can define a “Hysteresis in %” optionally.
“Outside range” : “Expression”: Expression to be monitored.
1)
“Maximum storage size” Maximum size of the memory file with specification of the unit. PLC
Engineering converts this size implicitly into an approximate maximum
number of entries that can be saved in the file (ring buffer).
“Circular buffer” For display purposes only (not editable).
: Memory in a circular buffer
: Memory in an unlimited buffer
The records that PLC Engineering saves in the database can be displayed in the
“Alarm Table” visualization element.
See also
● ⮫ Chapter 33.2.9 Object 'Alarm Class' on page 766
● ⮫ Chapter 33.2.10 Object 'Alarm Group' on page 768
User interface
●
“Date format” The settings are applied from the system control.
“Time format” The settings are applied from the system control.
Table 54: “Separator”
“Semicolon” The entries in the CSV file are separated by a semicolon.
“Comma” The entries in the CSV file are separated by a comma.
“Tab” The entries in the CSV file are separated by a tab.
“Local time” Available only if the “Formatted values and timestamps” data format is
selected.
: The time stamps are written to the CSV file in local time.
: The time stamps are written to the CSV file in universal time coordi-
nated (UTC).
User interface
This object is used as a node for subordinate data sources. At least one data
source must be available. An application with the data source manager commu-
nicates with remote devices.
Also refer to
● ⮫ Chapter 19.6 Data connection with data sources on page 241
Dialog 'Initialize data source wizard - Provider settings' (at 'PLC Engineering
Symbolic')
The settings of this dialog are described in the following chapter: Object 'Data
source' - Tab 'Communication".
The dialog is used for the initial configuration of the connection when you
select “PLC Engineering Symbolic” as the data source type. The communication
takes place by means of symbolic monitoring. The configuration can be modi-
fied later in the editor of the data source on the “Communication” tab.
Also refer to
● ⮫ Chapter Tab 'Communication' via PLC Engineering Symbolic on page 808
Dialog 'Initialize data source wizard - Provider settings' (for 'PLC Engineering
ApplicationV3')
The settings of this dialog are described in the following chapter: Object 'Data
source' - Tab 'Communication".
The dialog is used for the initial configuration of the connection when you
select “PLC Engineering ApplicationV3” as the data source type. The communi-
cation takes place by means of address monitoring.
Also refer to
● ⮫ Chapter Tab 'Communication' via PLC Engineering ApplicationV3
on page 812
User interface
Double-click in the field in order to edit the text.
The table contains as many language columns as you have added. A language column is named with
a language code that you entered when creating the column with the command “Insert Language”.
“<Language code>” Name of the language as a language code, for example en-US. This
column contains the translation of the text that is written under
“Standard”.
If the language code is selected as a language in the visualization
manager, a visualization displays the translation during operation. A
running visualization can switch over during operation to another lan-
guage at the request of a user.
Double-click in the field in order to edit the text.
See also
● ⮫ Chapter Command 'Add Language' on page 1021
● ⮫ Chapter Command 'Create Global Text List' on page 1021
● ⮫ Chapter Command 'Import/Export Text Lists' on page 1022
● ⮫ Chapter Command 'Remove Language' on page 1023
● ⮫ Chapter Command 'Remove Unused Text List Entries' on page 1024
● ⮫ Chapter Command 'Check Visualization Text IDs' on page 1024
● ⮫ Chapter Command 'Update Visualization Text IDs' on page 1024
● ⮫ Chapter 33.2.24 Object 'Text List' on page 788
● ⮫ Chapter 18.8 Managing Text in Text Lists on page 137
Also refer to
● ⮫ Chapter 18 Programming the application on page 129
● ⮫ Chapter “Properties”- “Network variables” dialog on page 1054
● ⮫ Chapter 33.4.26 'Options' dialog on page 1080
“Task with write access” Task that has exclusive write access to the variables.
See also
● ⮫ Chapter 18.16.7 Using Task-Local Variables on page 168
● ⮫ Chapter 18.16.6 Declaring Global Variables on page 167
● ⮫ Chapter 18.21.4 Multicore on page 209
● ⮫ Chapter 33.2.15 Object 'GVL' - Global Variable List on page 777
● ⮫ Chapter ‘Task group’ tab on page 865
Commands
The following commands are provided in the persistence editor:
● Command “Declarations 🠂 Add All Instance Paths”
● Command “Declarations 🠂 Reorder List and Clear Gaps”
See also
● TODO
● ⮫ Chapter "Rearrange list and clean gaps” command on page 1013
● ⮫ Chapter 18.22.5 Preserving Data with Persistent Variables on page 214
● ⮫ Chapter 18.22.6 Preserving Data with Retain Variables on page 217
● ⮫ Chapter Command 'Add all instance paths' on page 1014
User interface
“File name” File path of the image file. Click on to open the “Select image”
dialog.
“Image” Show a thumbnail of the image.
“Link type” Opens the “Select image” dialog. The type of linking is defined there.
“Prompt whether to reload If the image file has changed, you may be prompted whether or not the
the file” image file should be updated.
“Do nothing” The image file in the image collection is not updated.
Also refer to
● ⮫ Chapter 18.9 Using Image Pools on page 144
User interface
'Device_1', this placeholder is resolved to 'VisuElemsAlarms, 1.0.0.0
(system)”
A placeholder library included in the “POUs” view is resolved as fol-
lows: Depending on the application, it is checked whether a resolution
is specified in the device description. Afterwards, the library profile
is checked. The first detected resolution is used. If you have assigned
a special resolution to the placeholder library in the “Placeholders”
dialog, then this will always be ignored. The result is displayed in the
tooltip of the symbol.
Library signed with a trusted certificate; compatible with PLC Engi-
neering >= V3 SP15
Library that is signed with a trusted certificate, but references at least
one unsigned library
Library signed with a private key + token is compatible with PLC Engi-
neering < V3 SP15
Library that is not signed, or signed with an untrusted or expired cer-
tificate. In the case of an untrusted certificate, the “Trust Certificate”
command is provided in the context menu.
Library that is defined as optional and not currently available
Library whose status is being determined
Licensed library for which no valid license is currently available
Library symbol for a library that cannot be loaded because its signa-
ture (encryption) could not be verified
Table 57: Commands in the library manager
“Add Library” Opens a dialog to select a library. All libraries installed in the library
repository are offered.
“Delete Library” Removes the presently selected library from the project
“Properties” Opens the dialog for the display and editing of the properties of the
presently selected library
“Details” Opens a dialog with details for the presently selected library (general
information, contents, properties, license information)
“Try to Reload Library” If you select a library marked as not found, you can attempt to load it
into the project again using this command.
“Download Missing Opens a dialog that displays the libraries marked as missing in the
Libraries” library manager.
PLC Engineering scans for the missing libraries in the download
servers specified in the project options. Following the download, the
missing libraries are installed automatically.
As long as this dialog is open, the newly installed libraries can be
uninstalled again.
Documentation for the library function block selected in the lower left view
Tab “Inputs/Outputs” Interface (inputs/outputs) of the library function block
Tab “Graphical” Graphical display of the interface
User interface
Symbol:
A network variable list (sender) is used for declaring and listing global variables
that should be sent to network variable lists (receiver) of other devices or
network projects.
You add the object to the device tree by clicking “Add Object 🠂 Network
Variable List (Sender)” of an application.
You can configure the protocol and transmission parameters in the “Add
Network Variable List (Sender)” dialog or in the “Properties” dialog of the
object in the “Network variables” tab.
Also refer to
● ⮫ Chapter 19.5 Network variables on page 238
● ⮫ Chapter 19.5.2 Configuring a Network Variable Exchange on page 239
● ⮫ Chapter 33.2.20 Object 'Network Variable List (Sender)' on page 783
“File extension” File extension for the recipe file in the format .<file extension>
The resulting default name for recipe files is in the form
<recipe>.<recipe definition>.<file extension>.
“Separator” Delimiters between the individual values in the saved file
“Available Columns” Defines the information that is saved and in which order in the recipe
“ Selected Columns” file
“Save as Default” PLC Engineering uses the settings on the tab throughout the entire
project for all other recipe managers.
Tab 'General'
“Recipe management in the : Has to be selected for the user program or visualization elements to
User interface
PLC” load recipes at runtime. If you transfer recipes to the PLC exclusively
via the PLC Engineering program interface, then you can clear this
option.
Table 58: “Save Recipe”
“Save recipe changes to When “Recipe management in the PLC” is selected, there is the fol-
recipe files automatically” lowing option for saving the recipe:
: We recommend this option because it helps the recipe manager
operate "normally". The recipe files on the PLC are updated automati-
cally at runtime whenever a recipe is changed.
Table 59: “Load Recipe”
When “Recipe management in the PLC” is selected, there are the following two options for down-
loading from the PLC:
“Download only for exact : The recipe is only downloaded if the file on the PLC con-
match of the variable list” tains all variables from the variable list of the recipe definition
of the application and these are sorted in the same order. Addi-
tional entries at the end are ignored. If the required match does
not exist, then the error status ERR_RECIPE_MISMATCH is set
(RecipeManCommands.GetLastError).
“Download variables with : The recipe values are downloaded only for those variables that have
matching names” the same name in the recipe definition of the application as in the
recipe file on the PLC. If the variable lists differ in composition and
sorting, then no error status is set.
In this way, recipe files can also be downloaded if variables in the file
or in the recipe definition have been deleted.
“Overwrite existing recipes : If recipe files with the same name exist on the controller, then they
on download” are overwritten with the configured values from the project when the
application is started. If the values from the existing recipe files should
be loaded instead, then this option has to be disabled.
Requirement: The “Storage Type” is “Textual” and the “Save recipe
changes to recipe files automatically” option is selected.
Table 60: “Write Recipe”
The following options are available for writing recipe values to the variables on the PLC:
“Limit the variable to : If the recipe contains a value that is outside of the value range
min/max when recipe value specified in the definition, then the defined minimum or maximum
is out of the range” value is written to the PLC variable instead of this value.
“Do not write to a variable : If the recipe contains a value that is outside of the value range
when the recipe value is specified in the definition, then no value is written to the PLC variable.
out of the min/max range” It retains its current value.
Table 63: Option “Save recipe changes to recipe files automatically” is not
selected.
Actions Recipes defined in the Recipes defined at run-
project time
“Online 🠂 Reset Warm” The recipes of all Dynamically generated
“Online 🠂 Reset Cold” recipe definitions are recipes are lost.
downloaded with the
“Online 🠂 Download”
values from the current
projects. However, these
are set in the memory
only. To save recipes to a
file, you have to run the
User interface
“Save Recipe” command
explicitly.
“Online 🠂 Reset Origin” The application is Dynamically generated
removed from the PLC. recipes are lost.
When a download is per-
formed afterwards, the
recipes are restored.
Shutdown and restart of After the restart, the recipes are downloaded again
the PLC from the automatically created files. This will restore
the same state as before shutdown.
“Online 🠂 Online The recipe values remain unchanged. In runtime
Change” mode, a recipe can be changed only via the function
block command RecipeManCommands.
“Debug 🠂 Stop” The recipes remain unchanged when the PLC is
“Debug 🠂 Start” stopped or started.
See also
● ⮫ Chapter 22.2 Changing values with recipes on page 287
● ⮫ Chapter 'Read and save recipe' command on page 1020
● ⮫ Chapter 33.2.23 Object 'Recipe Definition' on page 787
User interface
● Contents of attributes assigned via compiler pragmas
● Scopes (example: VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT)
Table 65: “Client side data layout”
For detailed information and examples of layout options, see the next section "Symbol Configura-
tion Editor".
“Compatibility layout” This setting is used for the compatibility of old projects. The data
layout created for the client is adjusted as much as possible to the
layout created internally by the compiler.
“Optimized layout” Recommended for new projects. Calculates the output layout in opti-
mized form detached from the internal compiler layout. Does not
generate any gaps for unpublished elements and strictly fulfills the
requirements for memory alignment of the data types. Requires com-
piler version 3.5.7.0 or later.
Fields that are at uneven addresses. Some clients are not set up
for this.
Unintentional memory misalignment, which occurs when using
the attributes 'pack_mode' or 'relative_offset'.
● “Use empty namespaces by default (V2 compatible)”: Required
when using a PLC Engineering V2-compatible OPC server configura-
tion.
: Identical behavior as in PLC Engineering V2.3.
– Program variables are exported without application name
(Application.PLC_PRG.MyVar --> PLC_PRG.MyVar
– Global variables are additionally exported without the name of
the GVL(Application.GVL.MyGlobVar --> .MyGlobVar
User interface
● “Activate Direct I/O Access”: WARNING: This feature is potentially
dangerous and not intended for operation in production. Activate
only for error checking and tests, or when commissioning the
machinery (for example, for checking cables connections).
: In the symbol configuration, you can also use access to
direct I/O addresses that correspond to IEC syntax (for example,
"%IX0.0"). Access to input addresses (I) is read-only*. Access to
output addresses (Q) and memory addresses (M) can be read-
write.
*Info: In simulation mode, write access to symbols is also possible
for input addresses.
Because external clients for protocols such as OPC or OPC UA
do not always support IEC syntax for direct addresses, access is
also provided using an array syntax in the namespace __MIO of the
implicit code. For example, you can also access __MIO.MIO_IX[2].x3
instead of %IX2.3.
However, the symbols for array access are hidden in browsers
because some clients cannot handle the large number of nodes
(several thousand depending on the size of the I/O ranges).
● “Support Calls of Functions, FBs, Methods, and Programs”:
Note: Availability and editability of this option depend on the
device.
: The access rights “execute” can be set in the symbol table
for symbols of blocks of type function, function block, method, or
program. The “Support OPC UA features” option also has to be
selected in the “Settings”.
● “Include Call information in XML”:
: The information about called functions, function blocks,
methods, or programs is also listed in the XML file of the symbol
configuration. The option is enabled only if the “Support calls of
functions, FBs, methods, and programs” option is supported by the
device.
● “Enable Symbol Sets”:
: A toolbar with buttons and a list box is displayed above the
symbol table. You can use this to configure symbol sets for client-
specific assignment of access rights to the controller. See below for
more information: "Symbol group configuration toolbar".
“Download” If you use a device that supports its own application file for the symbol
configuration, then this button is also available in the toolbar. If you
have changed the symbol configuration in online mode, you can use it
to immediately load the new <application name>._Symbols file
onto the control.
“Tools” “Save xml schema file”: The command opens the standard dialog for
saving a file in the file system. With this command, you can prepare
the XSD format of the symbol file, for example for use in external
programs.
Table 67: Symbol table
“Access rights” You can change the access rights for a symbol by clicking the symbol in
the “Access Rights” column.
Icons for access rights (in ascending order)
● : Read only
● : Write only
● : Read and write
● : Execute
These rights allow for executing access to functions, function
blocks, methods, and programs.
Requirements for assignment: The device provides the options
“Support calls of functions, FBs, methods and programs” and
“Support OPC UA features”. Both options are activated in the
“Settings”.
Note: In case the control has a user management, you can use symbol
sets to define client-specific access rights to the same symbols.
“Maximum” Maximum access rights for this symbol
“Attribute” If the access right was assigned by attribute, then a corresponding
icon is displayed here.
“Type” Alias data types are also displayed In PLC Engineering V3.5 SP6 and
later. Example: MY_INT : INT for a variable declared with the data
type MY_INT (type INT).
“Member variables” You can add variables of a structured data type also by selecting a
check box for symbol configuration in the “Symbols” column. This
causes PLC Engineering to export all member variable symbols. How-
ever, in the “Members” column, you can click the ellipsis button
( ) to select only specific structural components. Note: This selec-
tion applies to all instances of this data type for which symbols are
exported. If a member of a structured type cannot be selected, then
an asterisk ( ) is displayed in the check boxes of the members to
indicate that all exportable members of that type are exported.
Table 68: Toolbar for symbol set configuration
“List box” Already defined symbol sets
“Add New Symbol Set” Opens the “Add New Symbol Set” dialog for specifying a name for this
set
“Add Duplicate from Opens the “Add Duplicate from Selected Symbol Set” dialog. A copy is
Selected Symbol Set” created for the set selected in the list box. You can change the default
name (<group name>_Duplicate).
“Rename Selected Opens the “Rename Selected Symbol Set” dialog for specifying
Symbol Set” another name for the set selected in list box.
“Delete selected Symbol Opens a dialog prompting whether or not the symbol set selected in
Set” the list box should be deleted.
“Configure Symbol Rights” Opens the “Symbol Rights” tab of the device editor. When logged
in there, you can assign different access rights for each user group
(client) to the symbol set selected in the list box.
Also refer to
● ⮫ Chapter 33.1.6 Tab 'Symbol Rights' on page 737
User interface
information” : Additional information that can be evaluated by OPC UA servers
is included in the symbol table. This includes inheritance information
of user-defined data types and the namespace node flags. Additional
information, such as comments and attributes, can also be included if
the OPC UA setting is active.
When the OPC UA setting is enabled, attributes are included in the
symbol table according to the following rule:
● In compiler versions V3.5.5.0 to V3.5.7.X, all attributes are included
according to the “Match simple identifiers” setting.
● In compiler version V3.5.8.X, all attributes are included according to
the setting “Include all attributes”.
● In compiler version V3.5.9.0 and later, you can customize the attrib-
utes that are included.
“Include comments” Prerequisite: “Enable extended OPC UA information” is enabled.
“Include attributes” : Comments and attributes are also saved in the symbol table.
“Also include comments Prerequisite: “Include comments” is enabled.
and attributes for type : The information for type nodes is also included (user-defined types,
nodes” such as STRUCT and ENUM elements).
: Only directly exported variables have comments and attributes.
Table 70: “XML symbol file contents”
“Include namespace node : The namespace node flags provide additional information about the
flags” origin of a node in the namespace. The node flags always in the symbol
table when OPC UA is activated. However, its inclusion in the XML file
can be deactivated as some defective parsers have problems with it.
“Include comments” : Comments can also be saved in the XML file.
In compiler versions V3.5.5.x to V3.5.8.0, this includes the setting
“Prefer docu-comments”.
“Include attributes” : Attributes can also be saved in the symbol file.
“Also include comments Prerequisite: “Include comments” is enabled.
and attributes for type : The information for type nodes is also included (user-defined types,
nodes” such as STRUCT and ENUM elements).
: Only directly exported variables have comments and attributes.
not consistent with regard to one or multiple IEC tasks. The consistency with
regard to the machine clock has to be already ensured by the IEC application.
For this purpose, the values that arise during a production cycle are typically
collected in a global variable list. At the end of the cycle, the symbolic client is
notified by means of an additional variable (BOOL or counter) that the machine
cycle has ended and the values are valid. Now the client has the chance to
archive the values from the production cycle. If required, successful reading
can also be displayed in opposite direction using a released variable. Thus,
the production can be stopped, even if production data could not be archived.
For this use case, the synchronized consistent access is neither required nor
useful, as the synchronization has to take place on application level.
In contrast, synchronized consistent access by symbolic clients is typically
applied in the process industry with continuously running systems without
User interface
production clocking when, for example when process values are written consis-
tently and cyclically in a fixed time frame of 60s. This can be done either by
synchronization on application level analogous to the clocked machines (see
above), or by synchronization of the synchronized consistent symbolic access.
The advantage of the latter is that no logic has to be implemented in the IEC
program and access is controlled entirely by the client.
Due to the increased jitter, the synchronized consistent
CAUTION
monitoring is not suitable for Motion or real-time crit-
ical applications. Due to these reasons, the synchronized
consistent access should only be released and used if
absolutely required.
If a client uses the synchronous consistent access enabled via this setting, it
also affects the client. Depending on the scheduler of the runtime system, the
response time can jitter more here for read/write access because the system
might still have to wait for an execution gap of the IEC tasks. Furthermore, read
and/or write access can fail if IEC tasks run for a very long time (multiple 100
ms) or if the CPU load by one or multiple IEC tasks is close to 100% for a
longer period. The availability of the values thus also depends on the control
load by the IEC application.
Additionally, the client can minimize effects on itself and on the runtime system
if considering the following when defining the variable lists to be read/written:
● Synchronously consistently access only those variables that are required as
consistent
● Separated variable lists for variables that have to be consistent and for
variables that may be inconsistent
● Split variable lists with many consistent variables into multiple smaller lists
● Select reading intervals for cyclic value reading as high as possible.
{attribute 'symbol':='none'}
InternalData : ARRAY[0..100] OF BYTE;
{attribute 'symbol':='readwrite'}
SecondNumber : INT;
{attribute 'symbol':='none'}
MoreData : ARRAY[0..100] OF BYTE;
END_STRUCT
END_TYPE
Resulting entries in the symbol file; pay attention to "size" and "byteoffset":
Symboldatei, Große Struktur, Option Kompatibilitätslayout
<TypeUserDef name="T_GrosseStruktur" size="208"
nativesize="208" typeclass="Userdef" pouclass="STRUCTURE"
iecname="GrosseStruktur">
</TypeUserDef>
Symboldatei, Große Struktur, Option Optimiertes Layout
<TypeUserDef name="T_GrosseStruktur" size="4"
nativesize="208" typeclass="Userdef" pouclass="STRUCTURE"
iecname="GrosseStruktur">
User interface
byteoffset="2" vartype="VAR" />
</TypeUserDef>
Beispiel: Struktur mit ungeraden Adressen
{attribute 'pack_mode':='1'}
TYPE UngeradeAdressen :
STRUCT
{attribute 'relative_offset':='3'}
{attribute 'symbol':='readwrite'}
PublicNumber : INT;
{attribute 'symbol':='readwrite'}
PublicValue : LREAL;
END_STRUCT
END_TYPE
Resulting entries in the symbol file; pay attention to "size" and "byteoffset":
Symboldatei, Struktur mit ungeraden Adressen, Option Kompatibilitätslayout
<TypeUserDef name="T_UngeradeAdressen" size="13"
nativesize="13" typeclass="Userdef" pouclass="STRUCTURE"
iecname="UngeradeAdressen">
</TypeUserDef>
</TypeUserDef>
Beispiel Funktionsbaustein
// Each POU contains some implicit variables, which do not
get published. Depending on the data type these might cause
memory gaps of different sizes.
FUNCTION_BLOCK Baustein IMPLEMENTS SomeInterface
VAR_INPUT
in : INT;
END_VAR
VAR_OUTPUT
out : INT;
END_VAR
VAR
END_VAR
Each block contains some implicit variables which are not published. If it is
a data type such as __XWORD, different sizes of memory gaps result in the
client-side data layout, depending on whether the system is 64-bit or 32-bit.
Resulting entries in the symbol file for 64-bit and 32-bit; pay attention to "size"
and "byteoffset":
Symboldatei, Funktionsbaustein, Option Kompatibilitätslayout, 64 Bit
<TypeUserDef name="T_Baustein" size="24"
nativesize="24" typeclass="Userdef" pouclass="FUNCTION_BLOCK"
iecname="Baustein">
</TypeUserDef>
Symboldatei, Funktionsbaustein, Option Optimiertes Layout, 64 Bit
<TypeUserDef name="T_Baustein" size="4"
nativesize="24" typeclass="Userdef" pouclass="FUNCTION_BLOCK"
iecname="Baustein">
</TypeUserDef>
</TypeUserDef>
User interface
Symboldatei, Funktionsbaustein, Option Optimiertes Layout, 32 Bit
<TypeUserDef name="T_Baustein" size="4"
nativesize="12" typeclass="Userdef" pouclass="FUNCTION_BLOCK"
iecname="Baustein">
</TypeUserDef>
Also refer to
● ⮫ Chapter 19.2 Symbol Configuration on page 229
Trace editor
At application runtime, the runtime system buffer of the trace component is
filled with the recorded samples. The data is transferred to the development
system and stored in its trace editor buffer. The trace editor accesses this data
and displays it in diagrams as a graph over time. If you close the trace editor,
the trace editor buffer will be freed up.
Use menu commands for controlling the trace. In addition, you can use menu
commands, keyboard shortcuts, and mouse input for navigating through the
data.
Also refer to
● ⮫ Chapter 22.4.4 Operating the Data Recording on page 304
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
User interface
“Name” Listing of the diagrams with the respective variables
● “Diagram <n>” : The diagram is displayed.
The diagram name can be changed by clicking on the selected name
● “<Variable>” : The variable is displayed.
The variable name can be changed by clicking on the selected name
in the line editor
When selecting a “Diagram <n>” in the table, the corresponding dia-
gram is also selected in the editor. This also works the other way
around.
“Cursor <n>” Y-value at the cursor position
“Delta” Delta of the Y-value from “cursor 2” to “cursor 1”
You can use drag&drop to reorder the charts and variables or move them to
other charts. With the [Ctrl] key pressed, the variable is copied. This is also
possible in online mode.
Table 74: Context menu in the trace variable list
“Add variable” Adds a new trace variable and opens the “Trace Configuration” dialog
with its variable settings. Select a variable in the input field of the
“Variable” setting to trace its value curve.
“Visible” Toggles the visibility of the graph (value curve or trace variable) in the
corresponding diagrams:
● : visible.
● : Hidden.
“Display Settings” Opens the “Trace Configuration” dialog. Select a configuration item in
the “Trace Record” tree view or “Presentation (Diagrams)”.
“Configuration” Opens the “Trace Configuration” dialog. The “Variable Settings” are
displayed on the right.
Also refer to
● ⮫ Chapter “Trace configuration” dialog on page 1096
User interface
● “Single scaling (offset)”: adds an offset to the input variable.
Result := Input + Offset
● “Single scaling (factor)”: multiplies the input variable by a factor.
Result := Input * Factor
● “Linear scaling 1 (factor and offset)”: converts the input variable
with a factor and offset. Result := Input * Factor + Offset
● “Linear scaling 2 (Base and target range)”: converts the input var-
iable for the output value to be within a target range. PLC Engi-
neering calculates the functional linear equation internally.
● “User defined conversion”: configures a user-defined conversion
rule with IEC operators. The input variable is rValue.
● “Switchable conversion”: defines a conversion rule that PLC Engi-
neering executes independent of any specified language or variable.
“Setting” Displays the configured conversion rule.
“Condition” ● “TRUE”: PLC Engineering always executes the conversion.
● “Language” If the language in the visualization is the lan-
guage defined here, then PLC Engineering executes the con-
version. The current visualization language is located in the
VisuElems.CurrentLanguage variable.
● “Variable”: If the comparison is TRUE, then PLC Engineering exe-
cutes the conversion rule. PLC Engineering can pass the compar-
ison for a constant, variable, or IEC expression.
You can edit the comparison below the table in the “Condition
Setting”.
“Condition Setting” If you select “TRUE” as the “Condition”, then the field is hidden.
If you configure “Language” as the “Condition”, then the field shows
the current configuration, for example en,de.
If you select “Variable” as the “Condition”, then the field shows the
current configuration, for example PLC_PRG.bActual=PLC_PRG.bSet.
You can edit the current condition setting below the table in the input
fields for “Condition Setting”.
Example
Conversion of electric current from a 10-bit input signal to an amperage range
of 4-20 mA
“Base start value” 0
“Base end value” 1024
“Target start value” 4.0
“Target end value” 20.0
Example
The Conv_A_LanguageDependent conversion rule that defines which conver-
sion rule is executed for the English or German language.
“Name” “Type” “Setting” “Condition” “Condition
setting”
Conv_A_Langu “Switchable Conv_AInInch “Language”
ageDependent conversion” , Conv_AInMM
“Switchable conversion name” “Condition setting”
Conv_AInInch en
Conv_AInMM de
User interface
See also
● ⮫ Chapter 18.14 Unit Conversion on page 157
Status bar
The status bar which is always visible notifies the user about the data source
type and the most important communication settings. If the communication
is established by means of the data source type PLC Engineering Symbolic,
then the name of the data source type, the connection type, and the network
name of the remote device are displayed. If the communication is established
by means of data source type PLC Engineering ApplicationV3 , then the name of
the data source type, the location of the remote project, and the instance name
of the remote application.
Example:
PLC Engineering Symbolic (PLC Engineering V3): PLC_Name
PLC Engineering ApplicationV3 (D:\Projects\Project_A):
Project_A.App_A
Also refer to
● ⮫ Chapter 19.1 Working with control networks – General information
on page 229
Tab 'Variables'
The variables for the data originating from the remote source are declared
in the global variable list <name of data source>. The global variable list
acts as a data interface to the remote PLC. The object is located below the
application and below the “DataSources_Objects” folder.
“Update variables” Establishes a connection to the remote device and opens the “Choose
Variables” dialog.
“Local variable” Variable in the local application. Contains the remote data.
“Access rights” Access rights of the variables. The respective remote variable has the
same access rights.
● : Write access. Every time the values changes, the variable is
updated on the controller.
● : Read access. Every time the values changes on the controller,
the variable is updated in the application.
● : Read/Write access
Note: If you change the access rights, then a download is required for
the change to go into effect.
“Update always” : The controller data is updated automatically (via the data source).
A variable is updated automatically if it is used in the visualization,
trend, recipe, or as an alarm.
Note: This is the recommended setting type.
: The variable is updated in each cycle.
Note: Select the option only when the variable is used exclusively in
IEC code. If a variable is used in the visualization code, then it is
updated automatically.
Note: When an instance of a function block or a data type is updated in
this way, the instance is always transferred completely.
“Create or map” Mapping type for how the remote variable is mapped to the local vari-
able.
● : Mapping to a specific created variable with the data type of
the remote variable. The control data is mapped 1:1. That is the
recommended mapping type. The variable is declared in the GVL
<name of data source>.
● : Mapping to an existing variable. This requires that the existing
variable has the same data type.
● : Mapping to a specific created variable with type-conforming
data type to the remote data type: remote and local data types are
not the same, but compatible. For example, a type-conforming data
type can be available in a library. The variable is declared in the GVL
<name of data source>.
“Type mapping” Data type of the remote variable. If the variable is not a scalar type,
then the type is listed on the “Type Mappings” tab.
“Remote variable” Variable in the remote PLC
“Variables” The remote variables are listed in the tree view. The top node is iden-
tified by the remote application name. Its variables are listed below
that. Structured data is listed with all of its subordinate elements.
Example: appControl_A
: The variable is selected for transferring to the local device. When
the variable is structured, it is applied with all subelements. If the
variables themselves are subelements, then only this subelement is
applied without accepting the structure completely.
Red font: When a variable is displayed in a red font, the variable is not
available (anymore) in the remote PLC.
Note: You can click “Uncheck unavailable variables” to remove the vari-
able from the list.
User interface
: The variable is not selected for the transfer.
The variable has expandable elements. By clicking the symbol, the
variable is extended by their elements.
“Insert the items : The selected variables are transferred with this structure if they are
structured” structured.
: The variable is transferred unstructured with a scalar data type.
“Uncheck unavailable Requirement: The link is visible when previously are no longer avail-
variables” able in the variable available on the remote PLC. These variables are
marked in red in the window above. The symbol configuration or the
application presumably changed in the remote PLC.
By clicking the command, the red variables are removed from the list
box.
See also
● ⮫ Chapter 19.6.6 Editing data source variables on page 249
“Connection type” Connection type between the remote PLC and the local device.
Depending on the selected connection type, the following settings
below change.
Note: Whenever possible, avoid a direct connection without a gateway.
● “PLC Engineering V2”
The devices exist in the same network. The V2 runtime on the
remote PLC provides a communication interface.
● “PLC Engineering V2 (Via gateway)”
The devices do not exist in the same network. They are connected
via a V2 gateway.
● “PLC Engineering V3”
User interface
The devices exist in the same network. The V3 runtime on the
remote PLC provides a communication interface.
● “PLC Engineering V3 (Via gateway)”
The devices do not exist in the same network. They are connected
via a V3 gateway.
“Advanced”
“Used as” ● “Don't use”
Recommended setting
The “INI content” property as well as any specified configuration
settings there are ignored.
● “Extend the configuration by the following content”
As a rule, the configuration settings are used which are specified
in the “Connection Settings for PLC Engineering V3 (Via gateway)”
property. Moreover, the configuration settings are used in the “INI
content” property.
● “Configure completely with the following content”
The configuration settings of the “Configuration Settings for PLC
User interface
Engineering V3 (Via gateway)” property are ignored. Instead, only
the configuration settings are used in the “INI content” property.
“INI content” Requirement: “Used as” is set to “Extend the configuration by the
following content”.
Example:
logfilter=16#000000FF
Example:
parameter0=EncryptCommunication
value0=1
Note: If the parameters are generic, then they can be specified as
0-based (parameter0 and value0). When extending, the numbering is
automatically adjusted so that the extended parameters connect to the
existing ones. The number of parameters (parameters=<n>) is also
set to the correct value.
“INI content” Requirement: “Used as” is set to “Configure completely with the
following content”.
Example:
[PLC:PLC_IdArti]
interfacetype=ARTI
active=1
logevents=1
motorola=0
nologin=0
timeout=10000
precheckidentity=0
tries=3
waittime=12
reconnecttime=10
buffersize=0
device=Tcp/Ip (Level 2 Route)
instance=PLCWinNT_TCPIP_L2Route
parameters=4
parameter0=Address
value0=localhost
parameter1=Port
value1=1200
parameter2=TargetId
value2=0
parameter3=Motorola byteorder
value3=No
See also
● ⮫ Chapter 19.6.5 Initially Adding a Data Source on page 243
● ⮫ Chapter 33.2.13 Object 'Data Sources Manager' on page 775
Window area for controllers Controllers and their subordinate applications, read from the selected
of the project project
Example:
User interface
“Automatic configuration” : The configuration is read automatically from the source project.
This is the recommended setting.
Example: “[DEVICE_A]”
Example: “[undetermined]”: No configuration can be read.
Note: Make sure that the application is running on the controller and
the network path is active. The communication settings of the con-
troller are applied only then. These are the communication settings
that were configured in the source project in the device editor on the
“Communication Settings” tab.
“Manual configuration” : More configuration settings are displayed.
See "Manual configuration" below.
Manual configuration
“Dynamic from variable” : The communication parameters are configured at applica-
tion runtime by means of an IEC variable of data type
DatasourceAppV3.ConnectionSetup.
: Opens the input for selecting the IEC variables for a dynamic con-
figuration.
The data type DatasourceAppV3.ConnectionSetup (STRUCT) is
defined in the Datasource ApplicationV3 Access library. For the
configuration, the structure member xDataValid first has to be set to
FALSE. If the address data has been specified, then xDataValid has
to be set back to TRUE.
Use case: The communication parameters are not available yet when a
project is being created.
“Use device address” : The communication is done via the address specified here.
Example: 0101
Hint: Click “From device” for an automatic address setting.
“From device” The data of the currently connected data source device is read
automatically and specified in “Use device address”. The address
corresponds to the setting of the device in the device editor in
“Communication Settings”.
“Search for the target : The data source manager starts the network scan for devices in the
device using the network network. The scan is successfully when controllers are found whose
scan” communication settings match the selected search criteria. The result
is displayed in the input fields.
“Node name” : Search for the specified node name
Example: WST06
“Target type” : Search for the specified target type
Example. 4096
“Target ID” : Search for the specified target ID
Example: 0000 0001
“Target version” : Search for the specified target version
Example: 1.0.0.0
“Network location” ● “Direct child of the data sources PLC”: The scanned remote PLC
has an address that is running with the address of the local con-
troller (of the data source manager).
Example: Data sources PLC: 0000.0001; remote source PLC:
0000.0001.0001
● “Direct child of node with address”: Specify the address of the
parent node
● “Direct child of the data source PLC or of the node with address”:
Combination of both options above.
“Search type” ● “First found device”: The first controller in the device tree is
selected that fulfills the specified criteria.
● “Exactly found device”: The controller is selected that fulfills the
specified criteria exactly.
Note: The data source manager waits until the network scan is com-
plete. This usually takes about 10 seconds.
See also
● ⮫ Chapter 19.6.5 Initially Adding a Data Source on page 243
● ⮫ Chapter 33.2.13 Object 'Data Sources Manager' on page 775
“Update Configuration”
“Update rate (ms)” Example: 200
“Connection Information”
“Connection status” Example: online
“Error information” Example: OK
See also
User interface
● ⮫ Chapter 19.6.8 Updating Data Interfaces on page 252
Object 'DUT'
Symbol:
● for a DUT without text list support
● for an enumeration data type with text list support
A DUT (Data Unit Type) declares a user-specific data type.
You can add this kind of object below the application or in the “POUs” view.
When the object is created, the “Add DUT” dialog opens. There you select
among the “Structure”, “Enumeration”, “Alias”, or “Union” data types.
Moreover, enumerations can have a text list stored to localize the enumeration
values. Then the object also has a localization view.
Syntax
TYPE <identifier> : <data type declaration with optional
initialization>
END_TYPE
How the data type declaration has to be done syntactically depends in detail on
the selected data type.
Examples
Declaration of a structure
TYPE S_POLYGONLINE :
STRUCT
aiStart : ARRAY[1..2] OF INT := [-99, -99];
aiPoint1 : ARRAY[1..2] OF INT;
aiPoint2 : ARRAY[1..2] OF INT;
aiPoint3 : ARRAY[1..2] OF INT;
aiPoint4 : ARRAY[1..2] OF INT;
aiEnd : ARRAY[1..2] OF INT := [99, 99];
END_STRUCT
END_TYPE
Extension of a structure
Declaration of an enumeration
{attribute 'qualified_only'}
{attribute 'strict'}
TYPE E_TRAFFICSIGNAL :
(
eRed,
eYellow,
eGreen := 10
);
END_TYPE
Enumeration with text list support in the localization view
The “Textual View” and “Localization View” buttons are located on the
right edge of the editor. Click the buttons to toggle between the views.
Declaration of an alias
TYPE A_MESSAGE : STRING[50];
END_TYPE
Declaration of a union of components with different data types
TYPE U_DATA :
UNION
lrA : LREAL;
liA : LINT;
dwA : DWORD;
END_UNION
END_TYPE
User interface
Example: E_TRAFFICSIGNAL
“Add Text List Support” : Enumeration that does not have any text list support
: Enumeration with additionally stored text list for the enumeration
values. The text list allows you to localize the names of the enumera-
tion values.
Example: ETL_TRAFFICSIGNAL
Note: In the case of an existing enumeration type, text list support
can be added or removed at any time. As a result, the “Add Text List
Support” and “Remove Text List Support” commands are provided in
the context menu of the object.
Hint: The localized texts can be displayed, for example, in a visualiza-
tion. In this case, the text output of a visualization element displays
the symbolic enumeration values in the current language instead of
the numeric enumeration values. When an enumeration with text list
support is specified in the “Text variable” property of a visualization
element, it gets the additional property < < enumeration name> >.
Example: In a visualization, you use the variable
PLC_PRG.eTrafficLight of type ETL_TRAFFICSIGNAL.
ETL_TRAFFICSIGNAL is an enumeration with text list support. Then
the entry in the properties editor of the visualization element looks like
this: PLC_PRG.eTrafficLight <ETL_TRAFFICSIGNAL>.
Hint: When you edit the enumeration type in the application, a prompt
opens when you close the application and asks whether the affected
visualizations should be updated automatically.
See also: Help for "Enumerations" with information about the declara-
tion syntax
“Alias” Creates an object which declares an alias with which an alternative
name is declared for a base type, data type, or function block
“Union” Creates an object which declares a union that combines multiple mem-
bers with mostly different data types into a logical unit.
All members have the same offset so that they are occupy the same
memory. The memory requirement of a union is determined by the
memory requirement of its "largest" component.
“Add” Closes the dialog and creates the new object
The object is displayed with the symbol in the device tree or in
the “POUs” view. When a text list is also stored for the object, the
symbol is displayed.
See also
● ⮫ Chapter 32.5.22 Alias on page 591
● ⮫ Chapter 32.5.21 Enumerations on page 586
● ⮫ Chapter 32.5.20 Structure on page 583
● ⮫ Chapter 32.5.23 Data Type 'UNION' on page 592
● ⮫ Chapter Command 'Add Text List Support' on page 1025
● ⮫ Chapter Command 'Remove Text List Support' on page 1025
● ⮫ Help for CODESYS Visualization: Using Texts
See also
● ⮫ Chapter 8.3.4 Adding objects on page 61
● ⮫ Chapter Command 'Add Object' on page 932
● ⮫ Chapter 'Properties’ dialog - 'External File' on page 1051
User interface
files; you import this directory into PLC Engineering.
● You add an object “C Code File” to a “C Code Module” and in doing so you
specify a C-file in the dialog box “Add C Code File” that you import into PLC
Engineering.
● You add an object “C Code File” to a “C Code Module” and in doing so you
specify the name for a new C-file in the dialog box “Add C Code File”. As
opposed to the two other methods you create an empty file by doing this.
Possible file formats of a C-code file:
● *.c
● *.ccp
● *.h
● *.hpp
You can make simple changes to the C-code in the text editor.
“Add” Opens the dialog box “Select Device”, where you can assign a precom-
piled module to a device and add it to the C-implemented library.
Any number of modules can be added to such an object. When down-
loading a concrete project with this library to a device, only the respec-
tively matching file is loaded to the device.
“Remove” Removes the selected entry in “Object files for devices”.
Table 81: “Choose Device ”
“Object File” Input of a file that matches the “Device” and can be loaded by the
operating system as a dynamic object, for example for Windows: *.dll,
for Linux: *.so
Please note: The file *.dll must contain the title of the library project
in its name. Example: if the library project has name XYlib, then the
“Object File” must be called: <name>_XYlib.dll
“Device” ● “Vendor”:
● List of the devices
● Options
– “Group by category”:
: the available devices (newest version) are sorted by category.
The category is defined in the device description file.
: the available devices appear flat and alphabetically sorted.
– “Display all versions (for experts only)”
: in addition, all other available versions of the devices can also
be selected.
: only the newest version of each device is available for selec-
tion.
– “Display outdated versions”
: in addition, outdated versions of the devices can also be
selected. Outdated versions result, for example, from the update
of plug-ins.
: outdated device versions are not displayed.
● Information about the device.
“Chose device” The runtime module precompiled in the “object file” is assigned to the
selected “device”.
See also
● ⮫ Chapter 18.10 Integrating C Modules on page 146
Call POUs
Certain POUs can call other POUs. Recursion is not permitted.
When calling POUs via the namespace, PLC Engineering scans the project for
the POU to be called as per the following sequence:
1. Current application
2. “Library manager” of the current application
3. View “POUs”
4. “Library manager” in “POUs view”
When calling a programming block that exists with the same name both in
a library used in the application and as an object in the “POUs” view, the
following applies: There is no syntax according to which you can call the POU
User interface
in the “POUs” view only by its name. In this case, you need to move the library
from the application's library manager to the project's library manager (in the
“POUs” view). Subsequently, you can call the POU object in the “POUs” view
using its name. When adding the library namespace, call the library POU.
The term "POU" is also used in PLC Engineering for the “POUs view”, where
PLC Engineering manages the objects valid across projects.
Also refer to
● ⮫ Chapter 'Properties' dialog – General information on page 1047
● “Access specifier”
– “PUBLIC”: Does not corresponds any access modifier specifica-
tion
– “INTERNAL”: The access to the function block is limited to the
namespace (of the library)
● “Method implementation language”: If you have selected the
“Implemented” option, select an implementation language for all
method objects that PLC Engineering creates via the implementa-
tion of the interface.
The “method implementation language” is independent of the
implementation language of the function block
“Function” Note: Not available if “Sequential Function Chart (SFC)” is selected in
the drop-down list “Implementation language”.
“Return type”: Selection list for the data type of the return value
“Implementation language” Selection list for the implementation language of the POU
Also refer to
● ⮫ Chapter ‘Function block’ object on page 823
● ⮫ Chapter 'Program’ object on page 822
● ⮫ Chapter Object 'Function' on page 825
● ⮫ Chapter 18.24.2 Extension of Function Blocks on page 220
● ⮫ Chapter 18.24.3 Implementing Interfaces on page 221
'Program’ object
A program is a POU that yields one or more values when executed. All values
remain unchanged after program execution until the next execution. The call
order of programs in an application are defined in task objects.
Add a program to the application or project using the command “Project 🠂 Add
object 🠂 POU”. In the device tree and in the “POUs” view, the program POUs
have the suffix “(PRG)”.
The editor of a program consists of the declaration section and the implemen-
tation section.
The top line of the declaration part contains the following declaration:
PROGRAM <program>
Calling a program
Programs and function blocks can call a program. A program call is not per-
mitted in a function. There are not instances of programs.
When a POU calls a program and values of the program change, the changes
remain up to the next program call. The values of the program also remains
if a different POU calls next. This is different from calling a function block.
When calling a function block, only the values of the respective instance of the
function block change. The changes have to be considered only when a POU
calls the same instance.
The input parameters and/or output parameters for a program can also directly
be set upon the call.
Syntax: <program>(<input variable> := <value>, <output value> =>
<value>):
When inserting a program call via the input help and the option “Insert with
arguments” is activated in the input help, PLC Engineering adds input and/or
output parameters to the program call according to the syntax.
Examples
Calls:
IL:
By parameter assignment:
User interface
ST:
PLC_PRG()
erg := PLC_PRG.out2;
By parameter assignment:
PLC_PRG(in1:=2, out1=>erg);
Also refer to
● ⮫ Chapter 33.2.29 "POU” object on page 820
● ⮫ Chapter 18.21 Task configuration on page 208
The top line of the declaration part contains the following declaration:
FUNCTION_BLOCK <access specifier> <function block> | EXTENDS
<function block> | IMPLEMENTS <comma-separated list of
interfaces>
Example
Access to function block variables:
The function block FB1 is provided with the input variable iVar1 of type INT
and the output variable out1. The variable iVar1 is called from the program
Prog in the following.
PROGRAM Prog
VAR
inst1 : FB1;
END_VAR
Example
The instance CMD_TMR of the timer function block is called with assignments
for the input variable IN and for PT. Subsequently, the output variable Q of the
timer is assigned to the variable A
PROGRAM PLC_PRG
VAR
CMD_TMR : TOF;
END_VAR
User interface
CMD_TMR(IN := %IX5.1, PT := T#100MS);
A := CMD_TMR.Q;
If you insert a function module instance via the “input help” and the “Insert
with arguments” option is activated in the Input “help” dialog, PLC Engineering
inserts the call with all input and output variables. Then, insert the value
assignment. In the example, above PLC Engineering inserts the call as follows:
CMD_TMR (IN:= ,PT:= , Q=> ).
Using the 'is_connected' attribute on a local variable is used to determine
whether a particular input receives an external assignment at call time in the
function module instance.
Also refer to
● ⮫ Chapter 33.2.29 "POU” object on page 820
● ⮫ Chapter 18.24.2 Extension of Function Blocks on page 220
● ⮫ Chapter 18.24.3 Implementing Interfaces on page 221
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Property' on page 839
● ⮫ Chapter Attribute 'is_connected' on page 627
Object 'Function'
A function is a POU that supplies precisely one data element when executed
and whose call in textual languages can occur as an operator in expressions.
The data element can also be an array or a structure.
Add the object to the application or project using the command “Project 🠂 Add
object 🠂 POU” command. In the device tree or in the “POUs” view, function
POUs have the “(FUN)” suffix.
Functions have no internal status information, which
NOTICE
means that functions do not save the values of their
variables until the next call. Calls of a function with
the same input variable values always supply the same
output value. Therefore functions must not use global
variables and addresses!
The editor of a function consists of the declaration part and the implementa-
tion part.
The top line of the declaration part contains the following declaration:
FUNCTION <function> : <data type>
Below that, you declare the input and function variables.
The output variable of a function is the function name.
Calling a function
In ST, you can use the call of a function as an operand in expressions.
In SFC, you can use a function call only within step actions or transitions.
Examples
Function with declaration part and a line implementation code
Function calls:
ST:
result := POU_Funct(5,3,22);
IL:
LD:
User interface
According to the IEC 61131-3 standard, functions can have additional outputs.
You declare the additional outputs in the function between the keywords
VAR_OUTPUT and END_VAR. The function is called according to the following
syntax:
<function> (<function output variable1> => <output variable
1>, <function output variable n> => <output variable n>)
Example
The fun function is defined with two input variables in1 and in2. The output
variable of the fun function is written to the locally declared output variables
loc1 and loc2.
fun(in1 := 1, in2 := 2, out1 => loc1, out2 => loc2);
Also refer to
● ⮫ Chapter 33.2.29 "POU” object on page 820
Object 'Interface'
Symbol:
Keyword: INTERFACE
An interface is a means of object-oriented programming. The object ITF
describes a set of method and property prototypes. In this context, prototype
means that the methods and properties contain only declarations and no imple-
mentation.
This allows different function blocks having common properties to be used in
the same way. An object “ITF” is added to the application or the project with
the command “Project 🠂 Add Object 🠂 Interface”.
Table 83: “Adding an interface”
“Inheritance”
“Name” Interface name
“Extends” : Extends the interface that you enter in the input field or via the
input assistant . This means that all methods of the interface that
extend the new interface are also available in the new interface.
You can add the objects “Interface property” and “Interface Method” to the
object “ITF”. Interface methods may contain only the declarations of input,
output and input/output variables, but no implementation.
So that you can also use an interface in the program, there must be a function
block that implements this interface.
This means:
● the function block contains the interface in its IMPLEMENTS list in its decla-
ration part
● the function block contains an implementation for all methods and property
prototypes of the interface
A function block can implement one or more interfaces. You can use the same
method with identical parameters, but different implementation code in dif-
ferent function blocks.
Please note the following:
● You may not define variables within an interface. An interface has no imple-
mentation part and no actions. Only a collection of methods is defined, in
which you may define only input, output and input/output variables.
● PLC Engineering always treats variables declared with the type of an inter-
face as references.
● A function block that implements an interface must contain implementation
code for the methods of the interface. You have named the methods exactly
as in the interface and the methods contain the same input, output and
input/output variables as in the interface.
Interface references and online change
NOTICE
The following can happen with a compiler version <
3.4.1.0: if a function block changes its data because vari-
ables are added or deleted, or because the type of varia-
bles changes, then PLC Engineering copies all instances
of the function block to a new memory location. In this
case, however, an interface reference refers not to the
new memory location, but still to the old one.
In case of compiler versions >= 3.4.1.0, PLC Engineering
automatically re-addresses the interface references so
that PLC Engineering also references the correct inter-
face in case of an online change. PLC Engineering
requires additional code and more time for this, so that
jitter problems can occur depending on the number of
objects concerned. Therefore, PLC Engineering displays
the number of variables and interface references con-
cerned before the execution of the online change and
you can then decide whether the online change should
be executed or aborted.
Example
Definition of an interface and its use in a function block
You have inserted the interface “ITF” below the application. The interface
contains the methods “Method1” and “Method2”. “ITF”, “Method1” and
“Method2” contain no implementation code. You insert the required variable
declarations only in the declaration part of the methods.
If you subsequently insert a function block in the device tree that implements
the interface “ITF”, PLC Engineering automatically also inserts the methods
“Method1” and “Method2” under the function block. Here you can implement
function-block-specific code in the methods.
User interface
● ⮫ Chapter 18.24.3 Implementing Interfaces on page 221
● ⮫ Chapter 18.24.4 Extending Interfaces on page 223
'Method’ object
Symbol:
Keyword: METHOD
Methods are an extension of the IEC 61131-3 standard and a tool for object-ori-
ented programming which is used for data encapsulation. A method contains a
declaration and an implementation. However, unlike a function, a method is not
an independent POU, and it is subordinated to a function block or program. A
method can access all valid variables of the superordinate POU.
You can add a method below a program or a function block. Use the command
“Project 🠂 Add object 🠂 Method”. The dialog opens to add a method.
Use interfaces for the organization of methods.
For further information, see: ⮫ Implementing Interfaces
IMPORTANT
NOTICE
When you copy a method below a POU and add it below
an interface, or move the method there, the contained
implementation is removed automatically.
Declaration
Syntax
METHOD <access specifier> <method name> : <type of return
value>
Sample/declaration
METHOD PUBLIC DoIt : BOOL
VAR_INPUT
iInput_1 : DWORD;
iInput_2 : DWORD;
sInput_3 : STRING(12);
END_VAR
Implementation
Optional
● When implementing the method, access to function block instances or pro-
User interface
gram variables is allowed.
● The THIS pointer allows for access to its own function block instance. There-
fore, the pointer is permitted only in methods that are assigned to a function
block.
● A method cannot access VAR_TEMP variables of the function block.
● A method can call itself recursively.
● There is no implementation for interface methods. Interface methods can
have declared input, output, and VAR_IN_OUT variables, but do not contain
any implementation.
Calling a method
Syntax bei Aufruf
Sample/declaration
Example
If you omit the names of the input variables, the assignment of the arguments
results from the declaration order.
Deklaration
User interface
IF iInput_1 = iInput_2 THEN
DoIt := TRUE; // explicit return value
END_IF
Aufruf mit Argumentübergabe nach Reihenfolge in der Deklaration
basic function block. Now, for example, you can easily adopt a method of the
basic function block first, and then adapt it accordingly for the derived function
of the module.
Methods and attributes with the PRIVATE access modifier are not available
either in this selection because they should not be inherited. When accepted
into the inherited block, methods and attributes with the PUBLIC access modi-
fier automatically have a blank access modifier field. Functionally seen, it is the
same.
Example
User interface
Also refer to
● ⮫ Chapter 18.24.2 Extension of Function Blocks on page 220
● ⮫ Chapter 18.24 Object-oriented programming on page 219
● ⮫ Chapter Object 'Action' on page 843
● ⮫ Chapter Object 'Property' on page 839
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Transition' on page 845
Also refer to
● ⮫ Chapter 18.24.3 Implementing Interfaces on page 221
● ⮫ Chapter ST editor in online mode on page 380
● ⮫ Chapter 22.3.3 Using Watch Lists on page 297
● ⮫ Chapter 32.2.10 Instance Variables - VAR_INST on page 445
Example
User interface
This interface itf_A has the property Literal_A with the accessor methods
Get and Set.
The function blocks fb_A1 and fb_A2 implement the interface itf_A and
therefore inherit its interface property. Each FB has its own implementation.
Interface itf_A
INTERFACE itf_A
VAR
END_VAR
PROPERTY Literal_A : STRING
FB fb_A1
VAR
END_VAR
Literal_A := CONCAT (str_1,' and property.');
Accessor fb_A1.Literal_A.Set
VAR
END_VAR
str_2 := Literal_A;
FB fb_A2
iCnt := iCnt + 1;
str_1 := 'Function block A2';
Accessor fb_A2.Literal_A.Get
VAR
END_VAR
Literal_A := str_1;
Accessor fb_A2.Literal_A.Set
VAR
END_VAR
str_2 := Literal_A;
Program PLC_PRG
PROGRAM PLC_PRG
VAR
iCnt : INT;
my_1 : fb_A1;
my_2 : fb_A2;
strName_1 : STRING;
strName_2: STRING;
END_VAR
iCnt := iCnt + 1;
my_1();
my_2();
strName_1:= my_1.Literal_A;
strName_2:= my_2.Literal_A;
my_1.Literal_A := 'Hello 1';
my_2.Literal_A := 'World 2';
This leads to the following monitoring of PLC_PRG when the application is in
runtime mode:
User interface
Object 'Property'
Symbol:
Keyword: PROPERTY
Properties are an extension of the IEC 61131-3 standard and a tool for object-
oriented programming.
Properties are used for data encapsulation because they allow for external
access to data and act as filters at the same time. For this purpose, a property
provides the accessor methods Get and Set which allows for read and write
access to the data of the instance below the property.
You can add a property with accessor methods below a program, a function
block, or a global variable list. Click “Project 🠂 Add Object 🠂 Property” to open
the “Add Property” dialog.
You can add an interface property below an interface.
When you copy a property that is inserted below a POU and add it below an
interface, or if you move the property there, the included implementations are
removed automatically.
Also refer to
● ⮫ Chapter Object 'Interface Property' on page 836
“PRIVATE” The access is limited to the program, the function block or the GVL.
The object is marked as (private) in the POU or device view. The
declaration contains the keyword PRIVATE.
“PROTECTED” Access is restricted to the program, function block, or GVL with its
derivations.
The object is marked as (protected) in the POU or device view. The
declaration contains the keyword PROTECTED.
“INTERNAL” Access is restricted to the namespace (library).
The object is marked as (internal) in the POU or device view. The
declaration contains the keyword INTERNAL.
“Abstract” : Identifies that the property does not have an implementation and
the implementation is provided by the derived function block
“Add” Adds a new property be low the selected object and below that the
accessor methods Get and Set
Note: When selecting a property, you can also add a previously
removed accessor explicitly by clicking on “Add object”.
Editor 'Property'
You can program the data access in the editor. The code can contain additional
local variables. However, it cannot contain any additional input variables or (as
opposed to a function or method) output variables.
Example
Funktionsbaustein FB_A
FUNCTION_BLOCK FB_A
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
iA : INT;
END_VAR
iA := iA + 1;
Eigenschaft prop_iA
prop_iA := iA;
Accessormethode FB_A.prop_iA.Set
iA := prop_iA;
PROGRAM PLC_PRG
VAR
fbA : FB_A;
iVar: INT;
END_VAR
fbA();
IF fbA.prop_iA > 500 THEN
fbA.prop_iA := 0;
END_IF
User interface
iVar := fbA.prop_iA;
“Add” Adds the accessor methods Get or Set below the selected property.
Each time the value is displayed, PLC Engineering calls the code of the Get
accessor. If this code contains a side effect, then the monitoring executes
the side effect!
Monitor a property with the help of the following functions.
● Inline monitoring
Prerequisite: The option “Activate inline monitoring” is selected in the cate-
gory “Text editor” of the “Options” dialog.
● Monitoring list
Also refer to
● ⮫ Chapter 18.24.5 Calling Methods on page 224
● ⮫ Chapter Attribute 'monitoring' on page 629
Example
User interface
Also refer to
● ⮫ Chapter 18.24.2 Extension of Function Blocks on page 220
● ⮫ Chapter 18.24 Object-oriented programming on page 219
● ⮫ Chapter Object 'Action' on page 843
● ⮫ Chapter Object 'Property' on page 839
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Transition' on page 845
Object 'Action'
Symbol:
In an action you implement further program code. You can implement this
program code in a different language than the base implementation. The base
implementation is a function block or a program where you inserted the action.
An action does not have its own declaration and it works with the data from
the base implementation. This means that the action uses the input and output
variables and the local variables from its base implementation.
Add an “Action” to a function block or program by clicking “Project 🠂 Add
Object 🠂 Action”.
Table 85: “Add Action”
“Name” Name of the action
“Implementation language” Combobox for the implementation language
Example
Also refer to
● ⮫ Chapter 18.24.2 Extension of Function Blocks on page 220
● ⮫ Chapter 18.24 Object-oriented programming on page 219
● ⮫ Chapter Object 'Action' on page 843
● ⮫ Chapter Object 'Property' on page 839
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Transition' on page 845
Calling an action
Syntax:
<program>.<action> or <FB-instance>.<action>
To call an action from only within the base implementation, you only have to
provide the action name.
Examples
Calling a “Reset” action from another POU The call is not executed from the
base implementation.
Declaration:
PROGRAM PLC_PRG
User interface
VAR
Inst : Counter;
END_VAR
Calling a “Reset” action from an IL POU
CAL Inst.Reset(In := FALSE)
LD Inst.Out
ST ERG
Calling a “Reset” action from an ST POU
Inst.Reset(In := FALSE);
Erg := Inst.out;
Calling a “Reset” action from an FBD POU
Also refer to
● ⮫ Chapter SFC Element 'Action' on page 402
Object 'Transition'
Symbol:
The object can be used as a transition element in a program block implemented
in SFC.
Also refer to
● ⮫ Chapter SFC Elements 'Step' and 'Transition' on page 400
Methods and attributes with the PRIVATE access modifier are not available
either in this selection because they should not be inherited. When accepted
into the inherited block, methods and attributes with the PUBLIC access modi-
fier automatically have a blank access modifier field. Functionally seen, it is the
same.
Example
Also refer to
● ⮫ Chapter 18.24.2 Extension of Function Blocks on page 220
● ⮫ Chapter 18.24 Object-oriented programming on page 219
● ⮫ Chapter Object 'Action' on page 843
● ⮫ Chapter Object 'Property' on page 839
● ⮫ Chapter 'Method’ object on page 829
● ⮫ Chapter Object 'Transition' on page 845
The command “Add Object 🠂 POU for Implicit Checks” is used for adding to
the application. The command opens the “Add POU for Implicit Checks” dialog
where you can select a monitoring function type (see table below). Depending
on the monitoring function, you have to edit the implementation code or create
it yourself from scratch.
To prevent multiple inclusions, monitoring functions that have already been
inserted are disabled in the “Add POU for Implicit Checks” dialog.
To get the feature for monitoring functions, do not edit
NOTICE
their declaration part. However, you are permitted to add
local variables.
After removing implicit monitoring functions (for example
CheckBounds) from the project, an online change is no
User interface
longer possible, only a download. A corresponding mes-
sage is output.
By default, PLC Engineering does not run implicit checks for function blocks
from libraries used in the application. However, you can extend the check to the
libraries as follows: Open the “Properties” dialog of the application and enter
the compiler definition checks_in_libs in the “Compiler defines” field on the
“Build” tab. This definition affects implementation libraries (*.library) only,
not protected libraries (*.compiled-library).
You can use the "no_check" attribute to deactivate the check for special POUs
in the project.
Table 86: “Available functions”
Monitoring function Type
“CheckBounds” “Bound Checks”
Appropriate handling of bound violations; such handling includes set-
ting flags or changing field indices.
“CheckDivDInt” “Division checks”:
“CheckDivLInt” Monitors the divisor value to avoid division by zero.
“CheckDivReal”
“CheckDivLReal”
“CheckRangeSigned” “Range checks”:
“CheckRangeUnsigned” Monitors the range limit of a subrange type in runtime mode. Valid for
data types DINT/UDINT.
“CheckLRangeSigned” “L-range checks”:
“CheckLRangeUnsigned” Monitors the range limit of a subrange type in runtime mode. Valid for
data types LINT/ULINT.
“CheckPointer” “Pointer checks”
You are responsible for filling in this function completely with imple-
mentation code. See the help page for "POU 'CheckPointer'". The
function should monitor whether the passed pointer reference a
valid memory address, and whether the orientation of the referenced
memory area matches the variable type to which the pointer refers.
If both conditions are fulfilled, then the pointer is returned. If not,
then CheckPointer should complete an appropriate error handling.
CheckPointer monitors variables of type REFERENCE TO in the same
way.
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter POU 'CheckBounds' on page 848
● ⮫ Chapter POU 'CheckDivInt' on page 851
● ⮫ Chapter POU 'CheckDivLInt' on page 851
POU 'CheckBounds'
Functions for bound checks: CheckBounds
The task of this monitoring function is to handle bound violations appropriately.
Examples of reactions to violations include setting error flags and changing
the value of the array index. The check is performed only for one variable
array index. An incorrect constant array index leads to a compiler error. PLC
Engineering calls the function implicitly as soon as values are assigned to a
variable of type ARRAY.
After inserting the function, you receive automatically generated code in the
declaration and implementation parts. See below.
To get the feature for monitoring functions, do not edit
CAUTION
the declaration part. However, you are permitted to add
local variables.
Deklarationsteil
// Automatisch erzeugter Code : NICHT EDITIEREN
FUNCTION CheckBounds : DINT
VAR_INPUT
index, lower, upper: DINT;
END_VAR
Implementierung
// Automatisch erzeugter Code: Es handelt sich hierbei um
einen Implementierungsvorschlag.
IF index < lower THEN
CheckBounds := lower;
ELSIF index > upper THEN
CheckBounds := upper;
ELSE
CheckBounds := index;
END_IF
Implementation:
_pApp := AppGetCurrent(pResult:=_result);
IF index < lower THEN
CheckBounds := lower;
User interface
*)
When called, the “CheckBounds” function is assigned the following input
parameters:
● index: Index of the array element
● lower: Lower limit of the array range
● upper: Upper limit of the array range
The return value is the index of the array element, as long as it is within a valid
range. If not, then the PLC Engineering returns either the upper or lower limit,
depending on which threshold was violated.
a[b]:=TRUE;
In this example, the CheckBounds function causes a to change the upper limit
of the array range index to 10. The value TRUE is assigned then to the element
a[7]. In this way, the function corrects array access outside of the valid array
range.
When you load and run this application, an "exception" is generated if the
array boundaries are violated. Processing stops in “CheckBounds” so that the
type of error can be detected.
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
● ⮫ Chapter 33.1.14 "Log” tab on page 751
POU 'CheckDivInt'
User interface
CheckDivReal und CheckDivLReal
To prevent division by zero, you can use the functions CheckDivInt,
CheckDivLint, CheckDivReal, and CheckDivLReal. If you include these func-
tions in the application, then they are called before each division operation in
the code.
To get the feature for monitoring functions, do not edit
CAUTION
the declaration part. However, you are permitted to add
local variables.
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
POU 'CheckDivLInt'
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
POU 'CheckDivReal'
User interface
CheckDivReal:=1;
ELSE
CheckDivReal:=divisor;
END_IF;
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
POU 'CheckDivLReal'
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
POU 'CheckRangeSigned'
Function for monitoring the range limits of a subrange type of type DINT.
User interface
counter variable of a FOR loop is a subrange type and
the counting range for the loop exits the defined sub-
range.
VAR
ui : UINT (0..10000);
...
END_VAR
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
POU 'CheckLRangeSigned'
Function for monitoring the range limits of a subrange type of type LINT.
For an implementation example of range monitoring, see the help page for the
CheckRangeSigned function.
VAR
ui : UINT (0..10000);
...
END_VAR
User interface
toring function prevents ui from being set to a value greater than 10000.
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter POU 'CheckRangeSigned' on page 854
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
POU 'CheckRangeUnsigned'
Function for monitoring the range limits of a subrange type of type UDINT.
For an implementation example of range monitoring, see the help page for the
CheckRangeSigned function.
VAR
ui : UINT (0..10000);
...
END_VAR
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter POU 'CheckRangeSigned' on page 854
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
POU 'CheckLRangeUnsigned'
Function for monitoring the range limits of a subrange type of type ULINT.
For an implementation example of range monitoring, see the help page for the
CheckRangeSigned function.
User interface
the counting range for the loop exits the defined sub-
range.
VAR
ui : UINT (0..10000);
...
END_VAR
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter POU 'CheckRangeSigned' on page 854
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
POU 'CheckPointer'
Monitoring function for pointers
Use this function to monitor the memory access of pointers in runtime mode.
As opposed to other monitoring functions, a standard suggestion does not exist
for the implementation of CheckPointer. You must define an implementation
according to your own requirements.
The CheckPointer function is intended to check whether the passed pointer
points to a valid memory address and whether the alignment of the referenced
memory area matches the type of the variable to which the pointer points. If
both conditions are fulfilled, the POINTER is returned. If not, then the function
should complete an appropriate error handling.
To get the feature for monitoring functions, do not edit
CAUTION
the declaration part. However, you are permitted to add
local variables.
For the THIS pointer and the SUPER pointer there is no
NOTICE
implicit call of the monitoring function.
The function “Checkpointer” is active from compiler ver-
NOTICE
sion 3.5.7.40 also for variables of type REFERENCE identi-
cally as on pointer variables.
Template
Deklaration:
Also refer to
● ⮫ Chapter 18.15 Using function blocks for implicit checks on page 160
● ⮫ Chapter 33.2.30 "POUs for implicit checks” object on page 846
Also refer to
● ⮫ Chapter 18.21.2 Creating a Task Configuration on page 208
● ⮫ Chapter Tab 'Properties' on page 861
● ⮫ Chapter Tab 'System Events' on page 861
● ⮫ Chapter Tab 'Monitor' on page 863
● ⮫ Chapter 'Variable use' tab on page 864
● ⮫ Chapter ‘Task group’ tab on page 865
● ⮫ Chapter Tab 'CPU Load' on page 865
● ⮫ Chapter 'Task’ object – General information on page 865
Tab 'Properties'
User interface
Object: “Task Configuration”
In this tab, you define the basic settings of the task configuration as predefined
by the target system, such as the maximum values for tasks and watchdog
parameters.
User interface
if an exception has task of the runtime, task
occurred in the or the task itself
context of an appli- if the runtime does
cation. not support exception
handling
Login Login of a client to Communication task No
this application
Logout Logout of a client Communication task No
from this applica-
tion
BeforeReadin- Call before reading IEC task Yes
gInputs the inputs
AfterReadingIn- Call after reading IEC task Yes
puts the inputs
BeforeWritin- Call before writing IEC task Yes
gOutputs the outputs
AfterWritingOut- Call after writing IEC task Yes
puts the outputs
DebugLoop Event is sent in Communication task No
cycles to the debug
loop if the IEC task
stops at a break-
point.
PrepareShut- Event is sent imme- Runtime main loop No
down diately before the
runtime system is
downloaded.
PrepareExit- Event is sent during Runtime main loop No
Comm download before
exiting the commu-
nication server.
PrepareExitTasks Event is sent during Runtime main loop No
download before
exiting all tasks.
Tab 'Monitor'
Object: “Task configuration”
In online mode, the tab shows the task status of the task configuration as
well as current messages about the cycle times and cycles. PLC Engineering
refreshes the values in the same time interval as for monitoring of values from
the control.
The displayed values can be reset to the value 0 with the context menu com-
mand “Reset”.
“Task” Task name as defined in the task configuration
“Status” ● “Not generated”: Task was not started since most recent update; espe-
cially for event tasks
● “Created”: The task is detected in the runtime system, but not yet in
operation
● “Valid”: Task is normal in operation
● “Exception”: Task has exceptional state
“Number of IEC cycles” Number of cycles executed since starting the application where the IEC
code was executed; 0 if the target system does not support the counter
function.
“Number of cycles” Number of executed cycles since logging in to the PLC.
It depends on the target system whether cycles are also counted where
the application is not running. In these cases, the “Cycle Count” may be
greater than the “IEC-Cycle Count”.
“Latest cycle time (µs)” Last measured cycle time [µs]
“Average cycle time Average cycle time over all cycles [µs]
(µs)”
“Max. Cycle time (µs)” Maximum measured cycle time over all cycles [µs]
“Min. Cycle time (µs)” Minimum measured cycle time over all cycles [µs]
“Jitter (µs)” Current value of the periodic jitter [µs]
Note: From PLC Engineering 3.5 SP11 to SP15, the peak-to-peak value of
the periodic jitter is displayed. In older versions, as now again from SP16,
the current value of the periodic jitter is displayed.
“Min. Jitter (µs)” Minimum measured periodic jitter [µs]
“Max. Jitter (µs)” Maximum measured periodic jitter [µs]
“Core” Number of processor cores on which the task is currently running.
Example: 2
Prerequisite: The control has a multi-core CPU.
If the CPU is not a multi-core CPU, the value -1 is displayed here.
Also refer to
● ⮫ Chapter 18.21.3 Definitions of jitter, latency on page 209
● ⮫ Chapter 18.21 Task configuration on page 208
Also refer to
● ⮫ Chapter 18.21.4 Multicore on page 209
● ⮫ Chapter 18.21 Task configuration on page 208
User interface
“Remove group” Deletes the selected task group
“Group name” The name can be changed by double-clicking in the field.
“Core” Specifies in which process kernel the task of this group is processed.
● “FreeFloating”: All tasks are dynamically connected to different pro-
cessor kernels - the operating system assigns the tasks, the user
cannot influence the assignment.
● “SequentialPinned”: All tasks are connected to different processor
kernels - the operating system assigns the tasks, the user cannot
influence the assignment.
● “FixedPinned”: All tasks are connected to a processor kernel. Which
processor kernel the tasks are connected to is decided in the run-
time system (standard setting).
● “<Core number>”: Defined processor kernel. If the process kernel is
not available, an error message is output.
Also refer to
● ⮫ Chapter 18.21.4 Multicore on page 209
● ⮫ Chapter 18.21 Task configuration on page 208
“Configuration” tab
Object: “Task”
User interface
“Update I/Os” in the “PLC Settings” of the PLC, then PLC Engineering
resets the outputs to the defined default values.
Possible cases:
● Multiple subsequent timeouts:
Sensitivity: 0, 1 - exception in cycle 1
Sensitivity: 2 - exception in cycle 2
Sensitivity: n - exception in cycle n
● One timeout: Exception if the cycle time of the current cycle
is longer than (time * sensitivity). Example: Time=t#10ms, Sensi-
tivity=5, i.e., exception as soon as the (one-time) task runs longer
than 50 ms.
“Time (example: t#200ms)” Watchdog time
Defined the time monitoring for a task together with the “Sensitivity”
as described in “Enabling”.
Depending on the target system, the monitoring interval is given as a
percentage of the task interval if possible. In this case, the drop-down
list for the unit is disabled and displays “%”.
“Sensitivity” Number
Defined the time monitoring for a task together with the watchdog
time as described in “Enabling”.
Using the functions from the library CmpIecTask.library, you can deactivate
a watchdog for specific PLC cycles. This is useful for cycles that demand more
time due to initialization.
Example
Disable/re-enable watchdog:
hIecTask := RTS_IEC_HANDLE //Declaration of the variable
hIecTask
hIecTask := IecTaskGetCurrent(0);
IecTaskDisableWatchdog(hIecTask); // Watchdog disabled
...
IecTaskEnableWatchdog(hIecTask); Watchdog enabled
Also refer to
● ⮫ Chapter 33.2.31 "Task configuration" object on page 860
● ⮫ Chapter Tab 'Monitor' on page 863
● ⮫ Chapter ‘Task group’ tab on page 865
“Categories”
“Libraries” Contains templates for creating library projects
“Projects” Contains templates for creating PLC projects
“Templates”
“Projects” category:
“Empty project” Contains only the “Project settings” object
“Standard project” Contains a basic set of objects and libraries. A wizard supports cre-
ating the objects and libraries, see below.
“Libraries” category:
“PLC Engineering-Container Library that contains only other libraries, but no individual blocks.
library”
“PLC Engineering-Interface Library only for defining the interface of a software component. Thus,
library” it contains only objects that do not generate code (constants, struc-
tures, interfaces, etc.).
“Empty library” Contains only the “Project settings” object
“External PLC Engineering Target system-specific library, is implemented as part of the runtime
library” system (in ANSI C or C++) .
User interface
“OK” PLC Engineering opens a new project. An error symbol at the input
field indicates missing data. When hovering with the mouse cursor
over it, a tooltip informs the user how to proceed.
Also refer to
● ⮫ Chapter 8.2.3 Creating a standard project on page 56
Symbol
Call
In the PLC Engineering menu “File 🠂 Open project from ctrlX CORE...”
Operating principle
The command opens the “Open project in ctrlX CORE” dialog, see:
⮫ Dialog “Open project in ctrlX CORE”
In the dialog, select from which ctrlX device the project data is to be loaded to
the Engineering PC. After the project data has been read from the ctrlX device,
it is possible to edit the project in PLC Engineering and then synchronize it
again with the project store in the ctrlX device. In addition, the project data can
also be stored on the Engineering PC.
Write protection is indicated by a line in the top right corner of the main
window. A mouse-click on this line brings up a menu with commands for the
possible actions:
● “Save project under a different file name on the disk”: a mouse-click on this
option leads to 'Save file as…'
● “Exit read-only mode”: appears only if the option “Open read-only” was
selected when opening the project.
● “Remove read-only attribute from the project on the disk”: appears only if
the project file had been provided with the property 'Read-only' on the disk
at the time of opening.
● “Remove identification 'Released' in the project information”: appears only if
this attribute is currently set.
User interface
Backup copy
Optionally a backup copy of the project file can be created. If the option
“Create backup copy” is activated in the option dialog box 'Load and Save',
the project is additionally copied to a file <projectname.backup> each time
the project is saved.
See also
● ⮫ Chapter Command 'Save project as' on page 871
● ⮫ Chapter 11.13 Saving the project on page 85
● ⮫ Chapter ‘Options’ dialog - ‘Load and save' on page 1084
● If you want to protect the library project against subsequent changes, set
the “Released” attribute in the “Project information” dialog. At the next
attempt to save the project, a corresponding message will be displayed and
the user must respond to the write protection with deliberate actions.
● If you save the project as a version of the development system other than
the one currently in use, then you will be informed first about possible data
loss.
Also refer to
● ⮫ Chapter Command 'Save project' on page 870
● ⮫ Chapter 11.13 Saving the project on page 85
● ⮫ Chapter ‘Options’ dialog - ‘Load and save' on page 1084
● ⮫ Chapter 27.3 Information for library developers on page 330
● ⮫ Chapter Command 'Save Project and Install into Library Repository'
on page 875
Entries that are display as red in the list require your attention. Move the
mouse pointer over this library for more information.
“Additional Files” Opens the dialog “Additional Files”. Here, further files can be added to
the archive with the “Add” button.
“Comment” Opens the "Comment" dialog. Here, comments can be added to the
archive.
“Save” Creates the archive file and saves it. The storage location and the
archive name are specified in the subsequent dialog
“Send” Creates a temporary archive file that is attached to an empty e-mail. A
correct installation of the MAPI (Messaging Application Programming
Interface) is required for the successful execution of this operation.
Failure is documented by the display of a corresponding error mes-
User interface
sage. The temporary archive is automatically deleted after sending the
e-mail.
'Advanced’ dialog
Table 92: “Repositories”
“Install devices in” Drop-down list with currently available repositories. Select the reposi-
“Install libraries in” tories to which PLC Engineering is to install the devices and libraries
contained in the archive.
(Only relevant in the con-
text of PLC programming)
Table 93: “Additional files”
By default, "additional files" are preconfigured with “Do not extract”. Change this by selecting
entries in the table and activating one of the following options:
“Extract to project Project file directory
directory”
“Extract to directory” User-defined directory
“Do not extract” Default setting
Also refer to
● ⮫ Chapter Command 'Save/Send Archive' on page 872
Command 'Print'
Symbol:
Function: This command opens the default Windows dialog box for printing
documents.
Call: Main menu “File”
See also
● ⮫ Chapter Dialog 'Project Settings' - 'Page Setup' on page 1063
Command 'Exit'
Shortcut: [<Alt>]+[<F4>]
Function: this command exits from the programming system. If a project is
currently opened that has been changed since it was last saved, a dialog box
opens asking whether the project should be saved.
Call: “File” menu
User interface
With this command PLC Engineering saves the project as a library in the 'sys-
tem' library repository. This is an extension to the saving of a project as a
library file using the “Save Project as” command. The library is installed on the
local system and is immediately available for insertion into a project.
See also
● ⮫ Chapter Command 'Save project as' on page 871
If you have the corresponding help files with translations, then as of PLC Engi-
neering V3 SP15 you can extend the library documentation with the translation
into other languages. This is done as follows:
Place the files __lmd__<language>.aux created for the new languages in
a directory <library name>.lmd parallel to the library project <library
name>.compiled-library-v3. If the files are correct, they are included in the
compiled library file when the library project is saved using the “Save project
as compiled library” command.
Example: The directory standard.lmd is exists parallel to the library file
standard.compiled-library-v3 and contains the file __lmd__fr.aux with
the French translation of the library documentation. After saving as a compiled
library, the French version of the documentation is also available in the library
manager.
Also refer to
● ⮫ Chapter Command 'Security Screen' on page 908
● ⮫ Chapter 27.3 Information for library developers on page 330
● ⮫ Chapter Command 'Save Project and Install into Library Repository'
on page 875
“Extract” If an extracted file has the same name as an existing file in the target
directory, then a dialog box opens, prompting whether the local file
should be replaced. The decision can be applied automatically to any
additional conflicting names. In this case, you have to select the
“Apply to all objects and files” check box.
User interface
network. Select a controller from this overview. Then the Archiv.prj project
archive is downloaded to this controller. You can click “Source Upload” to
upload the complete source code to the PLC Engineering development system
at a later time.
If you are already connected to a controller (in online mode), then the “Source
Download to Connected Device” command is also available for this process.
See also
● ⮫ Chapter Command 'Source Upload' on page 876
● ⮫ Chapter Command 'Source Download to Connected Device' on page 946
Table 96: In addition to the options of the “Search” dialog, the following settings are still possible:
“Replace with” Input field for the new character string.
“Replace” Each next found character string is highlighted in the editor and
replaced (step-by-step replace).
“Replace all” All found character strings are replaced at one time without them
being displayed in the editors.
“Leave changed objects The editors of the found objects remain open.
open after "Replace all"”
Replacement in referenced libraries is not possible.
Also refer to
● ⮫ Chapter Command ‘Search', 'Search in project on page 878
● ⮫ Chapter 18.11 Searching and Replacing in the Entire Project on page 149
‘Search' dialog
“Search for” Character string to be searched.
“Match case”: : The search considers uppercase and lowercase.
“Match whole word”: : Only character strings are found that exact matches.
“Search up”: : The specified search space is run through upwards.
: The specified search space is run through downwards.
“Use regular expressions”: Use the button to receive support when specifying regular expres-
sions.
“Search in” : Drop-down list with the areas of the project to be searched:
● “Active editor”
● “All open editors”
● “Selected objects & subobjects”
● “Entire project”
● “Entire project & non-compiled libraries”
● “Selection only”
: Opens a dialog where you set the areas of the project to be
searched (see below)
“Find next” Starting the search
“Find all” All search results are listed in the message view with their object path,
project name, object name, and object position. Possible additions
to the position: “(Decl)” = declaration part of the object, “(Impl)” =
implementation part of the object
Double-clicking the entry in the list opens the match position in the
respective object editor.
“Replace” Switches to the “Replace” dialog
The color of the search result markings can be customized in the options of the
text editor. This is done using the “Selection color” - “Inactive” parameter in
the “Text area” tab.
Also refer to
● ⮫ Tab 'Text Area' on page 1089
User interface
the drop-down list ( ) .
● “Object types”: : Browsing the object
● “Name filter”: Name filter for the objects to be browsed. The place-
holder "*" can be used.
Example: Filter "*CAN*": All objects are browsed containing "CAN" in
their name
“All open editors” All editors are searched that are currently open in a window.
“Active editor” Only the editor is searched where the cursor currently is.
“Selection only” Only the text is searched that is currently selected in an object.
Also refer to
● ⮫ Chapter Command ‘Replace’. 'Replace in project’ on page 877
● ⮫ Chapter 18.11 Searching and Replacing in the Entire Project on page 149
Function: This command, when searching for a specific string in the project,
selects the previous search result at its position in the relevant editor.
Call: Menu “Edit 🠂 Search and Replace”
Prerequisite: You have started a search for a certain character string in the
project using the “Search” or “Replace” commands.
Also refer to
● ⮫ Chapter Command ‘Search', 'Search in project on page 878
● ⮫ Chapter Command ‘Replace’. 'Replace in project’ on page 877
● ⮫ Chapter 18.11 Searching and Replacing in the Entire Project on page 149
Call:
In the device tree via the context menu of the object “DataLayer_Realtime
🠂 Select realtime data 🠂 Selectively from ctrlX CORE..”
Function:
The command opens the “Selecting real-time data online from ctrlX CORE”
dialog.
Via the dialog, add an instance of an EtherCAT master in the device tree, see:
⮫ Dialog “Selecting real-time data online from ctrlX CORE”
User interface
between the PLC and the ctrlX Data Layer to exchange real-time data, see:
⮫ Connection to the ctrlX real-time data system
Symbol
Call
In the device tree via the context menu of the “DataLayer_Realtime” object:
“DataLayer_Realtime 🠂 PLC real-time data”
Related topics
⮫ Device tree and device editor
⮫ Object “DataLayer_Realtime”
Call:
In the device tree via the context menu of the object “DataLayer_Realtime
🠂 Select realtime data 🠂 Selectively from file..”
Function:
The command opens a dialog for selecting the description file with the top-
ology of the real-time data system.
By using the description file, an instance of the real time data system can be
added to the ctrlX PLC Engineering device. In particular if no connection can
be established to the device and the configuration cannot be read out of the
control online (offline configuration).
The description file can be created in ctrlX IO Engineering.
Call:
In the device tree via the context menu of the object “DataLayer_Realtime
🠂 Select realtime data 🠂 All data from ctrlX CORE..”
Function:
By using the command, the real time data system configuration can be read out
of the control and can be applied to the project. Selecting/deselecting devices
is not possible using this command!
If you only want to integrate individual elements of the control configuration to
the project, see ⮫ Command “Selectively from ctrlX CORE..”
Prerequisite
The command is available only if at least one Global Variable List is configured
below the application node, see:
⮫ Object 'GVL' - Global Variable List
Symbol
Call
In the device tree via the context menu of the “DataLayer_Realtime” object:
“DataLayer_Realtime 🠂 plc_app_Application_realtime_data (DataLayerOwner)
🠂 PLC Realtime data input”
Optionally, GVL twins can also be created using the “Use as Plc Realtime data
(input)” command, see:
⮫ Command “PLC Realtime data input”
Related topics
⮫ Device tree and device editor
⮫ Object “DataLayer_Realtime”
Prerequisite
The command is available only if at least one Global Variable List is configured
below the application node, see:
⮫ Object 'GVL' - Global Variable List
Symbol
Call
In the device tree via the context menu of the “DataLayer_Realtime” object:
“DataLayer_Realtime 🠂 plc_app_Application_realtime_data (DataLayerOwner)
🠂 PLC Realtime data output”
Optionally, GVL twins can also be created using the “Use as Plc Realtime data
(Output)” command, see:
⮫ Command “Use as Plc Realtime data (Output)”
User interface
Related topics
⮫ Device tree and device editor
⮫ Object “DataLayer_Realtime”
Symbol
Call
Via the context menu of a GVL below the application node in the device tree:
“Use as Plc Realtime data 🠂 Input”
Optionally, GVL twins can also be created using the “PLC Realtime data input”
command, see:
⮫ Command “PLC Realtime data input”
Related topics
⮫ Device tree and device editor
⮫ Object “DataLayer_Realtime”
Symbol
Call
Via the context menu of a GVL below the application node in the device tree:
“Use as Plc Realtime data 🠂 Output”
Optionally, GVL twins can also be created using the “PLC Realtime data output”
command, see:
⮫ Command “PLC Realtime data output”
Related topics
⮫ Device tree and device editor
⮫ Object “DataLayer_Realtime”
Function:
The command opens the tab“Status” in the generic device editor, see:
⮫ Tab “Status”
The tab provides an overview of the configured participants of the real-time
data system and their current states.
User interface
See also
● ⮫ Chapter 'Options' dialog - 'Text editor' on page 1087
User interface
implementation or multiple lines are selected.
See also
● ⮫ Chapter Command 'Comment Out Selected Lines' on page 886
Call: The command is not in any menu by default. You can add it to a menu by
using the dialog from “Tools 🠂 Customize” (command category “Bookmarks”).
Requirement: A POU is open in the editor and the cursor is positioned in the
POU.
See also
● ⮫ Chapter Command 'Clear All Bookmarks (Active Editor)' on page 888
● ⮫ Chapter 18.20.3 Setting and Using Bookmarks on page 206
User interface
Reference List” view.
Call: Menu bar: “Edit 🠂 Browse”; cross reference view: toolbar
Requirement: A POU is open in the editor and the cursor is set at a variable.
Or the “Cross Reference List” view is open and a variable is specified in the
“Name” field.
See also
● ⮫ Chapter 18.20.1 Using the Cross-Reference List to Find Occurrences
on page 204
● ⮫ Chapter Command 'Browse Global Cross References' on page 889
Command 'AutoDeclare'
Shortcut: [Shift]+[F2]
Function: The command opens the dialog “Declare variable”, which supports
the declaration of a variable.
User interface
“OK” Variable is declared and is displayed in the declaration.
Example:
VAR RETAIN
// New input In1
xIn1 AT %IX1.0: BOOL := FALSE;
END_VAR
“Array” dialog
“Ranks and base type Definition of the field sizes (“Dimension”) by entering the lower and
specification” upper limits and the “Base type” of the array. You can enter the
basic type directly or with the help of the dialogs “Input Assistant”
or “Array” if you click the button.
“Result” Display of the defined array.
PLC Engineering only re-initializes variables if you have
NOTICE
modified the initialization values of the variables.
Also refer to
● ⮫ Chapter 32.10.1 Methods 'FB_Init', 'FB_Reinit', and 'FB_Exit' on page 660
● ⮫ Chapter 18.16.4 Using the 'Declare variable' dialog on page 165
● ⮫ Smart tag functions on page 134
● ⮫ Chapter 18.18.3 AT Declaration on page 200
● ⮫ Chapter 18.12 Refactoring on page 150
● ⮫ Chapter 18.22 Data persistence on page 211
● ⮫ Dialog box 'Refactoring' on page 895
● ⮫ Chapter 32.4.13 Addresses on page 552
● ⮫ Chapter 'Options' dialog - 'Refactoring' on page 1086
● ⮫ Chapter ST Editor on page 379
See also
● ⮫ Chapter 18.5 Using the input assistance on page 131
● ⮫ Dialog 'Properties' on page 1009
● ⮫ Chapter Command 'Input Assistant' on page 892
User interface
code position of the next or previous message.
See also
● ⮫ Chapter Command 'Next Message' on page 880
● ⮫ Chapter Command 'Previous Message' on page 880
● ⮫ Chapter 'Messages’ command on page 898
See also
● ⮫ Chapter 18.20.2 Finding Declarations on page 206
User interface
● ⮫ Chapter Command 'Reset Pins' on page 993
● ⮫ Chapter Command 'Update Parameters' on page 1005
“Right dialog frame ” Declaration part and implementation of the POU where the variable is
added.
Colored highlighting of changed locations: New added declarations
have a blue font and are highlighted in yellow (1).
“Left dialog frame ” Device tree or POUs tree of the project.
Colored highlighting of blocks where the POU is used: red font and
yellow highlight (2).
After you double-click the POU object, the detail view opens.
Before you decide which changes to accept at which locations, select the
required option from the drop-down list (3) at the upper right part of the
window:
“Add inputs with Default placeholder text: _REFACTOR_; editable
placeholder text” The placeholder text defined here is used at the occurrence locations
of the new added variables in the implementation code. This is used
for searching for the affected locations.
“Add inputs with the Initialization value for the new variable.
following value”
You can accept or reject changes by right-clicking the changed locations or by
executing commands in the left or right area of the dialog box. Refer to the
description of the “Refactoring 🠂 Rename” command.
Examples
1. By refactoring, the fun block receives a new input variable input3 with the
initialization value 1. The change has the following effect:
Before:
fun(a + b, 3, TRUE);
fun(input1:= a + b , input2 :=3 , inputx := TRUE);
After:
fun(a + b, 3, 1, TRUE);
fun(input1:= a + b , input2 :=3 , _REFACTOR_, inputx := TRUE);
2. By refactoring, the "fun" block receives a new input variable input3 with
the placeholder text "_REFACTOR_":
Before:
inst(input1 := a + b, input2 := 3, inputx := TRUE);
fun(a + b, 3, TRUE);
After:
inst(input1 := a + b, input2 := 3, input3 := _REFACTOR_,
inputx
:= TRUE);
fun(a + b, 3, _REFACTOR_, TRUE);
See also
● ⮫ Chapter 18.12 Refactoring on page 150
● ⮫ Chapter Command 'Refactoring' - 'Rename <...>' on page 894
Requirements: In the declaration part of the POU, the cursor is located in the
identifier of the variable to be removed.
Then, the command opens a dialog box with information about the removal.
After you confirm this, the “Refactoring” dialog box opens. For a description of
the “Refactoring” dialog box, refer to the “Edit 🠂 Refactoring 🠂 Rename” help
page.
When you accept the changes in the “Refactoring” dialog box, the respective
input and output parameters are deleted at the occurrence locations of the
affected POU.
In CFC, only the connection is removed between the removed input or output
to the block. The input or output itself remains in the chart.
User interface
Example in ST
In a POU, refactoring removes the input4 input variable. The occurrences are
updated automatically:
Before removal:
inst(input1 := a + b, input2 := 3, input4 := 1, input5 :=
TRUE);
fun(a + b, 3, 1, TRUE);
After removal:
inst(input1 := a + b, input2 := 3, input5 := TRUE);
fun(a + b, 3, TRUE);
See also
● ⮫ Chapter 18.12 Refactoring on page 150
● ⮫ Chapter Command 'Refactoring' - 'Rename <...>' on page 894
'Messages’ command
Symbol:
Function: The command opens the “Messages” view.
Call: Menu “View”
View 'Messages'
Message category The messages are categorized by component or functionality for selec-
tion from a list box. Filter the message display by selecting a category.
Message type Click the symbol of the message type to show or hide messages. PLC
Engineering shows the number of messages next to each symbol.
● : Errors
● : Warning
● : Information
Deletes all messages in the selected message category.
Deletes all messages in all message categories.
“Description” Message text with the reported object and the location in the object.
Double-click a message in the table to jump to the source text location.
Command icon In the case of unresolved libraries, it lists commands that can be used
to quickly fix the reported error (quickfix)
● Updating placeholder '<Library>' to the latest version.
● Open the 'Placeholder' dialog of the library manager.
“Project” Name of the project generating the message
“Object” Object in which the message was generated
“Position” Position in code
Table 97: “Commands in context menu”
“Next message” The source text position of the next message is displayed.
“Previous message” The source text position of the previous message is displayed.
“Go to source text position” The source position of the selected message is displayed.
User interface
until you remove the pin.
In the project options (“Load and Save”), you can configure whether this start
page should open automatically when you start PLC Engineering.
See also
● ⮫ Chapter ‘Options’ dialog - ‘Load and save' on page 1084
● ⮫ Chapter 'Options' dialog - 'Proxy settings' on page 1085
Command 'Properties'
Symbol:
Function: The command opens the properties of the currently selected object
in the POUs tree or device tree.
Call: Menu “View”
Also refer to
● ⮫ Chapter 33.4.22 “Properties” dialog on page 1047
See also
● ⮫ Chapter Command 'Devices' on page 898
● ⮫ Chapter Command ‘POUs’ on page 900
Command ‘POUs’
Symbol: , Shortcut: [Alt] + [1]
Function: This command opens the “POUs” view in the PLC Engineering main
window. POUs located here are available in the entire project.
Call: Menu “View”
See also
● ⮫ Chapter Standard Menu in View 'Devices', 'POUs', 'Modules' on page 899
● ⮫ Chapter 8.3.4 Adding objects on page 61
Command 'ToolBox'
Symbol:
Function: This command opens the “ToolBox” view.
Call: Main menu “View”
This command opens the toolbox view for the open object. By default, this view
is available for graphical editors and visualizations. It includes the graphical
programming elements that you can drag into the editor.
User interface
of cycle” this value is overwritten by the force value at the end of the cycle.
For inputs, this is the forced value.
● “Unforce and Keep All Selected Values”: For all selected entries in the list,
the variables will be set to the forced value and the forcing will be lifted
● “Unforce and Restore All Selected Values”: For all selected entries in the list,
the variables will be reset to the values they had before they were forced,
and the forcing will be lifted.
See also
● ⮫ Chapter 21.5 Forcing and writing of variables on page 277
● ⮫ Chapter 22.3.3 Using Watch Lists on page 297
Command 'Bookmarks'
Symbol:
Function: This command opens the “Bookmarks” view.
Call: Menu bar: “View”.
“Previous Bookmark” Jumps to the bookmark that above the selected bookmark in the table
and opens the respective POU in the editor.
“Next Bookmark” Jumps to the bookmark that below the selected bookmark in the table
and opens the respective POU in the editor.
Deletes the selected bookmark from the table and in the respective
POU.
List of bookmarks in the project with the following information: “Bookmark”, “Object”, and
“Position”.
You can edit the bookmark order per drag&drop.
When you double-click a row, PLC Engineering opens the respective “Object” in the editor and
jumps to this bookmark.
“Bookmark” Name of the bookmark as assigned by PLC Engineering in ascending
numerical order: “Bookmark_0”, “Bookmark_2” etc.
If the bookmark is selected and you click in the field, then it is editable
and you can modify the bookmark name.
“Object” Name and project path of the POU where the bookmark is set
Example: POU_Add [PLC_1: SPS-Logic: Application]
“Position” Position of the bookmark in the POU
Example: Row 3, Column 1 (Impl)
(Impl): in the implementation part of the POU
(Decl): in the declaration part of the POU
See also
● ⮫ Chapter 18.20.3 Setting and Using Bookmarks on page 206
● ⮫ Chapter Command 'Next Bookmark' on page 887
● ⮫ Chapter Command 'Previous Bookmark' on page 888
Command 'Breakpoints'
Symbol:
Function: This command opens the “Breakpoints” view.
Call: Menu bar: “View”.
This view shows an overview of all defined breakpoints for an application. You
have access to all breakpoint commands within this view.
Table 99: Table of current breakpoints
“Application” Select the required application from the list.
“POU” Name of the function block that will receive the breakpoint
“Location” Location of the breakpoint in the POU
● Text editor: Line number and column number
● Graphical editor: Network number or element number
For function blocks, "(Impl)" indicates that the breakpoint is located in
the implementation of the function block, not in an instance.
“Instance Path” Complete object path of the breakpoint location.
“Tasks” Names of tasks that will be effective when the breakpoint is executed.
If there are no restrictions, then "(all)" is displayed here.
“Condition” ● “Break always”: No additional enable condition defined; the break-
point is always enabled.
● Boolean expression. The expression must yield TRUE for the break-
point to be enabled.
“Hit Count Condition” When the breakpoint should be in effect (depending on the hit count)
“Current Hit Count” How often the breakpoint has already been reached up to now during
the execution
Table 100: Toolbar
“New This command opens the “Breakpoint Properties” dialog.
Breakpoint”
“New Data This command opens the “New Breakpoint” dialog.
Breakpoint”
User interface
●Data execution point disabled
As opposed to "Clear breakpoint", a disabled breakpoint remains in the
list and can be enabled again.
“Properties” The “Breakpoint Properties” dialog opens for editing the breakpoint
parameters. This dialog is the same as “New Breakpoint”. In online
mode, you can change the breakpoint into an execution point.
“Go to Source Opens the online view of the affected block. The cursor is set at the
Position” breakpoint location.
“Clear All Deletes all breakpoints and execution points in the application. The list
Breakpoints” is cleared. Not to be confused with "deactivate".
“Enable All Enables all currently disabled breakpoints and execution points.
Breakpoints”
“Disable All Disables all currently enabled breakpoints and execution points. The
Breakpoints” points remain in the list and can be enabled again.
See also
● ⮫ Chapter 33.4.9 Dialog 'Breakpoint Properties' on page 1040
● ⮫ Chapter Command 'New Breakpoint' on page 956
● ⮫ Chapter Command 'New Data Breakpoint' on page 956
● ⮫ Chapter Command 'Enable Breakpoint' on page 957
● ⮫ Chapter Command 'Disable Breakpoint' on page 957
● ⮫ Chapter Command 'Toggle Breakpoint' on page 957
Input field Symbol name (variable name, POU name, DUT name). Input
options:
● Selection of a declared symbol by means of the input assistant
( button).
● Manual input of the symbol name. Triggering of the search by
pressing the button or the [Enter] key.
For the text search, you can use the placeholders "*" (any
number of characters) or "?" (exactly any one character) in
combination with a partial string of a variable identifier.
Use the percent sign "%" to search for IEC addresses. Exam-
ples: "%MW8", "%M*".
More options outside of cross-reference list view:
● Use the command “Browse for Symbol 🠂 Browse Cross
References” if the name of a declared symbol is selected in
an editor, or if the cursor is in the name field. A search is also
possible if the object is selected in the device tree or POU
pool.
● Automatic if the name of a declared symbol is selected in an
editor, or if the cursor is in the name field. A automatic search
is also possible if the object is selected in the device tree or
POU pool.
Requirement: PLC Engineering option “Automatically list
selection in cross reference view” is activated (category
“SmartCoding”.
The following input is valid:
● Variable name, simple or qualified. Examples: "iVar",
"PLC_PRG.iVar".
● POU name: Examples: "PLC_PRG", "myFB".
● DUT name: Example: "mySTRUCT".
● Strings combined with placeholders: asterisk (*) for any char-
acter or question mark (?) for exactly one characters).
Example: "iVar*" applies to iVar1, iVar_glob2, iVar45, etc.
"iVar?" refers to iVar1, iVar2, iVarX, and so on, but not
iVar_glob2, iVar45 and so on...
● "%<IEC address>": PLC Engineering searches for variables
that are assigned to this address and direct memory access.
Example: "%QB0", %Q0 := 2.
Open input assistant for selecting a symbol
Perform a search
Define columns to search for the string.
Input field String that is searched for in the selected columns. The result
locations are marked in yellow. Cross references without this
string are hidden.
Show source position of previous cross-reference, [Shift]+[F4]
Show source position of next cross-reference, [F4]
Limit results to current declaration: Available if multiple declara-
tions are found for a symbol. Limits the display to the declaration
that you have selected in the list.
Show source position of selected cross-reference: The focus
jumps to the occurrence location of the symbol.
Print cross-reference list: The default dialog opens for setting up
a print job.
User interface
“Variable” Only the variable name (for example, iVar)
“Access” Type of access to the variable at the occurrence location:
“Declaration” / “Read” / “Write” / “Call”.
Special case for pointers: An assignment type p := ADR(var1)
is displayed as write | address when searching for var1. The
reason for this: Any write access to p is not displayed when
searching for var1. Write access is also possible by means of
pointer variables.
“Type” Data type of the variable
“Address” IEC address if variables are assigned Example: "AT %QB0".
“Position” Location of the occurrence in the POU editor, for example line
number, network number, declaration part, or implementation
part. Example: "line 1, column 1 (Impl)".
“Object” POU name plus complete path of the occurrence location in
brackets (if this is found in the “Devices” view). Example:
"PLC_PRG [Device:Plc Logic:Application]"
“Comment” Comments if available in the declaration of the variable
The search yields all result locations in the project and in included, uncompiled
libraries.
See also
● ⮫ Chapter Command 'Browse Cross References' on page 889
● ⮫ Chapter 18.20.1 Using the Cross-Reference List to Find Occurrences
on page 204
● ⮫ Chapter Command 'Limit Results to Current Declaration' on page 1034
● ⮫ Chapter Command 'Collapse All Folds' on page 886
● ⮫ Chapter Command 'Expand All Folds' on page 886
Call: The command is not in any menu by default. You can add it to a menu
by using the dialog box from “Tools 🠂 Customize” (command category “Browse
Project”).
The view corresponds to the “Cross Reference List” view before PLC Engi-
neering V3.5 SP6.
User interface
● (3) Node “<block name> is called by:”
● (4) Node “<block name> calls:”
“Block name” Name of the program block; specified manually, by dragging from
another view, or by means of the button .
The drop-down list includes the last specified block names.
Toolbar and keyboard usage
: Find block PLC Engineering searches for the block specified in “Block name” and
displays its caller and calls.
: Use block from the input The “Input Assistant” dialog box opens for selecting a block call or
assistant instance call. The call tree is refreshed automatically after the selec-
tion.
: Show source code posi- PLC Engineering jumps to the occurrence location of the block in the
tion of the selected block source code of the program.
[F4]: Show source code The selection in the call tree jumps to the next or previous block in the
position of the next block call structure. At the same time, the associated source code position is
[Shift]+[F4]: Show source opened in the respective editor.
code position of the pre- Note: Double-clicking an entry in the call tree also opens the associ-
vious block ated source code position.
Display of the call tree:
“Symbol” “<block name> is called by”: The call order is displayed for below this
node. The bottom entry in this tree structure shows the start of the
calls.
“<block name> calls”: The calls from this block are displayed below
this node. The bottom entry in this tree structure shows the end of the
call chain.
“Position” For the root node in the call tree: Line numbers of the declaration
(“Decl”) of the block.
For the caller or calls below the root node: Line number, column
number, and network number of the position, depending on the imple-
mentation language.
Context menu for the entry selected in the tree:
“Collapse All” The expanded entries in the call tree are collapsed, except for the two
root nodes.
“Show Source Position” PLC Engineering jumps to the occurrence location of the block in the
source code of the program.
“Set as New Root Node” The entry selected in the call tree is displayed in “Block name”. The
tree is refreshed automatically for the new root nodes.
The “Call list” view is provided for immediate information when stepping
through a program, as opposed to the static call tree that provides call informa-
tion about a block. The call list always shows the full call path of the current
position that is reached.
See also
● ⮫ Chapter 21.4 Stepping Through a Program on page 275
● ⮫ Chapter Command 'Call Stack' on page 906
● ⮫ Chapter Command 'Browse Call Tree' on page 889
Command 'Memory'
Symbol:
Function: In PLC Engineering V3.5 version earlier than SP11, the command
opens the “Memory” view.
Call: Menu bar: “View 🠂 Memory”.
As of SP11, the command provides the notice that you must install the COD-
ESYS Memory Tools package (available in the PLC Engineering Store) in order
to use the memory view. After installation, you can open the “Memory” view by
clicking “View 🠂 Show Memory View”.
Tab 'User'
On this tab, certificates are configured that are required for the encrypted com-
munication and the digital signature of the user. Only certificates with private
keys can be specified here. The user profile is saved as an XML file in the user
options.
“User Profile and By default, the login name for Windows is specified as the user profile.
Certificate Selection”
List box with existing user : Opens the “User Profiles” dialog. Here you specify the name for a
profiles new user profile.
: Deletes the selected user profile. This user profile is no longer
displayed in the list box.
“Digital Signature” : Opens the “Certificate Selection” dialog for selecting the certifi-
cate for the digital signature.
One certificate can be selected. The certificate has to have a private
key.
: Deletes the displayed certificate.
User interface
One certificate can be selected. The certificate has to have a private
key.
“Project File Decryption” : Opens the “Certificate Selection” dialog for selecting the certifi-
cate for decrypting project files.
One certificate can be selected. The certificate has to have a private
key.
: Deletes the displayed certificate.
See also
● ⮫ Chapter 33.4.19 'Certificate selection' dialog on page 1046
Table 101: “Security Level”
“Activate the Use of Certificates for Enhanced Security”
“Enforce encrypted : When the user communicates with the controller, the server certifi-
communication” cate of the controller is used for establishing an encrypted connection.
Then the entire communication is encrypted.
“Enforce encryption of : All project files of the user are encrypted with a certificate. When
project files” the project is saved, it is encrypted with the certificate specified
in the project settings (“Project Settings 🠂 Security” dialog). The
selected certificate is displayed on the “Project” tab in the “Project
file encryption” group.
To open this project, the certificate to be encrypted has to be speci-
fied in “Project file decryption” with a private key.
“Enforce signing of project : All project files of the user are signed with a certificate. In “Digital
files” Signature”, a certificate has to be specified with a private key.
When a project is saved, a signature file <project
name>.project.p7s is generated in the project directory containing
the signature.
“Enforce encryption of : The data that is downloaded to the controller has to be encrypted
downloads, online changes with a controller certificate.
and boot applications” This certificate is defined directly either in the properties dialog of the
application on the “Encryption” tab, or in the security screen, on the
“Project” tab, in the “Encryption of Boot Application, Download and
Online Change” group.
Controller certificates are located in the local Windows Certificate
Store in the “PLC Certificates” directory. If the certificates of your
controller are not available in the directory, then they first have to be
loaded from the controller and installed to the directory. For instruc-
tions, see the "“Controller Certificates”" chapter.
“Enforce signing of : The online code (downloads, online changes, and boot applica-
downloads, online changes tions) have to be signed with a certificate with a personal key. The
and boot applications” certificate is selected from the “Digital Signature” area.
Requirement: The “Encryption of boot application, download and
online change” option is selected.
“Enforce signing of : The “File 🠂 Save Project as Compiled Library” command generates
compiled libraries” a signed library <library name>.compiled-library-v3.
Requirements
● A certificate with a private key that supports code signing is avail-
able.
● A library compatibility >= PLC Engineering V3 SP15 is set in the
project information.
“Enforce timestamping of signed compiled libraries”: : The
URL of the time stamp server which created the time stamp
has to be entered in the “Timestamping server” field. Example:
timestamp.comodoca.com/rfc3161.
See also
● ⮫ Chapter Command 'Save Project as Compiled Library' on page 875
● ⮫ Chapter 27.3 Information for library developers on page 330
Tab 'Project'
All project-specific settings are configured on this tab. These elements are
active only when a primary project is loaded.
“Project file encryption”
“Technology” : Opens the “Project Settings 🠂 Security” dialog
When you select the “Encryption” project setting and then
“Certificates” in the dialog, you can choose a corresponding certifi-
cate by clicking . For more information, see the description of the
"Project Settings: Security" dialog.
“Certificates of Users Area for listing the certificates that encrypt the project file.
Sharing this Project”
See also
● ⮫ Chapter 'Project settings' dialog - 'Security' on page 1064
● ⮫ Chapter Dialog 'Properties' - 'Encryption' on page 1049
● ⮫ Chapter 11.12 Encrypting the project with a certificate on page 84
Tab 'Devices'
This tab is available only after you have installed the CODESYS Security Agent
add-on. For a description of this tab, see the help for the CODESYS Security
Agent.
User interface
Call: Menu bar: “View”.
In the view, memory reserves are configured for the function blocks during the
online change.
“Scan Application” ● Searches the selected application for function blocks and displays
them in the “Function blocks” area
● Updates the “Function blocks” area after the application is built
again.
● Updates the “Function blocks” area after an online change.
Drop-down list with the Selection of the application whose function blocks should be dis-
applications of the open played and/or edited in this view.
project
Table 102: “Function Blocks”
“All” All function blocks of the selected application are displayed.
“Pool” All function blocks of the “POUs” view that are displayed which are
referenced in the application.
“No memory-reserve” All function blocks with a memory reserve of 0 bytes are displayed.
“<memory reserve> bytes” Display of all function blocks with the number of bytes is displayed
that is defined in “Memory reserve”.
Information about the function blocks
Multiple selection is also possible when selecting a POU for the configuration of the memory
reserve.
“Function block” Name of the function block
“Size” Size of the function block
Size of an instance of a function block
Specified in bytes
“Number of instances ” Number of instances of a function block in the project
“Memory reserve” Display of the memory reserve for each instance of the function block
“Additional memory for all Product of “Number of instances” and “Memory reserve”
instances”
“Remaining memory Number of bytes that are available as reserve.
reserve”
See also
● ⮫ Chapter 18.3 Configuring the Memory Reserve for an Online Change
on page 129
● ⮫ Chapter "Online change" command on page 943
Symbol:
Call:
The command can be called either via the context menu of the ctrlX device
node in the device tree or optionally via the “Project” menu
Function:
The command opens the “Login - [Control IP address]” dialog, to establish a
connection with a ctrlX device.
Related topics:
● ⮫ Chapter Command “Log out current device user” on page 913
● ⮫ Chapter 33.4.3 Dialog “Login - [Control IP address]” on page 1037
Prerequisite:
A device user is logged in to the control.
Symbol:
Call:
User interface
The command can be called either via the context menu of the ctrlX device
node in the device tree or optionally via the “Project” menu
Function:
The command terminates the connection to the currently logged in ctrlX device.
Related topics:
● ⮫ Chapter Command “Logging in device user...” on page 912
● ⮫ Chapter 33.4.3 Dialog “Login - [Control IP address]” on page 1037
“Plug in device” PLC Engineering inserts the selected device in the selected slot. If the
slot is already occupied, the existing module is replaced by the new
one.
“Update device” PLC Engineering replaces the device selected in the device tree by the
one selected.
Please note: depending on the device, this may cause the configura-
tion already done in the device editor to be overwritten with the
default values!
“Character string for full- This field is editable after clicking in it. For any character string
text search in all devices” entered, only those devices that include the character string are dis-
played in the lower view. The matching character string is highlighted
in yellow for these devices.
“Manufacturer:” Drop-down list with manufacturers whose available devices are dis-
played.
“Group by category” : The available devices (newest version) are sorted by category. The
category is defined in the device description file.
: The available devices appear flat and alphabetically sorted.
“Show all versions (for : In addition, all other available versions of the devices can also be
experts only)” selected.
: Only the newest version of each device is available for selection
“Show outdated versions” : In addition, outdated versions of the devices can also be selected.
Outdated versions result, for example, from the update of plug-ins.
: Outdated device versions are not displayed.
The information provided by the device description file is displayed:
device name, vendor, categories, version, order number and a short description, device-specific
bitmap.
Also refer to
● ⮫ Chapter Command 'Update device' on page 914
User interface
Requirement: An object is selected in the device tree or in the “POUs” view.
In the standard installation of PLC Engineering, there is no object that has
multiple available editors.
Call:
The command can be called via the context menu of the ctrlX device in the
device tree or optionally via the “Project” menu.
Symbol:
Call:
The command has two access options:
● In the menu “Project 🠂 Project synchronisation...”
● In the context menu of the “device (ctrlX CORE)” object in the device tree
Function:
The command opens the “Project synchronization” dialog in which basic set-
tings to synchronize the project data between the control and the Engineering
PC, see:
⮫ Dialog “Project synchronization”.
Without active synchronization, only the data required for the control flow is
stored. The data is available in the “Manage app data” window of the ctrlX
CORE web interface in the following configuration data folder: “plc 🠂 run…”
The project synchronization functionality allows to transfer a project from the
control to the Engineering PC and to save it on the local file system. Moreover,
it can be defined for which actions the project is transferred or synchronized
from the Engineering PC to the control.
The data is stored on the control in the configuration data in the following
folder: “plc 🠂 run…”
If you are not the project owner of the project sources, the project can be
retrieved directly from the control by means of the project synchronization, you
can connect to the running project and to edit it and load it to the control
again, see:
⮫ Project data source - introduction.
Function:
By using the command, the project folder on the Engineering PC and the
project folder on the ctrlX device are compared, analogously to the check when
opening the project.
Please refer to: ⮫ Project data source - Introduction
Symbol:
Call:
The command has two access options:
● In the menu “Project 🠂 Synchronization cache...”
● In the context menu of the “device (ctrlX CORE)” object in the device tree
Function:
The “Synchronization cache...” command opens the “Project synchronization”
dialog to manage the project cache on the Engineering PC, see:
⮫ Dialog “Project synchronization” (Synchronization cache...)
The synchronization cache serves as a temporary file repository for project data
exchanged between the ctrlX device and PLC Engineering.
Related topics
⮫ Project data source - Introduction
Command 'Document'
Symbol:
Function: This command opens the “Document Project” dialog box, where you
can define the project documentation. This includes the selection of objects in
the open project that you want to print.
Call: Main menu “Project”
Table 107: “Document Project” dialog box
“Please select the objects Project tree view
User interface
which are to be printed” In this view, you can select or clear objects for printing.
All objects are selected by default.
“Title page” PLC Engineering creates a title page named "Project Documentation"
with the following information:
● File: project file name
● Date: Creation date of the project documentation
● Profile: PLC Engineering profile of the project
“Table of contents” PLC Engineering creates a table of contents for the project documen-
tation.
“Preview” PLC Engineering creates and opens a print preview of the project doc-
umentation.
“Select” PLC Engineering opens a drop-down list of all or single object types for
the project documentation.
“Deselect” PLC Engineering opens a drop-down list of all or single object types
that should be excluded from the project documentation.
“OK” The “Print” dialog box opens.
See also
● ⮫ Chapter Dialog 'Project Settings' - 'Page Setup' on page 1063
● ⮫ Chapter Command 'Print' on page 874
'Compare’ command
Symbol:
Function: The command opens the “Project compare” dialog. In this dialog, you
define the reference project to compare with the current project. You configure
the comparison process by means of options. When closing the dialog, the
comparison starts and the result is displayed in the “Project comparison -
Differences” view.
Call: “Comparing 🠂 project”.
Prerequisite: A project is opened.
Also refer to
● ⮫ Chapter Command 'Commit Accepted Changes' on page 922
User interface
detected.
“Accept Block” The block (selected object with all subordinate objects and units) is
selected for acceptance from the reference block to the current block.
Repeated clicking of “Accept Block” undoes the effects of its last
change.
“Accept Single” The object is selected in the current object for acceptance from the
reference line.
Prerequisite: The object selected in the object tree differs with regard
to properties, access rights or folder affiliation.
Opens the “Accept” dialog.
Table 111: Display of differences with colors, and symbols
Black font Objects are identical.
Object name with Child objects of the object are different
Gray highlight Objects are different.
Gray highlight + bold blue Object is only in the reference project.
font
Gray highlight + bold green Object is only in the open project (not in reference project).
font
Gray highlight + red font + Object has different properties.
Gray highlight + red font + Access rights of object and reference object are different.
Gray highlight + bold red Acceptance of the implementation of the reference project is acti-
font + vated.
“Comparison options” The comparison options defined in the “Project comparison” dialog.
“Compare statistics” Number of additions, deletions, and changes in the current project, as
compared to the reference project. “Change” means differences of an
object available in both projects.
The dialog prompt opens: “Do you want to commit the changes which
you made in the diff view?”
“Yes”: The contents, properties or access rights of the yellow high-
lighted objects are changed in the project. Now they correspond to the
reference project. The project comparison view is closed.
User interface
(1) Third compare view
(2) Result of action "Use right row"
(3) Button "Use right row"
The left row, that is the implementation in the current project, is used.
The left block, that is the implementation of the block into the current
project, is used.
The right row, that is the implementation in the reference project, is
used.
The right block, that is the implementation of the block in the refer-
ence project, is used.
Only available if the differences are not directly compared .
The left row is inserted above the right one in the third (result) view.
Only available if the differences are not directly compared .
The right row is inserted above the left row in the third (result) view.
Table 113: Display of differences with colors, and symbols
Black font Objects are identical.
Object name with The child objects of the object are different.
Gray highlight + bold blue Code is only in the reference project.
font
Gray highlight + bold green Code is only in the current project (not in reference project).
font
Yellow highlight The object is activated for acceptance.
The dialog prompt opens: “Do you want to commit the changes which
you made in the diff view?”
“Yes”: The code highlighted in yellow is transferred to the project. The
code corresponds to the reference project. The detailed view is closed
and the project view is displayed. You can continue working in the
project comparison.
'Apply' dialog
Table 114: “Which meta data should be accepted?”
“Access rights” : Access rights that are selected for acceptance.
“Accepted groups” Grouping with access rights accepted by the reference project.
A group is accepted if it exists in both projects with different access
rights.
Example: Group_A
“Unaccepted groups The group is not accepted if it is not present in one of the two proj-
(missing in a project)” ects.
“Properties” : Properties activated for accept
Prerequisite: The properties of the reference object and the object are
different.
“OK” Settings are accepted.
Command 'Export'
Function: This command opens a dialog box for exporting objects from a
project to an XML file.
Call: Menu bar: “Project”.
Dialog 'Export'
This dialog box lists all objects from the device tree, POU tree, and module tree
that PLC Engineering can export.
One file per subtree : PLC Engineering generates a separate export file for each subtree
that is located directly under the root node and includes selected files.
: PLC Engineering generates one export file for all selected objects.
“Saved version” This version should correspond to the target version where the export
file will later be imported.
If the current project contains plug-ins or add-ons that are not avail-
able in the selected memory format (profile), then the “Extend Profile”
dialog box opens. In this dialog box, the selected profile can be
extended with the add-ons.
See also
● ⮫ Chapter Command 'Save project as' on page 871
● ⮫ Chapter 'Import...’ command on page 922
● ⮫ Chapter 9.2 Exporting and Importing Projects on page 67
'Import...’ command
Function: The command opens a dialog for importing objects from an XML file.
Dialog 'Import'
The dialog lists all objects from the export file that PLC Engineering can import
at the current location.
“Currently selected target Object currently selected in the device tree
objects”
User interface
“Insertable items” Displays all objects in the export file that PLC Engineering can insert
below the selected object.
“Show Contents” Displays the contents of the export file in a tree structure
Also refer to
● ⮫ Chapter Command 'Export' on page 922
● ⮫ Chapter 9.2 Exporting and Importing Projects on page 67
“Conflict Resolution” When objects are imported which have the same names as existing
objects, the conflicts can be resolved for each object as follows:
● Replace the existing object:
The object which exists in the project is overwritten by the
imported object.
● Rename the new object:
The new object is imported with the changed name. The string
_<no> is appended to the end of the name.
● Skip the new object:
The object is not imported.
“Select” Opens a list box for selecting object types.
“Deselect” Opens a list box for deselecting object types.
“Conflicts” Opens a list box for resolving all conflicts.
“Show Contents” Opens a dialog where the objects of the XML file are displayed.
The PLCopenXML scheme does not permit VAR_GLOBAL and VAR_GLOBAL
CONSTANT POUs to be in the same variable list. Therefore, if you wish to
export both, the variables must first be divided into two separate variable lists.
See also
● ⮫ Chapter Command 'Export PLCopenXML' on page 923
● ⮫ Chapter 9.2 Exporting and Importing Projects on page 67
User interface
If the user is currently logged in to multiple projects or libraries included in
this one (does not have to be the same user account), the “Logout” dialog is
displayed. The project or library project from which the current user is to be
logged out can be specifically selected in this dialog.
The status bar always displays the user who is currently logged into the project.
A double-click the field “Current user” in the status bar enables quick access to
the “Login” or “Logout” dialog.
Also refer to:
● ⮫ Chapter 11.11 Logging in via user account and password manager
on page 82
● ⮫ Chapter Command 'User management' – 'Log in User' on page 924
Prerequisite
A SoftMotion device has to be present in the device configuration for a Soft-
Motion axis to be added ctrlX I/O Engineering device configuration has to be
available.
Call
The command can be called via the following locations:
● Via the context menu of the SoftMotion object in the device tree.
● Via the menu item “Project” if the Softmotion object is selected in the
device tree.
Prerequisite
A SoftMotion device has to be present in the device configuration for a Soft-
Motion axis to be added ctrlX I/O Engineering device configuration has to be
available.
Call
The command can be called via the following locations:
● Via the context menu of the SoftMotion object in the device tree.
● Via the menu item “Project” if the Softmotion object is selected in the
device tree.
Symbol:
Call:
The command has two access options:
● In the menu “Project 🠂 Insert templates...”
● In the context menu of the application node in the device tree
Function:
The command opens the dialog “Insert templates”, refer to ⮫ Dialog “Insert
templates”.
Via the dialog, project templates under Check Functions and MotionInterface
can be implemented in the project which considerably facilitates project plan-
ning.
User interface
search results are marked in yellow.
“Filter” Selection list with filters for the I/O assignments shown in the map-
ping table:
● “Show all”
● “Show only outputs”
● “Show only inputs”
● “Show only unmapped variables”
● “Show only mapped variables”
● “Show only mappings to existing variables”
● “Show only mappings to new variables”
In the context menu you will find the following commands among other things:
“Export I/O mapping to CSV”: Serves to save the mappings of a device and its
subdevices to an external file. To do this you select the device in the device tree
or in the mapping list.
“Import I/O mapping from CSV”: inserts mappings from a file created before-
hand by export.
Also refer to
● ⮫ Chapter 17 Configuring the I/O connection on page 111
● ⮫ Chapter "Edit I/O mapping" command on page 927
● ⮫ Chapter Command 'Export Mappings to CSV' on page 931
● ⮫ Chapter Command 'Import Mappings from CSV' on page 929
“Position information” Selection of which positions of the selected text categories in the
project should be included in the translation file. The position infor-
mation is located in the first line(s) of a segment for a translation.
Example:
#: D:\Proj1.project\Project_Settings:1
msgid "Project settings"
msgstr ""
● “All”: All detected positions of the text are listed.
● “First appearance”: In the translation file, the position is included
in the project where the text to be translated appears for the first
time.
User interface
● “None”
“Generate” This button opens the dialog for saving a file. The translation template
is created in a text file of type *.pot (portable object template). Each
further generation creates a completely new template file.
See also
● Help about CODESYS Visualization: Multi-language capability
See also
● ⮫ Chapter "Online change" command on page 943
● ⮫ Chapter Command 'Load' on page 942
User interface
Command 'Export Mappings to CSV'
Function: The command opens the default dialog for saving a file to the local
file system. The filter is set to file format CSV. After specifying a name and a
location, PLC Engineering stores the I/O mapping configuration in a CSV file
with the semicolon separator.
Call: Context menu of a device object in the “Devices” view.
Requirement: A device object with an I/O mapping configuration is selected in
the device tree.
Parameter names that are not unique are numbered sequentially in this file
(@<n>).
See also
● ⮫ Chapter Command 'Import Mappings from CSV' on page 929
● ⮫ Chapter 17.4 Configuring Devices and I/O Mapping on page 118
Command 'Clean'
Function: This command deletes the build information for the active applica-
tion.
Call: Main menu “Build”.
During the last download, the build information was created and saved to a file
(*.compileinfo).
After a cleaning process, an online change is no longer possible for the affected
application. The application must be fully downloaded to the controller again.
See also
● ⮫ Chapter Command 'Clean All' on page 933
User interface
mand is really necessary. If you only want to rebuild
and download the active application, then execute the
“Clean” command.
See also
● ⮫ Chapter Command 'Clean' on page 932
Command 'Build'
Function: The command starts the build operation for the active application.
Call: The command is not in any menu by default. You can add it to a menu by
using the dialog from “Tools 🠂 Customize” (command category “Build”).
During the build operation, PLC Engineering performs a syntactic validation of
all objects in the application. However, code is not generated like at log in to
the target system or download of the application. The build operation is always
performed automatically when you log in with a changed program.
When the check is complete, PLC Engineering displays any error messages or
warnings in the message view (“Build” category).
If the program has not been changed since it was compiled without errors the
last time, then it is not recompiled. The message "The application is current"
appears. If the syntactic validation is repeated, then you must execute the
“Rebuild” command.
See also
● ⮫ Chapter Command 'Rebuild' on page 933
Command 'Rebuild'
Function: The command starts the build operation for the active application,
even if the last build contained errors.
Call: The command is not in any menu by default. You can add it to a menu by
using the dialog from “Tools 🠂 Customize” (command category “Build”).
See also
● ⮫ Chapter Command 'Build' on page 933
“Output directory” Directory where PLC Engineering creates the runtime system files.
Click the button to open the default dialog for browsing the file
system.
“Component names” Name of the library project
“Which files do you want to create?”
“M4 interface file” : Interface file <project name>Itf.m4 with definitions. Example of m4
file:
“C stub file” : Stub file for reprogramming the library in C. Example of stub file:
“Options”
“Export referenced types : The referenced types are included in the export.
included in libraries”
“Use original type names ” : The type names of the library project are used.
User interface
Requirement: A library project is open.
The command does not result in code generation. In
NOTICE
addition, no file is created in the project directory with
information about the build operation.
See also
● ⮫ Chapter Dialog 'Customize' - 'Menu' on page 1094
● ⮫ Chapter 27.3 Information for library developers on page 330
User interface
“iec_external.h”.
Call: Main menu “Build”, context menu
Requirement: A POU that is inserted under the object of the type “C Code
Module” is selected in the device tree. The application has been compiled
without errors.
See also
● ⮫ Chapter 18.10 Integrating C Modules on page 146
Call:
In thectrlX I/O Engineering interface in the “Online” menu
Function:
The command opens a comparison view of the project data sources on the
Engineering PC and on the ctrlX device, see also:
⮫ 'Compare’ command
⮫ Project data source - Introduction
Example
When you call commands in the “Build” oder “Online” menus, these commands
are applied to the active application. This is displayed in the list box, and also
displayed in bold in the device tree. In particular, this applies to the “Build
User interface
🠂 Build” and “Online 🠂 Login” commands.
You can also access these commands using the command icons on the toolbar
where the list box is located. When the command icons are called, they are also
applied to the active application.
However, if you call a command from the context menu of a device object in
the device tree, then the command is applied to the corresponding object. For
example, by calling , you can establish a connection to an application on the
device which is not active.
See also
● ⮫ Chapter Command 'Set Active Application' on page 931
● ⮫ Chapter Command 'Build' on page 933
● ⮫ Chapter Command 'Login' on page 939
Command 'Login'
Symbol: , keyboard shortcuts: [Alt] + [F8]
Function: The command connects the application to the target system (control
to simulated device) and starts the online mode.
Call: Menu “Online”, context menu of the object “Application”.
Prerequisite: The application contains no errors and the communication set-
tings are configured.
A dialog prompt opens if the communication settings are incorrect. Then,
switch directly to the “Communication settings” of the control.
If you click “Login” from the online menu, then the currently active application
is connected to the target system. If you choose this command from the con-
text menu (right-click) while an application is selected in the device tree, then
that application is logged in, even if it is not set as the active application.
If an online user management is configured on the target device, then you are
prompted for user data when you log in. The “Device user login” dialog opens.
Check controller accessibility
CAUTION
For security reasons, controllers should not be acces-
sible from the Internet or untrusted Networks under any
circumstances! In particular, the TCP/IP programming
ports (usually UDP-Ports 1740..1743 and TCP-Ports 1217
+ 11740 or the controller specific ports) should not be
accessible from the internet without protection. In case
Internet access to the controller is needed, using a a safe
mechanism is absolutely mandatory, such as VPN and
password protection of the controller.
see also: ⮫ Chapter 20.4 Handling of Device User Man-
agement on page 262
User interface
source code.
This detailed information can help you to better assess the effects of login
in the current situation and to make a decision about downloading the new
application.
The comparison can also be displayed in the device editor (“Applications” tab)
by clicking “Content”.
Also refer to
● ⮫ Chapter 10 Comparing Projects on page 71
*SOURCEPOSITION* is included in the log, then you can display the affected
function in the editor by clicking “Show in Editor”. The cursor jumps to the line
containing the error.
In online mode, you cannot change the settings of the devices or modules.
You must log out of the application for changing device parameters. Depending
on the bus system, there may be some special parameters that you can also
change in online mode.
PLC Engineering saves the view configuration separately in online and offline
mode. In addition, views are closed that cannot be used in any operating mode.
Due to this, the view can change automatically at login.
Command 'Logout'
Symbol: , keyboard shortcut: [Ctrl]+[F8].
Function: This command disconnects the application from the target system
(controller or simulated device) and returns to offline mode.
Call: Main menu “Online”, or context menu of the “Application” object.
Command 'Load'
Function: This command causes a compilation of the active application with
subsequent download to the controller.
Call: Menu bar: “Online”.
Requirement: The application is in online mode.
When you execute this command, PLC Engineering performs a syntax check
and generates the application code. This code is downloaded to the PLC. Fur-
thermore, PLC Engineering generates the build log <project name>.<device
name>.<application ID>.compile info in the project directory.
During loading all variables are re-initialized with the
NOTICE
exception of persistent variables.
User interface
The description of the “Login” command describes the possible situations
when logging in and loading.
If you attempt to download an application when the same version of the appli-
cation is already on the PLC, then you get the message: "Program is unchanged.
Application was not downloaded". PLC Engineering downloads the application
to the PLC.
During loading a record of the actions being executed (generation of code,
execution of initialization, etc.) appears in the Message window in the mes-
sage category “Compile”. Furthermore, information is displayed regarding the
memory ranges, the size of the code, the global data and the allocated memory.
For the purpose of clarity, as opposed to the online change, the modified
function blocks are no longer listed.
See also
● ⮫ Chapter Command 'Login' on page 939
● ⮫ Chapter 19.3 Subordinate Safety Controller on page 232
User interface
POU proper- Change of the “External implementation” option (“Build” tab)
ties
Task local All changes
global vari-
able list
Function Changing the basic function block of a function block(EXTENDS
block FBbase), also the insertion or deletion of such a basic function
block
Change in the interface list (IMPLEMENTS ITF). Exception:
Adding a new interface to the end of the list
Data type Change of the data type of a variable from one customized data
type to another customized data type (for example, from TON to
TOF)
Change of the data type from a customized data type to a basic
data type (for example, from TON to TIME)
Note: As a workaround, always change the name of the variable at
the same time as the data type. The variable is initialized as new
variable and the old one is removed. An online change is possible
afterwards.
alarm con- Change in the alarm database configuration
figuration Changing the number of latch variables (also affects the storage
format in the database)
Change to the configuration of the distributed alarms
Data source All changes in the configuration
Device con- Change in the device tree (also via the command “Update
figuration device”)
Change in a device configuration: Changes made to device
parameters are not online changeable by default However, excep-
tions may be configured in the device description.
Note: I/O mapping to variables is possible via online change.
Visualization Switching the Overlay function
Before V3.5 SP6: Change in the configuration of the Trace ele-
ment
Note: As of V3.5 SP6 applies: In the case of online changes
affecting visualizations or data of the application (for example:
new variable inserted), the visualization reinitializes itself com-
pletely. For TargetVisu, the visualization closes and reopens with
the start page for example. In the case of WebvVisu, the visualiza-
tion also restarts with the start visualization after a short waiting
time.
Also refer to
● ⮫ Chapter Command 'Clean All' on page 933
● ⮫ Chapter 20.5 Generating Application Code on page 265
● ⮫ Chapter 23.2 Executing the Online Change on page 315
● ⮫ "Application information" dialog (details) on page 940
● ⮫ Chapter Attribute "init_on_onlchange" on page 625
● ⮫ Chapter 18.3 Configuring the Memory Reserve for an Online Change
on page 129
● ⮫ Chapter “Configuration” tab on page 865
● ⮫ Chapter 'Project settings' dialog - 'Compiler options' on page 1062
● ⮫ Chapter 'Properties' dialog - 'Build' on page 1048
User interface
If an earlier version already exists on the control and is different from the current version, then the
following options are provided:
“Try to execute an online Enabled by default. If an online change cannot be executed for one of
change. If not possible, the applications, then a download is performed.
perform download”
“ Force online change. If If an online change cannot be performed for (at least) one of the
this is not possible, cancel applications, then no download is performed and the online change
the operation” is terminated (for example, if you have executed the command “Clean
All” beforehand).
“Always execute complete Downloads all parts of the applications to the control, regardless of
download” any existing versions.
For selected applications that do not exist on the PLC yet, PLC Engineering
performs a download automatically to the PLC.
Table 117: “Other Options”
“Delete all applications : Corresponding applications are deleted
from the controller that
are not contained in the
project”
“Start all applications after : The applications are started after the download or online change.
download or online change”
“Do not release forced : If there is an application with forced variables on the control and
variables” the implementation of this application has been changed in the mean-
time, no download is performed for this application.
In the “Multiple download - Result” window, the following message is
displayed for this application: “Error: Skipped as one or more variables
have been forced”.
Note that variables with the key attribute PERSISTENT RETAIN are not gener-
ally initialized. If you change the data layout, however, the persistent variables
are automatically re-initialized.
After completion of the download a listing of all selected applications appears
in the download order that you configured. In addition, for each application
information about the success of the download is provided in the“ Multiple
download - Result” dialog:
● “Created” A new application was created and loaded to the control.
● “Not buffered” The application already existing on the control was not
changed
● “Executing the online change”: The application already existing on the con-
trol was changed by an online change
● “Download completed”: The application already existing on the control was
replaced by a newly created application
● “Skipped due to online change that is not possible”: No online change could
be performed for the application, it was not changed
● “Error”: An error occurred during the download for this application. If neces-
sary, further details are displayed
● “Command was aborted by the user”: The operation was aborted by the
user
Also refer to
● ⮫ Chapter 19.3 Subordinate Safety Controller on page 232
● ⮫ Chapter 18.22 Data persistence on page 211
● ⮫ Chapter 20.5 Generating Application Code on page 265
● ⮫ Chapter Command 'Load' on page 942
See also
● ⮫ Chapter 21.6 Resetting applications on page 281
● ⮫ Chapter 18.22.5 Preserving Data with Persistent Variables on page 214
User interface
After restarting with “Reset Warm”, the following happens:
● Application code remains loaded on the controller.
● Variables are initialized (with the initialization value or the default initializa-
tion value 0).
● Retain variables are retained with values.
● Persistent variables are retained with values.
● Breakpoints that were set in the code are retained with their status (for
example, activated or deactivated).
● The application goes into the “STOP” state.
You can also select the command while debugging the application when it
halts at a breakpoint in the “HALT ON BP” state. Then either the warm start
is executed immediately, or the remaining statements of the current cycle are
processed. Therefore, a message window opens for you to select the next
action. However, the message window opens only if the runtime system is
capable of restarting the cycle without terminating it first.
After the reset, you can run the application as usual and, for example, start the
execution by clicking “Debug 🠂 Start”.
See also
● ⮫ Chapter 21.6 Resetting applications on page 281
● ⮫ Chapter 18.22.5 Preserving Data with Persistent Variables on page 214
● ⮫ Chapter 21.3 Using Breakpoints on page 271
● ⮫ Chapter 32.2.13 Persistent Variable - PERSISTENT on page 447
● ⮫ Chapter 19.3 Subordinate Safety Controller on page 232
● ⮫ Chapter Command 'Reset Cold' on page 948
● ⮫ Chapter Command 'Reset Origin' on page 949
See also
● ⮫ Chapter 21.6 Resetting applications on page 281
● ⮫ Chapter 18.22.5 Preserving Data with Persistent Variables on page 214
● ⮫ Chapter 21.3 Using Breakpoints on page 271
● ⮫ Chapter 32.2.13 Persistent Variable - PERSISTENT on page 447
● ⮫ Chapter 19.3 Subordinate Safety Controller on page 232
● ⮫ Chapter Command 'Reset Warm' on page 949
● ⮫ Chapter Command 'Reset Cold' on page 948
You can manage the device user management in the “Users and Groups”
User interface
tab and “Access control” of the device editor. The commands in the “Online
🠂 Security” menu provide another simple option for protecting access to the
target device.
See also
● ⮫ Chapter 33.1.16 "Users and groups” tab on page 754
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
You can manage the device user management in the “Users and Groups”
tab and “Access control” of the device editor. The commands in the “Online
🠂 Security” menu provide another simple option for protecting access to the
target device.
See also
● ⮫ Chapter 33.1.16 "Users and groups” tab on page 754
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
This command opens the “Add Device User” dialog. Here you define the access
data of the new user.
The dialog corresponds to the dialog in the “Users and Groups” tab of the
device editor for adding a new user.
Please use a strong password as follows:
● Password length >= 8 characters (best >= 12)
● Use uppercase and lowercase
● Include numbers
● Use special characters
● Do not use existing names or sequence of characters that are easy to guess
(for example, “123”, “abc”, “qwerty”)
After performing this action, you can no longer use a
CAUTION
blank user name and password to log in. You must
remember your password.
See also
● ⮫ Chapter Command 'Remove Device User' on page 952
● ⮫ Chapter Command 'Change Password Device User' on page 952
You can manage the device user management in the “Users and Groups”
tab and “Access control” of the device editor. The commands in the “Online
🠂 Security” menu provide another simple option for protecting access to the
target device.
See also
● ⮫ Chapter 33.1.16 "Users and groups” tab on page 754
● ⮫ Chapter 20.4 Handling of Device User Management on page 262
This command opens the “Remove Device User” dialog. Specify the user name
and password of the user to be removed and click “OK” to confirm.
After performing this action, you can no longer use this
CAUTION
removed user account to log in. If this user is the only
one on the target system, then a dialog prompt notifies
you that this user cannot be removed.
See also
● ⮫ Chapter Command 'Add Device User' on page 951
● ⮫ Chapter Command 'Change Password Device User' on page 952
Call: This command is not available by default, but it can be configured from
the “Tools 🠂 Customize”, “Add Command” dialog box (“Online” category).
Requirement: The application is in online mode and contains a programmed
exception handling with the __TRY and __CATCH operators.
If you have configured this command from the “Online” menu and you call it
from there, then the currently active application is affected. Furthermore, this
command can help you to detect errors.
See also
● ⮫ Chapter 32.3.75 Operators '__TRY', '__CATCH', '__FINALLY', '__ENDTRY'
on page 529
● ⮫ Adding commands on page 48
● ⮫ Chapter Command 'Customize' on page 965
User interface
Command 'Wink'
Symbol:
Function: The command causes an LED of a connected controller to blink. As a
result, the hardware can be identified clearly.
Call: The command is not in any menu by default. You can add it to a menu by
means of the “Tools 🠂 Customize” dialog, in the “Online” command category.
Requirement: The controller supports this function and the connection parame-
ters are configured correctly.
Command 'Simulation
Function: The command switches the development system to simulation mode.
Call: Menu bar: “Online”
In simulation mode, you can start and debug the active application an on a
simulated target device. A physical target device is not necessary for testing
the online behavior of an application. When logging in for the first time, you
are prompted whether the application should be created or loaded. For a simu-
lated device, you do not have to configure the communication settings. In PLC
Engineering simulation mode, the entry of the controller in the device tree is
displayed in italics.
No C code for simulation mode
NOTICE
In simulation mode, C code is not generated and loaded
to the runtime system. To simulate the code contained in
the C modules anyway, you can implement it for this pur-
pose in the respective IEC objects of the C code module.
After successful login, the red triangle symbol ( ) in the device tree indicates
simulation mode. You can use the corresponding online commands for testing
the application.
To switch off simulation mode, log out of the controller and execute the
“Simulation” command again.
The command affects the active application only.
See also
● ⮫ Chapter 21.2 Testing in Simulation Mode on page 271
● linktarget doesn't exist but @y.link.required='true'
User interface
If it supports the controller, then you can switch the controller to the following
operating modes:
● “Debug”: No restrictions
● “Locked”: The current state of debugging is locked on the application.
No additional breakpoints can be set and no additional variables can be
forced. Writing variables is still possible and breakpoints which are already
set remain active.
Only the "RUN" state of an application is preserved in “Locked” operating
mode even if the controller is restarted.
With this operating mode, a developer can prevent himself or another devel-
oper from changing the application on the controller, for example by setting
or deleting a breakpoint, by forcing, or by making changes to the file system.
This operating mode is helpful to prevent a download to an incorrect con-
troller when, for example, multiple controllers of a plant are programmed.
● “Operational”:
This operating mode makes sure that the controller reloads the same appli-
cations after a restart and that no debug features are active anymore. The
operating mode is set when a controller is completely programmed and
should be accepted or already is.
Conditions for activating the “Operational” mode
– A boot application for each application has to exist on the controller.
– There must not be any active breakpoints set.
– All applications have to be running.
– There must not exist any forced values.
– Furthermore, the device can define more of its own restrictions.
The “Locked” and “Operational” operating modes are different in the use cases
and in the requirements for activating the operating mode. However, for both
operating modes the runtime system prevents the following actions:
● Regarding the application
– Download of an application
– Online change
– Force variables
– Set breakpoints
– Stop application
– Reset application
– Start application
– Delete application
● Regarding the file transfer of the controller
– Download of a file to the controller
– Delete a file on the controller
Command 'Stop'
Symbol: ; keyboard shortcut: [Shift]+[F8]
Function: This command stops the application (status: “STOP”).
Call: Menu bar: “Debug”; context menu of object: “Application”
Requirement: The application is in offline mode and its status is “RUN”.
Executing this command from the “Debug” menu will affect the application that
is currently in focus.
Requirement:
● The application is in online mode.
● The device description file of the target device contains the entries for the
"data breakpoints" functionality. Currently, data breakpoints are possible
only with the ctrlX CORE.
See also
● ⮫ Chapter 33.4.11 Dialog 'New Breakpoint' on page 1041
● ⮫ Chapter 21.3 Using Breakpoints on page 271
User interface
Function: This command opens the “Breakpoint Properties” dialog box.
Call: Main menu “Debug”.
Requirement: The application is in online mode and the cursor is halted at a
breakpoint.
See also
● ⮫ Chapter 21.3 Using Breakpoints on page 271
● ⮫ Chapter 33.4.9 Dialog 'Breakpoint Properties' on page 1040
See also
● ⮫ Chapter 21.4 Stepping Through a Program on page 275
● ⮫ Chapter Command 'Step Into' on page 958
See also
● ⮫ Chapter 21.4 Stepping Through a Program on page 275
● ⮫ Chapter Command 'Step Over' on page 957
See also
● ⮫ Chapter 21.4 Stepping Through a Program on page 275
See also
● ⮫ Chapter 21.4 Stepping Through a Program on page 275
User interface
Command 'Set Next Statement'
Symbol:
Function: The command determines which statement is executed next.
Call: Menu bar: “Debug”
Requirement: The application is in online mode and the program is halted at
the current break position (debug mode). Moreover, you have marked any line
of code in any POU with the cursor.
The line of code marked with the cursor becomes the current breakpoint posi-
tion without executing the statements in between or the statement that jumped
to it.
See also
● ⮫ Chapter 21.4 Stepping Through a Program on page 275
See also
● ⮫ Chapter 21.4 Stepping Through a Program on page 275
Call: “Debug”.
Requirement: The application is in online mode.
The “Remove Force List” command has the same functionality as this command
with one difference. If the “Remove Force List” command cannot be executed
for all forced values, then no message is displayed.
Unusual changes to variable values in an application cur-
CAUTION
rently running on the PLC can lead to undesired behavior
of the controlled machinery.
Evaluate possible dangers before forcing variable values.
Take the respective safety precautions. Depending on
the controlled system, the result may lead to damage to
machinery and equipment or injury to health and life of
User interface
personnel.
The command “Force Values [All Applications]” affects all application in the
project and is not included in a menu by default.
See also
● ⮫ Chapter Command 'Force Values' on page 959
● ⮫ Chapter 21.5 Forcing and writing of variables on page 277
When a file is loaded into the project, an online view of the application appears
with state of the application at the time when the core dump was generated.
You can then view the variable values afterwards. Finally, the call tree is also
available.
Call: Main menu “Debug 🠂 Core Dump”.
Requirement: The application is in offline mode.
You can close the core dump view only by clicking “Close
NOTICE
Core Dump”. The “Logout” command has no effect in
this view.
See also
● ⮫ Chapter 22.5.6 Analysing Errors with Core Dump on page 309
● ⮫ Chapter Command 'Create Core Dump' on page 962
● ⮫ Chapter Command 'Close Core Dump' on page 962
User interface
⮫ 'Add-on installer' dialog
Symbol
Call
Menu “Tools 🠂 Add-on Installer”
Further topics:
⮫ Chapter 29.2 Installing/uninstalling add-ons on page 335
“Location” Shows the device repository directory on the local system. The list box
shows the currently set save locations. By default, PLC Engineering
creates the system repository during installation. The devices of the
selected location are listed in the “Installed device descriptions” field.
“Edit Locations” Opens the “Edit Repository Locations” dialog.
Table 118: Dialog 'Edit Repository Locations'
List of the repositories with “Location” and “Name”.
“Add” Creates a new repository.
Opens the “Repository Location” dialog. The selected directory
(“Location” input field) must be empty or it must be a valid repository.
“Edit” Opens the “Repository Location” dialog (see “Add”).
“Remove ” A dialog prompt opens for you to decide whether the respective direc-
tory should also be deleted from the hard disk.
User interface
Call: “Tools 🠂 Scripting 🠂 Scripts”
Prerequisite: The ScriptDir subdirectory is created in the PLC Engineering
installation directory. Python scripts are stored in this folder with the file exten-
sion .py.
All scripts that are contained in the ScriptDir folder are executable as menu
commands and are sorted alphabetically by file name.
Also refer to
● ⮫ Calling scripts from toolbar icons
Command 'Customize'
Function: This command opens the “Customize” dialog box, where you can
customize the menus, toolbars, and keyboard shortcuts according to your indi-
vidual requirements.
Call: Main menu “Tools”
See also
● ⮫ Chapter 7.2.1 Customizing Menus on page 47
● ⮫ Chapter 7.2.2 Customizing Toolbars on page 48
● ⮫ Chapter 7.2.4 Customizing Keyboard Shortcuts on page 50
Command 'Options'
Function: The command opens the “Options” dialog for configuring the PLC
Engineering options. These options define the behavior and appearance of the
PLC Engineering user interface. PLC Engineering saves the settings in your
current user profile on your local system. The current profile specifies the
standard settings.
Call: Menu “Tools”
Also refer to
● ⮫ Chapter “Options” - “SFC editor” dialog on page 1089
● ⮫ Chapter “Options” - “CFC editor” dialog on page 1091
● ⮫ Chapter ‘Options’ dialog - ‘Declaration editor' on page 1081
● ⮫ Chapter 'Options' dialog - 'Device editor' on page 1082
● ⮫ Chapter 'Options' dialog - 'Download device descriptions' on page 1081
● ⮫ Chapter “Options” - “FBD, LD and IL” dialog on page 1091
● ⮫ Chapter Dialog 'Options' – 'International Settings' on page 1084
● ⮫ Chapter 'Options' dialog - 'Libraries' on page 1080
● ⮫ Chapter Dialog 'Options' – 'Library Download' on page 1093
● ⮫ Chapter ‘Options’ dialog - ‘Load and save' on page 1084
● ⮫ Chapter Dialog 'Options' - 'PLCopenXML' on page 1085
● ⮫ Chapter 'Options' dialog - 'Proxy settings' on page 1085
● ⮫ Chapter 'Options' dialog - 'Refactoring' on page 1086
User interface
clicking on “Next >” opens the dialog for selecting the device in the network.
The dialog corresponds to the classic view of the “Communication Settings”
tab of the device editor.
“Licenses” List of licenses available on the server for the given ticket ID. The
following information for the selected license is displayed next to the
window on the right:
● “Name”
● “Number of activations”
● “Return allowed”
● “Activation type”
● “Activation date”
● “Company code”
● “Comment”
“Return License(s)” Button for returning the selected license(s). These can be reactivated
User interface
later on another system.
Also refer to
● ⮫ Chapter 33.1.1 Tab “Communication” on page 735
User interface
system and can be integrated into PLC Engineering projects.
Call: Menu “Tools”
Table 130: 'OPC UA information model’ dialog
“Memory location” OPC UA information model directory display on the local system.
The list box shows the currently set locations. By default, PLC Engi-
neering creates the system repository during installation. The informa-
tion models of the selected location are listed in the “Installed OPC UA
information models ” area.
“Change location” Opens the “Edit Repository Locations” dialog.
“Documentation” Opens the installed documentation for the selected information model.
If no documentation is installed for the selected information model,
the command cannot be activated.
“Display all versions” All installed versions of the information models are displayed in a tree
structure.
User interface
directly below a currently inactive application. Object editors in the POU view
remain open.
Call: Menu “Window”
Prerequisite: At least one object of an inactive application is open.
Also refer to
● ⮫ Chapter Command 'Close all editors' on page 973
● ⮫ Chapter Command 'Close All Editors But This' on page 975
Command 'Float'
Function: This command releases a docked view from its frame in the user
interface and repositions it on the screen as a floating window.
Command 'Dock'
Function: This command returns a floating window, which was released by the
“Float” command, to the frame of the user interface.
Call: Main menu “Window”
See also
● ⮫ Chapter Command 'Float' on page 973
Command 'Windows'
Function: This command opens the “Windows” dialog box, which lists all open
objects. You can then activate or close any of the listed views.
Call: Main menu “Window”
User interface
Call: “Window”.
Requirement: The cursor is positioned in the editor of one of the following
objects:
● POU
● Transition
● Method
● Get accessor method of a property
● Set accessor method of a property
● Visualization
You can also toggle the subviews by means of the buttons.
See also
● ⮫ Chapter Command 'Toggle Second Pane' on page 975
See also
● ⮫ Chapter Command 'Toggle First Pane' on page 975
Command 'Find'
Symbol:
Function: This command opens the PLC Engineering help.
Call: Menu bar: “Help”.
In the online help, you can run a full-text search from the input field on the top
right of the help page. The “Find” tab opens in the offline help.
Table 132: Tab 'Search'
“Search for” Combo box for defining the search term or for selecting the 25 most
recent search terms.
“ Search in titles only” The search is performed only in the titles of the help pages.
“Display partial matches” Displays terms also as search results that include the search term.
“Limit to .... matches ” Limits the number of search results.
Maximum value: 1000
“Find” Starts the full-text search.
Command 'Index'
Symbol: ; keyboard shortcut: [Ctrl]+[Shift]+[F2]
Function: This command opens the PLC Engineering help.
Call: Menu bar: “Help”.
An index search is not possible in the online help. The “Index” tab opens in the
offline help.
All index entries of the help are listed alphabetically in the index view.
“ Look for ” As you type letters into the input field, PLC Engineering searches auto-
matically for matches in the index list.
“Display” Opens the help page for the highlighted index entry in the list and
displays the title of the help page and location of the help file (*.chm)
in the “Index results for <index entry>” view. When several pages are
found and then displayed in this view, then you view a specific help
page by clicking its entry in the list.
Clicking an entry in the index list achieves the same result.
Command 'Contents'
Symbol: ; keyboard shortcut: [Ctrl]+[Shift]+[F1]
Function: This command opens the PLC Engineering help.
User interface
Call: Menu bar: “Help”.
Command 'About'
Function: This command opens a splash screen with information about the
PLC Engineering version and copyright. In addition, buttons are available for
detailed information about the version, license, and acknowledgments.
Call: Main menu “Help”.
“Version Info” Opens the “Detailed Version Information” dialog box with a list of PLC
Engineering components and information about the operating system.
“Export”: Exports the detailed version information as a *.txt file or in
any other format.
“License Info” Opens the “License Information” dialog box.
● “Plug-in”: Drop-down list for the plug-in to display the license infor-
mation
● “Software License”: License information about selected “Plug-in”
“Acknowledgments”
User interface
● ⮫ Chapter SFC Elements 'Step' and 'Transition' on page 400
See also
● ⮫ Chapter “Options” - “SFC editor” dialog on page 1089
● ⮫ Chapter Programming in SFC on page 193
● ⮫ Chapter SFC Element 'Action' on page 402
● ⮫ Chapter Command 'Do Not Display Embedded Objects' on page 985
Command 'Parallel'
Symbol:
Function: This command converts the selected alternative branch into a parallel
branch.
Call: Main menu “SFC”
Requirement: The horizontal connecting line of a branch is selected.
Please note that after you convert a branch, you must check and modify the
layout of the steps and transitions before and after the branch.
See also
● ⮫ Chapter Command 'Alternative' on page 980
Command 'Alternative'
Symbol:
Function: This command converts the selected parallel branch into an alterna-
tive branch.
Call: Main menu “SFC”
Requirement: The horizontal connecting line of a branch is selected.
Please note that after you convert a branch, you must check and modify the
layout of the steps and transitions before and after the branch.
See also
● ⮫ Chapter Command 'Parallel' on page 980
See also
● ⮫ Chapter SFC Element 'Branch' on page 405
● ⮫ Chapter Command 'Insert Branch Right' on page 981
User interface
● If the uppermost element of the selected elements is a step, a macro, a
jump, or a parallel branch, then PLC Engineering inserts a parallel branch
with the Branch<x> jump marker, where x is an incremental number. You
can edit the default name of the jump marker or define the jump marker as a
jump destination.
● If a common element of an existing branch (horizontal line) is selected, then
PLC Engineering inserts the new branch line as a branch line on the far
right. If an entire branch line of an existing branch is selected, then PLC
Engineering inserts the new branch line directly to the right as a new branch
line.
Please note: You can convert a branch into another type with the “Alternative”
and “Parallel” commands.
See also
● ⮫ Chapter SFC Element 'Branch' on page 405
● ⮫ Chapter Command 'Insert Branch' on page 980
● ⮫ Chapter Command 'Parallel' on page 980
● ⮫ Chapter Command 'Alternative' on page 980
See also
● ⮫ Chapter Command 'Insert Action Association After' on page 983
● ⮫ Chapter Qualifiers for Actions in SFC on page 394
User interface
new action in the last position of the action list, not the first position. If you
select an action in the action list, then PLC Engineering inserts the new action
at the bottom of the list, not at the top.
See also
● ⮫ Chapter Command 'Insert Action Association' on page 982
● ⮫ Chapter Qualifiers for Actions in SFC on page 394
See also
● ⮫ Chapter Command 'Zoom Into Macro' on page 984
● ⮫ Chapter Command 'Insert Macro After' on page 984
User interface
the source.
Call: Menu bar: “SFC”.
For more details about duplication mode, refer to the help page for the SFC
element properties and the instructions for adding step actions.
Pseudo-embedded objects can be hidden in the “Devices” or “POUs” view by
means of a command.
See also
● ⮫ Chapter SFC Element Properties on page 408
● ⮫ Chapter Programming in SFC on page 193
● ⮫ Chapter Command 'Do Not Display Embedded Objects' on page 985
Command 'Negate'
Symbol:
Function: This command negates the selected function block input or function
block output.
Call: Main menu “CFC”, context menu
Requirements: A CFC editor is active. A function block input or function block
output is selected.
Command 'EN/ENO'
Symbol:
Function: This command adds a boolean input “EN” (Enable) and a boolean
output “ENO” (Enable Out) to the selected function block.
Call: Main menu “CFC”, context menu
Requirements: A CFC editor is active. A function block is selected.
The added input “EN” activates the function block. The function block is exe-
cuted only if the input is TRUE. The value of this signal is output at the “ENO”
output.
Command 'None'
Symbol: ; keyboard shortcut : [Ctrl]+[M] (to toggle between “S”, “R”, “REF”,
and None)
Function: The command removes a Reset (R), Set (S), or REF from the input of
the “Output” element.
Call: Menu bar: “CFC 🠂 Set/Reset”; context menu: “Set/Reset”
Requirement: A CFC editor is active. The input of an “Output” element is
selected.
User interface
See also
● ⮫ Chapter Command 'R (Reset)' on page 986
Example:
Declaration:
ref_int : REFERENCE TO INT;
a : INT;
CFC:
For more information, see the description for the data type REFERENCE TO.
See also
● ⮫ Chapter Programming in the CFC editor on page 184
● ⮫ Chapter 32.5.17 Reference on page 567
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Command 'Set Start of Feedback' on page 988
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
In the CFC editor, the starting point within the feedbacks is decorated with
the symbol. Then the element has the lowest number in the execution order
within the feedbacks. At runtime, the processing of the feedback begins with
this element.
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Command 'Display Execution Order' on page 987
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
The selected elements get the lowest numbers beginning at 0 while keeping the
previous order. The remaining elements are numbered so that their execution
order remains the same. The topological positions of the elements are retained
anyway.
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
● ⮫ Chapter Command 'Send to Back' on page 988
● ⮫ Chapter Command 'Move Up' on page 989
● ⮫ Chapter Command 'Move Down' on page 989
● ⮫ Chapter Command 'Order by Data Flow' on page 990
● ⮫ Chapter Command 'Order by Topology' on page 991
Call: Menu bar: “CFC 🠂 Execution Order”; context menu: “Execution Order”
Requirements: A CFC editor is active and the “Explicit Execution Order Mode”
property is selected. At least one element is selected.
The selected elements get the highest numbers while keeping the previous
order. The remaining elements are numbered so that their execution order
remains the same. The topological positions of the elements are retained
anyway.
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
User interface
● ⮫ Chapter Command 'Send to Front' on page 988
● ⮫ Chapter Command 'Move Up' on page 989
● ⮫ Chapter Command 'Move Down' on page 989
● ⮫ Chapter Command 'Order by Data Flow' on page 990
● ⮫ Chapter Command 'Order by Topology' on page 991
The selected elements get a numbering decreased by one while keeping the
previous order. The selected elements are processed one position earlier. The
remaining elements are numbered so that their execution order remains the
same. The topological positions of the elements are retained anyway.
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
● ⮫ Chapter Command 'Send to Front' on page 988
● ⮫ Chapter Command 'Send to Back' on page 988
● ⮫ Chapter Command 'Move Down' on page 989
● ⮫ Chapter Command 'Order by Data Flow' on page 990
● ⮫ Chapter Command 'Order by Topology' on page 991
The selected elements get a numbering increased by one while keeping the
previous order. The elements are processed one position later. The remaining
elements are numbered so that their execution order remains the same. The
topological positions of the elements are retained anyway.
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
● ⮫ Chapter Command 'Send to Front' on page 988
● ⮫ Chapter Command 'Send to Back' on page 988
● ⮫ Chapter Command 'Move Up' on page 989
● ⮫ Chapter Command 'Order by Data Flow' on page 990
● ⮫ Chapter Command 'Order by Topology' on page 991
The selected element gets the number specified in the dialog. The remaining
elements are numbered so that their execution order remains the same. The
topological positions of the elements are retained anyway.
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
● ⮫ Chapter Command 'Send to Front' on page 988
● ⮫ Chapter Command 'Send to Back' on page 988
● ⮫ Chapter Command 'Move Up' on page 989
● ⮫ Chapter Command 'Move Down' on page 989
● ⮫ Chapter Command 'Order by Data Flow' on page 990
● ⮫ Chapter Command 'Order by Topology' on page 991
The execution order is determined by data flow. In the case of multiple net-
works, it is determined by their topological position of the networks. All num-
bered elements of the POU are set accordingly. Afterwards, the execution order
is identical to that in auto data flow mode. The topological positions of the
elements are retained anyway.
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
● ⮫ Chapter Command 'Send to Front' on page 988
● ⮫ Chapter Command 'Send to Back' on page 988
● ⮫ Chapter Command 'Move Up' on page 989
● ⮫ Chapter Command 'Move Down' on page 989
● ⮫ Chapter Command 'Order by Topology' on page 991
The command applies to all elements in the program, even if not all elements
are selected when the command is executed. The topological positions of the
elements are retained anyway.
See also
User interface
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Dialog 'Properties' - 'CFC Execution Order' on page 1055
● ⮫ Chapter Command 'Send to Front' on page 988
● ⮫ Chapter Command 'Send to Back' on page 988
● ⮫ Chapter Command 'Move Up' on page 989
● ⮫ Chapter Command 'Move Down' on page 989
● ⮫ Chapter Command 'Order by Data Flow' on page 990
You obtain a disabled connection if you change the connections of the auto-
matic routing. If you wish to carry out automatic routing again, you must first
unlock a disabled connection.
With a mouse-click on the icon of a disabled connection you can similarly
unlock this connection.
See also
● ⮫ Chapter Programming in the CFC editor on page 184
● ⮫ Chapter CFC Element 'Connection Mark - Source/Sink' on page 437
User interface
Call: Menu menu “CFC 🠂 Routing”, context menu “Routing”
Requirements: A CFC editor is active and at least one connection with a colli-
sion is present.
This function is very useful if you operate with large networks and see only one
sub-area. A collision is additionally indicated to you by the red bordered symbol
in the top right corner of the editor.
See also
● ⮫ Chapter CFC editor on page 425
● ⮫ Chapter CFC editor, page-oriented on page 428
● ⮫ Chapter CFC Element 'Connection Mark - Source/Sink' on page 437
See also
● ⮫ Chapter CFC Element 'Control Point' on page 435
● ⮫ Chapter Command 'Remove Control Point' on page 994
User interface
selected.
If you have selected a connecting line, the command removes this line and adds
a “Connection Mark - Source” at the output of one element and a “Connection
Mark - Sink” at the input of the other. Both are given the same name by default,
“C-<n>”, where n is a sequential number.
If you select a pair of connection marks, the command converts these marks
into a connecting line.
See also
● ⮫ Chapter CFC Element 'Connection Mark - Source/Sink' on page 437
Grouped elements can only be moved together. The position of the elements is
not affected by the grouping.
See also
● ⮫ Chapter Command 'Ungroup' on page 995
Command 'Ungroup'
Symbol:
Function: The command undoes a previous grouping.
Call: Main menu “CFC 🠂 Group”, context menu “Group”
Requirements: A CFC editor is active. A grouping is selected.
See also
● ⮫ Chapter Command 'Create group' on page 995
After executing the command, the “Force Function Block Input” command is
available in online mode to open a dialog for forcing the box input values.
See also
● ⮫ Chapter Command 'Force Function Block Input' on page 996
● ⮫ Chapter CFC editor on page 425
● ⮫ Chapter 21.5 Forcing and writing of variables on page 277
The member of the structure that is connected to the input of the sub-
sequent function block must be provided with the pragma {attribute
'ProcessValue'}. The data type of the structure member has to be compat-
ible with the data type of the subsequent input. Inputs connected in this way
are flagged with the "V" symbol.
Example
TYPE QINT :
STRUCT
Status : STRING;
{attribute 'ProcessValue'}
Value1 : INT;
User interface
Value2 : INT;
END_STRUCT
END_TYPE
PROGRAM PLC_PRG
VAR
input1: QINT;
output1: QINT;
intValue: INT;
END_VAR
If you do not execute the command “Use attributed member as input” for this
link, then a compiler error is issued.
See also
● ⮫ Chapter Attribute 'ProcessValue' on page 645
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
User interface
Symbol:
Function: The command inserts an empty box with a Boolean input “Enable”
and a Boolean output “Enable Out” at the end of the selected network.
Call: Main menu “FBD/LD/IL”, context menu
Requirements: The FBD editor, the IL editor or the LD editor is active. A net-
work must be selected. No other box may be selected.
If “Enable” has the value FALSE at the time of the function block call, then the
operations defined in the fb are not executed. Otherwise, if “Enable” has the
value TRUE, these operations are executed. The ENO output acts as a repeater
of the EN input.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter FBD/LD/IL Element 'Label' on page 420
Also refer to
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter LD Element 'Coil' on page 423
● ⮫ Chapter Ladder diagram (LD) on page 175
User interface
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter LD Element 'Contact' on page 423
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter Command 'Insert Contact in Parallel (Above)' on page 1001
● ⮫ Chapter Closed Branch on page 421
See also
● ⮫ Chapter LD Element 'Contact' on page 423
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter Closed Branch on page 421
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter Closed Branch on page 421
User interface
Shortcut: [Ctrl] + [G]
Function: this command inserts a previously copied contact to the right of the
selected element.
Call: Main menu “FBD/LD/IL 🠂 Paste Contacts”, context menu
Requirements: The LD editor is active. A line or a contact is selected.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
● ⮫ Chapter LD Element 'Contact' on page 423
Command 'Negation'
Symbol: , shortcut: [Ctrl] + [N]
Function: This command negates the following elements:
● Input/output of a box
● Jump
● Return
● Coil
Call: Main menu “FBD/LD/IL”, context menu
Requirements: the FBD or LD editor is active. The corresponding element is
selected.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
Command 'Set/Reset'
Symbol: , shortcut [Ctrl] + [M]
Function: In the case of an element with a boolean output, this command
switches between reset, set and no mark.
Call: Main menu “FBD/LD/IL”, context menu
Requirements: The FBD or LD editor is active. An element with a boolean
output is selected.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
User interface
Symbol
Function: This command sets the starting point of a line branch on the selected
line.
Call: Main menu “FBD/LD/IL”, context menu
Requirements: The LD editor is active. A line is selected.
See also
● ⮫ Chapter Closed Branch on page 421
● ⮫ Chapter FBD/LD/IL Editor on page 410
Requirements: The FBD or LD editor is active. A box is selected. The box has
interfaces to which no value is assigned.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
Function: This command converts the active function block code or the active
ladder diagram into an instruction list.
Call: Menu “FBD/LD/IL 🠂 View”
Requirements: The LD or FBD editor is active.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
User interface
Requirements: The LD, FBD or IL editor is active. A network is selected.
This command opens a dialog box with an input field. Enter the number of the
desired network in the input field.
See also
● ⮫ Chapter FBD/LD/IL Editor on page 410
Command 'Properties'
Function: The command opens the “Properties” dialog for the library selected
in the Library Manager.
Call
● Menu bar: “Library”
● Context menu of the selected library
● Symbol in the toolbar of the Library Manager
Requirement: A library is selected.
Dialog 'Properties'
Table 136: “General”
“Namespace” Namespace of the selected library. By default, this is identical to the
library name, unless it was defined explicitly in the project information
User interface
when the library was created. You can change the namespace for the
open project.
Example: LA
“Default”: Library that triggers the placeholder when no other trigger is defined
or is possible.
Requirement: The selected library is a library placeholder, and there-
fore the setting is available.
Note: For compiler version 3.5.8.0 and higher, the following state-
ment applies in the case of library placeholders with a resolution
in the device description that are located in the Library Manager of
the “POUs” view. This placeholder is always resolved automatically
according to the description of the device that compiles the applica-
tion.
If the selected library is developed in compliance with the "Guidelines for
Developing Libraries", then we do not recommend that you change the fol-
lowing settings.
Table 137: “Version”
Selection of version constraint
Requirement: The settings are available only if the selected library is not a library placeholder.
Note: Container and interface libraries are created automatically with library references with ver-
sion constraint. As far as possible, do not create libraries that include library references with
version constraint. Otherwise, you reference the libraries by placeholders. Edit a placeholder reso-
lution in the “Placeholders” dialog.
“Exact version” : (selected from list box) Version is integrated into the project.
Note: This option is strongly recommended for container libraries, and
it is usually preset for this library type.
“Always newest version” : The library repository is scanned and the latest detected version is
integrated.
Note: If a newer library version is available, then the library POUs that
are actually used can change. This option is strongly recommended for
interface libraries, and it is usually preset for this library type.
Table 138: “Visibility”
“Allow only qualified access : Library POUs (and variables) are called in the project only with
to all identifiers” prepended namespace paths.
“When the current project Note: Changing the following settings makes sense only if you created
is referenced as a library in a library with your project and therefore opened a library project. In
another project ” this way, the selected library is referenced in the new library.
“Make visible all IEC : As a container library, the selected library makes the contents of
symbols in the project if is the referenced library visible at the top level (later in a project).
this reference were directly Requirement: A container project is created with a library project. A
integrated here.” container library does not implement its own POUs, but references
other libraries exclusively. It bundles libraries. A container library can
be employed sensibly to bundle multiple libraries (in a reference) in a
project. This option must be activated for each library reference.
Symbolic access to library POUs: <namespace of container
library>.<POU name>
: The contents of the referenced library is accessed uniquely by
means of the namespace. The path name consists of the library name
and the unique name (library reference), and it is prepended to the
POU name.
Requirement: No container project is created with a library project.
“Do not show this reference : The selected library is not displayed in the Library Manager as a
in the dependency tree.” library reference (later in a project). The library is a hidden reference.
Warning: If there are compile errors resulting from hidden library
errors, then detecting the errors may be difficult.
: The selected library is displayed as a library reference (later in a
project).
“Optional (if the library is : The selected library is treated as optional. When downloading the
missing, no error will be project that references the library, no error is reported, even if the
reported).” library is not available in the library repository.
See also
● ⮫ Chapter 'Placeholder' command on page 1010
'Placeholder' command
Function: The command opens the “Placeholder” dialog. The dialog provides
information about the selected placeholder library and allows to assign a reso-
lution specifically valid for the project.
Remark
NOTICE
The compilation process always takes place for a specific
application. Consequently, libraries have to be available
for the library entries contained in a library manager.
The resolution of placeholders in the various library man-
agers of a project (applications, POUs pool) is a complex
process. The result of a resolution is only visible during
the compilation and cannot be reliably read beforehand
from the placeholder information in the library man-
agers.
Call:
● “Libraries” menu
● symbol in the top part of the toolbar of the Library Manager
● Quickfix command in case of an error message about an unresolved library.
For further information, see: ⮫ 'Messages’ command
Remark
NOTICE
As of compiler version 3.5.18.0, the library profile is
ignored in favor of the placeholder resolution. The place-
holders become "Free placeholders".
Prerequisite: A placeholder library is selected in the library manager.
User interface
● ⮫ Chapter 33.2.19 "Library manager” object on page 780
● ⮫ Chapter 27.3 Information for library developers on page 330
'Placeholder' dialog
“Name” Identifier of the placeholder
“Library” Current resolution for the project
Double-click the entry to edit the placeholder resolution. A drop-down
list of available versions of the library is displayed. In addition, the
“Other libraries” command appears.
Command “Other library” The “Search libraries” dialog opens for searching for and installing
libraries. Select this command to redirect to a special library, and not
to switch to another version.
“Info” Type of placeholder resolution
● Resolved by device description
● Resolved by library profile
● Resolved by <special library>
“Set all unresolved For the resolution of not yet resolved placeholder libraries in the
unbound placeholders to library manager, the latest available version is entered.
the newest available
versions”
Requirements: An image pool is active and a line is selected in the image pool.
See also
● ⮫ Chapter 33.2.18 "Image pool” object on page 779
User interface
ration editor.
See also
● ⮫ Chapter 18.16.3 Using the Declaration Editor on page 165
Also refer to
● ⮫ Chapter 18.22 Data persistence on page 211
● ⮫ Chapter "Rearrange list and clean gaps” command on page 1013
● ⮫ Chapter "Restore values from recipe” command on page 1014
● ⮫ Chapter 33.2.17 Object 'Persistent variable list' on page 778
See also
● ⮫ Chapter 32.2.13 Persistent Variable - PERSISTENT on page 447
● ⮫ Chapter 32.2.14 Retain variable - RETAIN on page 449
Dialog 'Gateway'
“Name” Name of the gateway.
“drivers” Driver type from a list box.
Driver-specific settings, for Editable after double-clicking the predefined value. A short description
example: for each parameter is displayed in the lower part of the dialog.
IP address, port Note: You can also specify the address of a DNS domain. This has to
begin with dns: (example: dns:MyDynDNSAdress).
The dialog is also used for later editing of the gateway entries of your project.
Also refer to
● ⮫ Chapter 33.1.1 Tab “Communication” on page 735
User interface
'Configure local gateway’ commad
Function: The command opens the “Gateway Configuration” dialog where you
can set the block driver configuration for the local gateway, as an alternative to
editing the Gateway.cfgconfiguration file manually.
Call: Context menu if a gateway entry is selected in the device editor in the
“Communication” dialog.
A correct configuration of the gateway requires detailed
NOTICE
knowledge. If in doubt, leave the default configuration
settings unchanged!
User interface
“Inactivity timeout”: default = 0; this setting defines
the time span in seconds after which the TCP connec-
tions are closed if no more data is exchanged
“CAN client” “Name”: only symbolic
A description of the other settings can be found
directly in the dialog.
“USB port” “Name”: only symbolic
A description of the other settings can be found
directly in the dialog.
Also refer to:
● ⮫ Chapter 33.1.1 Tab “Communication” on page 735
Also refer to
● ⮫ Chapter 22.2 Changing values with recipes on page 287
● ⮫ Chapter 33.3.20 “Recipes” menu on page 1017
User interface
“Read Recipe”, then an online change is required when logging in again.
Also refer to
● ⮫ Chapter 22.2 Changing values with recipes on page 287
● ⮫ Chapter 33.3.20 “Recipes” menu on page 1017
Also refer to
● ⮫ Chapter 22.2 Changing values with recipes on page 287
● ⮫ Chapter 33.3.20 “Recipes” menu on page 1017
User interface
“Update instances of : If the declaration of a structure or function block is extended and
structures and function available in the recipe definition with an instance, then the respective
blocks” variables are added to the recipe definition.
“Update array dimensions : If the dimension of an array is extended and available in the recipe
of array instances” definition with an instance, then the respective variables are added to
the recipe definition.
“Update contained global : If the declaration of a global variable list is extended and available
variable lists” in the recipe definition with an instance, then the respective variables
are added to the recipe definition.
“Update contained : If the declaration of a program is extended and instantiated in the
programs” recipe definition, then the respective variables are added to the recipe
definition.
Also refer to
● ⮫ Chapter 22.2 Changing values with recipes on page 287
● ⮫ Chapter 33.3.20 “Recipes” menu on page 1017
Requirement
● A text list or a global text list is open and active.
● The visualization does not code the characters of the texts in Unicode.
PLC Engineering creates a file as plain text in the format .txt for each text list.
The name of the text list becomes the name of the file. The directory into which
the files are exported is set in “Project 🠂 Project Settings 🠂 Visualization”,
category “General” in “Text list files”.
A controller can read and use this format. For example, you can copy the file to
a controller and, by means of a configuration in the visualization manager, pre-
vent the text lists from being transmitted again when loading the application.
Dialog 'Import/Export'
“Select File for Import” File that PLC Engineering reads.
opens the dialog “Select Text List File” for you to select a file.
“Select export file” File that PLC Engineering writes to.
opens the dialog “Select Text List File” for you to select a file and
directory.
Table 141: “Import/Export Type”
“Import” Requirement: A file is selected in “Select file for compare or import”.
The file can contain text list entries for both the global text list and
text lists.
User interface
Global text list
● PLC Engineering reads the file, compares the text list entries for
the same source text, and accepts differences in the translations.
PLC Engineering overwrites any translations in the project.
Text lists
● PLC Engineering reads the file, compares the text list entries for
the same ID, and accepts differences in the source text and trans-
lations into the project. PLC Engineering overwrites any text list
entries in the project.
● If the file contains a new ID, then the text list entry is imported into
the text list of the project and the text list is added.
“Import replacement file” Requirement: A replacement file is selected in “Select file for compare
or import”.
The replacement file contains replacements for the global text list.
PLC Engineering processes the replacement file row by row and per-
forms the specified replacements in the global text list.
The structure of the replacement file is described in the section "Man-
aging static text in a global text list".
“Export” Requirement: The file that PLC Engineering writes to is selected in
“Select export file”.
PLC Engineering exports all texts from all text lists of the current
project. All languages available in the project are inserted as columns
in the export file. The file can be used for the external translation of
the language-dependent texts.
“Export text differences Requirement: An import file is selected for the comparison in “Select
only” file for compare or export”, and an export file that PLC Engineering
writes to is selected in “Select export file”.
PLC Engineering reads the import file and then uses that information
to compare the rows of the active text list. PLC Engineering ignores
the rows that match. If rows differ, then PLC Engineering writes the
row to the export file and, if necessary, copies translations from the
text list. PLC Engineering accepts the translations from the import file
and overwrites them if necessary.
See also
● ⮫ Chapter 18.8 Managing Text in Text Lists on page 137
● ⮫ Updating the global text list with a replacement file on page 141
Requirement: A text list or a global text list is open and active. A field is
selected in the column of the language that you wish to remove.
See also
● ⮫ Chapter 18.8 Managing Text in Text Lists on page 137
See also
● ⮫ Chapter 18.8 Managing Text in Text Lists on page 137
● ⮫ Chapter 11.10 Protecting Objects in the Project by Access Rights
on page 81
User interface
fier and the display of the symbolic component value in a text output of a
visualization.
See also
● ⮫ Chapter Object 'DUT' on page 815
● ⮫ Chapter Command 'Remove Text List Support' on page 1025
Command 'AutoFit'
Symbol:
Function: When this command is called, the Y-axis of the trace diagram is
automatically scaled so that all graphs are susequently displayed optimally. The
Y-values fit into the visible area of the diagram. Meanwhile, the command is
displayed as active in the menu (command with a check mark).
Call: Menu “Trace”, context menu
Prerequisite: The trace is running. To do this, you have previously created a
trace, specified a fixed scale for the Y-axis, and executed the Dwonload Trace
command.
Also refer to
● ⮫ Subdialog 'Display mode' on page 1100
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
Command 'Compress'
Symbol:
Function: This command compresses the trace graph by zooming into the dis-
played time range by a fixed percentage.
Call: Main menu “Trace”, or context menu.
See also
● ⮫ Chapter Command 'Stretch' on page 1033
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
Command 'Configuration'
Function: This command opens the “Trace Configuration” dialog box for ena-
bling the configuration of the data recording.
Call: Main menu “Trace”, or context menu.
See also
● ⮫ Chapter “Trace configuration” dialog on page 1096
Command 'Cursor'
Symbol:
Function: This function
● inserts a trace cursor into the trace diagram when no trace cursor is avail-
able
● inserts a second trace cursor into the trace diagram when 1 trace cursor is
available
● removes the trace cursors when 2 trace cursors are available
Call: Menu bar: “Trace”; context menu.
A trace cursor is a small black triangle with a vertical black line running parallel
to the y-axis.
User interface
Mouse Input Symbol Effect
Drag the triangle of a trace While the mouse button is
cursor to another position. pressed, the cursor can be
moved without restriction. The
current y-value is always dis-
played in the status bar. When
the mouse button is released,
the cursor jumps to the nearest
measuring point
Keyboard Shortcuts Effect
[Left arrow] PLC Engineering moves the black trace cursor to
[Right arrow] the next measuring point.
[Shift]+[Left Arrow] PLC Engineering moves the gray trace cursor to
[Shift]+[Right Arrow] the next measuring point.
See also
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
[key]; [value]
Version; 0x03050000
Name; Application.Trace_Trigger
ApplicationName; Application
ApplicationDataGuid; 00000000-0000-0000-0000-000000000000
IecTaskName; MainTask
Comment;
Trigger.Flags; 5
Trigger.Edge; 2
Trigger.Position; 0
Trigger.UpdatesAfterTrigger; 50
Trigger.Variable.Name; PLC_PRG.B.OUT
Trigger.Variable.AddrFlags; 0x00000101
Trigger.Variable.Class; 0
Trigger.Variable.Size; 1
Trigger.Level;
Condition.Name;
Condition.AddrFlags; 0x00000000
Condition.Class; 0
Condition.Size; 0
EveryNCycles; 1
BufferEntries; 100
Flags; 16
0.Variable; PLC_PRG.S5.OUT
0.Address.AddrFlags; 0x00000101
0.Class; 7
0.Size; 2
0.GraphColor; 4278190335
0.GraphType; 3
0.MinWarningColor; 4278190080
0.MaxWarningColor; 4294901760
0.CriticalLowerLimit; 0
0.CriticalUpperLimit; 0
0.ActivateMinWarning; 0
0.ActivateMaxWarning; 0
0.YAxis; 0
User interface
0.Data;
1.Variable; PLC_PRG.B.OUT
1.Address.AddrFlags; 0x00000101
1.Class; 0
1.Size; 1
1.GraphColor; 4278222848
1.GraphType; 1
1.MinWarningColor; 4278190080
1.MaxWarningColor; 4294901760
1.CriticalLowerLimit; 0
1.CriticalUpperLimit; 0
1.ActivateMinWarning; 0
1.ActivateMaxWarning; 0
1.YAxis; 0
1.Data;
See also
● ⮫ Chapter 22.4.6 Managing Trace on page 305
See also
● ⮫ Chapter Command 'Save Trace' on page 1032
● ⮫ Chapter 22.4.6 Managing Trace on page 305
See also
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
Multi-channel display
Multi-channel display means that the trace variables are displayed in multiple
diagrams.
See also
● ⮫ Chapter “Trace configuration” dialog on page 1096
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
Single-channel display
If a trace is displayed as single-channel, then all trace variables are included in
one diagram.
User interface
See also
● ⮫ Chapter “Trace configuration” dialog on page 1096
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
See also
● ⮫ Chapter Command 'AutoFit' on page 1025
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
See also
● ⮫ Chapter Command 'Load Trace' on page 1029
● ⮫ Chapter 22.4.6 Managing Trace on page 305
Command 'Stretch'
Symbol:
Function: This command stretches the trace graph by zooming out of the dis-
played time range by a fixed percentage.
Call: Main menu “Trace”, or context menu.
See also
● ⮫ Chapter Command 'Compress' on page 1026
● ⮫ Chapter 22.4.5 Navigating into Trace Data on page 304
'Statistics' command
Function: The command opens the “Trace Statistics” dialog, which shows sta-
User interface
tistics about each trace variable.
Call: Menu “Trace”, context menu
Prerequisite: Traceeditor contains samples.
Also refer to
● ⮫ Chapter 22.4 Data recording with "Trace" on page 298
33.4 Dialogs
33.4.1 'Import Wizard' dialog
Function: The dialog facilitates applying PLC Engineering options and package
installations of an older PLC Engineering installation found on a local computer.
Call: The dialog is displayed when a newly installed PLC Engineering version
is started for the first time and an older version is already installed on the
computer.
“Program settings” : The user-specific PLC Engineering options are transferred from the
older installation to the new installation.
“Packages” : The packages installed with the older PLC Engineering version are
User interface
transferred to the Package Manager of the new version. See the list
of discovered package installations with the “Name”, “Version”, and
“Installation date”.
“Importing” The program settings and/or options are transferred to the current
PLC Engineering version.
“Skip” The program settings and/or options are not transferred to the current
PLC Engineering version.
Also refer to
● ⮫ Chapter 7.1 Setting PLC Engineering Options on page 47
Actions
All possible actions on objects of the projects are listed in “Actions”. The
actions are divided into four categories and assignments to all current objects
of the project are listed below each action. For each "action->object" assign-
ment, you can define the permission for each existing user group.
Action categories:
“Commands” Actions regarding the execution of commands
“Users, groups and Actions regarding the configuration of user accounts, user groups, and
permissions” their permissions
“Object types” Actions regarding the creation of object types
“Project objects” Actions regarding the viewing, modification, removal, and child-object
handling of objects of the project
Actions in detail:
“Execute” Execute a menu command
“Create” Create a new object in the project
“Add or remove children” Add or remove a child object below an existing object
“Modify” Modify an object in the editor or modification of user, group, and
permission settings in the corresponding editor/dialog
“Remove” Delete or remove an object
“View” Open the view of an object in the editor
Possible target of an action. This can be specific objects of the project,
or the user, group, and permission configuration.
Permissions
All defined user groups (except the "Owner" group) are listed in “Permissions”
with a toolbar for configuring the permissions of a group.
Granted The action, which is selected in the actions view, on the selected target(s) is
granted for the selected group.
Denied The action, which is selected in the “Actions” view, on the selected target(s)
is denied for the selected group.
The permission that executes the actions, which are selected in the “Actions”
view, on the selected targets has not been defined explicitly. However, the
actions are granted by default; for example, because the corresponding per-
missions have been granted to the parent object. Example: The group has the
permission for the object "myplc". As a result, it also has the permission by
default for the object "myplc.pb_1".
The action, which is expanded in the actions view, on the selected targets
has not been denied explicitly. However, it is denied by default; for example,
because it has been denied to the parent object.
No symbol There are currently multiple actions selected in the Actions view for which the
group does not have the same permission.
Toolbar:
“Grant” The selected action on the selected target object is granted explicitly for the
selected group.
“Deny” The selected action on the selected target object is denied explicitly for the
selected group.
“Clear” The permission for the selected action on the selected target object is reset
to the default value for the selected group.
Call:
Call the dialog using the Logging in device user... command, see ⮫ Chapter
Command “Logging in device user...” on page 912
Function:
The dialog is used to log in a user to a ctrlX device.
To log in, the user name and the password has to be entered in the dialog.
User interface
The Engineering system “remembers” the entered login data until the next
restart. Consequently, the login dialog is not displayed each time the user
wants to log in.
When enabling the checkbox “Save login data for this device”, the login data
in the Windows Credential Manager and are available after a restart of the
Engineering system.
Symbol
Call
Menu “Tools 🠂 Add-on Installer”
Description
The dialog is divided into two sections:
● Header
● Add-on overview
Header
The header contains the following information and setting options:
Information/setting Description
“Version” Name of the installation with version number and plat-
form specification
“Location” Storage location of the installation.
It is possible to change the location by clicking
on“Browse”.
“Channel for setups” Service channel for setups
“Channel for AddOns” Service channel for add-ons
Add-ons overview
The overview is divided into three tabs and contains commands for managing
add-ons.
Tabs Description
“Installed” Lists all currently installed add-ons.
Tabs Description
“Browse” Lists all available and compatible add-ons that have
not yet been installed.
To install the add-ons, select the add-on in the list and
execute the installation command that appears.
“Updates” Lists all currently installed add-ons for which at least
one update is available.
To install the update, select the add-on in the list and
execute the installation command that is displayed.
Commands Description
“Install File” Opens the file selection dialog, for selecting an add-
on.
● Confirming the dialog starts the installation of the
add-on
● Confirm the following license agreements and sig-
nature information
● The user is informed about the progress during the
installation
● A message is output once the installation is com-
pleted
“Export config” Opens the file selection dialog so that it is possible to
create and store a configuration file.
The file contains information about all settings of the
dialog.
“Import config” Opens the file selection dialog so that you can select a
previously stored configuration file.
The file contains information that is used to preset all
other settings in the dialog.
The ctrlX Add-on Installer is based on functions of the CODESYS installer of the
CODESYS GmbH.
The complete documentation can be found on the CODESYS website, see:
⮫ Web documentation
User interface
Call: When opening a CoDeSys V2.3 project in V3, the dialog opens when the
converter detects a library which cannot be used anymore in the current PLC
Engineering version.
A CoDeSys V2.3 project can be converted into a PLC Engineering V3 project
only if the CODESYS V2.3 Converter package is installed in PLC Engineering V3.
The package is available in the CODESYS Store.
Table 142: “What do you want to do?”
“Convert and install the The converter also converts the library file into the new format. It
library as well.” remains referenced in the project. It is installed automatically in the
library repository in the "Other" category. If the library does not pro-
vide the necessary project information for an installation, then the
“Enter Project Information” dialog opens for the information to be
added.
“Use the following library The previously used library is replaced by another library. The
that has already been “Browse” button opens a dialog for selecting from the local library
installed” repository.
“Ignore the library. The The library reference is removed from the project.
reference will not appear in
the converted project”
“Remember this mapping The settings made here in the dialog are also used for future project
for all future occurrences of conversions.
that library reference”
See also
● ⮫ Chapter Command 'Library Repository' on page 969
User interface
ration section
● When clicking in the inline monitoring field of a forced variable
● When clicking in the field “Prepared value” of a forced variable in the moni-
toring window
“Prepare a new value for Value that PLC Engineering writes to the variable with the next force
the next write or force operation
operation”
“Remove a preparation with PLC Engineering deletes the prepared value.
a value”
“Release the force, without PLC Engineering retains the forced value and ends forcing. PLC Engi-
modifying the value” neering marks the variable <Unforce>.
“Release the force and PLC Engineering resets the forced value and ends forcing. The variable
restore the variable to the is marked with <Unforce and restore>.
value it had before forcing
it”
See also
● ⮫ Chapter Command 'Force Values' on page 959
Tab 'Condition'
The dialog defines the requirements for which program processing should halt
at a breakpoint.
Using conditional breakpoints slows down code execu-
NOTICE
tion, even when the condition does not yield TRUE.
Conditional breakpoints required a PLC Engineering runtime >= V3.5.4.0.
Tab 'Data'
Requirement: This is used for the properties of a data breakpoint.
The function of data breakpoints depends on the target system. Currently, data
breakpoints are possible only with the ctrlX CORE.
On the tab, the variable or memory address is specified for which the data breakpoint is set or will
be set.
“Break execution when the ● Input of a qualified variable name
value of the variable or ● : Selection of a variable in the “Input Assistant” dialog, in the
address changes” “Watch Variables” category
Examples: variable: PLC_PRG.fb_DoSth.dwVariable; address:
16#12A, 0x12A, 129
“Size” Number of bytes of the specified variable or memory address above
which should be monitored for changes. When a new variable or
memory address is specified, a value that matches the data type or
memory is set automatically at first.
Note: The “Size” and quantity depend on the target system. For the
ctrlX CORE, a maximum of four data breakpoints with a maximum size
of 8 bytes can be defined.
Example: 4 for data type DWORD
Example: 2 for data type DWORD: Only the two first bytes of the variable
are monitored.
Tab 'Location'
Requirement: The command “New breakpoint” was selected.
“POU” POU of the active application where the breakpoint is placed.
“Position” Position of the breakpoint in the POU. Entry as row and column num-
bers (text editor) or as network or element numbers.
“Instances” In the case of function blocks, you have to define whether the break-
point should be set in the implementation or in an instance.
PLC Engineering sets the breakpoint in the instance. For this option,
select “Instance Path”.
PLC Engineering sets the breakpoint in the implementation.
User interface
“Enable breakpoint : The breakpoint is activated.
immediately” : The breakpoint is not activated. To activate later, click the button
in the “Breakpoints” view.
See also
● ⮫ Chapter 33.4.9 Dialog 'Breakpoint Properties' on page 1040
● ⮫ Chapter 21.3 Using Breakpoints on page 271
“Valid range” The validity range of the array elements that are monitored.
Example of a three-dimensional array: [1..10][-3..3][-10..10]
“Maximum number of array Number of elements of the array variables
elements” Example: 1470
When you edit one of the settings “Start”, “End”, or “Scroll range of 1000 elements”, both of the
other settings are adapted automatically.
“Start” Index of the first array element whose value is displayed.
“End” Index of the last array element whose value is displayed.
“Scroll range of 1000 Scrollbar for selecting a range from the set of array elements.
elements”
See also
● ⮫ Chapter 22.3.2 Calling of Monitoring in Programming Objects on page 291
“Maximum number of Maximum number of trend variables that can be managed in the data-
variables” base. If you increase this value afterwards, then will PLC Engineering
perform a download and reconfigure the database.
“Store every N Time interval (in ms) when the CmpTraceMgr runtime system compo-
milliseconds” nent buffers the recorded data before storing it persistently in the
database. The application calculates internally the number of task
cycles from the time interval. The duration of a task cycle is defined
in the task configuration.
A high value results in better runtime performance. The disadvantage
is the increased risk of losing data if the controller crashes or shuts
down. A low value reduces this risk. The disadvantage is the slower
control over a trend visualization with large amounts of data.
“Limit” : Limit the recording
● “No Limit”: Unlimited number of data records (not recommended)
● “Maximum number of records”: Maximum number of data records
that are stored in the database. A data record consists of time
stamp and the values of the trend variables at this time.
● “Maximum storage size”: Maximum size of the trend storage. The
application calculates internally the number of data records.
Clicking the "down" symbol ( ) of the drop-down list will set the
units to kilobytes (KB), megabytes (MB), or gigabytes (GB).
See also
● ⮫ Chapter 22.5.2 Getting Started with Trend Recording on page 306
Also refer to
● ⮫ Chapter 22.5 Data recording with "Trend" on page 305
● ⮫ Chapter 22.5.3 Configuring the trend recording on page 306
Function:
Via the dialog, add an EtherCAT master as a Data Layer instance in the device
tree.
User interface
the “DataLayer_Realtime” object in the device tree.
3. If there are slave devices below the EtherCAT master, the dialog remains
open and shows the slave devices. If slave devices are to be applied to the
project, confirm the device application to the project.
Exit the dialog via the button“Close” without changing the configuration.
Call:
The dialog can be opened via the “Selectively from ctrlX CORE..” command,
see :
⮫ Command “Selectively from ctrlX CORE..”
The apply button is only enabled in case of differences between the device
and target configuration.
Function:
The dialog provides project templates under “Check Functions” and MotionIn-
terface. By implementing the project templates, specific template elements are
automatically added to the application nodes.
Available templates under “Check Functions”:
● Array limits
● Division by 0
● Pointer accesses
● Range limits
Available templates under “MotionInterface”
● AxisInterface
● KinematicInterface and AxisInterface
User interface
● Call point: “View 🠂 Properties” of the application
– “Certificates of devices that share the encrypted download and the boot application”
● Call point: “Project 🠂 Project settings”, category “Security”
– “Certificate for project encryption”
Listing of the selected cer- The following properties are displayed for each selected X.509 certifi-
tificates in a table cate:
● “Created for”
● “Created by ”
● “Valid as of”
● “Valid until ”
● “Thumb print”: SHA1 fingerprint
Double-clicking on an entry opens the “Certificate” dialog with the
“General”, “Details” and “Certification path” tabs. In that tab, you will
find a reference to Windows help with more information about the
dialog.
Adds the selected available certificate to the list of selected certifi-
cates.
Deletes the certificate selected in the list.
“Available certificates in the Double-clicking on an entry opens the “Certificate” dialog with the
local Windows Certificate “General”, “Details” and “Certification path” tabs. In that tab, you will
Store:” find a reference to Windows help with more information about the
dialog.
Certificate icons ●
● : Certificate with private key
● : Untrusted certificate
33.4.21 Dialog “Tranfer plc project data source from ctrlX to PC”
Being prepared
Call: Menu “View”, context menu of the object in the “Devices”, “POUs” or
“Modules” view.
Name Description
Moves the selected compiler definition from the “Ignored definitions”
field to the “Defined in device” field. The compiler definition is taken
into account during the compilation.
Also refer to
● ⮫ Chapter 32.6.3 Conditional pragmas on page 597
● ⮫ Chapter Attribute 'linkalways' on page 628
User interface
“Device” or “POUs”.
Requirement: An object is selected in the view “Device” or in the view “POUs”.
“Groups, actions and permissions” A table which displays the following user groups access
rights on objects:
● “View”
● “Modify”
● “Remove”
● “Add/remove children”
Perform a double click on the access right symbol to open
the drop down list with the available rights.
See also
● ⮫ Chapter 11.10 Protecting Objects in the Project by Access Rights
on page 81
● ⮫ Chapter 33.4.2 Dialog 'Permissions' on page 1035
Call:
● Menu bar: “View 🠂 Properties”
● Context menu of an application object
Important
NOTICE
Encryption with a dongle is no longer classified as a
secure encryption method.
It is recommended to encrypt with certificates instead.
Table 147: “Encryption Technology”
If the “Enforce encryption of downloads, online changes, and boot applications” option is selected
in the “Security Screen” view in the “Security Level” group, then the encryption technology is set to
“Encryption with certificates” and cannot be changed in this dialog.
“No Encryption”
“Simple Encryption” You can download the boot application to the controller only when the
defined dongle (license key) is connected to the computer.
The dongle is provided by Bosch Rexroth AG or the respective hard-
ware manufacturer. The firm code is displayed. Please enter the pro-
vided product code.
“Encryption with license You can download the boot application to the controller only after
management” you have specified the product code and firmcode, and the respec-
tive dongle is connected to both the development computer and the
controller. You receive the codes from the vendor that manages the
licenses.
“Encryption with You can download the boot application to the controller only when a
certificates” valid certificate exists for it. The “Certificates” group is enabled. See
the description below.
The option is already selected if the “Enforce signing of downloads,
online changes, and boot applications” option is selected on the
“User” tab of the “Security Screen” view.
Table 148: “Certificates”
Note: If the option “Encryption of downloads, online changes, and boot applications” is enabled
in the “Security screen” view under “Security level”, the encryption technique “Encryption with
certificates” is set in the “Properties” dialog and cannot be changed.
: The “Certificate selection” dialog opens. Here you can select previ-
ously installed certificates of devices for which the encryption of
download, online change, and boot application is enabled. The list
can contain several entries if several devices are authorized to run this
application.
“Digitally sign application The application is signed with a digital signature. The certificate for
code” the digital signature is specified in the “Security Screen” view on the
“User” tab.
Area for the display of the Information per certificate:
selected certificates with ● “Created for”
corresponding information ● “Issued by”
● “Valid as of”
● “Valid until ”
● “Thumbprint”
“Encryption Wizard” This button is available only if the CODESYS Security Agent is
installed. It starts the wizard with the same name. See the help for
CODESYS Security Agent in this case.
Also refer to
● ⮫ Chapter 18.13 Encrypting the application on page 153
● ⮫ Chapter Command 'Security Screen' on page 908
● Help about CODESYS Security Agent
User interface
Visual Studio. For other environments, the dialog can
look different or may not even be available at all.
“Visual Studio location” Installation path of Visual Studio on the hard disk
You can also select the path with the input assistant or search for it
with the magnifying glass.
“Windows SDK location” Installation path of Windows SDK on the hard disk
You can also select the path with the input assistant or search for it
with the magnifying glass.
“Temporary build folder Path on the hard disk for the temporary build files
Location”
See also
● linktarget doesn't exist but @y.link.required='true'
● ⮫ Chapter 18.10 Integrating C Modules on page 146
“If the external file The update type of the copy saved in the project for which a file link
changes” was saved at the same time.
Prerequisite: The option Save the link and embed it into the project is
enabled.
“Reload the file If the external file changes, the copy saved in the project is updated.
automatically”
“Prompt whether to reload If the external file changes, a dialog is displayed prompting the user
the file” whether or not to update the copy in the project.
“Do nothing” Although the external file changes, the copy in the project remains
unchanged.
“Linked file” Information about the file link stored in the project.
Prerequisite: The option Save the link or the option Save the link and
embed it into the project is enabled.
“Name, place, size, Information about the file link.
changed”
“Show file properties” Opens the standard dialog “Properties of <file name>” in the Windows
file system.
This dialog is identical to the Properties dialog that can be opened in
Windows via the file's context menu.
“Embedded file” Information about the copy stored in the project.
Prerequisite: The option Save the link and embed it into the project or
Embed into project is enabled.
“Size, changed” Information about the copy (embedded file).
“Update embedded file” : If the external file has changed, the copy embedded in the project
is updated .
“Online handling” Handling of the file during online operation.
“Transfer with download/ : During download and online change, the external file is also loaded
online change” onto the control and stored in the target system path.
“Target system path The target system path can be entered as follows:
(relative to "$PlcLogic$" on ● For root directory $PlcLogic$: Leave input field blank
the device)”
● Individual folder (not yet existing) in the root directory.
Example: MySubDirectory
● Folder of the application (below $PlcLogic$)
Example of application 'App123' App123
● Nested folder structure below the application folder.
Example: App123/Sub01/SubSub01
● Use another existing placeholder.
Example of visualization: $visu$
Remark: When using existing paths on the device, the paths have to be
case sensitive.
“OK” button Applies the settings to the object.
Also refer to
● ⮫ Chapter Object 'External File' on page 818
User interface
“Download application info” This feature requires compiler version >=3.5.0.0, runtime
version >= 3.5.0.0.
The information about the application contents is also
downloaded to the PLC. We recommend that you keep this
option enabled because it allows for a difference check
between the current application and the application on
the PLC. This compares the number of blocks, data, and
memory locations.
To get the information about the differences, click “Details”
in the “Applications” tab of the device editor. This is also
in the message view that opens when you are downloading
an application to the PLC when it is different from the one
already on the PLC.
“Dynamic memory settings” Memory is allocated dynamically for the application, for
example when using the operator __NEW. In this case, define
the “Maximum size of memory (bytes)”.
Caution: The entire memory is not available for creating
objects dynamically. Instead, the system always uses part
of it for management information.
See also
● ⮫ Chapter 20.5 Generating Application Code on page 265
● ⮫ Chapter 20.7 Generating Boot Applications on page 268
● ⮫ Chapter 33.2.6 “Application” object on page 763
See also
● ⮫ Chapter 33.2.6 “Application” object on page 763
“Transmit on event”, “variable” : PLC Engineering sends the variables as soon as the
defined variable yields TRUE.
“Settings” Log-specific settings; possible entries depend on the net-
work library:
“Port”: Number of the port that PLC Engineering uses for
data exchange with other network units. The “Default value”
is "1202". The current value can be changed in the “Value”
field at any time: Select the field, press the [spacebar],
enter the value.
Caution: The other nodes in the network must define the
same port! If more than one UDP connection is defined in
the project, the port number is automatically adjusted in all
User interface
configurations to the value set here.
“Broadcast Addr.”: The “preset value” is "255. 255. 255.
255" means that data is exchanged with all network devices.
Change the current value in the “Value” field: Select field,
press [spacebar], enter the address or the address range of
a subnetwork. Example: "197 . 200. 100 . 255" in case
of communication with all nodes having IP addresses in the
range from "197 . 200. 100 . x".
Also refer to
● ⮫ Chapter 19.5 Network variables on page 238
● ⮫ Chapter 19.5.2 Configuring a Network Variable Exchange on page 239
● ⮫ Chapter 33.2.21 Object 'Network Variable List (Receiver)' on page 783
● ⮫ Chapter 33.2.20 Object 'Network Variable List (Sender)' on page 783
See also
● ⮫ Chapter Automatic execution order according to data flow on page 180
● ⮫ Chapter Command 'Set Start of Feedback' on page 988
● ⮫ Chapter Command 'Send to Front' on page 988
● ⮫ Chapter Command 'Send to Back' on page 988
● ⮫ Chapter Command 'Move Up' on page 989
● ⮫ Chapter Command 'Move Down' on page 989
● ⮫ Chapter Command 'Order by Data Flow' on page 990
● ⮫ Chapter Command 'Order by Topology' on page 991
Call: Main menu “View 🠂 Properties”, context menu of a SFC POU in the view
“Device” or “POUs”.
Flag
List of all possible SFC “Use” : The SFC flag is activated and will be considered in the pro-
flags gram execution.
“Declare” : The SFC flag is declared automatically.
If “Declare” is activated, but “Use” is not activated, the variable will be
declared but the flag has no effect in the program execution.
Hint: If you have manually declared a SFC variable you have to disable
the declaration of this flag in the “SFC Settings”. Otherwise the auto-
matically generated flag will overwrite the manually declared flag.
User interface
Hint: A automatically declared flag variable is only visible in the online
mode in the declaration part of the SFC editor.
“Use defaults” : The settings of this dialog overwrites the “SFC settings” of the
single POUs.
Build
Table 149: “Code generation”
“Calculate active transitions : PLC Engineering generates code for the currently active transition
only” only.
TYPE SMC_CAMTable_LREAL_720_2 :
STRUCT
Table: ARRAY[0..719] OF ARRAY[0..1] OF LREAL;
fEditorMasterMin, fEditorMasterMax: REAL;
fEditorSlaveMin, fEditorSlaveMax: REAL;
fTableMasterMin, fTableMasterMax: REAL;
fTableSlaveMin, fTableSlaveMax: REAL;
END_STRUCT
END_TYPE
User interface
library” The symbol library receives the key VisuSymbolLibrary = TRUE as
file property in the project information. The VisuElements library is
inserted automatically as a placeholder library in the “POUs” pool of
the Library Manager.
Requirement: A library project is open.
PLC Engineering displays symbol libraries that are installed in the
repository in the “Project Settings” (“Visualization” category, “Symbol
Libraries” tab).
“Textlist for symbol Select the text list from the drop-down list that contains the translated
translation” texts for the image pool.
See also
● ⮫ Chapter 33.2.18 "Image pool” object on page 779
● ⮫ Displaying and Marking Visualization Elements
● ⮫ Chapter 18.9 Using Image Pools on page 144
● ⮫ Using Text Lists
● ⮫ Project Settings - Visualization
'User' tab
Displays the users and their memberships in groups
“Add” Opens the “Add user” dialog.
“Edit” Opens the “Edit User” dialog.
“Delete” An error message appears if you attempt to delete the last user of a
User interface
group, since a group must have at least one member.
Table 157: “Add user/edit user”
Input fields for setting up a new user account or changing an existing one
“Enabled” : You can use the user account which is the default.
: The user cannot login. If the user repeatedly tries to log in with
incorrect credentials, the account may be deactivated automatically,
see below: Settings.
“Memberships” List of all user groups that you have defined in addition to the group
“Everyone” (to which each new user automatically belongs).
<Group name> : the new user belongs to the group.
Table 158: “Export/Import”
“Export users and groups ” The command opens the standard dialog for saving a file to the local
file system. You can store the users and groups defined in the project
in a *.users file in xml format.
“Import users and groups ” The command opens the standard dialog for searching for a file with
the extension *.users in the local file system in order to read user and
group definitions into the project from the file system.
'Groups' tab
Display of the groups and their members. A group can also be a member of a group.
“Add” Opens the “Add group” dialog.
“Edit” Opens the “Edit Group” dialog.
“Delete” If you delete a group, the user accounts of the members remain
unchanged.
You cannot delete the groups “Everyone” and “Owner”.
For the “Export/Import” button, please see “Users” above.
'Settings' tab
Display of the groups and their members in a tree structure. A group can also be a member of a
group.
“Maximum number of login (default): If the user has tried to log in with an incorrect password
attempts” as many times as specified here, the user account is disabled.
: The number of the unsuccessful attempts is unlimited
“Log out automatically after : If PLC Engineering does not register any user actions via mouse or
inactivity” keyboard for the period of time (minutes) specified here, the user is
logged out automatically.
Also refer to
● ⮫ Chapter 8.3.2 Selecting project settings on page 60
● ⮫ Chapter Command 'User management' – 'Log in User' on page 924
Also refer to
● ⮫ Chapter 'Project settings' dialog - 'Compiler options' on page 1062
● ⮫ Chapter Command 'Build' on page 933
User interface
“<all devices in the PLC Engineering loads the project archive to all controls of the project.
project>”
Table 163: “Scope”
Defines the content of the project archive.
“Use compact download” : The project archive contains only that device in the project that
contains the active application.
: The project archive contains all the devices in the project
“Additional files” Opens the “Additional files” dialog where you can select additional
files for download.
Table 164: “Time”
Defines when PLC Engineering creates a project archive.
“Implicit in program PLC Engineering loads the project archive to the target device(s) each
download and online time an application is loaded and each time an online change is per-
change” formed, without any further prompting.
“Implicitly when creating a PLC Engineering additionally loads the project archive to the target
boot application” device(s) each time a boot application is created, without any further
prompt.
“Implicitly when creating a PLC Engineering loads the project archive to the target device(s) each
boot application, download time a boot application is created, each time an application is loaded,
and online change” and each time an online change is performed without any further
prompt.
“Prompt during program PLC Engineering opens a prompt every time an application is loaded
download and online and every time an online change is made. Select, whether PLC Engi-
change” neering loads the project archive to the control.
“Only on request” Only when calling the command “Online 🠂 Load source code on
connected control” opens a command prompt. Select, whether PLC
Engineering loads the project archivey to the control.
Also refer to
● ⮫ Chapter Command 'Source Download to Connected Device' on page 946
● ⮫ Chapter Command 'Source Download' on page 877
● “Paper”
● “Margins”
● “Header and Footer”
● “Document”
● “Title Page”
Table 165: “Edit Header, Edit Footer”
The headers and footers are structured in table style. You can configure rows and columns, and add
text and images to the resulting cells.
“Row spanning” Number of rows that PLC Engineering should merge into a single
column.
“Column spanning” Number of columns that PLC Engineering should merge into a single
row.
Opens the list of available placeholders for the “Text” field. When
printing the page, PLC Engineering provides the placeholders with the
current values.
See also
● ⮫ Chapter Command 'Page Setup' on page 874
● ⮫ Chapter Command 'Document' on page 917
● ⮫ Chapter Command 'Print' on page 874
User interface
The dongle must be connected to the computer when PLC Engineering loads
the project, even if it is loaded as a library reference.
Also refer to
● ⮫ Chapter 11.7 Assigning passwords on page 79
● ⮫ Chapter 11.8 Protecting projects using a dongle on page 80
● ⮫ Chapter 11.12 Encrypting the project with a certificate on page 84
● ⮫ Chapter 33.4.19 'Certificate selection' dialog on page 1046
Tab 'Flags'
Implicitly generated variables for checking and monitoring the processing in an SFC diagram
“Active” : The corresponding variable is used.
“Declare” : The corresponding variable is created automatically. Otherwise, you
have to declare the variable explicitly if you intend to use it (“Use” is
selected).
“Apply to all” In this dialog, PLC Engineering applies changes to existing SFC
objects. PLC Engineering selects the “Use defaults” check box in the
properties of the SFC POUs.
Automatically declared variables are visible in the decla-
NOTICE
ration part of the SFC editor only in online mode.
Tab 'Build'
Table 167: “Code Generation”
“Calculate active transitions : PLC Engineering generates code only for currently active transi-
only” tions.
“SA0027: Multiple use of Detects multiple uses of a name/identifier for a variable or an object
identifiers” (POU) within the scope of a project.
The following cases are detected:
● The name of an enumeration constant is the same as in another
enumeration in the application or used in an included library.
● The name of a variable is the same as an object in the application or
an included library.
● The name of a variable is the same as for an enumeration constant
in and enumeration in the application or an included library.
● The name of an object is the same as another object in the applica-
tion.
● The name of a variable is the same as the name of a method.
User interface
● The name of an object is the same as the name of a superordinate
object ("parent object").
“SA0167: Temporary The test detects function block instances that are declared as tempo-
function block instances” rary variables. This concerns instances that are declared in a method
or in a function or as VAR_TEMP, and therefore are reinitialized in each
processing cycle and for each POU call.
Examples
SA0003: Empty statements
;
(* Comment *);
iVar;
SA0006: Concurrent access
FUNCTION_BLOCK ADD_FB
g_iTemp1 := g_iTemp1 + INT#1;
PROGRAM PLC_PRG //controlled by MainTask
g_iTemp1 := g_iTemp1 + INT#2;
g_xTemp2 := g_iTemp1 > INT#10;
PROGRAM PLC_PRG_1 //controlled by SubTask
g_iTemp1 := g_iTemp1 - INT#3;
g_xTemp2 := g_iTemp1 < INT#-10;
SA0004 Multiple write access on output
VAR_GLOBAL
g_xVar AT %QX0.0 : BOOL ;
g_iTest AT %QW0 : INT ;
END_VAR
PROGRAM PLC_PRG
IF iCondition < INT#0 THEN
g_xVar := TRUE;
g_iTest := INT#12;
END_IF
CASE iCondition OF
INT#1:
g_xVar := FALSE;
INT#2:
g_iTest := INT#11;
ELSE
g_xVar := TRUE;
g_iTest := INT#9;
END_CASE
FUNCTION_BLOCK ADD_FB
g_iTemp1 := g_iTemp1 + INT#1;
PROGRAM PLC_PRG
VAR
iVar:INT;
_123test_var_: INT;
END_VAR
ivar := iVar + 1; // notation different to that in the
declaration part -> SA0029
_123TEST_var_ := _123test_var_INT; // notation different
to that in the declaration part -> SA0029
Fnc(); // notation different to that in the devices tree
-> SA0029
END_VAR
SA0167: Temporary function block instances
PROGRAM PLC_PRG
VAR
END_VAR
VAR_TEMP
yafb: AFB;
END_VAR
VAR
methafb: AFB;
END_VAR
See also
● ⮫ Chapter 18.19.3 Analyzing Code Statically on page 202
User interface
Requirement: A project is open.
Table 169: “Visualization Profile”
“Certain profile” Profile that PLC Engineering uses in the project and that determines
the visualization elements that are available in the project.
The selection list contains all the profiles installed so far.
Tab 'General'
Table 170: “Visualization Directories”
“Text list files” Directory which contains text lists that are available in the project
to configure texts for different languages. PLC Engineering uses the
directory, for example to import or export text lists.
After clicking , the “Select Directory” dialog opens which allows for
the selection of a directory in the file system.
“Image files” Directory which contains image files that are available in the project.
Multiple folders are separated with a semicolon. PLC Engineering uses
the directory, for example to import or export image files.
After clicking , the “Select Directory” dialog opens which allows for
the selection of a directory in the file system.
Table 171: “Advanced”
“Activate property handling : You can also configure a visualization element with a property in
in all element properties” those of its properties in which you select an IEC variable. Then PLC
Engineering creates additional code for the property handling when a
visualization is compiled.
Requirement: Its IEC code contains at least an object of type
“Interface property” (a property ).
“Enable implicit checks for : The implicit check is also performed for visualization POUs. As a
visualization POUs” result, additional code is generated, which increases memory usage.
When memory is limited, this option should be disabled.
See also
● ⮫ Object 'Property'
“Check for updates when : PLC Engineering checks for new versions each time the project is
loading this project” opened. If there is a new version, then the respective update dialog
opens automatically.
: The compiler version is not checked. The update dialogs do not
open automatically.
“Set all to newest” The compiler version is set to the latest version.
User interface
This dialog opens automatically when you open a project that contains an out-
dated device.
Names of the outdated devices and their versions, as well as the current version and the planned
action.
“Action” Double-click in the field to select the required actions.
“Check for updates when : The check is performed when the project is opened.
loading this project” : The check is performed one time only.
“Set all to newest” PLC Engineering uses the latest library version.
“OK” PLC Engineering executes the selected actions.
“Action” ● “Do not update”: The visualization style of the project remains
unchanged.
● “Update to x.x.x.x”: PLC Engineering updates the project to the
version of the selected visualization style.
“Check for updates when : PLC Engineering checks for new versions each time the project is
loading this project” opened. If there is a new version, then the respective update dialog
opens automatically.
: The version is not checked. The update dialogs do not open auto-
matically.
“Set all to newest” PLC Engineering updates the version.
See also
● Help for visualization, section "Visualization style"
See also
● Help for visualization, "Using the symbol library in the visualization" chapter
Function:
User interface
When creating new ctrlX CORE control projects, basic settings have to be
selected.
The “New Project” dialog is used to configure the following settings:
● Selecting the control to be configured in the network
● Synchronization settings between control and Engineering PC
Dialog elements:
Element Description
“Project storage on Display of:
PC” ● Project name
● Project data storage in the file system of the Engi-
neering PC
The displayed settings cannot be changed in this
dialog!
To change the settings, the dialog has to be canceled
using the “Cancel” interface.
Subsequently, execute the steps to create a new
project and specify the settings, see ⮫ Chapter 8.2
Creating a new project on page 53.
ctrlX CORE Configuration of the following settings:
● “Control”:
Selecting the control to be configured in the net-
work
● “Configuration”:
Selecting the active configuration on the control on
which the project is to be operated on the selected
control
Element Description
Synchronisation PC There is the option to additionally store all relevant
and ctrlX CORE project data at certain points in time on the ctrlX
CORE control or to open a project on the control.
Setting options:
● " Synchronization of project storages between PC
and ctrlX CORE if:"
Enabing/disabling the synchronization.
In case of an enabled synchronization, the following
conditions have to be configured:
– " The project is opened"
In this setting, the project is synchronized upon
opening of the project
– " the project is saved on the PC"
In this setting, the project is synchronized upon
saving of the project
– " an application is downloaded on the ctrlX
CORE"
In this setting, the project is synchronized upon
download of the project to ctrlX CORE
– " the project is closed"
In this setting, the project is synchronized upon
closing of the project
● " Synchronize device description files and libra-
ries"
With this setting, device description files and libra-
ries (only in the PLC context) that are not part of
the ctrlX WORKS installation are additionally stored
on the control. This option facilitates the direct
project login.
For more information about the project synchroniza-
tion, see: ⮫ Project data source - Introduction
Related topics
⮫ Chapter 8.2.1 Creating a project on the basis of a template for ctrlX CORE
Creating devices on page 54
Function:
Upon the PLC Engineering start, the system compares the project configuration
on the control to the project configuration in PLC Engineering. If the compar-
ison showed differences, you can display the project data comparison. Addi-
tionally, extended project information can be displayed via button “Details...”.
Further information:
● ⮫ Chapter Command “Project synchronisation...” on page 915
● ⮫ Chapter 'Compare’ command on page 917
Symbol:
Call:
Open the dialog as follows:
● Via the command “Project synchronisation...”, see: ⮫ Command “Project
User interface
synchronisation...”
● In the lower PLC Engineering status bar, double-click on the symbol
Function:
The dialog “Project synchronization” is used to configure the project synchroni-
zation between the ctrlX device and PLC Engineering on the Engineering PC.
Dialog elements:
Project storage on PC
“Name” Project name
“Location” Filing of the project data in the file system of the Engi-
neering PC
ctrlX CORE
“Control / IP” Selecting the target control from which the project is
to be opened. Enter the IP address or select a device
from drop-down menu list of the ctrlX CORE control
accessible in the network (“Project 🠂 New project”)
List of configured ctrlX CORE controls (“Project
🠂 Project synchronization...”)
“Connection test” When confirming the button with the “Arrow symbol”,
the connection to the control is tested and the current
status is displayed.
Synchronization PC and ctrlX CORE Description
(default setting)
Synchronization of project storages Enabling/disabling the synchroni-
between PC and ctrlX CORE if: zation function.
If active, then under the following
subconditions:
the project is opened Is automatically enabled if the syn-
chronization is active
the project is saved on PC Synchronization when saving the
project
a download / OnlineChange is Synchronization when down-
carried out and thus the project is loading an application to the con-
saved trol
A boot application is created Synchronization occurs when the
and login data is synchronized command “Generate boot applica-
tion" is executed in the logged-in
state .
Related topics
⮫ Command “Project synchronisation...”
⮫ Project data source - Introduction
Prerequisite:
The dialog “Project synchronization” is exclusively supported by the ctrlX
CORE, ctrlX CORE Virtual devices.
Symbol:
Call:
In PLC Engineering via the “Synchronization cache...” command, see:
⮫ Command “Synchronization cache...”
Function:
The dialog is used to manage the cache of all projects on the Engineering PC
Dialog elements:
Element Description
Display “Size” Size of the assigned memory for the synchronization
cache
Display “Location:” Storage location of the cache in the file system.
The information provides a link. Via the link, the cur-
rent directory can be directly opened in the Windows
file Explorer.
Button “Clear cache” Button to delete the cache and the contents of the file
repository
Button “Close” Button to close the dialog
Related topics
⮫ Command “Synchronization cache...”
⮫ Project data source - Introduction
Symbol:
Call:
Via the “Open project from ctrlX CORE...” command, see ⮫ Chapter Command
“Open project from ctrlX CORE...” on page 869
Function:
Use the “Open project in ctrlX CORE” dialog to retrieve a project from
the control that was saved on the control via ⮫ Chapter Dialog “Project
synchronization” on page 1075 with the corresponding sources.
User interface
The data is applied in two steps. First select the control.
1. Select the control.
ctrlX CORE
“Control / IP” Selecting the target control from which the project
is to be opened. Enter the IP address or select a
device from drop-down menu list of the ctrlX CORE
control accessible in the network (“Project 🠂 New
project”)
List of configured ctrlX CORE controls (“Project
🠂 Project synchronization...”)
“Connection test” When confirming the button with the “Arrow
symbol”, the connection to the control is tested
and the current status is displayed.
2. Confirm the data application via the “Next” button. Optionally, the opera-
tion can be canceled.
3. Before retrieving the data, authentication is required for access to the
control. Login to the control with your user data.
4. If you have the required access rights, a dialog to store the data is dis-
played. The name and the directory under which the project data are
stored in the file system of the PC are specified here.
Project storage on PC
“Name” Project name
“Location” Filing of the project data in the file system of the
Engineering PC
5. Enter the values in the corresponding fields.
If no project is stored on the ctrlX device, a new project is created
(project synchronization option active).
6. Confirm the data application via the “OK” button. Thus, the project is
opened and can be edited.
Optionally, the operation can also be canceled here.
Call
Automatically, if the project is called via PLC Engineering and the synchroniza-
tion function has detected differences in the project files of the ctrlX device
and the Engineering PC.
Function
Differences in the project files may occur, for example, if the project is edited
on the Engineering PC during offline project planning and there is no connec-
tion to the ctrlX device. The project changes cannot be transferred to the ctrlX
device in this case. The next time you connect to the ctrlX device, the differ-
ences in the project files are detected. In this case, the dialog offers a choice of
options on how to handle the project differences between ctrlX device and PLC
Engineering, see:
⮫ Synchronization – Online behavior
Call
Automatically, when calling ctrlX PLC Engineering via the ctrlX CORE web inter-
face and the synchronization function detected differences in the ctrlX project
repositories and an Engineering PC.
Function
Differences in the project repositories can occur if the project is edited at the
Engineering PC but no connection to the control is established, e.g. in case of
offline configuration. In this case, project changes cannot be transferred to the
control. The differences are detected upon the next time, a connection to the
control is established. The dialog provides several objects on how to handle
project differences between control and PLC Engineering, see:
⮫ Synchronization – Online behavior
Call
The dialog is called automatically if differences between the project file on the
engineering PC and the project file on the ctrlX device are detected during
project synchronization when logging in to the ctrlX device.
Function
The dialog offers a choice of options how to handle project differences
between the ctrlX device and the engineering PC, see:
⮫ Synchronization – Online behavior
Call
The dialog is called automatically, for example if differences between the
User interface
project repository on the Engineering PC and the project repository on the
ctrlX device are detected when opening a project.
Function
The dialog offers a choice of options on how to handle project differences
between data repositories, see:
⮫ Synchronization – Online behavior
Call
The dialog is automatically called if differences between the project repository
on the Engineering PC and the project repository on the ctrlX device are
detected when closing the project during project synchronization.
Function
The dialog provides a choice of options how to handle project differences
between the repository on the ctrlX device and the Engineering PC, see:
⮫ Synchronization – Online behavior
Call
The dialog is automatically called if the project synchronization detects differ-
ences between the project repository on the Engineering PC and the project
repository on the ctrlX device when saving the project.
Function
The dialog provides several options on how to handle project differences
between the ctrlX device and PLC Engineering, see:
⮫ Synchronization – Online behavior
Call
The dialog is called up automatically if differences between the project files
of the Engineering PC and ctrlX device are detected during the project compar-
ison, see:
⮫ Command “Equalize project PC <-> ctrlX CORE”
Function
Differences in the project repositories can occur if the project is edited at the
Engineering PC but no connection to the control is established, e.g. in case of
offline configuration. In this case, project changes cannot be transferred to the
control. The differences are detected upon the next time, a connection to the
control is established. The dialog provides several objects on how to handle
project differences between ctrlX device and PLC Engineering, see:
⮫ Synchronization – Online behavior
Symbol
Call
The dialog is called up automatically if it was detected during project synchroni-
zation that the address of the referenced or connected ctrlX device does not
match the destination address assigned in the project. This can occur after the
following actions:
● If the IP address of the ctrlX device was changed, refer to the ⮫ web docu-
mentation
● If the project planning data was changed on the ctrlX device via the “Manage
app data” window, refer to the ⮫ web documentation
Function
The dialog provides a selection of possibilities how project differences between
control and PLC Engineering should be handled, see:
⮫ Synchronization – Online behavior
Symbol:
Function: The dialog helps to manage the mappings of library references that
PLC Engineering uses during the conversion of an old project. If you have not
yet stored any mapping for a certain library, you must redefine the mapping
each time when opening an old project in which this library is integrated.
Call: Menu “Tools 🠂 Options”, category“Libraries”
A mapping defines what a library reference looks like following the conversion
of the project to the current format. There are three possibilities:
● You retain the reference. This means that PLC Engineering similarly converts
the library into the current format (*.library) and installs it in the local
library repository.
● You replace a reference with another reference. This means that one of the
installed libraries replaces the library that was integrated until now.
● You delete the reference. This means that the converted project no longer
integrates the library.
PLC Engineering applies all the listed mappings to the library references of an old project the next
time it is converted. Hence, you must repeat the mapping definition if the same library is integrated
again in a project that is to be converted. You can enter a new mapping in the last line.
“Source library” Path of the library that is integrated in the project before the conver-
sion.
User interface
A double-click an entry makes the field editable and the button for the
input assistance appears.
“Target library” Name and location of the library that is to be integrated in the project
after the conversion.
Double-clicking on an entry opens the “Set target system library”
dialog.
Table 175: “Set target system library”
“Search” “Select library” dialog appears. You can select a library from the
library repository here. The dialog corresponds to the dialog in the
library repository.
“Ignore....” When PLC Engineering converts the project, PLC Engineering always
removes the existing source library from the project.
Also refer to
● ⮫ Installing Devices
Tab 'View'
“Show generic device : The tab with the list of device parameters is available in the device
configuration views” editors of parameterizable devices.
“Creating cross-references : PLC Engineering creates the cross-references for unmapped I/Os.
for IEC addresses (cleanup
required) ”
“Communication page” ● “Classic mode”: The “Communication” tab of the device editors is
displayed as a two-part window: The left part shows the currently
configured gateway channels in a tree structure, the right part
shows the related data and information.
● “Simple mode”: The “Communication” tab is displayed as described
in the corresponding chapter in the help.
Additional modes can still be available as customer-specific exten-
sions.
“Show implicit files for : The tab for synchronized files is available in the device editors.
application download on Synchronized files are downloaded to the PLC at the time of applica-
the editor of a PLC” tion download. These can be external files that were added to the
application, or implicit files such as a source code archive.
“Show access rights page” : The “Access Rights” tab is available in the device editors.
Note: Depending on the device, the device description may overwrite
this setting.
Also refer to
● ⮫ Chapter 33.1.1 Tab “Communication” on page 735
Symbol:
Function: The dialog is used to configure the settings that facilitate the code
entry.
Call: Menu “Tools 🠂 Options”, “Intelligent coding” category
“Automatically declare : The “Declare variable” dialog opens as soon as an identifier that
unknown variables has not yet been declared is entered in a programming language editor
(AutoDeclare)” and the input line was left.
In order for the AutoDeclare function to be available in the ST editor as
well, the “Enable for ST editor” option also has to be enabled.
“Enable for ST editor” Prerequisite: The option “Automatically declare unknown variables
(AutoDeclare)” is enabled.
: The AutoDeclare function is also available in the ST editor.
User interface
: The AutoDeclare function is not available in the ST editor.
“Show all variables of : The "List Components" function also provides the local variables of
an instance in the input a function block instance for selection.
assistance” : The "List components" function only provides the input variables
and output variables of a function block instance for selection.
“Display system library System libraries are automatically inserted in the library manager and
symbols in the input displayed in light gray.
assistant” : Symbols such as global variables, data types, function blocks, etc
are provided in the input help.
: The symbols of the system libraries are not available in the input
assistance.
“List components after a : Enables the "List components" function. That means: When
dot (.) has been entered” entering a dot . at a position where PLC Engineering expects an iden-
tifier, a selection list with input options is displayed.
“List components Prerequisite: “List components after entering a dot (.)” option is ena-
immediately after entering a bled.
character” : After entering any character string, a selection list of available iden-
tifiers and operators is displayed
“Insert with namespace” : In front of the identifier, PLC Engineering automatically inserts the
namespace.
“Automatically convert : PLC Engineering automatically capitalizes all keywords.
keywords to uppercase
(Autoformat)”
“Update cross-references : The cross reference list automatically shows the references of the
automatically on selection variables/POUs/DUTs that you are currently selecting or on which the
change” cursor is positioned.
“Underline errors in the : Incorrect or unknown program code is underlined.
editor”
“Highlight symbols” : All the places of use of a symbol on which the cursor is positioned
are highlighted in the editor. Consequently, cross-references within the
editor are detected quickly.
“Maximum degree of Selection list for the number of parallel threads that can be used for
parallelism” precompile processing.
PLC Engineering determines the displayed number of threads from the
number of CPU cores of the processor. This preset number should only
be changed in exceptional cases.
Also refer to
● ⮫ Chapter 32.1 Programming languages and their editors on page 377
● ⮫ Smart tag functions on page 134
“Upon startup” Selection list for the start screen of PLC Engineering:
● “Show start page”: The home page of PLC Engineering is displayed
● “Open the last used project”
● “Display the "Open project" dialog”
● “Display the "New project" dialog”
● “Show an empty environment”
“News page” URL, which can be called with the command “Help 🠂 PLC Engineering
Homepage” is opened.
By default, http://www.codesys.com/startpage is entered.
Table 177: “Advanced settings” dialog
“Project compression”
User interface
“Step” Prerequisite: In the project settings in the “Security” category, the
“No protection” option is enabled. That means: The project is not pro-
tected from unauthorized access and data manipulation and there is
no integrity check when loading the project.
Selection list for the compression level that is applied when saving the
project:
● “Lowest compression - highest speed (recommended)”
● “Medium compression - medium speed”
● “Highest compression - smallest speed”
“Loading behavior” (only relevant in the context of PLC programming)
Loading libraries and translation information is done in the back-
ground while you are already editing the project.
Function: The dialog is used to save authentication data for the proxy server
currently used for accesses from PLC Engineering to the internet.
Call: Menu “Tools 🠂 Options”, “Proxy settings”Category
Prerequisite: The internet in the network can be accessed via a proxy server
“Enter proxy acess data” A double-click opens a prompt for user name and password for the
proxy server.
PLC Engineering uses the access data when connecting to the down-
load servers for libraries and device description, when connecting to
CODESYS Store and when using the command “View 🠂 Homepage”
when displaying the start page.
Prerequisite: The button is available if your workstation computer or
network accesses the internet through a proxy server.
Also refer to
● ⮫ Chapter 33.2.19 "Library manager” object on page 780
● ⮫ Chapter Command 'Start Page' on page 899
User interface
: When changing a module name in the class diagram, refactoring
is supported.
● “When renaming variables or properties”:
: When removing a variable or a property in the class diagram,
refactoring is supported.
Note: If the “Skip refactoring preview” option is enabled in the UML
options, refactoring can be performed on all affected locations in
the project without first being displayed in the “Refactoring” dialog,
depending on the case. See the help page “Dialog 'Options' - 'UML'" in
the CODESYS UML help.
Also refer to
● ⮫ Chapter 18.12 Refactoring on page 150
● ⮫ Chapter 18 Programming the application on page 129
● ⮫ Chapter Command 'Refactoring' - 'Rename <...>' on page 894
● ⮫ Chapter Command 'AutoDeclare' on page 889
● ⮫ Chapter 33.2.27 Object 'Unit Conversion' on page 803
'Theme' tab
Set the desired "Theme" for the interface design of the ST editor.
“Theme” Color scheme for the text editor. The selected "Theme" is displayed in
the “Preview” window. The available color schemes are stored in the
installation directory in the Themes folder.
'Edit' tab
“Number of undo steps” Maximum number of editing steps to which you can apply the com-
mand “Edit 🠂 Undo” command.
“Folding” Defines the structuring of the code by means of indentation.
When you select an indentation, you can expand or collapse the inden-
tation section with the help of a plus or a minus sign respectively
before the first line of the respective section.
● “Indent”: PLC Engineering collects all lines that are indented in
comparison with the preceding line in an indentation unit.
● “Explicit”: They explicitly identify the code section with comments
that should be combined into one indentation unit: The section has
to be preceded by a comment containing 3 opening curly braces
"{{", the section has to be followed by a comment containing 3
closing curly braces "}}". The comments can contain additional text.
Example:
“Word wrap” ● “Soft”: The line break occurs at the edge of the editor window if 0
is entered in the “break point”.
● “Hard”: The line break occurs after the number of characters speci-
fied in the “break point”.
“Tab width” Number of characters
“Keep tabs” : The empty space that you inserted with the [Tab] key is not
resolved into spaces afterwards by PLC Engineering.
“Indent width” If you have selected the “AutoIndent” option “Smart” or “Smart with
code completion”, then PLC Engineering inserts the number of spaces
at the beginning of the line.
“AutoIndent” ● “None”
● “Block”: A new line automatically takes over the indentation of the
previous line.
● “Intelligent”: Lines following a line containing a keyword (for
example VAR) automatically indent by the specified indent size.
● “Intelligent with code completion”: Indentation as for the
“Intelligent ” option , in addition PLC Engineering inserts the termi-
nating keyword (for example END_VAR).
User interface
Tab 'Margin'
Settings for the left margin of the text editor window, which is separated from the input area by a
vertical line:
“Line numbering” : The declaration and implementation part of the editor have line
numbering on the left, starting with 1
“Highlight current line” : The line number of the line where the cursor is located is high-
lighted.
“Show bracket area” : Bracketing encompasses the lines between the keywords that open
and close a construct, for example IF and END_IF. If this option is
enabled and the cursor is located before, after or in one of the key-
words of a construct, the bracketed area is indicated by a square
bracket in the border.
“Mouse actions” You can assign one of the following actions to each of the specified
mouse actions or mouse button combinations. PLC Engineering per-
forms the selected action when you perform the mouse action on the
plus or minus sign in front of the header of a bracketed area:
● “None”: The mouse action does not trigger any action.
● “Select fold”: PLC Engineering selects all lines of the bracketed
area.
● “Toggle fold”: PLC Engineering opens or closes the bracketed area
or, if there are nested brackets, the first level of the bracketed area.
● “Toggle fold fully”: PLC Engineering opens or closes all levels of a
nested bracketed area.
Tab 'Monitoring'
Settings for the display of the monitoring fields
“Enable inline monitoring” : Display of the monitoring fields behind the variables in online mode
“Number of displayed Number of decimal places in the monitoring field
digits”
“String length” Maximum length of string variable values in the monitoring field
Also refer to
● ⮫ Chapter Programming in Structured Text (ST) on page 193
Also refer to
● ⮫ Chapter Programming in SFC on page 193
● ⮫ Chapter 33.3.12 “SFC” menu on page 977
● ⮫ Chapter SFC (sequential function chart) editor on page 391
Tab 'Layout'
Table 180: “Elements”
This defines the dimensions of the SFC elements: step, action, qualifier, property. The values are
specified in grid units. 1 grid unit = Font size currently set in the text editor options (Text area/
Font). The settings are always active immediately in all open SFC editor views.
“Step height” Possible values: 1-100
“Step width” Possible values: 2-100
“Action width” Possible values: 2-100
“Qualifier width” Possible values: 2-100
“Property width” Possible values: 2-100
Table 181: “Character set”
The example text shows the current font. Click it to change the font.
Table 182: “Step actions”
“Standard insertion ● “Copy reference”: The reference to the action objects called by the
method” step are copied when copying the step. The copied step and new
step call the same action.
● “Duplicate implementation”: The reference to the action objects
called by the step are fixedly connected to this step. When copying
the step element, new action objects are created for the new step,
and the implementation is duplicated.
● “Always ask”: When inserting a step action, it is always prompted
whether its actions are to be duplicated when copying the step
element or whether the reference is to be applied to an existing
action.
Note: If a step already includes an embedded action, newly inserted
actions of this step are also embedded. Likewise, new inserted
actions are not embedded when the step already contains a non-
embedded action. In these cases, you are no longer prompted for a
duplication mode.
Table 183: “Embedded objects”
“Show action and transition : Action and transition objects that are permanently linked
objects in the navigator” ("embedded") to a step in the SFC block are displayed in the “Devices”
or “POUs” tree view.
Tab 'View'
Table 184: “Visibility of properties”
List of element properties for the categories “Common” and “Specific” with definitions of the
display options.
“Property” Defines the element properties displayed next to the element in the
SFC diagram.
“Value” : Display of the property value.
“With name” : Display of the property value with name.
Table 185: “Online”
“Show step time” : In online mode, PLC Engineering displays the step time to the right
of the steps.
"General” tab
“Enable automatic : When dragging and dropping a CFC element onto the editor
connection” canvas, PLC Engineering automatically connects unlinked pins that
"touch" each other. Make sure that you do not create unwanted con-
nections when shifting elements!
User interface
“Prepare values in the : In online mode you can also prepare variable values for writing and
implementation part” forcing in the implementation part of the CFC module. In addition,
PLC Engineering displays the currently prepared values in the inline
monitoring box of the variable in angle brackets.
Tab 'View'
“Show grid points” : Grid points, at which you can position the elements, are a validity
range in the editor.
“Show function block : PLC Engineering displays existing function blocks in the CFC editor
symbol” that are linked to a bitmap as a symbol.
Prerequisite: You have either created the link for a function block or a
function in the object properties or loaded it via a library.
“Edit line colors” Opens the “Edit Line Colors” dialog for the definition of the colors
of the connecting lines, depending on the data type applied. The
lines appear in these colors in offline and online mode, except ifPLC
Engineering overpaints these colors with the bold black and blue line
display indicating a Boolean data flow.
● “Add type”: Adds a data type to the list.
● “Delete type”
“Font” Display of the font and button for changing the font.
Also refer to
● ⮫ Chapter Dialog 'Properties' - 'Bitmap' on page 1052
Tab 'Print'
Setting the “layout options”
“Page scaling” “Page” or “Poster”
“Scaling” Possible values: 20 % - 200 %
Also refer to
● ⮫ Chapter Programming in the CFC editor on page 184
● ⮫ Chapter 32.1 Programming languages and their editors on page 377
"General” tab
Table 186: “View”
“Show network title” The network title is displayed in the upper left corner of the network.
“Show network comment” The network comment is displayed in the upper left corner of the
network. When the network title is also shown in PLC Engineering, the
comment is shown in the line below.
“Show function block The block symbol is displayed in the block element in the FBD and LD
symbol” editor. The standard operators also have symbols.
“Show operand comment” PLC Engineering shows the comment that you indicated for a variable
in the implementation part. The operand comment refers to the local
occurrence of the variable only, as opposed to the symbol comment.
The comment is truncated automatically depending on available space.
You can limit the comment to a defined width by activating the option
“Fixed size for operand fields”.
“Show symbol comment” The comment that you indicated for a variable or symbol in the decla-
ration is displayed in PLC Engineering above the variable name. You
can also assign a local operand comment in addition to or instead of
the symbol comment.
“Show symbol address” If an address is assigned to a symbol (variable), then this address is
displayed above the variable name.
“Show network separators” A separator is displayed between the individual networks.
Table 187: “Behavior”
“Placeholder for new The operand field of pins for the new function block is left blank
operands” (instead of "???").
“Empty operands for Adds blank operands instead of ???.
function block pins”
Table 188: “Font”
Click the input field to open the “Font” dialog.
“Specified size for operand : “Edit operand size” can be enabled.
fields”
“Edit operand size” The “Operand Sizes” dialog opens for setting the number of characters
and lines.
Tab 'FBD'
Table 189: “View”
“Networks with line breaks” : Display of the network with line breaks so that PLC Engineering
can show as many function blocks as possible in the current window
width.
“Connect function blocks : The length of the lines between the elements are fixed and short.
with straight lines”
Table 190: “Behavior”
“Network content” Drop-down list: Content of a new network.
“Selection after insertion” Drop-down list: Element that PLC Engineering selects after inserting a
new network.
Tab 'LD'
Table 191: “View”
“Networks with line breaks” : Display of the network with line breaks so that PLC Engineering
can show as many function blocks as possible in the current window
width.
Tab 'IL'
Table 193: “View”
“Enable IL” The IL implementation language is available in the development
system.
Table 194: “Behavior”
“Network content” Drop-down list: Content of a new network.
User interface
“Selection after insertion” Drop-down list: Element that PLC Engineering selects after inserting a
new network.
Tab 'Print'
Table 195: “Layout options”
“Fit method” Selection list for resizing.
“Avoid cutting of elements” Elements that do not fit on the page are printed on the next page.
“Mark connections on Enabled for selection when “Avoid cutting of elements” is selected.
adjacent pages”
Also refer to
● ⮫ Chapter 32.1 Programming languages and their editors on page 377
User interface
toolbar.
Adds a command above the selected command. Opens the “Add
Command” dialog.
Use the “Add Command” dialog to select one or more commands. Left
part: List of categories. Right part: List of commands in the selected
category.
“Add Separator” Adds a separator above the selected command.
“Hide” Hide the selected toolbar from the user interface.
“Show” Shows the selected hidden toolbar in the PLC Engineering user inter-
face.
“Reset” Resets the default settings of the toolbars.
“Load” Loads the settings from a stored file (<file name>.opt.tbar).
See also
● ⮫ Chapter 7.2.2 Customizing Toolbars on page 48
● ⮫ Chapter Dialog 'Customize' - 'Menu' on page 1094
See also
● ⮫ Chapter 33.2.26 Object 'Trace' on page 799
● ⮫ Chapter 22.4.3 Creating Trace Configuration on page 301
User interface
Table 201: Context menu commands
“Add Variable” Adds a new trace variable. The “Variable Settings” subdialog opens on
the right and it is partially configured. Select a variable in the input
field of the “Variable” setting to trace its value curve.
“Assign to Diagram” Lists (in the submenu on the right) those diagrams in which the
selected variable is not currently displayed. Select a diagram to display
the variable in it.
The command is available when a variable is selected in the tree view.
Tip: If the command is disabled, the variable is already displayed in all
diagrams.
“Enabled” Enabled by default
Disabled variables are grayed out. They are neither displayed nor
recorded.
“Post trigger (samples)” Number of records per trace variable that are buffered after triggering.
Default: 50. Value range: 0 to (232 - 1)
“Trigger level” Value causing the trigger when reached
“Task” Task recording data
“Record condition” At runtime, the application checks the recording condition. If the con-
dition is fulfilled, the trace data is buffered.
Record condition for data recording with CmpTraceMgr runtime system
component:
● As an expression that includes only permitted operators and oper-
ands.
Permitted operators (can also be nested): (Logical) AND, NOT,OR,
User interface
the relational operators <, <=, >, >=, =, <>.
Permitted operands: Variables that are valid for trace.
● As a variable.
Permitted type: BOOL, bit access, property. The condition is met for
TRUE or 1. The contents of a pointer are not permitted.
Recording condition for a data recording with IEC code.
● As an expression that returns a Boolean value.
“Comment” Comment (for example, from the recording condition).
“Resolution” Measure for the time stamp that is recorded per data set
● “ms”: Time stamp in ms
● “µs”: Time stamp in µs microseconds for a task cycle time of 1 ms
or less
“Automatic restart” : Persistently saves the trace configuration and the last contents of
the RTS buffer to the target device. After the device is restarted, the
trace is started automatically if the trigger has not occurred yet.
“Extended” Opens the “Advanced trace settings” dialog
Also refer to
● ⮫ Chapter Dialog 'Advanced Trace Settings' on page 1095
User interface
Note: An initial value is required for the variable. This is important for
offline display and scale subdivision. Example iLimit_Min: INT :=
20
“Maximum” Literal, variable (integer data type) or constant variable (integer data
type). Contains the end value of the section. Prerequisite: “Display
mode” is “Fixed”.
Examples: 80,PLC_PRG.iLimit_Max, GVL.c_iLimit_Max
Note: An initial value is required for the variable. This is important for
offline display and scale subdivision. Example iLimit_Max: INT :=
80
“Length” Constant segment length; the initial value is adjusted automatically.
“Grid” : Diagram with grid lines in the x-direction. Select the grid line color
from the dropdown list of colors.
Table 203: “Scale lines”
“Fixed spacing” : Display of graduation marks with “spacing” and “subdivision”
“Distance” Distance of the tick marks
“Divisions” Number of divisions between two division marks
“Font” Font for the time axis.
Link “Preview” Displays the preview of the diagram.
Diagram preview
Prerequisite: In the tree view “Representation (diagrams)” a diagram is
selected.
“Background color” Background color of the diagram. opens the color selection list.
“Background color on Background color of the selected diagram.
selection”
Link “Add variable” Adds a new trace variable (in the tree view “Trace record”).
Link “Remove variable” Deletes the selected trace variable (in the tree view “Trace record”).
Link “Add diagram” Adds a new diagram (in the tree view “Display”).
Link “Remove diagram” Deletes the selected diagram (in the tree view “Display”).
Link “Reset display Resets the display settings of either the selected diagram or y-axis to
settings” the default values.
“OK” Accepts the configuration changes and saves the trace configuration.
34 Software add-ons/documentation
In ctrlX I/O Engineering and ctrlX PLC Engineering there is the option to inte-
grate third-party software add-ons into the user interface, see:
⮫ Command 'Add-on Installer'
Documentation for third-party add-ons have to be obtained from the respective
software manufacturer.
Software add-ons/documentation
Help forCODESYS Store can be found in the ⮫ CODESYS web documentation
Software/link to manufacturer documentation Description
⮫ CODESYS Engineering Development environment:
● CODESYS Development System
● CODESYS Tools
● CODESYS Installer
⮫ CODESYS Library Documentation Collection of library documentation
⮫ CODESYS Fieldbus Field bus connections:
● CODESYS CANbus
● CODESYS EtherCAT
● CODESYS EtherNet/IP
● CODESYS IO-Link
● CODESYS Modbus
● CODESYS PROFIBUS
● CODESYS KNX
● CODESYS Sercos
● CODESYS BACnet
● CODESYS Ethernet Adapter
● CODESYS PROFINET
⮫ CODESYS SoftMotion Implementing PLC-controlled movements effi-
ciently
⮫ CODESYS Visualization Creating user interfaces based on available visuali-
zation elements
⮫ CODESYS Communication Enables easy publishing and integration of data
into applications
The CODESYS add-ons released for the ctrlX system can be obtained via the
ctrlX STORE, see ⮫ ctrlX Store on the web
For questions regarding CODESYS Add-Ons not listed there, please contact
your Bosch Rexroth representative.
I/O mapping
An essential function of an PLC Engineering I/O driver is to update the I/O map-
ping. This means the mapping of the I/O data of the bus system to variables of
the IEC application (and vice versa).
The input/output data is mapped cyclically by copy and conversion operations
in both directions from the internal memory image of the bus system to IEC
variables assigned to %I and %Q addresses.
For the I/O driver, there is no internal difference whether symbolic names or
"direct" access to the %I and %Q addresses are used for this I/O mapping.
For the maintainability of the application, it is recommended to always use
descriptive variable names (example: variable "TemperatureReactor" instead of
"%IW117" access).
The updating of the I/O mapping can be set with “Always update variables”
(globally in the “PLC Settings” or individually for each device in the I/O map-
ping dialog):
● Disabled:
Only I/O data used in the application is mapped.
This may improve performance by avoiding the copy operations, but may
cause confusion if the I/O data in the I/O mapping dialog is not updated (the
values are then grayed out). This setting is recommended for an application
whose development has been completed.
● Enabled 1:
All data is updated.
● Enabled 2:
Caution: For productive use in special cases only.
As a result, inconsistent I/O data may occur, because the bus cycle task
reads/writes this data while the application code uses it in other tasks.
See „Consistency of I/O data“.
See also
● ⮫ Chapter 33.1.9 Tab '<Device name> I/O mapping' on page 739
Services
In addition to the basic functionality, some I/O drivers provide services that can
be called from the PLC Engineering IDE, such as the device scan function or the
setting of device addresses.
General recommendations
Settings:
● “PLC Settings”: I/O updates in stop:
The bus cycle continues even when the application is stopped, for example
when the application is on a debug breakpoint. In this way, communication
with the field devices is maintained and can be continued immediately
without interruption.
● “PLC Settings”: “Always update variables” is set to “Enabled 1 – use bus
cycle task if not used in any task”:
During the development of the application, it is useful to see the values of all
I/O data.
Task configuration:
● Especially for real-time critical fieldbus systems such as Profinet, EtherCAT,
or CAN, which depend on maintaining an exact send/receive clock, it is
37 Libraries
Libraries are used to provide function blocks and functions for use in thePLC
Engineering applications. Apart from the descriptions available in the help,
please refer to the documents contained in the library.
For handling libraries in the PLC Engineering project, please refer to the
chapter “Installing libraries”.
If you want to create libraries with PLC Engineering, please refer to the guide-
lines for library developers!
Also refer to
● ⮫ Chapter 27 Using libraries on page 329
Libraries
37.1 Guidelines for Creating Libraries
Libraries must be created according to specific rules to avoid compatibility
issues.
The main items include the following:
● Select a meaningful library name (required)
● Use templates to ensure consistency (optional)
● Use a familiar and uniform project structure, when possible (optional)
● Register a unique library namespace (required)
● Enter all project information (required)
● Apply the correct method for referencing other libraries correctly (required)
● Design smart external and internal interfaces (required)
● Implement a user-friendly error handling (required)
● Apply the correct method (protection) for deployment (required)
● Apply a consistent naming convention to get clean code (optional)
● When revising an existing library, consider the interface compatibility with
previous versions.
For creating a "translated library" or library documentation, the "CODESYS
Library Documentation Support x.x.x.x.package" is also required.
The package is provided as a separate package via the ctrlX WORKS installation
and is installed via the Package Manager in ctrlX PLC Engineering.
Follow these guidelines when developing libraries in PLC Engineering: "Library
Development Summary". You will find this document as a CHM file (LibDevSum-
mary.chm) in the installation directory of PLC Engineering, or in the online
help.
Also refer to
● ⮫ Chapter 27 Using libraries on page 329
38 Related documentation
38.1 Overview
First Steps
1
Related documentation
4 2
CORE ctrlX
WORKS
7 8 9 10
OPC-UA OPC-UA EtherCAT VPN
Server Client Master Client
11 12 13 14
Remote
Firewall Oscilloscope IDE
Agent
15 16 17 18
3D Telegraf PROFINET
Node-RED
Viewer device
19 20 21 22
Container IoT Python
InfluxDB Dashboard
Engine Runtime
23 24 25 26
G-Code Key Value OPC UA Modbus
Runtime Database Pub/Sub TCP
27
Service
Indicator
No. Documentation
1 ctrlX WORKS First Steps 01VRS
Quick Start Guide
⮫ Web documentation link
Ordering information:
● DOK-XWORKS-F*STEP**V01-QURS-EN-P
● R911403760
No. Documentation
2 ctrlX WORKS Basic System 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XWORKS-********V01-APRS-EN-P
● R911403761
3 ctrlX PLC Engineering - PLC Programming System 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XPLC**-ENG*****V01-APRS-EN-P
● R911403764
3 ctrlX PLC Engineering - PLC Libraries 01VRS
Reference
⮫ Web documentation link
Ordering information:
● DOK-XPLC**-LIBRARY*V01-RERS-EN-P
● R911403766
No. Documentation
4 ctrlX CORE - Runtime 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-BASE****V01-APRS-EN-P
● R911403768
ctrlX CORE - Nodes of the Data Layer 01VRS
Reference
⮫ Web documentation link
Bestellinformationen:
● DOK-XCORE*-BASE*DL*V01-RERS-EN-P
● R911420072
ctrlX CORE - Diagnostics 01VRS
Reference
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-DIAG****V01-RERS-EN-P
● R911403770
No. Documentation
5 PLC App - PLC Runtime Environment for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-PLC*****V01-APRS-EN-P
● R911403787
6 Motion App - Motion Runtime Environment for ctrlX CORE 01VRS
Application Manual
Related documentation
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-MOTION**V01-APRS-EN-P
● R911403791
7 OPC UA Server App - OPC UA Server for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-OPCSERV*V01-APRS-EN-P
● R911403778
8 OPC UA Client App - OPC UA Client for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-OPCCLIENV01-APRS-EN-P
● R911403781
9 EtherCAT Master App - EtherCAT Master for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-ETHERCATV01-APRS-EN-P
● R911403773
10 VPN Client App - Remote Support Software for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-VPN*****V01-APRS-EN-P
● R911403775
11 Firewall App - Security Functions for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-FIREWALLV01-APRS-EN-P
● R911403783
No. Documentation
12 Remote Agent App - ctrlX Device Portal Connection for ctrlX Devices
01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-REMOTE**V01-APRS-EN-P
● R911403785
13 Oscilloscope App - Oscilloscope Function for ctrlX Devices 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-OSCI****V01-APRS-EN-P
● R911409806
14 IDE App - Integrated Development Environment 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-IDE*****V01-APRS-EN-P
● R911410625
15 Node RED App - Graphic Programming for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-NODERED*V01-APRS-EN-P
● R911403789
16 3D Viewer App - Browser-based 3D Kinematic Simulation for ctrlX
CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-3D*VIEW*V01-APRS-EN-P
● R911416124
17 Telegraf App - Server Agent for Collecting Data in the Data Layer
01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-TELEGRAFV01-APRS-EN-P
● R911416836
18 PROFINET Device App - PROFINET Device for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-PROFINETV01-APRS-EN-P
● R911417857
No. Documentation
19 Container Engine App - Use of Docker® Images on ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-DOCKER**V01-APRS-EN-P
● R911417855
20 InfluxDB App - Influx Database Connection for ctrlX CORE 01VRS
Application Manual
Related documentation
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-INFLUX**V01-APRS-EN-P
● R911418738
21 IoT Dashboard App - Data Visualization in Dynamic, Interactive Dash-
boards 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-GDB*****V01-APRS-EN-P
● R911420426
22 Python Runtime App - Python Runtime Environment for ctrlX CORE
01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-PYR*****V01-APRS-EN-P
● R911420430
23 G-Code Runtime App - G-Code Interpreter for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-GCO*****V01-APRS-EN-P
● R911420428
24 Key Value Database App - Managing Data in the Data Layer 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-KVD*****V01-APRS-EN-P
● R911420423
25 OPC UA Pub/Sub App - OPC UA Pub/Sub for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-PUBSUB**V01-APRS-EN-P
● R911418736
No. Documentation
26 Modbus TCP App - Modbus TCP Communication for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-MOD*TCP*V01-APRS-EN-P
● R911417926
27 Service Indicator App - Service Indicator for ctrlX CORE 01VRS
Application Manual
⮫ Web documentation link
Ordering information:
● DOK-XCORE*-SIN*****V01-APRS-EN-P
● R911418740
Service Germany
Our technology-oriented Competence Center in Lohr, Germany, is responsible
for all your service-related queries for electric drive and controls.
Contact the Service Hotline and Service Helpdesk under:
Phone: +49 9352 40 5060
Service worldwide
Outside Germany, please contact your local service office first. For hotline
numbers, refer to the sales office addresses on the internet.
Preparing information
To be able to help you more quickly and efficiently, please have the following
information ready:
● Detailed description of malfunction and circumstances
● Type plate specifications of the affected products, in particular type codes
and serial numbers
● Your contact data (phone and fax number as well as your e-mail address)
40 Index
1, 2, 3 ... __UXINT_TO_UDINT. . . . . . . . . . . . . . . . . . . . 482
__AdrInst. . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __UXINT_TO_UINT. . . . . . . . . . . . . . . . . . . . . . 482
__BitOffset. . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __UXINT_TO_ULINT. . . . . . . . . . . . . . . . . . . . . 482
__Cast. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __UXINT_TO_USINT. . . . . . . . . . . . . . . . . . . . 482
__CATCH. . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 __UXINT_TO_WORD. . . . . . . . . . . . . . . . . . . . 482
__COMPARE_AND_SWAP. . . . . . . . . . . . . . . . 534 __UXINT_TO_WSTRING. . . . . . . . . . . . . . . . . . 482
__Copy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __VarInfo. . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
__CRC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __VCADD. . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
__CURRENTTASK. . . . . . . . . . . . . . . . . . . . . . 533 vector operator. . . . . . . . . . . . . . . . . . . . . 577
__DELETE. . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 __VCDIV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
__ENDTRY'. . . . . . . . . . . . . . . . . . . . . . . . . . . 529 vector operator. . . . . . . . . . . . . . . . . . . . . 578
__FCall. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __VCDOT. . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
__FINALLY. . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 vector operator. . . . . . . . . . . . . . . . . . . . . 579
__Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __VCLOAD_LREAL. . . . . . . . . . . . . . . . . . . . . 582
__ISVALIDREF. . . . . . . . . . . . . . . . . . . . 524, 567 vector operator. . . . . . . . . . . . . . . . . . . . . 582
__Lazy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __VCLOAD_REAL. . . . . . . . . . . . . . . . . . . . . . 581
__Localoffset. . . . . . . . . . . . . . . . . . . . . . . . . 659 vector operator. . . . . . . . . . . . . . . . . . . . . 581
__MaxOffset. . . . . . . . . . . . . . . . . . . . . . . . . . 659 __VCMAX. . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
__NEW. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 vector operator. . . . . . . . . . . . . . . . . . . . . 580
__POOL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 __VCMIN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
__POSITION. . . . . . . . . . . . . . . . . . . . . . . . . . 536 vector operator. . . . . . . . . . . . . . . . . . . . . 580
__POUNAME. . . . . . . . . . . . . . . . . . . . . . . . . . 536 __VCMUL. . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
__PropertyInfo. . . . . . . . . . . . . . . . . . . . . . . . 659 vector operator. . . . . . . . . . . . . . . . . . . . . 578
__QUERYINTERFACE. . . . . . . . . . . . . . . . . . . 527 __VCSET_LREAL. . . . . . . . . . . . . . . . . . . . . . . 581
__QUERYPOINTER. . . . . . . . . . . . . . . . . . . . . 528 vector operator. . . . . . . . . . . . . . . . . . . . . 581
__RefAdr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __VCSET_REAL. . . . . . . . . . . . . . . . . . . . . . . . 580
__RELOC. . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 vector operator. . . . . . . . . . . . . . . . . . . . . 580
__System.ExceptionCode, data type. . . . . . . 529 __VCSQRT. . . . . . . . . . . . . . . . . . . . . . . . . . . 579
__SystemScope. . . . . . . . . . . . . . . . . . . . . . . 659 vector operator. . . . . . . . . . . . . . . . . . . . . 579
__TEST_AND_SET. . . . . . . . . . . . . . . . . . . . . . 537 __VCSTORE. . . . . . . . . . . . . . . . . . . . . . . . . . 582
__TRY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 vector operator. . . . . . . . . . . . . . . . . . . . . 582
__TypeOf. . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 __VCSUB. . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
__UXINT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565 vector operator. . . . . . . . . . . . . . . . . . . . . 577
convert. . . . . . . . . . . . . . . . . . . . . . . . . . . 482 __VECTOR. . . . . . . . . . . . . . . . . . . . . . . . . . . 575
__UXINT_TO___XINT. . . . . . . . . . . . . . . . . . . . 482 __Wait. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
__UXINT_TO___XWORD. . . . . . . . . . . . . . . . . . 482 __XADD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
__UXINT_TO_BIT. . . . . . . . . . . . . . . . . . . . . . . 482 __XINT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
__UXINT_TO_BOOL. . . . . . . . . . . . . . . . . . . . . 482 konvertieren. . . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_BYTE. . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO___UXINT. . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_DATE. . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO___XWORD. . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_DINT. . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_BIT. . . . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_DT. . . . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_BOOL. . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_DWORD. . . . . . . . . . . . . . . . . . . 482 __XINT_TO_BYTE. . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_INT. . . . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_DATE. . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_LDATE. . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_DINT. . . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_LDT. . . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_DT. . . . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_LINT. . . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_DWORD. . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_LREAL. . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_INT. . . . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_LTIME. . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_LDATE. . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_LTOD. . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_LDT. . . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_LWORD. . . . . . . . . . . . . . . . . . . 482 __XINT_TO_LINT. . . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_REAL. . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_LREAL. . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_SINT. . . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_LTIME. . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_STRING. . . . . . . . . . . . . . . . . . . 482 __XINT_TO_LWORD. . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_TIME. . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_REAL. . . . . . . . . . . . . . . . . . . . . . 482
__UXINT_TO_TOD. . . . . . . . . . . . . . . . . . . . . . 482 __XINT_TO_SINT. . . . . . . . . . . . . . . . . . . . . . . 482
configuration convert
device. . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 device. . . . . . . . . . . . . . . . . . . . . . . . . . . 1040
Configuration library reference. . . . . . . . . . . . . . . . . . . 1039
Programming system. . . . . . . . . . . . . . . 1035 to FBD. . . . . . . . . . . . . . . . . . . . . . . . . . . 1006
Task. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865 to IL. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1006
Trace. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1096 to LD. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1006
configuration variable. . . . . . . . . . . . . . . . . . 446 Convert
connect Integer. . . . . . . . . . . . . . . . . . . . . . . . . . . 482
to device. . . . . . . . . . . . . . . . . . . . . . . . . . 953 strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
connection TO_. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
CFC, connect pins. . . . . . . . . . . . . . . . . . 992 TRUNC. . . . . . . . . . . . . . . . . . . . . . . . . . . 516
CFC, route. . . . . . . . . . . . . . . . . . . . . . . . 994 TRUNC_INT. . . . . . . . . . . . . . . . . . . . . . . . 517
connection mark. . . . . . . . . . . . . . . . . . . . 995 core dump. . . . . . . . . . . . . . . . . . . . . . . . . . . 309
connection mark close. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 962
CFC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 create. . . . . . . . . . . . . . . . . . . . . . . . . . . . 962
const_non_replaced, pragma. . . . . . . . . . . . . 612 load. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961
const_replaced, pragma. . . . . . . . . . . . . . . . 612 load device log. . . . . . . . . . . . . . . . . . . . . 962
constant open memory view. . . . . . . . . . . . . . . . . . 908
BOOL. . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 COS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
date. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546 CPU load. . . . . . . . . . . . . . . . . . . . . . . . . . . . 865
LTIME. . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 cpuload
REAL and LREAL. . . . . . . . . . . . . . . . . . . . 542 Multicore. . . . . . . . . . . . . . . . . . . . . . . . . 211
string. . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 create localization template. . . . . . . . . . . . . 928
time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 create stub implementation in C. . . . . . . . . . 937
TIME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 cross reference
time of day. . . . . . . . . . . . . . . . . . . . . . . . 546 browse. . . . . . . . . . . . . . . . . . . . . . . . . . . 889
Constant. . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 global. . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
Input and output variable. . . . . . . . . . . . . 442 Cross reference
Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . 542 IEC address. . . . . . . . . . . . . . . . . . . . . . 1082
Variable. . . . . . . . . . . . . . . . . . . . . . . . . . . 446 update automatically. . . . . . . . . . . . . . . 1082
CONSTANT. . . . . . . . . . . . . . . . . . . . . . . . . . . 540 cross-reference. . . . . . . . . . . . . . . . . . . . . . . 905
Variable. . . . . . . . . . . . . . . . . . . . . . . . . . . 446 cross-reference list. . . . . . . . . . . . . . . . . . . . 903
contact. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 classic view. . . . . . . . . . . . . . . . . . . . . . . . 905
insert. . . . . . . . . . . . . . . . . . . . . . 1002, 1003 collapse all. . . . . . . . . . . . . . . . . . . . . . . . 886
ld. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1001 limit. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1034
negated . . . . . . . . . . . . . . . . . . . . . . . . . 1002 occurrence location. . . . . . . . . . . . . . . . . 204
negated, parallel. . . . . . . . . . . . . . . . . . . 1002 view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
paste right after. . . . . . . . . . . . . . . . . . . 1003 CSV export of alarm storage
right. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1001 command. . . . . . . . . . . . . . . . . . . . . . . . . 773
content operator. . . . . . . . . . . . . . . . . . . . . . 475 configuration. . . . . . . . . . . . . . . . . . . . . . 773
CONTINUE. . . . . . . . . . . . . . . . . . . . . . . . . . . 389 ctrlX AUTOMATION
Continuous Function Chart. . . . . . . . . . . . . . 179 Related documentation. . . . . . . . . . . . . 1113
Continuous Function Chart (CFC) - page- ctrlX CORE
oriented. . . . . . . . . . . . . . . . . . . . . . . . . 180, 425 Licensing notes. . . . . . . . . . . . . . . . . . . . . . 34
Control ctrlX CORE Licensing notes. . . . . . . . . . . . . . . 34
Certificate encrypted communication. . . . 75 ctrlX PLC Engineering
control point Assigning a new target device. . . . . . . 56, 63
CFC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 Commands869, 880, 881, 882, 883, 884, 912,
create. . . . . . . . . . . . . . . . . . . . . . . . . . . . 994 913, 915, 916, 926
remove. . . . . . . . . . . . . . . . . . . . . . . . . . . 994 Create a standard project. . . . . . . . . . . 56, 60
Control system Create an empty project. . . . . . . . . . . . . . . 58
Security. . . . . . . . . . . . . . . . . . . . . . . . . . 375 ctrlX CORE Creating an axis/kin interface. 55,
controller 62
symbol access. . . . . . . . . . . . . . . . . . . . . 737 Dialogs. . . . . . . . . . . 1037, 1044, 1046, 1078
wink. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953 Objects. . . . . . . . . . . . . . . . . . . . . . . 762, 763
conversion rule, see unit conversion. . . . . . . 157 Project for the target system ctrlX CORE
Virtual Axis/kin interface. . . . . . . . . . . 55, 62
Project template for ctrlX CORE devices. . 54 Standard data types. . . . . . . . . . . . . . . . . 555
User management on the control. . . . . 43, 89 user-defined. . . . . . . . . . . . . . . . . . . . . . . 586
custom data type. . . . . . . . . . . . . . . . . . . . . . 815 User-defined. . . . . . . . . . . . . . . . . . . . . . . 556
cycle consistency. . . . . . . . . . . . . . . . . . . . . . 168 WSTRING. . . . . . . . . . . . . . . . . . . . . . . . . 564
D data types
Python. . . . . . . . . . . . . . . . . . . . . . . . . . . 352
D. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
data unit type. . . . . . . . . . . . . . . . . . . . . . . . 815
keyword. . . . . . . . . . . . . . . . . . . . . . . . . . 546
dataflow, pragma attribute. . . . . . . . . . . . . . 612
size prefix. . . . . . . . . . . . . . . . . . . . . . . . . 552
date. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
dar file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
constant. . . . . . . . . . . . . . . . . . . . . . . . . . 546
data
data type. . . . . . . . . . . . . . . . . . . . . . . . . . 559
record and trace. . . . . . . . . . . . . . . . . . . . 298
DATE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Data
convert. . . . . . . . . . . . . . . . . . . . . . . . . . . 511
exchange. . . . . . . . . . . . . . . . . . . . . . . . . . 229
data type. . . . . . . . . . . . . . . . . . . . . . . . . . 559
data breakpoint. . . . . . . . . . . . . . . . . . . . . . . 271
keyword. . . . . . . . . . . . . . . . . . . . . . . . . . 546
condition. . . . . . . . . . . . . . . . . . . . . . . . 1041
DATE_AND_TIME. . . . . . . . . . . . . . . . . . . . . . 559
execution point. . . . . . . . . . . . . . . . . . . . 1042
data type. . . . . . . . . . . . . . . . . . . . . . . . . . 559
Data persistence. . . . . . . . . . . . . . . . . . . . . . 211
keyword. . . . . . . . . . . . . . . . . . . . . . . . . . 546
data record (see sample). . . . . . . . . . . . . . . 298
DATE_TO___UXINT. . . . . . . . . . . . . . . . . . . . . 511
Data security. . . . . . . . . . . . . . . . . . . . . . . . . 262
DATE_TO___XINT. . . . . . . . . . . . . . . . . . . . . . 511
data source
DATE_TO___XWORD. . . . . . . . . . . . . . . . . . . . 511
add initially. . . . . . . . . . . . . . . . . . . . . . . . 243
DATE_TO_BOOL. . . . . . . . . . . . . . . . . . . . . . . 511
choose variables. . . . . . . . . . . . . . . . . . . . 806
DATE_TO_BYTE. . . . . . . . . . . . . . . . . . . . . . . 511
communication via address monitoring . . 812
DATE_TO_DINT. . . . . . . . . . . . . . . . . . . . . . . . 511
communication via symbols . . . . . . . . . . . 808
DATE_TO_DT. . . . . . . . . . . . . . . . . . . . . . . . . 511
OPC UA Client. . . . . . . . . . . . . . . . . . . . . 254
DATE_TO_DWORD. . . . . . . . . . . . . . . . . . . . . 511
symbolic access. . . . . . . . . . . . . . . . . . . . 808
DATE_TO_INT. . . . . . . . . . . . . . . . . . . . . . . . . 511
type mapping. . . . . . . . . . . . . . . . . . . . . . 807
DATE_TO_LDATE. . . . . . . . . . . . . . . . . . . . . . 511
update rate. . . . . . . . . . . . . . . . . . . . . . . . 815
DATE_TO_LDT. . . . . . . . . . . . . . . . . . . . . . . . 511
variables. . . . . . . . . . . . . . . . . . . . . . . . . . 805
DATE_TO_LINT. . . . . . . . . . . . . . . . . . . . . . . . 511
Data source. . . . . . . . . . . . . . . . . . . . . . 241, 805
DATE_TO_LREAL. . . . . . . . . . . . . . . . . . . . . . 511
add. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
DATE_TO_LTOD. . . . . . . . . . . . . . . . . . . . . . . 511
Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
DATE_TO_LWORD. . . . . . . . . . . . . . . . . . . . . . 511
Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
DATE_TO_REAL. . . . . . . . . . . . . . . . . . . . . . . 511
Data source manager
DATE_TO_SINT. . . . . . . . . . . . . . . . . . . . . . . . 511
general. . . . . . . . . . . . . . . . . . . . . . . . . . . 241
DATE_TO_STRING. . . . . . . . . . . . . . . . . . . . . 511
Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
DATE_TO_TIME. . . . . . . . . . . . . . . . . . . . . . . . 511
Data source type
DATE_TO_TOD. . . . . . . . . . . . . . . . . . . . . . . . 511
ApplicationV3. . . . . . . . . . . . . . . . . . . . . . 241
DATE_TO_UDINT. . . . . . . . . . . . . . . . . . . . . . 511
Symbolic. . . . . . . . . . . . . . . . . . . . . . . . . . 242
DATE_TO_UINT. . . . . . . . . . . . . . . . . . . . . . . . 511
data type
DATE_TO_ULINT. . . . . . . . . . . . . . . . . . . . . . . 511
__System.ExceptionCode. . . . . . . . . . . . . 529
DATE_TO_USINT. . . . . . . . . . . . . . . . . . . . . . . 511
ANY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
DATE_TO_WORD. . . . . . . . . . . . . . . . . . . . . . 511
BIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
DATE_TO_WSTRING. . . . . . . . . . . . . . . . . . . . 511
date and time. . . . . . . . . . . . . . . . . . . . . . 559
DCF file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963
integer. . . . . . . . . . . . . . . . . . . . . . . . . . . 556
debug. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
LTIME. . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
operating mode. . . . . . . . . . . . . . . . . . . . 955
message. . . . . . . . . . . . . . . . . . . . . . . . . . 639
run to cursor. . . . . . . . . . . . . . . . . . . . . . . 958
reference. . . . . . . . . . . . . . . . . . . . . . . . . 567
set next statement. . . . . . . . . . . . . . . . . . 959
structure. . . . . . . . . . . . . . . . . . . . . . . . . . 583
show next statement. . . . . . . . . . . . . . . . 959
UNION. . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
step out. . . . . . . . . . . . . . . . . . . . . . . . . . 958
Data type
using step into. . . . . . . . . . . . . . . . . . . . . 958
Alias. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
using step over. . . . . . . . . . . . . . . . . . . . . 957
Default data type. . . . . . . . . . . . . . . . . . . 555
Debug
Enumeration. . . . . . . . . . . . . . . . . . . . . . . 586
CFC Editor. . . . . . . . . . . . . . . . . . . . . . . . 430
Extensions to the IEC 61131-3 standard. 556
Sequential control. . . . . . . . . . . . . . . . . . 282
Implicit enumeration. . . . . . . . . . . . . . . . 453
debug mode. . . . . . . . . . . . . . . . . . . . . . . . . 275
Overflow underflow. . . . . . . . . . . . . . . . . 455
force get
force values. . . . . . . . . . . . . . . . . . . . . . . . 959 access method, interface. . . . . . . . . . . . . 836
handling in watch list. . . . . . . . . . . . . . . . 900 Get
in CFC. . . . . . . . . . . . . . . . . . . . . . . . 995, 996 Accessor method. . . . . . . . . . . . . . . . . . . 839
Force global namespace operator. . . . . . . . . . . . . . 537
Show all forces. . . . . . . . . . . . . . . . . . . . . 280 Global network variables list. . . . . . . . . . . . . 238
forcing global text list
add all forces to watchlist. . . . . . . . . . . . 901 add language and translate text. . . . . . . . 137
prepare value. . . . . . . . . . . . . . . . . . . . . 1041 check. . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Forcing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 compare and export differences. . . . . . . . 139
format document. . . . . . . . . . . . . . . . . . . . . . 897 create. . . . . . . . . . . . . . . . . . . . . . . . . . . 1021
format code. . . . . . . . . . . . . . . . . . . . . . . 897 create again with current IDs. . . . . . . . . . 141
full screen mode. . . . . . . . . . . . . . . . . . . . . . 899 enter text in visualization element. . . . . . 140
function export. . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
call via event. . . . . . . . . . . . . . . . . . . . . . . 861 for static application. . . . . . . . . . . . . . . . . 140
call with external implementation. . . . . . 130 import file. . . . . . . . . . . . . . . . . . . . . . . . . 138
monitor. . . . . . . . . . . . . . . . . . . . . . . . . . . 297 object. . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
Python. . . . . . . . . . . . . . . . . . . . . . . . . . . 360 remove text list entries. . . . . . . . . . . . . . . 141
reaction to type change. . . . . . . . . . . . . . 608 update ID. . . . . . . . . . . . . . . . . . . . . . . . . 141
Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . 825 update with replacement file. . . . . . . . . . 141
Call. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825 global variable. . . . . . . . . . . . . . . . . . . . . . . . 444
FUNCTION. . . . . . . . . . . . . . . . . . . . . . . . . . . 825 declare. . . . . . . . . . . . . . . . . . . . . . . . . . . 167
function as operand. . . . . . . . . . . . . . . . . . . 554 global variable list
function block declare task-local. . . . . . . . . . . . . . . . . . . 168
add input, CFC. . . . . . . . . . . . . . . . . . . . . 438 task-local. . . . . . . . . . . . . . . . . . . . . . . . . . 778
add output, CFC. . . . . . . . . . . . . . . . . . . . 438 Global Variable List. . . . . . . . . . . . . . . . . . . . 777
assignment, info. . . . . . . . . . . . . . . . . . . . 627 global variables list
call with external implementation. . . . . . 130 namespace. . . . . . . . . . . . . . . . . . . . . . . . 538
call, ST. . . . . . . . . . . . . . . . . . . . . . . . . . . 389 global_init_slot, pragma. . . . . . . . . . . . . . . . . 618
extend. . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 GlobalImagePool. . . . . . . . . . . . . . . . . . . . . . 144
I/O channel. . . . . . . . . . . . . . . . . . . . . . . . 122 go to
I/O channel, mapping. . . . . . . . . . . . . . . . 738 definition, how to. . . . . . . . . . . . . . . . . . . 206
I/O mapping. . . . . . . . . . . . . . . . . . . 122, 626 line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
implement interface. . . . . . . . . . . . . . . . . 223 matching bracket. . . . . . . . . . . . . . . . . . . 885
initialization on call. . . . . . . . . . . . . . . . . . 623 network. . . . . . . . . . . . . . . . . . . . . . . . . . 1007
monitor. . . . . . . . . . . . . . . . . . . . . . . . . . . 294 go to definition
monitor with properties. . . . . . . . . . . . . . 295 command. . . . . . . . . . . . . . . . . . . . . . . . . 893
select for I/O mapping. . . . . . . . . . . . . . 1039 Go to source position. . . . . . . . . . . . . . . . . . 898
test, reflection. . . . . . . . . . . . . . . . . . . . . 645 graphical editor toolbar. . . . . . . . . . . . . . . . . 378
Function block. . . . . . . . . . . . . . . . . . . . . . . . 823 group
Call. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823 CFC, create. . . . . . . . . . . . . . . . . . . . . . . . 995
I/O mapping. . . . . . . . . . . . . . . . . . . . . . . 739 CFC, remove. . . . . . . . . . . . . . . . . . . . . . . 995
Map I/O channel. . . . . . . . . . . . . . . . . . . . 739 Group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
Function block diagram. . . . . . . . . . . . . . . . . 173 User administration. . . . . . . . . . . . . . . . . . 76
Function module GSD file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963
Property. . . . . . . . . . . . . . . . . . . . . . . . . . 839 GT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
FUNCTION_BLOCK. . . . . . . . . . . . . . . . . . . . 823 GVL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
G declare task-local. . . . . . . . . . . . . . . . . . . 168
namespace. . . . . . . . . . . . . . . . . . . . . . . . 538
Gateway
Property. . . . . . . . . . . . . . . . . . . . . . . . . . 839
Block driver. . . . . . . . . . . . . . . . . . . . . . . 1015
task-local. . . . . . . . . . . . . . . . . . . . . . . . . . 778
Configuration. . . . . . . . . . . . . . . . . . . . . 1015
Configuration file. . . . . . . . . . . . . . . . . . 1015 H
gateway.cfg. . . . . . . . . . . . . . . . . . . . . . . . . 1015 Hardware
GE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473 map in device tree. . . . . . . . . . . . . . . . . . 115
Generate EtherCAT XML. . . . . . . . . . . . . . . . 924 search. . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Generate Sercos SCI XML. . . . . . . . . . . . . . . 924 hasattribute, pragma. . . . . . . . . . . . . . . . . . . 597
hasconstantvalue, pragma. . . . . . . . . . . . . . . 597
STRING_TO_ULINT. . . . . . . . . . . . . . . . . . . . . 499 T
STRING_TO_USINT. . . . . . . . . . . . . . . . . . . . . 499 T
STRING_TO_WORD. . . . . . . . . . . . . . . . . . . . 499 constant. . . . . . . . . . . . . . . . . . . . . . . . . . 544
STRING_TO_WSTRING. . . . . . . . . . . . . . . . . . 499 literal. . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
Strings Tab
convert. . . . . . . . . . . . . . . . . . . . . . . . . . . 498 Communication. . . . . . . . . . . . . . . . . . . . 735
STRUCT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 DataLayerNode I/O image. . . . . . . . . . . . . 737
structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 Status. . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
access. . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 tab group
BIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585 new horizontal. . . . . . . . . . . . . . . . . . . . . 973
data type. . . . . . . . . . . . . . . . . . . . . . . . . . 583 new vertical. . . . . . . . . . . . . . . . . . . . . . . 973
extend. . . . . . . . . . . . . . . . . . . . . . . . . . . . 584 table of contents. . . . . . . . . . . . . . . . . . . . . . 977
EXTENDS. . . . . . . . . . . . . . . . . . . . . . . . . 584 TAN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
object DUT. . . . . . . . . . . . . . . . . . . . . . . . 815 task
symbolic bit access. . . . . . . . . . . . . . . . . 585 check. . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
SUB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 cycle consistency. . . . . . . . . . . . . . . . . . . 168
subrange types. . . . . . . . . . . . . . . . . . . . . . . 592 cycle times. . . . . . . . . . . . . . . . . . . . . . . . 308
subsequent, pragma. . . . . . . . . . . . . . . . . . . 646 monitor. . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Subversion statistics. . . . . . . . . . . . . . . . . . . . . . . . . . 308
source management. . . . . . . . . . . . . . . . . . 88 task-local variables. . . . . . . . . . . . . . . . . . 168
SUPER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450 Task. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865
Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1119 Configuration. . . . . . . . . . . . . . . . . . . . . . 865
suppress warning, pragma. . . . . . . . . . . . . . 647 Jitter, latency. . . . . . . . . . . . . . . . . . . . . . 209
SVN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Monitoring. . . . . . . . . . . . . . . . . . . . . . . . 863
symbol Processing sequence. . . . . . . . . . . . . . . . 208
access rights. . . . . . . . . . . . . . . . . . . . . . . 229 Task cycle time. . . . . . . . . . . . . . . . . . . . . 865
access to controller. . . . . . . . . . . . . . . . . 737 Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865
symbol configuration. . . . . . . . . . . . . . . . . . . 229 Watchdog. . . . . . . . . . . . . . . . . . . . . . . . . 865
symbol set. . . . . . . . . . . . . . . . . . . . . . . . 229 task configuration
Symbol configuration. . . . . . . . . . . . . . . . . . 788 basic settings. . . . . . . . . . . . . . . . . . . . . . 861
Access rights. . . . . . . . . . . . . . . . . . . . . . 789 create. . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
add. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789 properties. . . . . . . . . . . . . . . . . . . . . . . . . 861
Comments and attributes. . . . . . . . . . . . . 793 Task configuration. . . . . . . . . . . . . . . . . . . . . 208
Data layout. . . . . . . . . . . . . . . . . . . . . . . . 789 Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . 789 Jitter. Latency. . . . . . . . . . . . . . . . . . . . . . 209
OPC UA. . . . . . . . . . . . . . . . . . . . . . . . . . . 789 Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
Task synchronization. . . . . . . . . . . . . . . . . 794 task deployment
Symbol file. . . . . . . . . . . . . . . . . . . . . . . . . . 788 check. . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
symbol library device editor. . . . . . . . . . . . . . . . . . . . . . . 753
project environment of visualization. . . . 1072 Task groups. . . . . . . . . . . . . . . . . . . . . . 209, 865
update. . . . . . . . . . . . . . . . . . . . . . . . . . 1072 Task monitoring, online. . . . . . . . . . . . . . . . . 863
symbol rights task-local
device editor. . . . . . . . . . . . . . . . . . . . . . . 737 declare GVL. . . . . . . . . . . . . . . . . . . . . . . 168
symbol access. . . . . . . . . . . . . . . . . . . . . 229 GVL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
symbol set temporary variable. . . . . . . . . . . . . . . . . . . . 444
symbol configuration. . . . . . . . . . . . . . . . 229 TEST_AND_SET. . . . . . . . . . . . . . . . . . . . . . . 537
symbol, pragma. . . . . . . . . . . . . . . . . . . . . . . 646 text
synchronize translate and manage. . . . . . . . . . . . . . . . 137
cycle-consistent variables. . . . . . . . . . . . . 168 text editor
syntax check. . . . . . . . . . . . . . . . . . . . . . . . . 935 show whitespace. . . . . . . . . . . . . . . . . . . 884
system event. . . . . . . . . . . . . . . . . . . . . . . . . 861 Text editor. . . . . . . . . . . . . . . . . . . . . . . . . . . 887
function call. . . . . . . . . . . . . . . . . . . . . . . 861 Option. . . . . . . . . . . . . . . . . . . . . . . . . . . 1087
SYSTEM.VAR_INFO. . . . . . . . . . . . . . . . . . . . . 530 text list
data structure. . . . . . . . . . . . . . . . . . . . . . 530 add language. . . . . . . . . . . . . . . . . . . . . 1021
add language and translate text. . . . . . . . 137
availability. . . . . . . . . . . . . . . . . . . . . . . . 1059
check ID. . . . . . . . . . . . . . . . . . . . . . . . . 1024
compare and export differences. . . . . . . . 139
view word
bookmarks. . . . . . . . . . . . . . . . . . . . . . . . 901 addressing mode. . . . . . . . . . . . . . . . . . . 552
breakpoints. . . . . . . . . . . . . . . . . . . . . . . . 902 WORD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
call stack. . . . . . . . . . . . . . . . . . . . . . . . . . 906 convert. . . . . . . . . . . . . . . . . . . . . . . . . . . 482
call tree. . . . . . . . . . . . . . . . . . . . . . . . . . . 906 WORD_TO___XWORD. . . . . . . . . . . . . . . . . . . 482
cross-reference list. . . . . . . . . . . . . . . . . . 903 WORD_TO__UXINT. . . . . . . . . . . . . . . . . . . . . 482
memory view. . . . . . . . . . . . . . . . . . . . . . 908 WORD_TO__XINT. . . . . . . . . . . . . . . . . . . . . . 482
POUs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900 WORD_TO_BIT. . . . . . . . . . . . . . . . . . . . . . . . 482
standard menu bar. . . . . . . . . . . . . . . . . . 899 WORD_TO_BOOL. . . . . . . . . . . . . . . . . . . . . . 482
View WORD_TO_BYTE. . . . . . . . . . . . . . . . . . . . . . 482
Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . 898 WORD_TO_DATE. . . . . . . . . . . . . . . . . . . . . . 482
view indentation guides. . . . . . . . . . . . . . . . 885 WORD_TO_DINT. . . . . . . . . . . . . . . . . . . . . . . 482
visualization WORD_TO_DT. . . . . . . . . . . . . . . . . . . . . . . . 482
folder containing image pool. . . . . . . . . 1069 WORD_TO_DWORD. . . . . . . . . . . . . . . . . . . . 482
folder containing text list. . . . . . . . . . . . 1069 WORD_TO_INT. . . . . . . . . . . . . . . . . . . . . . . . 482
project settings. . . . . . . . . . . . . . . . . . . . 1069 WORD_TO_LDATE. . . . . . . . . . . . . . . . . . . . . 482
visualization element WORD_TO_LDT. . . . . . . . . . . . . . . . . . . . . . . 482
configuration with interface property. . 1069 WORD_TO_LINT. . . . . . . . . . . . . . . . . . . . . . . 482
enter static text. . . . . . . . . . . . . . . . . . . . 140 WORD_TO_LREAL. . . . . . . . . . . . . . . . . . . . . 482
visualization profile WORD_TO_LTIME. . . . . . . . . . . . . . . . . . . . . . 482
project setting. . . . . . . . . . . . . . . . . . . . 1069 WORD_TO_LTOD. . . . . . . . . . . . . . . . . . . . . . 482
version. . . . . . . . . . . . . . . . . . . . . . . . . . 1071 WORD_TO_LWORD. . . . . . . . . . . . . . . . . . . . 482
visualization style WORD_TO_REAL. . . . . . . . . . . . . . . . . . . . . . 482
version. . . . . . . . . . . . . . . . . . . . . . . . . . 1071 WORD_TO_SINT. . . . . . . . . . . . . . . . . . . . . . . 482
W WORD_TO_STRING. . . . . . . . . . . . . . . . . . . . 482
WORD_TO_TIME. . . . . . . . . . . . . . . . . . . . . . 482
W. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
WORD_TO_TOD. . . . . . . . . . . . . . . . . . . . . . . 482
size prefix. . . . . . . . . . . . . . . . . . . . . . . . . 552
WORD_TO_UDINT. . . . . . . . . . . . . . . . . . . . . 482
warm start. . . . . . . . . . . . . . . . . . . . . . . . . . . 949
WORD_TO_UINT. . . . . . . . . . . . . . . . . . . . . . . 482
warning disable, pragma. . . . . . . . . . . . . . . . 647
WORD_TO_ULINT. . . . . . . . . . . . . . . . . . . . . . 482
warning restore, pragma. . . . . . . . . . . . . . . . 647
WORD_TO_USINT. . . . . . . . . . . . . . . . . . . . . 482
watch
WORD_TO_WSTRING. . . . . . . . . . . . . . . . . . . 482
add all forces to watchlist. . . . . . . . . . . . 901
Working with ctrlX PLC Engineering
open view. . . . . . . . . . . . . . . . . . . . . . . . . 900
Connection to ctrlX real-time data. . . . . . . 93
watch list
worksheet. . . . . . . . . . . . . . . . . . . . . . . . . . . 985
watch all forces. . . . . . . . . . . . . . . . . . . . 900
Write. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Watch list. . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Write protection. . . . . . . . . . . . . . . . . . . . . . . 79
watchlist. . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
WebVisu
writing values
security. . . . . . . . . . . . . . . . . . . . . . . . . . . 376
command. . . . . . . . . . . . . . . . . . . . . . . . . 960
WHILE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
prepare value. . . . . . . . . . . . . . . . . . . . . 1041
whitespace. . . . . . . . . . . . . . . . . . . . . . . . . . 884
WSTRING. . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
show in text editor. . . . . . . . . . . . . . . . . . 884
convert. . . . . . . . . . . . . . . . . . . . . . . . . . . 499
window
index access. . . . . . . . . . . . . . . . . . . . . . . 567
auto hide. . . . . . . . . . . . . . . . . . . . . . . . . . 974
WSTRING_TO___UXINT. . . . . . . . . . . . . . . . . . 499
dock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974
WSTRING_TO___UXWORD. . . . . . . . . . . . . . . 499
float. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
WSTRING_TO___XINT. . . . . . . . . . . . . . . . . . . 499
reset layout. . . . . . . . . . . . . . . . . . . . . . . . 973
WSTRING_TO_BIT. . . . . . . . . . . . . . . . . . . . . 499
window <n>. . . . . . . . . . . . . . . . . . . . . . . . . . 975
WSTRING_TO_BOOL. . . . . . . . . . . . . . . . . . . 499
windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . 974
WSTRING_TO_BYTE. . . . . . . . . . . . . . . . . . . . 499
hide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
WSTRING_TO_DATE. . . . . . . . . . . . . . . . . . . . 499
layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
WSTRING_TO_DINT. . . . . . . . . . . . . . . . . . . . 499
move. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
WSTRING_TO_DT. . . . . . . . . . . . . . . . . . . . . . 499
resize. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
WSTRING_TO_DWORD. . . . . . . . . . . . . . . . . 499
show. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
WSTRING_TO_INT. . . . . . . . . . . . . . . . . . . . . 499
toggle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
WSTRING_TO_LDT. . . . . . . . . . . . . . . . . . . . . 499
Windows Certificate Store. . . . . . . . . . . . . . . 75
WSTRING_TO_LINT. . . . . . . . . . . . . . . . . . . . 499
wink. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953
WSTRING_TO_LREAL. . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_LTIME. . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_LTOD. . . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_LWORD. . . . . . . . . . . . . . . . . . 499
WSTRING_TO_REAL. . . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_STRING. . . . . . . . . . . . . . . . . . 499
WSTRING_TO_TIME. . . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_TOD. . . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_UDINT. . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_UINT. . . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_ULINT. . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_USINT. . . . . . . . . . . . . . . . . . . 499
WSTRING_TO_WORD. . . . . . . . . . . . . . . . . . . 499
X
X. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
size prefix. . . . . . . . . . . . . . . . . . . . . . . . . 552
XADD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
XOR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
XORN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
XSIZEOF. . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
Z
zoom
factor. . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
graphical editor. . . . . . . . . . . . . . . . . . . . 378
zoom in/out
graphical editor. . . . . . . . . . . . . . . . . . . . 378
R911403764
R911403764