0% found this document useful (0 votes)
52 views634 pages

Obsolete - Block Library

The document provides original instructions for the EcoStruxure™ Control Expert Obsolete Block Library, detailing product information, safety regulations, and technical characteristics. It emphasizes the importance of performing risk analysis and testing for specific applications, while also outlining the structure and availability of various function blocks. Additionally, it includes a comprehensive table of contents covering multiple chapters on different control functions and their descriptions.

Uploaded by

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

Obsolete - Block Library

The document provides original instructions for the EcoStruxure™ Control Expert Obsolete Block Library, detailing product information, safety regulations, and technical characteristics. It emphasizes the importance of performing risk analysis and testing for specific applications, while also outlining the structure and availability of various function blocks. Additionally, it includes a comprehensive table of contents covering multiple chapters on different control functions and their descriptions.

Uploaded by

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

EcoStruxure™ Control Expert

33002543 10/2019

EcoStruxure™
Control Expert
Obsolete
Block Library
Original instructions

10/2019
33002543.19

www.schneider-electric.com
The information provided in this documentation contains general descriptions and/or technical
characteristics of the performance of the products contained herein. This documentation is not
intended as a substitute for and is not to be used for determining suitability or reliability of these
products for specific user applications. It is the duty of any such user or integrator to perform the
appropriate and complete risk analysis, evaluation and testing of the products with respect to the
relevant specific application or use thereof. Neither Schneider Electric nor any of its affiliates or
subsidiaries shall be responsible or liable for misuse of the information contained herein. If you
have any suggestions for improvements or amendments or have found errors in this publication,
please notify us.
You agree not to reproduce, other than for your own personal, noncommercial use, all or part of
this document on any medium whatsoever without permission of Schneider Electric, given in
writing. You also agree not to establish any hypertext links to this document or its content.
Schneider Electric does not grant any right or license for the personal and noncommercial use of
the document or its content, except for a non-exclusive license to consult it on an "as is" basis, at
your own risk. All other rights are reserved.
All pertinent state, regional, and local safety regulations must be observed when installing and
using this product. For reasons of safety and to help ensure compliance with documented system
data, only the manufacturer should perform repairs to components.
When devices are used for applications with technical safety requirements, the relevant
instructions must be followed.
Failure to use Schneider Electric software or approved software with our hardware products may
result in injury, harm, or improper operating results.
Failure to observe this information can result in injury or equipment damage.
© 2019 Schneider Electric. All rights reserved.

2 33002543 10/2019
Table of Contents

Safety Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Part I General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 1 Block Types and their Applications. . . . . . . . . . . . . . . . . 21
Block Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
FFB Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
EN and ENO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Chapter 2 Block Availability on Various Hardware Platforms . . . . . 31
Block Availability on Various Hardware Platforms . . . . . . . . . . . . . . . . 31
Chapter 3 List of obsolete functions described in the other libraries 37
Summary of functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Part II CLC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Chapter 4 DELAY: Deadtime device . . . . . . . . . . . . . . . . . . . . . . . . 41
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Example for behavior of the function block . . . . . . . . . . . . . . . . . . . . . 46
Chapter 5 INTEGRATOR1: Integrator with limit . . . . . . . . . . . . . . . 47
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Chapter 6 LAG1: Delay element 1st order . . . . . . . . . . . . . . . . . . . 53
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Chapter 7 LEAD_LAG1: PD device with smoothing . . . . . . . . . . . . 59
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Examples of function blocks LEAD_LAG1 . . . . . . . . . . . . . . . . . . . . . . 64
Chapter 8 LIMV: Velocity limiter 1st order . . . . . . . . . . . . . . . . . . . . 67
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

33002543 10/2019 3
Chapter 9 PI1: PI controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Example of the PI1 controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Chapter 10 PID1: PID controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
PID1 function block structure diagram. . . . . . . . . . . . . . . . . . . . . . . . . 89
Setting parameters for the PID1 controller . . . . . . . . . . . . . . . . . . . . . 90
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Chapter 11 PIDP1: PID Controller with Parallel Structure. . . . . . . . . . 97
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Setting parameters for the PIDP1 controller . . . . . . . . . . . . . . . . . . . . 103
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Chapter 12 SMOOTH_RATE: Differentiator with smoothing. . . . . . . . 109
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Formulas for the SMOOTH_RATE function block . . . . . . . . . . . . . . . . . . 113
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Chapter 13 THREE_STEP_CON1: Three step controller . . . . . . . . . . 117
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Chapter 14 THREEPOINT_CON1: Three point controller. . . . . . . . . . 125
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Chapter 15 TWOPOINT_CON1: Two point controller . . . . . . . . . . . . . 135
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Part III CLC_PRO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Chapter 16 ALIM: Velocity limiter: 2nd order . . . . . . . . . . . . . . . . . . . 145
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Chapter 17 COMP_PID: Complex PID controller . . . . . . . . . . . . . . . . 151
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Complex PID controller structure diagram . . . . . . . . . . . . . . . . . . . . . . 158
Setting parameters for the COMP_PID controller . . . . . . . . . . . . . . . . . 159

4 33002543 10/2019
Anti-windup for COMP_PID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Controller type selection for COMP_PID. . . . . . . . . . . . . . . . . . . . . . . . 163
Bumpless operating mode switchover . . . . . . . . . . . . . . . . . . . . . . . . . 164
Selecting the operating mode of the COMP_PID . . . . . . . . . . . . . . . . . 167
Detailed formulas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Chapter 18 DEADTIME: Deadtime device . . . . . . . . . . . . . . . . . . . . 173
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Example for behavior of the function block . . . . . . . . . . . . . . . . . . . . . 179
Chapter 19 DERIV: Differentiator with smoothing . . . . . . . . . . . . . . . 181
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Example for the function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Chapter 20 FGEN: Function generator . . . . . . . . . . . . . . . . . . . . . . . 189
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Function selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Function definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Diagrams of the individual functions . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Special cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Timing diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Chapter 21 INTEG: Integrator with limit. . . . . . . . . . . . . . . . . . . . . . . 205
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Chapter 22 LAG: Delay element 1st order . . . . . . . . . . . . . . . . . . . . 213
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Chapter 23 LAG2: Delay element 2nd order . . . . . . . . . . . . . . . . . . . 219
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Timing diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Chapter 24 LEAD_LAG: PD device with smoothing . . . . . . . . . . . . . 227
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Examples of function blocks LEAD_LAG . . . . . . . . . . . . . . . . . . . . . . . 232

33002543 10/2019 5
Chapter 25 PCON2: Two point controller . . . . . . . . . . . . . . . . . . . . . . 235
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Chapter 26 PCON3: Three point controller . . . . . . . . . . . . . . . . . . . . . 243
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Runtime error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Chapter 27 PD_OR_PI: Structure changeover PD/PI controller . . . . . 253
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Structure diagram for the function block PD_OR_PI . . . . . . . . . . . . . . 259
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Chapter 28 PDM: Pulse duration modulation . . . . . . . . . . . . . . . . . . . 267
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Chapter 29 PI: PI controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Example of a PI controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Chapter 30 PID: PID controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
PID function block structure diagram. . . . . . . . . . . . . . . . . . . . . . . . . . 293
Setting parameters for the PID controller. . . . . . . . . . . . . . . . . . . . . . . 294
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Chapter 31 PID_P: PID controller with parallel structure. . . . . . . . . . . 301
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Setting parameters for the PID_P controller . . . . . . . . . . . . . . . . 307
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Chapter 32 PIP: PIP cascade controller . . . . . . . . . . . . . . . . . . . . . . . 313
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
PIP function block structure diagram. . . . . . . . . . . . . . . . . . . . . . . . . . 319
Setting parameters for the PIP cascade controller . . . . . . . . . . . . . . . 320
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324

6 33002543 10/2019
Chapter 33 PPI: PPI cascade controller . . . . . . . . . . . . . . . . . . . . . . 327
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
PPI function block structure diagram . . . . . . . . . . . . . . . . . . . . . . . . . 333
Setting parameters for the PPI cascade controller . . . . . . . . . . . . . . . 334
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Detailed formulas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Chapter 34 PWM: Pulse width modulation . . . . . . . . . . . . . . . . . . . . 339
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Example for the PWM block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Chapter 35 QPWM: Pulse width modulation (simple) . . . . . . . . . . . . 351
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Example for the QPWM block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Chapter 36 SCON3: Three step controller . . . . . . . . . . . . . . . . . . . . 359
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Chapter 37 VLIM: Velocity limiter 1st order . . . . . . . . . . . . . . . . . . . . 367
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Part IV Extension/Compatibility . . . . . . . . . . . . . . . . . . . . . . 373
Chapter 38 ADD_***_PL7 : Add a period. . . . . . . . . . . . . . . . . . . . . . 377
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Chapter 39 AKF_FL: Detection of any edge . . . . . . . . . . . . . . . . . . . 381
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Chapter 40 AKF_TA: Switch off delay . . . . . . . . . . . . . . . . . . . . . . . . 383
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Chapter 41 AKF_TE: Switch-on delay . . . . . . . . . . . . . . . . . . . . . . . . 387
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Chapter 42 AKF_TI: Pulse. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Chapter 43 AKF_TS: Storing switch on delay . . . . . . . . . . . . . . . . . . 395
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Chapter 44 AKF_TV: Extended pulse . . . . . . . . . . . . . . . . . . . . . . . . 399
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Chapter 45 AKF_ZR: Decremental counter. . . . . . . . . . . . . . . . . . . . 403
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403

33002543 10/2019 7
Chapter 46 AKF_ZV: Incremental counter . . . . . . . . . . . . . . . . . . . . . 407
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Chapter 47 AKF_ZVR: Incremental/decremental counter . . . . . . . . . . 411
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Chapter 48 COMPARE: Comparing two integers . . . . . . . . . . . . . . . . 415
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Chapter 49 DATE_DINT_TO_STRING: Conversion of a date (DATE
PL7) into a character string . . . . . . . . . . . . . . . . . . . . . . . 417
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Chapter 50 DAY_OF_WEEK : Day of the week . . . . . . . . . . . . . . . . . 419
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Chapter 51 DELTA_***: Difference between two dates. . . . . . . . . . . . 421
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Chapter 52 DT_ARINT_TO_STRING: Converting a PL7 date into a
character string. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Chapter 53 END: Unconditional end of program. . . . . . . . . . . . . . . . . 427
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Chapter 54 FIFO: First In/First Out stack register . . . . . . . . . . . . . . . . 429
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
Chapter 55 FPULSOR: Generation of rectangular signals . . . . . . . . . 433
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Detailed description of the operation of the FPULSOR function . . . . . 436
Chapter 56 FSTEP_PL7_DRUM : Forcing a drum to a step . . . . . . . 437
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Chapter 57 FTOF: Deactivation timer . . . . . . . . . . . . . . . . . . . . . . . . . 439
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Detailed description of the operation of the FTOF function . . . . . . . . . 442
Chapter 58 FTON: Activation timer . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Detailed description of the operation of the FTON function . . . . . . . . . 446
Chapter 59 FTP: Pulse timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
Detailed description of the operation of the FTP function . . . . . . . . . . 450
Chapter 60 GET_3X: Read %IW Words (3x-Register) . . . . . . . . . . . . 451
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451

8 33002543 10/2019
Chapter 61 GET_4X: Read %MW Words (4x-Register) . . . . . . . . . . 453
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
Chapter 62 GET_BIT: Reading bit. . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Chapter 63 HIGH_INT: Extracting the most significant word of a
double integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Chapter 64 IEC_BMDI: Block move . . . . . . . . . . . . . . . . . . . . . . . . . 459
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Chapter 65 IEC_BMDI_M: Block move . . . . . . . . . . . . . . . . . . . . . . . 467
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Chapter 66 LIFO: Last In/First Out stack register . . . . . . . . . . . . . . . 475
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Chapter 67 LOW_INT: Extracting the least significant word of a
double integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Chapter 68 MUX_DINTARR_125: Multiplexer for arrays of the data
type DIntArr125. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Chapter 69 PL7_COUNTER : Counter/downcounter . . . . . . . . . . . . 483
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Mode of operation of the PL7_COUNTER function . . . . . . . . . . . . . . . 488
Chapter 70 PL7_DRUM : Drum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Mode of operation of the PL7_DRUM timer function . . . . . . . . . . . . . . 494
Chapter 71 PL7_MONOSTABLE : Monostable . . . . . . . . . . . . . . . . . 495
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Detailed description of the operation of the PL7_MONOSTABLE
function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Mode of operation of the PL7_MONOSTABLE monostable function . 500
Chapter 72 PL7_REGISTER_32 : 32 word memory register. . . . . . . 501
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Chapter 73 PL7_REGISTER_255 : 255 word memory register. . . . . 505
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505

33002543 10/2019 9
Chapter 74 PL7 and Control Expert Timers Comparison . . . . . . . . . . 509
Differences between PL7 and Control Expert: Timers . . . . . . . . . . . . . 509
Chapter 75 PL7_TOF : TOF type timer . . . . . . . . . . . . . . . . . . . . . . . . 511
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
Detailed description of the operation of the PL7_TOF function . . . . . . 515
Mode of operation of the PL7_TOF timer function . . . . . . . . . . . . . . . . 516
Chapter 76 PL7_TON : TON type timer . . . . . . . . . . . . . . . . . . . . . . . 517
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Detailed description of the operation of the PL7_TON function . . . . . . 521
Mode of operation of the PL7_TON timer function. . . . . . . . . . . . . . . . 522
Chapter 77 PL7_TP : TP type timer . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
Detailed description of the operation of the PL7_TP function . . . . . . . 527
Mode of operation of the PL7_TP timer function . . . . . . . . . . . . . . . . . 528
Chapter 78 PL7_3_TIMER : Conversion timer for % Ti’s of PL7. . . . . 529
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
Detailed description of the operation of the PL7_3_TIMER function . . 533
Mode of operation of the PL7_3_TIMER timer function . . . . . . . . . . . . 534
Chapter 79 PUT_4X: Write 4x register . . . . . . . . . . . . . . . . . . . . . . . . 535
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
Chapter 80 R_INT_WORD: Type conversion (REAL -> INT -> WORD)
(R_INT_WORD: Type conversion (REAL -> INT ->
WORD)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Chapter 81 R_UINT_WORD: Type conversion (REAL -> UINT ->
WORD) (R_UINT_WORD: Type conversion (REAL ->
UINT -> WORD)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Chapter 82 R2T_***: Register to table . . . . . . . . . . . . . . . . . . . . . . . . 541
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Chapter 83 READ_PCMCIA: Reading data in the memory card. . . . . 547
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
READ_PCMCIA and WRITE_PCMCIA Example . . . . . . . . . . . . . . . . . 551
Chapter 84 ROR1_ARB: Right shift of one byte from a table of bytes 553
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Chapter 85 RRTC: Reading the system date . . . . . . . . . . . . . . . . . . . 555
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555

10 33002543 10/2019
Chapter 86 SCOUNT: Up/down counting with overshoot signaling . 557
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Chapter 87 SET_BIT: Set bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Chapter 88 SET_PCMCIA: Initialization of the archiving zone . . . . . 565
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Chapter 89 SHL_RBIT_***: Left shift on an integer or double integer 567
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
Chapter 90 SHR_RBIT_***: Right shift on an integer or double integer 569
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
Chapter 91 SHRZ_***: Right shift on an integer or double integer . . 571
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
Chapter 92 SHRZ_RBIT_***: Right shift on an integer or double
integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Chapter 93 SRCH: Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
Chapter 94 STR_ROUND: Approximate value of a floating point
number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Chapter 95 SUB_***_PL7 : Subtract a period . . . . . . . . . . . . . . . . . . 583
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
Chapter 96 SYSSTATE: System state . . . . . . . . . . . . . . . . . . . . . . . 587
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Chapter 97 T2T: Table to table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
Chapter 98 TIME_DINT_TO_STRING: Conversion of a variable to
DINT format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Chapter 99 TOD_DINT_TO_STRING: Conversion of a variable to
TOD format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Chapter 100 TRANS_TIME: Conversion of a duration into DINT format 599
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599

33002543 10/2019 11
Chapter 101 W_INT_REAL: Type conversion (WORD -> INT -> REAL)
(W_INT_REAL: Type conversion (WORD -> INT ->
REAL)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Chapter 102 W_UINT_REAL: Type conversion (WORD -> UINT ->
REAL) (W_UINT_REAL: Type conversion (WORD ->
UINT -> REAL)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Chapter 103 WRITE_PCMCIA: Writing data to the memory card . . . . . 605
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
Chapter 104 WRTC: Updating the system date . . . . . . . . . . . . . . . . . . 609
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Appendix A EFB Error Codes and Values . . . . . . . . . . . . . . . . . . . . . . 613
Tables of Error Codes for the Obsolete Library . . . . . . . . . . . . . . . . . . 614
Common Floating Point Errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631

12 33002543 10/2019
Safety Information

Important Information

NOTICE
Read these instructions carefully, and look at the equipment to become familiar with the device
before trying to install, operate, service, or maintain it. The following special messages may appear
throughout this documentation or on the equipment to warn of potential hazards or to call attention
to information that clarifies or simplifies a procedure.

33002543 10/2019 13
PLEASE NOTE
Electrical equipment should be installed, operated, serviced, and maintained only by qualified
personnel. No responsibility is assumed by Schneider Electric for any consequences arising out of
the use of this material.
A qualified person is one who has skills and knowledge related to the construction and operation
of electrical equipment and its installation, and has received safety training to recognize and avoid
the hazards involved.

BEFORE YOU BEGIN


Do not use this product on machinery lacking effective point-of-operation guarding. Lack of
effective point-of-operation guarding on a machine can result in serious injury to the operator of
that machine.

WARNING
UNGUARDED EQUIPMENT
 Do not use this software and related automation equipment on equipment which does not have
point-of-operation protection.
 Do not reach into machinery during operation.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

This automation equipment and related software is used to control a variety of industrial processes.
The type or model of automation equipment suitable for each application will vary depending on
factors such as the control function required, degree of protection required, production methods,
unusual conditions, government regulations, etc. In some applications, more than one processor
may be required, as when backup redundancy is needed.
Only you, the user, machine builder or system integrator can be aware of all the conditions and
factors present during setup, operation, and maintenance of the machine and, therefore, can
determine the automation equipment and the related safeties and interlocks which can be properly
used. When selecting automation and control equipment and related software for a particular
application, you should refer to the applicable local and national standards and regulations. The
National Safety Council's Accident Prevention Manual (nationally recognized in the United States
of America) also provides much useful information.
In some applications, such as packaging machinery, additional operator protection such as point-
of-operation guarding must be provided. This is necessary if the operator's hands and other parts
of the body are free to enter the pinch points or other hazardous areas and serious injury can occur.
Software products alone cannot protect an operator from injury. For this reason the software
cannot be substituted for or take the place of point-of-operation protection.

14 33002543 10/2019
Ensure that appropriate safeties and mechanical/electrical interlocks related to point-of-operation
protection have been installed and are operational before placing the equipment into service. All
interlocks and safeties related to point-of-operation protection must be coordinated with the related
automation equipment and software programming.
NOTE: Coordination of safeties and mechanical/electrical interlocks for point-of-operation
protection is outside the scope of the Function Block Library, System User Guide, or other
implementation referenced in this documentation.

START-UP AND TEST


Before using electrical control and automation equipment for regular operation after installation,
the system should be given a start-up test by qualified personnel to verify correct operation of the
equipment. It is important that arrangements for such a check be made and that enough time is
allowed to perform complete and satisfactory testing.

WARNING
EQUIPMENT OPERATION HAZARD
 Verify that all installation and set up procedures have been completed.
 Before operational tests are performed, remove all blocks or other temporary holding means
used for shipment from all component devices.
 Remove tools, meters, and debris from equipment.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Follow all start-up tests recommended in the equipment documentation. Store all equipment
documentation for future references.
Software testing must be done in both simulated and real environments.
Verify that the completed system is free from all short circuits and temporary grounds that are not
installed according to local regulations (according to the National Electrical Code in the U.S.A, for
instance). If high-potential voltage testing is necessary, follow recommendations in equipment
documentation to prevent accidental equipment damage.
Before energizing equipment:
 Remove tools, meters, and debris from equipment.
 Close the equipment enclosure door.
 Remove all temporary grounds from incoming power lines.
 Perform all start-up tests recommended by the manufacturer.

33002543 10/2019 15
OPERATION AND ADJUSTMENTS
The following precautions are from the NEMA Standards Publication ICS 7.1-1995 (English
version prevails):
 Regardless of the care exercised in the design and manufacture of equipment or in the selection
and ratings of components, there are hazards that can be encountered if such equipment is
improperly operated.
 It is sometimes possible to misadjust the equipment and thus produce unsatisfactory or unsafe
operation. Always use the manufacturer’s instructions as a guide for functional adjustments.
Personnel who have access to these adjustments should be familiar with the equipment
manufacturer’s instructions and the machinery used with the electrical equipment.
 Only those operational adjustments actually required by the operator should be accessible to
the operator. Access to other controls should be restricted to prevent unauthorized changes in
operating characteristics.

16 33002543 10/2019
About the Book

At a Glance

Document Scope
This documentation describes the functions and function blocks in the Obsolete library.
NOTE: The functions and function blocks in this library are only used to convert from Concept and
PL7 user programs. Even if the Obsolete library will continue to be fully supported in the future
versions of Control Expert, the functions and function blocks it contains should not be used to
create new user programs.

Validity Note
This document is valid for EcoStruxure™ Control Expert 14.1 or later.

33002543 10/2019 17
Related Documents

Title of documentation Reference number


EcoStruxure™ Control Expert, Program Languages 35006144 (English),
and Structure, Reference Manual 35006145 (French),
35006146 (German),
35013361 (Italian),
35006147 (Spanish),
35013362 (Chinese)
EcoStruxure™ Control Expert, Operating Modes 33003101 (English),
33003102 (French),
33003103 (German),
33003104 (Spanish),
33003696 (Italian),
33003697 (Chinese)
EcoStruxure™ Control Expert, System Bits and EIO0000002135 (English),
Words, Reference Manual EIO0000002136 (French),
EIO0000002137 (German),
EIO0000002138 (Italian),
EIO0000002139 (Spanish),
EIO0000002140 (Chinese)
EcoStruxure™ Control Expert, Standard, Block 33002519 (English),
Library 33002520 (French),
33002521 (German),
33003678 (Italian),
33002522 (Spanish),
33003679 (Chinese)

You can download these technical publications and other technical information from our website
at www.schneider-electric.com/en/download.

18 33002543 10/2019
EcoStruxure™ Control Expert
General
33002543 10/2019

Part I
General

General

Overview
This section contains general information about the Obsolete library.
NOTE: For a detailed description of system objects (%S and %SW), refer to EcoStruxure™ Control
Expert, System Bits and Words, Reference Manual.

What Is in This Part?


This part contains the following chapters:
Chapter Chapter Name Page
1 Block Types and their Applications 21
2 Block Availability on Various Hardware Platforms 31
3 List of obsolete functions described in the other libraries 37

33002543 10/2019 19
General

20 33002543 10/2019
EcoStruxure™ Control Expert
Block Types and their Applications
33002543 10/2019

Chapter 1
Block Types and their Applications

Block Types and their Applications

Overview
This chapter describes the different block types and their applications.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Block Types 22
FFB Structure 24
EN and ENO 28

33002543 10/2019 21
Block Types and their Applications

Block Types

Block Types
Different block types are used in Control Expert. The general term for the block types is FFB.
There are the following types of block:
 Elementary Function (EF)
 Elementary Function Block (EFB)
 Derived Function Block (DFB)
 Procedure

NOTE: Motion Function Blocks are not available on the Quantum platform.

Elementary Function
Elementary functions (EF) have no internal status and one output only. If the input values are the
same, the output value is the same for the executions of the function, for example the addition of
two values gives the same result at every execution.
An elementary function is represented in the graphical languages (FBD and LD) as a block frame
with inputs and an output. The inputs are represented on the left and the outputs on the right of the
block frame. The name of the function, that is the function type, is shown in the center of the block
frame.
The number of inputs can be increased with some elementary functions.
NOTE: Unity Pro is the former name of Control Expert for version 13.1 or earlier.

CAUTION
UNEXPECTED BEHAVIOR OF EQUIPMENT
For Unity Pro V4.0 and earlier versions, do not use links to connect function blocks outputs, when
your application relies on persistent output data of an EF.
Failure to follow these instructions can result in injury or equipment damage.

NOTE: With Unity Pro V4.0 and earlier versions the deactivation of an EF (EN=0) causes links
connected to its Input/Output to be reset. To transfer the state of the signal do not use a link. A
variable must be connected to the EF’s output and must be used to connect the input of the
element. With Unity Pro V4.1 and later versions you can maintain the output links even if an EF is
deactivated by activating the option Maintain output links on disabled EF (EN=0) via the menu
Tools → Program → Languages → Common.

22 33002543 10/2019
Block Types and their Applications

Elementary Function Block


Elementary function blocks (EFB) have an internal status. If the inputs have the same values, the
value on the outputs can have another value during the individual executions. For example, with a
counter, the value on the output is incremented.
An elementary function block is represented in the graphical languages (FBD and LD) as a block
frame with inputs and outputs. The inputs are represented on the left and the outputs on the right
of the block frame. The name of the function block, that is the function block type, is shown in the
center of the block frame. The instance name is displayed above the block frame.

Derived Function Block


Derived function blocks (DFBs) have the same properties as elementary function blocks. They are
created by the user in the programming languages FBD, LD, IL and/or ST.

Procedure
Procedures are functions with several outputs. They have no internal state.
The only difference from elementary functions is that procedures can have more than one output
and they support variables of the VAR_IN_OUT data type.
Procedures do not return a value.
Procedures are a supplement to IEC 61131-3 and must be enabled explicitly.
There is no visual difference between procedures and elementary functions.
NOTE: Unity Pro is the former name of Control Expert for version 13.1 or earlier.

CAUTION
UNEXPECTED BEHAVIOR OF EQUIPMENT
For Unity Pro V4.0 and earlier versions, do not use links to connect function blocks outputs, when
your application relies on persistent output data of an EF.
Failure to follow these instructions can result in injury or equipment damage.

NOTE: With Unity Pro V4.0 and earlier versions the deactivation of an EF (EN=0) causes links
connected to its Input/Output to be reset. To transfer the state of the signal do not use a link. A
variable must be connected to the EF’s output and must be used to connect the input of the
element. With Unity Pro V4.1 and later versions you can maintain the output links even if an EF is
deactivated by activating the option Maintain output links on disabled EF (EN=0) via the menu
Tools → Program → Languages → Common.

33002543 10/2019 23
Block Types and their Applications

FFB Structure

Structure
Each FFB is made up of an operation (name of the FFB), the operands are required for the
operation (formal and actual parameters) and an instance name for elementary/derived function
blocks.
Call of a function block in the FBD programming language:

CAUTION
UNEXPECTED APPLICATION BEHAVIOR
Do not call several times the same block instance within a PLC cycle
Failure to follow these instructions can result in injury or equipment damage.

24 33002543 10/2019
Block Types and their Applications

Formal call of a function block in the ST programming language:

Operation
The operation determines which function is to be executed with the FFB, e.g. shift register,
conversion operations.

Operand
The operand specifies what the operation is to be executed with. With FFBs, this consists of formal
and actual parameters.

Formal/actual parameters
Inputs and outputs are required to transfer values to or from an FFB. These are called formal
parameters.
Objects are linked to formal parameters; these objects contain the current process states. They are
called actual parameters.
At program runtime, the values from the process are transferred to the FFB via the actual
parameters and then output again after processing.
The data type of the actual parameters must match the data type of the input/output (formal
parameters). The only exceptions are generic inputs/outputs whose data type is determined by the
actual parameter. If the actual parameters consist of literals, a suitable data type is selected for the
function block.

33002543 10/2019 25
Block Types and their Applications

FFB Call in IL/ST


In text languages IL and ST, FFBs can be called in formal and in informal form. For detail, refer to
chapter Programming Language (see EcoStruxure™ Control Expert, Program Languages and
Structure, Reference Manual).
Example of a formal function call:
out:=LIMIT (MN:=0, IN:=var1, MX:=5);
Example of an informal function call:
out:=LIMIT (0, var1, 5);
NOTE: The use of EN and ENO is only possible for formal calls.

VAR_IN_OUT variable
FFBs are often used to read a variable at an input (input variables), to process it and to output the
altered values of the same variable (output variables).
This special type of input/output variable is also called a VAR_IN_OUT variable.
The input and output variable are linked in the graphic languages (FBD and LD) using a line
showing that they belong together.
Function block with VAR_IN_OUT variable in FBD:

Function block with VAR_IN_OUT variable in ST:


MY_EXAMP1 (IN1:=Input1, IN2:=Input2, IO1:=Comb_IN_OUT,
OUT1=>Output1, OUT2=>Output2);
The following points must be considered when using FFBs with VAR_IN_OUT variables:
 The VAR_IN_OUT inputs must be assigned a variable.
 Literals or constants cannot be assigned to VAR_IN_OUT inputs/outputs.

26 33002543 10/2019
Block Types and their Applications

The following additional limitations apply to the graphic languages (FBD and LD):
 When using graphic connections, VAR_IN_OUT outputs can only be connected with
VAR_IN_OUT inputs.
 Only one graphical link can be connected to a VAR_IN_OUT input/output.
 Different variables/variable components can be connected to the VAR_IN_OUT input and the
VAR_IN_OUT output. In this case the value of the variables/variable component on the input is
copied to the output variables/variable component.
 No negations can be used on VAR_IN_OUT inputs/outputs.
 A combination of variable/address and graphic connections is not possible for VAR_IN_OUT
outputs.

33002543 10/2019 27
Block Types and their Applications

EN and ENO

Description
An EN input and an ENO output can be configured for the FFBs.
If the value of EN is equal to "0" when the FFB is invoked, the algorithms defined by the FFB are
not executed and ENO is set to "0".
If the value of EN is equal to "1" when the FFB is invoked, the algorithms defined by the FFB will
be executed. After the algorithms have been executed successfully, the value of ENO is set to "1".
If certain error conditions are detected when executing these algorithms, ENO is set to "0".
If the EN pin is not assigned a value, when the FFB is invoked, the algorithm defined by the FFB is
executed (same as if EN equals to "1"), Please refer to Maintain output links on disabled EF
(see EcoStruxure™ Control Expert, Operating Modes).
If the algorithms are executed successfully, then value of ENO is set to "1", else ENO is set to "0".
If ENO is set to "0" (caused by EN=0 or a detected error condition during execution or unsuccessful
algorithm execution):
 Function blocks
 EN/ENO handling with function blocks that (only) have one link as an output parameter:

If EN from FunctionBlock_1 is set to "0", the output connection OUT from Function-
Block_1 retains the status it had in the last correctly executed cycle.
 EN/ENO handling with function blocks that have one variable and one link as output
parameters:

If EN from FunctionBlock_1 is set to "0", the output connection OUT from Function-
Block_1 retains the status it had in the last correctly executed cycle. The variable OUT1 on
the same pin, either retains its previous status or can be changed externally without
influencing the connection. The variable and the link are saved independently of each other.

28 33002543 10/2019
Block Types and their Applications

 Functions/Procedures
NOTE: Unity Pro is the former name of Control Expert for version 13.1 or earlier.

CAUTION
UNEXPECTED BEHAVIOR OF EQUIPMENT
For Unity Pro V4.0 and earlier versions, do not use links to connect function blocks outputs,
when your application relies on persistent output data of an EF.
Failure to follow these instructions can result in injury or equipment damage.

NOTE: With Unity Pro V4.0 and earlier versions the deactivation of an EF (EN=0) causes links
connected to its Input/Output to be reset. To transfer the state of the signal do not use a link. A
variable must be connected to the EF’s output and must be used to connect the input of the
element. With Unity Pro V4.1 and later versions you can maintain the output links even if an EF
is deactivated by activating the option Maintain output links on disabled EF (EN=0) via the menu
Tools → Program → Languages → Common.
As defined in IEC61131-3, the outputs from deactivated functions (EN-input set to "0") is
undefined. (The same applies to procedures.)
Here is an explanation of the output status in this case:
 EN/ENO handling with functions/procedures that (only) have one link as an output
parameter:

If EN from Function/Procedure_1 is set to "0", the output connection OUT from


Function/Procedure_1 is also set to "0".
 EN/ENO handling with function blocks that have one variable and one link as output
parameters:

If EN from Function/Procedure_1 is set to "0", the output connection OUT from


Function/Procedure_1 is also set to "0". The variable OUT1 on the same pin, either
retains its previous status or can be changed externally without influencing the connection.
The variable and the link are saved independently of each other.
The output behavior of the FFBs does not depend on whether the FFBs are called up without
EN/ENO or with EN=1.

33002543 10/2019 29
Block Types and their Applications

Conditional/Unconditional FFB Call


"Unconditional" or "conditional" calls are possible with each FFB. The condition is realized by pre-
linking the input EN.
 EN connected
conditional calls (the FFB is only processed if EN = 1)
 EN shown, hidden, and marked TRUE, or shown and not occupied
unconditional calls (FFB is processed independent from EN)
NOTE: For disabled function blocks (EN = 0) with an internal time function (e.g. DELAY), time
seems to keep running, since it is calculated with the help of a system clock and is therefore
independent of the program cycle and the release of the block.

CAUTION
UNEXPECTED APPLICATION EQUIPMENT
Do not disable function blocks with internal time function during their operation.
Failure to follow these instructions can result in injury or equipment damage.

Note for IL and ST


The use of EN and ENO is only possible in the text languages for a formal FFB call, e.g.
MY_BLOCK (EN:=enable, IN1:=var1, IN2:=var2,
ENO=>error, OUT1=>result1, OUT2=>result2);
Assigning the variables to ENO must be done with the operator =>.
With an informal call, EN and ENO cannot be used.

30 33002543 10/2019
EcoStruxure™ Control Expert
Availability of Blocks
33002543 10/2019

Chapter 2
Block Availability on Various Hardware Platforms

Block Availability on Various Hardware Platforms

Block Availability on Various Hardware Platforms

Introduction
Not all blocks are available on all hardware platforms. The blocks available on your hardware
platform can be found in the following tables.
NOTE: The functions and function blocks in this library are not defined in IEC 61131-3.

CLC
Availability of the blocks:

Block name Block M340 M580 Quantum Momentum Premium Source


type
DELAY EFB + + + + + Concept
INTEGRATOR1 EFB + + + + + Concept
LAG1 EFB + + + + + Concept
LEAD_LAG1 EFB + + + + + Concept
LIMV EFB + + + + + Concept
PI1 EFB + + + + + Concept
PID1 EFB + + + + + Concept
PIDP1 EFB + + + + + Concept
SMOOTH_RATE EFB + + + + + Concept
THREE_STEP_CON1 EFB + + + + + Concept
THREEPOINT_CON1 EFB + + + + + Concept
TWOPOINT_CON1 EFB + + + + + Concept

Legend:
+ Yes
- No

33002543 10/2019 31
Availability of Blocks

CLC_PRO
Availability of the blocks:

Block name Block M340 M580 Quantum Momentum Premium Source


type
ALIM EFB + + + + + Concept
COMP_PID EFB + + + + + Concept
DEADTIME EFB + + + + + Concept
DERIV EFB + + + + + Concept
FGEN EFB + + + + + Concept
INTEG EFB + + + + + Concept
LAG EFB + + + + + Concept
LAG2 EFB + + + + + Concept
LEAD_LAG EFB + + + + + Concept
PCON2 EFB + + + + + Concept
PCON3 EFB + + + + + Concept
PD_OR_PI EFB + + + + + Concept
PDM EFB + + + + + Concept
PI EFB + + + + + Concept
PID EFB + + + + + Concept
PID_P EFB + + + + + Concept
PIP EFB + + + + + Concept
PPI EFB + + + + + Concept
PWM EFB + + + + + Concept
QPWM EFB + + + + + Concept
SCON3 EFB + + + + + Concept
VLIM EFB + + + + + Concept

Legend:
+ Yes
- No

32 33002543 10/2019
Availability of Blocks

Extensions/Compatibility
Availability of the blocks:

Block name Block type M340 M580 Quantum Momentum Premium Source
ADD_DT_PL7 EF + - - + + PL7
ADD_TOD_PL7 EF + - - + + PL7
AKF_FL EFB + + + + + Concept
AKF_TA EFB + + + + + Concept
AKF_TE EFB + + + + + Concept
AKF_TI EFB + + + + + Concept
AKF_TS EFB + + + + + Concept
AKF_TV EFB + + + + + Concept
AKF_ZR EFB + + + + + Concept
AKF_ZV EFB + + + + + Concept
AKF_ZVR EFB + + + + + Concept
AND_ARINT_INT EF + - + + + PL7
AND_ARDINT_DINT EF + - + + + PL7
AND_*** EF + - + + + PL7
COMPARE Procedure + + + + TSX P 57 5• PL7
DATE_DINT_TO_STRING EF + - - + + PL7
DAY_OF_WEEK EF + - - + + PL7
DELTA_D EF + - - + + PL7
DELTA_DT EF + - - + + PL7
DELTA_TOD EF + - - + + PL7
DOWN_PL7_COUNTER Procedure - - - - + PL7
DOWN_PL7_TOF Procedure - - - - + PL7
DOWN_PL7_TON Procedure - - - - + PL7
DOWN_PL7_TP Procedure - - - - + PL7
DT_ARINT_TO_STRING EF + - - + + PL7
END Procedure + + Only 140 + + PL7
CPU 6xx xx
FIFO EFB + + + + + Concept
FPULSOR Procedure + + - + + PL7
FSTEP_PL7_DRUM Procedure - - - - + PL7
FTOF Procedure - - - - + PL7
FTON Procedure - - - - + PL7

33002543 10/2019 33
Availability of Blocks

Block name Block type M340 M580 Quantum Momentum Premium Source
FTP Procedure - - - - + PL7
GET_3X EF - - + - - Concept
GET_4X EF + - + + + Concept
GET_BIT EF + + + + + Concept
GET_PL7_REGISTER_255 Procedure - - - - + PL7
GET_PL7_REGISTER_32 Procedure - - - - + PL7
HIGH_INT EF + + + + + PL7
IEC_BMDI Procedure - - + - - Concept
IEC_BMDI_M Procedure - - - + - Concept
LIFO EFB + + + + + Concept
LOW_INT EF + + + + + PL7
MUX_DINTARR_125 EF + + + + + Concept
NOT_ARINT EF + + + + + PL7
NOT_ARDINT EF + + + + + PL7
NOT_INT EF + + + + + PL7
NOT_DINT EF + + + + + PL7
OR_ARINT_INT EF + + + + + PL7
OR_ARDINT_DINT EF + + + + + PL7
OR_*** EF + + + + + PL7
PL7_3_TIMER EFB - - - - + PL7
PL7_COUNTER EFB - - - - + PL7
PL7_DRUM EFB - - - - + PL7
PL7_MONOSTABLE EFB - - - - + PL7
PL7_REGISTER_255 EFB - - - - + PL7
PL7_REGISTER_32 EFB - - - - + PL7
PL7_TOF EFB - - - - + PL7
PL7_TON EFB - - - - + PL7
PL7_TP EFB - - - - + PL7
PRESET_PL7_3_TIMER Procedure - - - - + PL7
PRESET_PL7_COUNTER Procedure - - - - + PL7
PUT_4X Procedure + - + + + Concept
PUT_PL7_REGISTER_255 Procedure - - - - + PL7
PUT_PL7_REGISTER_32 Procedure - - - - + PL7
R_INT_WORD EF + + + + + Concept

34 33002543 10/2019
Availability of Blocks

Block name Block type M340 M580 Quantum Momentum Premium Source
R_UINT_WORD EF + + + + + Concept
READ_PCMCIA Procedure - - Only 140 - + PL7
CPU 6xx xx
R2T_*** EFB + + + + + Concept
RESET_PL7_COUNTER Procedure - - - - + PL7
RESET_PL7_DRUM Procedure - - - - + PL7
RESET_PL7_REGISTER_255 Procedure - - - - + PL7
RESET_PL7_REGISTER_32 Procedure - - - - + PL7
ROL_*** EF + + + + + PL7
ROR_*** EF + + + + + PL7
ROR1_ARB Procedure + + + + + PL7
RRTC Procedure + + - + + PL7
SCOUNT Procedure + + + + + PL7
SET_BIT EF + + + + + Concept
SET_PCMCIA Procedure - - + - + PL7
SHL_*** EF + + + + + PL7
SHL_RBIT_*** Procedure + + + + + PL7
SHR_RBIT_*** Procedure + + + + + PL7
SHRZ_*** EF + + + + + PL7
SHRZ_RBIT_*** Procedure + + + + + PL7
SRCH EFB + + + + + Concept
START_PL7_3_TIMER Procedure - - - - + PL7
START_PL7_MONOSTABLE Procedure - - - - + PL7
START_PL7_TOF Procedure - - - - + PL7
START_PL7_TON Procedure - - - - + PL7
START_PL7_TP Procedure - - - - + PL7
STOP_PL7_3_TIMER Procedure - - - - + PL7
STR_ROUND Procedure + + + + + PL7
SUB_***_PL7 EF + - - + + PL7
SYSSTATE EFB + + + + + Concept
T2T EFB + + + + + Concept
TIME_DINT_TO_STRING EF + - - + + PL7
TOD_DINT_TO_STRING EF + - - + + PL7
TRANS_TIME EF + + - + + PL7
UP_PL7_COUNTER Procedure - - - - + PL7

33002543 10/2019 35
Availability of Blocks

Block name Block type M340 M580 Quantum Momentum Premium Source
UP_PL7_DRUM Procedure - - - - + PL7
W_INT_REAL EF + + + + + Concept
W_UINT_REAL EF + + + + + Concept
WRITE_PCMCIA Procedure - - Only 140 - + PL7
CPU 6xx xx
WRTC Procedure + + - + + PL7
XOR_ARINT_INT EF + - + + + PL7
XOR_ARDINT_DINT EF + - + + + PL7
XOR_*** EF + - + + + PL7

Legend:
+ Yes
- No

36 33002543 10/2019
EcoStruxure™ Control Expert
List of obsolete functions described in the other libraries
33002543 10/2019

Chapter 3
List of obsolete functions described in the other libraries

List of obsolete functions described in the other libraries

Summary of functions

At a Glance
Despite belonging to the obsolete library, certain functions are described in the documentation for
the general library.
The following table provides a summary of these functions, and indicates the correspondence
between the function family through which they can be accessed using Control Expert, and that of
the general library where they are described in the documentation.

Use of the obsolete functions


This library includes the functions from previous software generations. Conserving these functions
makes it possible to convert applications created by software products other than Control Expert,
as well as enabling users to carry on programming as before. In most cases, functions are specific
to an API range. However, it should be noted that these functions are not IEC 61131-3 compliant,
and that in certain cases, IEC-equivalent functions do exist.
It is therefore recommended not to use this library for creating program modules that are
transferable from one PLC to another.

Summary table
The following table shows the different functions of the obsolete library which are described in the
general library:

Functions Using Control Expert, the function The function is described in the
can be accessed via the family... family...
AND_ARDINT_DINT Extensions/compatibility Array
AND_ARINT_INT Extensions/compatibility Array
AND_ARDINT Extensions/compatibility Array
AND_ARINT Extensions/compatibility Array
AND_DINT Extensions/compatibility Logic
AND_INT Extensions/compatibility Logic
NOT_DINT Extensions/compatibility Logic
NOT_INT Extensions/compatibility Logic
NOT_ARDINT Extensions/compatibility Array

33002543 10/2019 37
List of obsolete functions described in the other libraries

Functions Using Control Expert, the function The function is described in the
can be accessed via the family... family...
NOT_ARINT Extensions/compatibility Array
OR_ARDINT_DINT Extensions/compatibility Array
OR_ARINT_INT Extensions/compatibility Array
OR_ARDINT Extensions/compatibility Array
OR_ARINT Extensions/compatibility Array
OR_DINT Extensions/compatibility Logic
OR_INT Extensions/compatibility Logic
ROL_DINT Extensions/compatibility Logic
ROL_INT Extensions/compatibility Logic
ROR_DINT Extensions/compatibility Logic
ROR_INT Extensions/compatibility Logic
SHL_DINT Extensions/compatibility Logic
SHL_INT Extensions/compatibility Logic
XOR_ARDINT_DINT Extensions/compatibility Array
XOR_ARINT_INT Extensions/compatibility Array
XOR_ARDINT Extensions/compatibility Array
XOR_ARINT Extensions/compatibility Array
XOR_DINT Extensions/compatibility Logic
XOR_INT Extensions/compatibility Logic

For more details on these functions, refer to EcoStruxure™ Control Expert, Standard, Block
Library.

38 33002543 10/2019
EcoStruxure™ Control Expert
CLC
33002543 10/2019

Part II
CLC

CLC

Overview
This part describes the elementary functions and elementary function blocks in the family CLC.

What Is in This Part?


This part contains the following chapters:
Chapter Chapter Name Page
4 DELAY: Deadtime device 41
5 INTEGRATOR1: Integrator with limit 47
6 LAG1: Delay element 1st order 53
7 LEAD_LAG1: PD device with smoothing 59
8 LIMV: Velocity limiter 1st order 67
9 PI1: PI controller 73
10 PID1: PID controller 83
11 PIDP1: PID Controller with Parallel Structure 97
12 SMOOTH_RATE: Differentiator with smoothing 109
13 THREE_STEP_CON1: Three step controller 117
14 THREEPOINT_CON1: Three point controller 125
15 TWOPOINT_CON1: Two point controller 135

33002543 10/2019 39
CLC

40 33002543 10/2019
EcoStruxure™ Control Expert
DELAY
33002543 10/2019

Chapter 4
DELAY: Deadtime device

DELAY: Deadtime device

Introduction
This chapter describes the DELAY block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 42
Operating mode 45
Example for behavior of the function block 46

33002543 10/2019 41
DELAY

Description

Function description
With this function block the input signal is delayed by a deadtime.
The function block delays the signal X by the deadtime T_DELAY before it appears again at Y.
The function block incorporates a delay buffer for 128 elements (X values), meaning that during
the time span T_DELAY 128 X values can be stored. The buffer is used in such a way that it
corresponds with the operating mode.
Whether the system is started cold or warm, the value of Y remains unchanged. The internal values
are set to the value of X.
After a change of deadtime T_DELAY or a cold or warm system start, the output READY goes to
"0". This means: that the buffer is not ready because it is empty.
The function block has the following operating mode: Manual, halt and automatic mode.
EN and ENO can be configured as additional parameters.
NOTE: The delay time continues to run even if the block is disabled via the EN parameter, because
the block calculates its time differences according to the system clock.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Representation in FBD
Representation:

42 33002543 10/2019
DELAY

Representation in LD
Representation:

Representation in IL
Representation:
CAL DELAY_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputValue, T_DELAY:=DelayTime,
YMAN:=ManualControl_Y_Value, Y=>Output,
READY=>InternalBufferFlag)

Representation in ST
Representation:
DELAY_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputValue, T_DELAY:=DelayTime,
YMAN:=ManualControl_Y_Value, Y=>Output,
READY=>InternalBufferFlag) ;

33002543 10/2019 43
DELAY

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1" = Manual operating mode
HALT BOOL "1" = Halt mode
X REAL Input value
T_DELAY TIME Deadtime
YMAN REAL Manually manipulated value

Description of output parameters:

Parameter Data type Description


Y REAL Output
READY BOOL "1" = internal buffer is full
"0" = internal buffer is not full (e.g. after warm/cold
start or modification of deadtime)

Runtime error
For a list of all block error codes and values, see CLC, page 614.

44 33002543 10/2019
DELAY

Operating mode

Selecting the operating modes


There are three operating modes, which are selected via the inputs MAN and HALT.

Operating mode MAN HALT


Automatic 0 0
Manual mode 1 0 or 1
Halt 0 1

Automatic operating mode


In the automatic mode, the function block operates according to the following rules:

If... Then...
the current X value is transferred to the buffer, and the oldest X value in the
buffer is placed on the output Y. If a cycle time is greater than T_DELAY / 128,
a resolution of less than 128 will result, causing a systematic error leading to
double storage of some X values. (see the following Example).
not all X values can be stored in the buffer. In this case the X value is not saved
in some cycles, and Y remains unchanged in these cycles.

Example of automatic mode


In the example the following values are accepted:
Cycle time = 100 ms
T_DELAY = 10 s
tin = T_DELAY / 128 = 78 ms
As the reading time tin is shorter than the cycle time, each X value is transferred to the buffer. On
the fourth execution of the function block (after 400 ms) the X value is saved twice rather than once
(as 3 x 78 = 312 and 4 x 78 = 390).

Manual mode
In manual mode the manual value YMAN is consistently transferred to the control output Y. The
internal buffer is charged with the manual value YMAN. The buffer is marked as charged (READY
=1).

Halt mode
The output Yis held at the last calculated value in Halt mode. The internal buffer still continues to
operate as in automatic mode.

33002543 10/2019 45
DELAY

Example for behavior of the function block

Example
The following diagram shows an example for behavior of the function block. Input X follows a ramp
function from one value to a new value. Delayed by the deadtime T_DELAY, X values appear at Y.
Function block diagram DELAY

46 33002543 10/2019
EcoStruxure™ Control Expert
INTEGRATOR1
33002543 10/2019

Chapter 5
INTEGRATOR1: Integrator with limit

INTEGRATOR1: Integrator with limit

Introduction
This chapter describes the INTEGRATOR1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 48
Detailed description 51

33002543 10/2019 47
INTEGRATOR1

Description

Function description
The function block replicates a limited integrator.
The function block has the following properties:
 Manual, halt and automatic modes
 Manipulated variable limiting in automatic mode

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Formula
The transfer function is:

The formula for the output Y is:

Meaning of the sizes

Variable Description
Value of input X from the previous cycle

Value of the output Y from the previous cycle

dt is the time differential between the current cycle and the previous cycle

48 33002543 10/2019
INTEGRATOR1

Representation in FBD
Representation:

Representation in LD
Representation:

33002543 10/2019 49
INTEGRATOR1

Representation in IL
Representation:
CAL INTEGRATOR1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputVariable, GAIN:=IntegralGain,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualControlLimit, Y=>Output,
QMAX=>Y_AtUpperLimit, QMIN=>Y_AtLowerLimit)

Representation in ST
Representation:
INTEGRATOR1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputVariable, GAIN:=IntegralGain,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualControlLimit, Y=>Output,
QMAX=>Y_AtUpperLimit, QMIN=>Y_AtLowerLimit) ;

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1" = Manual operating mode
HALT BOOL "1" = Halt mode
X REAL Input variable
GAIN REAL Integral gain
YMAX REAL Upper limit
YMIN REAL Lower limit
YMAN REAL Manually manipulated value

Description of output parameters:

Parameter Data type Description


Y REAL Output
QMAX BOOL "1" = Output Y has reached upper limit
QMIN BOOL "1" = Output Y has reached lower limit

Runtime error
If YMAN < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see CLC, page 614.

50 33002543 10/2019
INTEGRATOR1

Detailed description

Parametering
The parameter assignments of the function block are satisfied by the determination of the integral
GAIN and the limiting values YMAX and YMIN for output Y.
The limits YMAX and YMIN limit the output within the prescribed range. Therefore YMIN ≤ Y ≤
YMAX.
The markers QMAX and QMIN signal that the limits have been reached or the output signal is being
limited.
 QMAX = 1 if Y ≥ YMAX
 QMIN = 1 if Y ≤ YMIN

Operating mode
There are three operating modes, which are selected via the inputs MAN and HALT:

Operating MAN HALT Meaning


mode
Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed to
the output Y. The control output is, however, limited
by YMAX and YMIN.
Halt 0 1 The output Y will be held at the last calculated value.

33002543 10/2019 51
INTEGRATOR1

Example
The input signal is integrated via the time. If there is a jump on input X the output increases (for
positive X values) or decreases (for negative X values) according to a ramp function. Y is always
between YMAX and YMIN; if Y is equal to YMAX or YMIN, this is shown accordingly in QMAX or QMIN.
It displays the integrator jump response:

52 33002543 10/2019
EcoStruxure™ Control Expert
LAG1
33002543 10/2019

Chapter 6
LAG1: Delay element 1st order

LAG1: Delay element 1st order

Introduction
This chapter describes the LAG1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 54
Detailed description 57

33002543 10/2019 53
LAG1

Description

Function description
The function block represents a delay element 1st order.
The function block contains the following operating mode:
 Manual mode
 Halt
 Automatic

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouput may deliver a wrong value.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Formula
The transfer function is:

The formula of calculation is:

Meaning of the sizes

Variable Description
Value of input X from the previous cycle

Value of the output Y from the previous cycle

dt is the time differential between the current cycle and the previous cycle

54 33002543 10/2019
LAG1

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL LAG1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputValue, GAIN:=GainFactor, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue, Y=>Output)

33002543 10/2019 55
LAG1

Representation in ST
Representation:
LAG1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputValue, GAIN:=GainFactor, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue, Y=>Output) ;

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1" = Manual operating mode
HALT BOOL "1" = Halt mode
X REAL Input value
GAIN REAL Gain factor
LAG TIME Delayed time constants
YMAN REAL Manually manipulated value

Description of output parameters:

Parameter Data type Description


Y REAL Output

Runtime error
For a list of all block error codes and values, see CLC, page 614.

56 33002543 10/2019
LAG1

Detailed description

Parametering
Setting parameters for the function block is achieved through specification of the factor GAIN as
well as setting parameters for the delayed time constant LAG.
The unit jump at input X (jump at input X from 0 to 1.0) follows output Y with a delay. Along an e-
function

it will approximate the value .

Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:

Operating mode MAN HALT Meaning


Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y.
Halt 0 1 The output Y will be held at the last calculated
value.

33002543 10/2019 57
LAG1

Example
The diagram shows an example of the jump response of the LAG device: Input X jumps to a new
value and output Y follows an e-function for input X.
Jump response for function block LAG1 if GAIN = 1

58 33002543 10/2019
EcoStruxure™ Control Expert
LEAD_LAG1
33002543 10/2019

Chapter 7
LEAD_LAG1: PD device with smoothing

LEAD_LAG1: PD device with smoothing

Introduction
This chapter describes the LEAD_LAG1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 60
Detailed description 63
Examples of function blocks LEAD_LAG1 64

33002543 10/2019 59
LEAD_LAG1

Description

Function description
The function block serves as a PD outline with subsequent smoothing.
The function block has the following properties:
 Definable delay of the D-component
 Operating modes Manual, Halt, Automatic

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouput may deliver a wrong value.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Formula
The transfer function is:

The formula of calculation is:

Meaning of the sizes

Variable Description
Value of input X from the previous cycle

Value of the output Y from the previous cycle

dt is the time differential between the current cycle and the previous cycle

60 33002543 10/2019
LEAD_LAG1

Representation in FBD
Representation:

Representation in LD
Representation:

33002543 10/2019 61
LEAD_LAG1

Representation in IL
Representation:
CAL LEAD_LAG1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=Input, GAIN:=GainFactor,
LEAD:=DifferentialTimeConstant, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue, Y=>Output)

Representation in ST
Representation:
LEAD_LAG1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=Input, GAIN:=GainFactor,
LEAD:=DifferentialTimeConstant, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue, Y=>Output) ;

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1" = Manual operating mode
HALT BOOL "1" = Halt mode
X REAL Input
GAIN REAL Gain factor
LEAD TIME Derivative time constant
LAG TIME Delayed time constants
YMAN REAL Manual value manipulated value

Description of output parameters:

Parameter Data type Description


Y REAL Output

Runtime error
For a list of all block error codes and values, see CLC, page 614.

62 33002543 10/2019
LEAD_LAG1

Detailed description

Parametering
The parameter assignments of the function block are satisfied by the determination of the factor
GAIN, and the values the derivative time constant LEAD and delayed time constant LAG.
For very small sample times and the unit jump to input X (jump at input X from 0 to 1.0) output Y
will jump to the value (theoretical value - actual slightly smaller due to the
not infinitely small sample times), using the time constant LAG to approximate the value
closer.

Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:

Operating mode MAN HALT Meaning


Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y.
Halt 0 1 The output Y will be held at the last calculated
value.

33002543 10/2019 63
LEAD_LAG1

Examples of function blocks LEAD_LAG1

Example overview
The following examples are presented in the following diagrams:
 LEAD = LAG
 LEAD=LAG * 0.5, GAIN = 1
 LEAD/LAG = 2, GAIN = 1

LEAD = LAG
The function blocks behave like a pure multiplication block with the multiplier GAIN.
Function block LEAD_LAG1 with LEAD = LAG

64 33002543 10/2019
LEAD_LAG1

LEAD=LAG * 0.5, GAIN = 1


The output Y jumps in this case to half the end value in order to run into the end value with the
delayed time constant lag (GAIN * X).
Function block LEAD_LAG1 with LEAD/LAG = 0.5 and GAIN = 1

LEAD/LAG = 2, GAIN = 1
The output Y jumps in this case to twice the end value in order to run into the end value with the
delayed time constant LAG (GAIN * X).
Function block LEAD_LAG1 with LEAD/LAG = 2 and GAIN = 1

33002543 10/2019 65
LEAD_LAG1

66 33002543 10/2019
EcoStruxure™ Control Expert
LIMV
33002543 10/2019

Chapter 8
LIMV: Velocity limiter 1st order

LIMV: Velocity limiter 1st order

Introduction
This chapter describes the LIMV block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 68
Detailed description 71

33002543 10/2019 67
LIMV

Description

Function description
The function block produces an velocity limiter of the 1st order with limiting of the manipulated
variable.
The gradient of the input size X is limited to a specified value RATE. Furthermore, the output Y will
be limited through YMAX and YMIN. This allows the function block to adjust signals to the technolog-
ically limited pace and limits from controlling elements.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 Operating modes Manual, Halt, Automatic
 Manipulated variable limiting in automatic mode

Representation in FBD
Representation:

68 33002543 10/2019
LIMV

Representation in LD
Representation:

Representation in IL
Representation:
CAL LIMV_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=Input, RATE:=MaximumRateOfChange,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualControlValue, Y=>Output,
QMAX=>Y_AtUpperLimit, QMIN=>Y_AtLowerLimit)

Representation in ST
Representation:
LIMV_Instance (MAN:=ManualMode, HALT:=HaltMode, X:=Input,
RATE:=MaximumRateOfChange,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualControlValue, Y=>Output,
QMAX=>Y_AtUpperLimit, QMIN=>Y_AtLowerLimit) ;

33002543 10/2019 69
LIMV

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1" = Manual operating mode
HALT BOOL "1" = Halt mode
X REAL Input
RATE REAL Maximum upper limit (maximum x’)
YMAX REAL Upper limit
YMIN REAL Lower limit
YMAN REAL Manually manipulated value

Description of output parameters:

Parameter Data type Description


Y REAL Output
QMAX BOOL "1" = Output Y has reached upper limit
QMIN BOOL "1" = Output Y has reached lower limit

Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see CLC, page 614.

70 33002543 10/2019
LIMV

Detailed description

Parametering
The parameter assignments of the function block are created by the determination of the maximum
velocity RATE and the limiting values YMAX and YMIN for output Y. The maximum velocity rate
indicates by how much the output may change within one second.
The amount will be evaluated for parameter RATE. If RATE = 0, then Y = X.
The limits YMAX and YMIN limit the output within the prescribed range. Therefore YMIN ≤ Y ≤
YMAX.
The outputs QMAX and QMIN signal that the limits have been reached or the output signal is being
limited.
 QMAX = 1 if Y ≥ YMAX
 QMIN = 1 if Y ≤ YMIN

Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:

Operating mode MAN HALT Meaning


Automatic 0 0 The current value for Y will be constantly
calculated and output.
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y. The control output is, however,
limited by YMAX and YMIN.
Halt 0 1 The output Y will be held at the last calculated
value.

33002543 10/2019 71
LIMV

Example
The function block follows the jump to input X with maximum change in speed. Output Y remains
at a standstill in Halt mode, in order to subsequently move on from the position at which it has
stopped. It is also clear to see the limits of output Y through YMAX and YMIN with the relevant
messages QMAX and QMIN.
Dynamic behavior of LIMV:

72 33002543 10/2019
EcoStruxure™ Control Expert
PI1
33002543 10/2019

Chapter 9
PI1: PI controller

PI1: PI controller

Introduction
This chapter describes the PI1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 74
Formulas 78
Parametering 79
Operating modes 81
Example of the PI1 controller 82

33002543 10/2019 73
PI1

Description

Function description
The function block represents a simple PI controller.
A system deviation ERR is formed by the difference between the setpoint SP and the controlled
variable PV. This deviation ERR causes the manipulated variable Y to change.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 Operating modes Manual, Halt, Automatic
 bumpless changeover between manual and automatic
 Manipulated variable limiting
 Anti-windup reset
 Anti-windup measure with an active I component only

74 33002543 10/2019
PI1

Representation in FBD
Representation:

Representation in LD
Representation:

33002543 10/2019 75
PI1

Representation in IL
Representation:
CAL PI1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
GAIN:=ProportionalRate, TI:=ResetTime,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualValue, Y=>ManipulatedVariable,
ERR=>OutputSystemDeviation, QMAX=>Y_Reached_YMAX,
QMIN=>Y_Reached_YMIN)

Representation in ST
Representation:
PI1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
GAIN:=ProportionalRate, TI:=ResetTime,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualValue, Y=>ManipulatedVariable,
ERR=>OutputSystemDeviation, QMAX=>Y_Reached_YMAX,
QMIN=>Y_Reached_YMIN) ;

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1": Manual mode
HALT BOOL "1": Halt mode
SP REAL Setpoint input
PV REAL Controlled variable (process variable)
GAIN REAL Proportional action coefficient (gain)
TI TIME Integral time
YMAX REAL Upper limit
YMIN REAL Lower limit
YMAN REAL Manual value

76 33002543 10/2019
PI1

Description of output parameters:

Parameter Data type Description


Y REAL Manipulated variable
ERR REAL Output system deviation
QMAX BOOL "1" = Output Y has reached upper limit
QMIN BOOL "1" = Output Y has reached lower limit

Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see CLC, page 614.

33002543 10/2019 77
PI1

Formulas

Transfer function
The transfer function is:

The I component can be disabled by setting TI = 0.

Calculation formulas
The calculation formulas are:

Output signal Y
The output signal Y is then:

The I component is formed according to the trapezoid rule.

Explanation of formula variables


The meaning of the formula variables is given in the following table:

Variable Meaning
Present sample time

System deviation (SP - PV)

System deviation value from the previous sampling step

YI I component
YP P component

78 33002543 10/2019
PI1

Parametering

Structure diagram
The following is the structure diagram of the PI1 controller:

Parametering
The PI1 control structure is displayed in theStructure diagram, page 79. Setting parameters for the
function block takes place first of all for the elemental PI parameters: the proportional action
coefficient GAIN and reset time TI.
The limits YMAX and YMIN limit the output within the prescribed range. Therefore YMIN ≤ Y ≤
YMAX.
The markers QMAX and QMIN signal that the limits have been reached or the output signal is being
limited.
 QMAX = 1 if Y ≥ YMAX
 QMIN = 1 if Y ≤ YMIN

Manipulated variable limiting


After summation of the components manipulated variable limiting takes place, so that: YMIN ≤ Y
≤ YMAX

33002543 10/2019 79
PI1

Anti-windup reset
Should limiting of the manipulated variable take place, the anti-windup reset should ensure that the
integral component "cannot go berserk". The anti-windup measure is only implemented if the I
component of the controller is not disabled. Anti-windup limits are identical to those for the
manipulated variable. The anti-windup-reset measure corrects the I component such that: YMIN -
YP ≤ YI ≤ YMAX - YP

80 33002543 10/2019
PI1

Operating modes

Selecting the operating modes


There are three operating modes, which are selected via the inputs MAN and HALT.

Operating mode MAN HALT


Automatic 0 0
Manual mode 1 1 or 0
Halt 0 1

Automatic operating mode


In automatic mode the control output Y is determined through the closed-loop control based on the
controlled variable PV and reference variable SP. The manipulated variable is limited by YMAX and
YMIN. The control limits are also limits for the Anti-windup reset.
The changeover from automatic to manual is normally not bumpless, since output Y can take on
any value between YMAX and YMIN, and Y goes directly to YMAN at the changeover.
If the changeover from automatic to manual is to be bumpless nevertheless, there are two
possibilities, which are explained as an example for a PID1 Controller (see page 92).

Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the control output
Y. However, the manipulated variable is limited by YMAX and YMIN. Internal variables will be
manipulated in such a manner that the controller changeover from manual to automatic (with I
component enabled) can be bumpless. The control limits are also limits for the Anti-windup reset

Halt mode
In halt mode the control output remains unchanged; the function block does not influence the
control output Y, i.e. Y = Y(old). Internal variables will be manipulated in such a manner that the
component sum corresponds with the manipulated variable, thus allowing the controller to be
driven smoothly from its current position. The control limits are also limits for the Anti-windup reset.

33002543 10/2019 81
PI1

Example of the PI1 controller

Example
The jump response of the PI1 controller is shown in the following Diagram (see page 82) as an
example.
In the first part of the figure the function block response to MAN operating mode can be seen: The
output Y jumps to the YMAN value.
The second part of the diagram shows the reaction of the function block in automatic mode (MAN
= 0 and HALT= 0) both with a positive ERR system deviation and with a negative ERR system
deviation. For constant positive system deviation, Y ramps upward until the upper output limit is
reached.
The output is subsequently limited to the YMAX value. The limit is signaled in the QMAX output. The
system deviation then jumps to a negative value whose absolute value is greater than the previous
positive value.
The input jumps to the value ); through the P component, then
there is a ramp decrease in Y. The absolute value of the gradient is greater than under the previous
positive system deviation. This can be attributed to the now greater absolute value of the system
deviation.

The jump response of the PI1 controller


Presentation of the jump response of the PI1 controller

82 33002543 10/2019
EcoStruxure™ Control Expert
PID1
33002543 10/2019

Chapter 10
PID1: PID controller

PID1: PID controller

Introduction
This chapter describes the PID1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 84
PID1 function block structure diagram 89
Setting parameters for the PID1 controller 90
Operating modes 92
Detailed formulas 94

33002543 10/2019 83
PID1

Description

Function description
The function block produces a PID controller.
A system deviation ERR is formed because of the reference variable SP and the controlled variable
PV. This deviation ERR causes the manipulated variable Y to change.

Initialization requirements
This function block performs an internal initialization in the first program cycle after a warm start or
cold start (for examle application download or power cycle) of the PLC program.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.


For the proportional part of the controller to behave properly, the integral action must be reset (the
input coefficient EN_I set to zero) for at least one scan time after a warm start or cold start.
If the integral action coefficient EN_I is set to a non-zero value at initialization, the function block
behaves like an I or ID controller with no proportional part.

Properties
The function block has the following properties:
 real PID controller with independent GAIN, TI, TD setting
 Operating modes Manual, Halt, Automatic
 bumpless changeover between manual and automatic
 Manipulated variable limiting in automatic mode
 Separately enabled P, I and D component
 Anti-Windup-Reset
 Anti-windup measures taken only for an active I component
 definable delay of the D component
 D component connectable to controlled variable PV or system deviation ERR

84 33002543 10/2019
PID1

Transfer function
The transfer function is:

Explanation of the variables:

Variable Description
YD D component (only when EN_D = 1)
YI I component (only when EN_I = 1)
YP P component (only when EN_P = 1)

Representation in FBD
Representation:

33002543 10/2019 85
PID1

Representation in LD
Representation:

86 33002543 10/2019
PID1

Representation in IL
Representation:
CAL PID1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
BIAS:=DisturbanceInput, EN_P:=P_Portion_On,
EN_I:=I_Portion_On, EN_D:=D_Portion_On,
D_ON_X:=D_PortionValueFlag, GAIN:=ProportionalRate,
TI:=ResetTime, TD:=DerivativeActionTime,
TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
YMIN:=LowerControlLimit, YMAN:=ManualValue,
Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
QMAX=>Y_Reached_YMAX, QMIN=>Y_Reached_YMIN)

Representation in ST
Representation:
PID1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
BIAS:=DisturbanceInput, EN_P:=P_Portion_On,
EN_I:=I_Portion_On, EN_D:=D_Portion_On,
D_ON_X:=D_PortionValueFlag, GAIN:=ProportionalRate,
TI:=ResetTime, TD:=DerivativeActionTime,
TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
YMIN:=LowerControlLimit, YMAN:=ManualValue,
Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
QMAX=>Y_Reached_YMAX, QMIN=>Y_Reached_YMIN) ;

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1": Manual mode
HALT BOOL "1": Halt mode
SP REAL Setpoint input
PV REAL Controlled variable (process variable)
BIAS REAL Disturbance input
EN_P BOOL "1": P component on
EN_I1 BOOL "1": I component on
EN_D BOOL "1": D component on
D_ON_X BOOL "1": D component on controlled variable
"0": D component on system deviation

33002543 10/2019 87
PID1

Parameter Data type Description


GAIN REAL Proportional action coefficient (gain)
TI TIME Integral time
TD TIME Derivative time
TD_LAG TIME Delay, D component
YMAX REAL Upper limit
YMIN REAL Lower limit
YMAN REAL Manually manipulated value

1
Refer to Initialization Requirements (see page 84).
Description of output parameters:

Parameter Data type Description


ERR REAL Output system deviation
Y REAL Manipulated variable
QMAX BOOL "1" = Output Y has reached upper limit
QMIN BOOL "1" = Output Y has reached lower limit

Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see Tables of Error Codes for the Obsolete
Library (see page 616).

88 33002543 10/2019
PID1

PID1 function block structure diagram

Structure diagram
The following is the structure diagram of the PID1block:

33002543 10/2019 89
PID1

Setting parameters for the PID1 controller

Parametering
The PID1 control structure is displayed in theStructure diagram, page 89.
Setting function block parameters is initially performed by the pure PID parameters, i.e. the
proportional action coefficient GAIN, the reset time TI and the rate time TD.
The D component is delayed by the time TD_LAG. The ratio between TD/TD_LAG is called
differential gain VD. The D component can either be formed by the system deviation ERR (D_ON_X
= 0) or the controlled variable PV (D_ON_X = 1). Should the D component be determined by the
controlled variable PV, then the D component will not be able to cause jumps when reference
variable fluctuations (changes in input SP) take place. Generally, the D component only affects
disturbances and process variances.

Control direction reversal


A reversed behavior of the controller can be achieved by reversing the sign of GAIN. A positive
value on GAIN causes the increase of the output value, for a positive error variable. A negative
value on GAIN causes the increase of the output value, for a positive error variable.

Manipulated variable limiting


The limits YMAX and YMIN limit the output within the prescribed range. Therefore YMIN ≤ Y ≤
YMAX.
The markers QMAX and QMIN signal that the limits have been reached or the output signal is being
limited.
 QMAX = 1 if Y ≥ YMAX
 QMIN = 1 if Y ≤ YMIN

For limiting the manipulated variable, the upper limit YMAX should be greater than the lower limit
YMIN.

Anti-windup reset
If manipulated variable limiting takes place, the anti-windup reset should make sure that the
integral component cannot exceed all limits. The anti-windup measure is only implemented if the I
component of the controller is not disabled. Anti-windup limits are identical to those for the
manipulated variable. The anti-windup measure disregards the D component, to avoid the capping
of the D component peaks through the anti-windup measure.
The anti-windup reset measure corrects the I component in the form, which means:

90 33002543 10/2019
PID1

Selecting the control types


There are various controller types, which can be selected via the EN_P, EN_I and EN_D
parameters.

Controller type EN_P EN_I EN_D


P controller 1 0 0
PI controller 1 1 0
PD controller 1 0 1
PID controller 1 1 1
I controller 0 1 0

The I component can also be disabled with TI = 0.

33002543 10/2019 91
PID1

Operating modes

Selecting the operating modes


There are three operating modes, which are selected via the parameters MAN and HALT:

Operating mode MAN HALT


Automatic 0 0
Manual mode 1 0 or 1
Halt 0 1

Automatic operating mode


In automatic mode, the manipulated variable Y is determined through the discrete PID closed-loop
control algorithm subject to controlled variable PV and reference variable SP. The manipulated
variable is limited by YMAX and YMIN. The control limits are also limits for the Anti-windup reset.

Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the control output
Y. The control output is, however, limited by YMAX and YMIN. Internal variables will be manipulated
in such a manner that the controller changeover from manual to automatic (with I component
enabled) can be bumpless. The control limits are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.

Halt mode
In halt mode the control output remains unchanged; the function block does not influence the
control output Y, i.e. Y = Y(old). Internal variables will be manipulated in such a manner that the
component sum corresponds to the control output, thus allowing the controller to be driven
smoothly from its current position (when the I component is enabled). The control limits are also
limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.

Switching from automatic to manual


The changeover from automatic to manual is normally not bumpless, since output Y can take on
any value between YMAX and YMIN, and Y goes directly to YMAN at the changeover.
There are two possibilities if, nevertheless, a bumpless changeover from automatic to manual is
required:
 Switching with the help of the MOVE function
 Switching with the help of the velocity limiter function block LIMV

92 33002543 10/2019
PID1

Switching via MOVE


Using function MOVE set the value of YMAN to the value of Y:

NOTE: This type of display was selected purely for clarity of understanding. The links represented
by a dotted line can not be programmed as Links (link objects), as they form unauthorized (in
Control Expert) loops. In programming, the links must be established using variables.
The MOVE function is only executed when the PID controller is in automatic or halt mode (MAN = 0).
If only one changeover from automatic to manual takes place it is bumpless, as the value of YMAN
is equal to the value of Y in this cycle. In the manual mode the value of YMAN can slowly be
changed.

Switching via LIMV


Should you not wish to modify YMAN, e.g. because it is a constant, then the previous solution must
be replace by a velocity limiter (function block LIMV (see page 67)):

NOTE: This type of display was selected purely for clarity of understanding. The links represented
by a dotted line can not be programmed as Links (link objects), as they form unauthorized (in
Control Expert) loops. In programming, the links must be established using variables.
The MOVE function is only executed when the PID controller is in automatic or halt mode (MAN = 0).
If only one changeover from automatic to manual takes place, it is bumpless, as the value of YMAN
(of the PID1) is equal to the value of Y (of the PID1) in this cycle. The PID1 controller YMAN value,
starting at your adjustment value (RATE), are compared with the actual manual value (on LIMV)
beginning with the next cycle.

33002543 10/2019 93
PID1

Detailed formulas

Explanation of formula variables


Meaning of the variables in the following formulas:

Variable Meaning
Time differential between the present cycle and the previous cycle

System deviation (SP - PV)

System deviation value from the current sampling step

System deviation value from the previous sampling step

BIAS Disturbance variable


Value of controlled variable from the current sampling step

Value of controlled variable from the previous sampling step

Y current output (halt mode) or YMAN (manual mode)


YD D component
YI I component
YP P component

Manipulated variable
The manipulated variable consists of various terms which are dependent on the operating mode:

After summation of the components manipulated variable limiting takes place, so that:

Overview of the calculation of the control components


Following this an overview on the different calculations of the control components in relation to the
inputs EN_P, EN_I and EN_D can be found:
 P component YP for manual, Halt and automatic mode
 I component YI for automatic mode
 I component YI for manual and halt modes
 D component YD for automatic mode
 D component YD for manual and halt modes

94 33002543 10/2019
PID1

P component YP for all operating modes


YP for manual, halt and automatic modes is determined as follows:
For EN_P = 1 the following applies:

For EN_P = 0 the following applies:

I component YI for automatic mode


YI for automatic mode is determined as follows:
For EN_I = 1 the following applies:

For EN_I = 0 the following applies:

The I component is formed according to the trapezoid rule.

I component YI for manual and halt modes


YI for manual, halt and automatic modes is determined as follows:
For EN_I = 1 the following applies:

For EN_I = 0 the following applies:

D component YD for automatic mode


YD for automatic mode and cascade is determined as follows:
For EN_D = 1 and D_ON_X = 0 the following applies:

For EN_D = 1 and D_ON_X = 1 the following applies:

For EN_D = 0 the following applies:

33002543 10/2019 95
PID1

D component YD for manual and halt modes


YD for manual, halt and automatic modes is determined as follows:
YD = 0

96 33002543 10/2019
EcoStruxure™ Control Expert
PID_P1
33002543 10/2019

Chapter 11
PIDP1: PID Controller with Parallel Structure

PIDP1: PID Controller with Parallel Structure

At a Glance
This chapter describes the PIDP1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 98
Setting parameters for the PIDP1 controller 103
Operating modes 105
Detailed formulas 106

33002543 10/2019 97
PID_P1

Description

Function description
The function block replicates a PID controller in parallel structure.
A system deviation ERR is formed by the difference between the setpoint SP and the controlled
variable PV. The deviation ERR causes the manipulated variable Y to change.

Initialization Requirements
This function block performs an internal initialization in the first program cycle after a warm start or
cold start (e.g. application download or power cycle) of the PLC program.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.


For the proportional part of the controller to behave properly, the integral action must be reset (the
input coefficient KI set to zero) for at least one scan time after a warm start or cold start.
If the integral action coefficient KI is set to a non-zero value at initialization, the function block
behaves like an I or ID controller with no proportional part.

Properties
The function block has the following properties:
 PID controller in pure parallel structure
 Each component P, I and D can be individually enabled
 Limiting control limits in automatic mode
 Anti-windup measure with an active I component only
 Anti-windup reset
 Operating modes Manual, Halt, Automatic
 Bumpless changeover between manual and automatic
 D component connectable to input variable PV or system deviation ERR
 D component with variable delay

98 33002543 10/2019
PID_P1

Transfer function
The transfer function is:

Explanation of the variables:

Variable Description
YD D component
YI I component
YP P component

Representation in FBD
Representation:

33002543 10/2019 99
PID_P1

Representation in LD
Representation:

100 33002543 10/2019


PID_P1

Representation in IL
Representation:
CAL PIDP1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
BIAS:=DisturbanceInput, D_ON_X:=D_PortionValueFlag,
REVERS:=OutputReversed, KP:=ProportionalRate,
KI:=IntegralRate, KD:=DifferentiationRate,
TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
YMIN:=LowerControlLimit, YMAN:=ManualValue,
Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
QMAX=>Y_Reached_YMAX, YMIN=>Y_Reached_YMIN)

Representation in ST
Representation:
PIDP1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
BIAS:=DisturbanceInput, D_ON_X:=D_PortionValueFlag,
REVERS:=OutputReversed, KP:=ProportionalRate,
KI:=IntegralRate, KD:=DifferentiationRate,
TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
YMIN:=LowerControlLimit, YMAN:=ManualValue,
Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
QMAX=>Y_Reached_YMAX, YMIN=>Y_Reached_YMIN) ;

Parameter description
Description of the input parameters:

Parameter Data type Description


MAN BOOL "1": Manual mode
HALT BOOL "1": Halt mode
SP1 REAL Setpoint input

PV1 REAL Input variable

BIAS REAL Disturbance input


D_ON_X BOOL 1: D component in relation to the controlled
variable
0: D component in relation to the system deviation
REVERSE BOOL 1: Output reversed
KP REAL Proportional action coefficient (gain)
KI1 REAL Integral action coefficient
KD REAL Derivative time constant

33002543 10/2019 101


PID_P1

Parameter Data type Description


TD_LAG TIME Delay, D component
YMAX REAL Upper limit
YMIN REAL Lower limit
YMAN REAL Manually manipulated value

1
Refer to Initialization Requirements (see page 98).
Description of the output parameters:

Parameter Data type Description


Y REAL Manipulated variable
ERR REAL System deviation
QMAX BOOL 1 = Y has reached the upper control limit
QMIN BOOL 1 = Y has reached the lower control limit

Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see Tables of Error Codes for the Obsolete
Library (see page 614).

102 33002543 10/2019


PID_P1

Setting parameters for the PIDP1 controller

Structure diagram
The following is the structure diagram of the PIDP1 block:

Setting Parameters
The PIDP1 control structure is displayed in the Structure diagram.
Setting parameters for the PIDP1 controller takes place first of all for the pure PID parameters, that
is to say, the proportional action coefficient KP, the integral action coefficient KI and rate of
differentiation KD.
The P, I and D components can be individually disabled while the corresponding input (KP, KI oder
KD) is set to 0.
The D component is delayed by the time constant TD_LAG. The D component can either be formed
by the system deviation ERR (D_ON_X = 0) or the controlled variable PV (D_ON_X = 1). Should the
D component be determined by the controlled variable PV, then the D component will not be able
to cause jumps when reference variable fluctuations (changes in input SP) take place. In principle,
the D component only affects disturbances and process variances.

33002543 10/2019 103


PID_P1

Control direction reversal


The opposite behavior of the controller can be attained by setting input REVERSE to 1. REVERSE =
0 results in an increased output value when there is a positive disturbance. REVERSE = 1 results
in an decreased output value when there is a positive disturbance.

Manipulated variable limiting


The limits YMAX and YMIN limit the output within the prescribed range. Therefore YMIN ≤ Y ≤
YMAX.
The markers QMAX and QMIN signal that the limits have been reached or the output signal is being
limited.
 QMAX = 1 if Y ≥ YMAX
 QMIN = 1 if Y ≤ YMIN

For limiting the manipulated variable, the upper limit YMAX should be greater than the lower limit
YMIN.

Anti-Windup-Reset
If manipulated variable limiting takes place, the anti-windup reset should make sure that the
integral component cannot exceed all limits. The antiwindup measure is only implemented if the I
component of the controller is not disabled. Anti-windup limits are identical to those for the
manipulated variable. The anti-windup measure disregards the D component, to avoid the capping
of the D component peaks through the anti-windup measure.
The anti-windup reset measure corrects the I component in the form, which means:

Selecting the control types


Several controller variants can be selected over the parameters KP, KI and KD:

Controller type KP KI KD
P controller >0 =0 =0
PI controller >0 >0 =0
PD controller >0 =0 >0
PID controller >0 >0 >0
I controller =0 >0 =0

104 33002543 10/2019


PID_P1

Operating modes

Selecting the operating modes


There are three operating modes, which are selected via the parameters MAN and HALT:

Operating mode MAN HALT


Automatic 0 0
Manual mode 1 0 or 1
Halt 0 1

Automatic operating mode


In automatic mode, the control output Y is determined through the discrete PID closed-loop control
algorithm subject to controlled variable PV and reference variable SP. The control output is limited
by YMAX and YMIN. The control limits are also limits for the Anti-windup reset.
The changeover from automatic to manual is normally not bumpless, since output Y can take on
any value between YMAX and YMIN, and Y goes directly to YMAN at the changeover.
If the changeover from automatic to manual is to be bumpless in spite of this, there are two
exemplary possibilities shown for a PID1 Controller (see page 92).

Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the control output
Y. The control output is, however, limited by YMAX and YMIN. Internal variables will be manipulated
in such a manner that the controller changeover from manual to automatic (with I component
enabled) can be bumpless. The control limits are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.

Halt mode
In halt mode the control output remains unchanged; the function block does not influence the
control output Y, i.e. Y = Y(old). Internal variables will be manipulated in such a manner that the
component sum corresponds to the control output, thus allowing the controller to be driven
smoothly from its current position (when the I component is enabled). The control limits are also
limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.

33002543 10/2019 105


PID_P1

Detailed formulas

Explanation of formula variables


Meaning of the variables in the formulas:

Variable Description
Time differential between the present cycle and the previous cycle

System deviation (SP-PV)

System deviation value from the current sampling step

System deviation value from the previous sampling step

BIAS Disturbance variable


Value of controlled variable from the current sampling step

Value of controlled variable from the previous sampling step

Y current output (halt mode) or YMAN (manual mode)


YD D component
YI I component
YP P component

Manipulated variable
The manipulated variable is composed of various terms:

After summation of the components manipulated variable limiting takes place, so that:

System deviation
The system deviation will be determined as follows:

If... Then
REVERSE = 0 ERR = SP - PV
REVERSE = 1 ERR = PV - SP

106 33002543 10/2019


PID_P1

Overview of the calculation of the control components


Following this an overview on the different calculations of the control components in relation to the
gains KP, KI and KD can be found:
 P component YP for manual, halt and automatic modes
 I component YI for automatic mode
 I component YI for manual and halt modes
 D component YD for automatic mode
 D component YD for manual and halt modes

P component YP for all operating modes


YP for manual, halt and automatic modes is determined as follows:

I component YI for automatic mode


YI for automatic mode is determined as follows:
For KI > the following applies:0

For KI = 0 the following applies:

The I component is formed according to the trapezoid rule.

I component YI for manual and halt modes


YI for manual, halt and automatic modes is determined as follows:
For KI > 0 the following applies:

For KI = 0 the following applies:

33002543 10/2019 107


PID_P1

D component YD for automatic mode


YD for automatic mode and cascade is determined as follows:
For KD > 0 and D_ON_X = 0 the following applies:

For KD > 0 and D_ON_X = 1 the following applies:

For KD = 0 the following applies:

D component YD for manual and halt modes


YD for manual, halt and automatic modes is determined as follows:

108 33002543 10/2019


EcoStruxure™ Control Expert
SMOOTH_RATE
33002543 10/2019

Chapter 12
SMOOTH_RATE: Differentiator with smoothing

SMOOTH_RATE: Differentiator with smoothing

Introduction
This chapter describes the SMOOTH_RATE block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 110
Formulas for the SMOOTH_RATE function block 113
Detailed description 114

33002543 10/2019 109


SMOOTH_RATE

Description

Function description
The function block is a differential element with a delayed output Y respecting the delay time
constant LAG.
The function block contains the following operating mode:
 Manual mode
 Halt
 Automatic

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouput may deliver a wrong value.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

110 33002543 10/2019


SMOOTH_RATE

Representation in LD
Representation:

Representation in IL
Representation:
CAL SMOOTH_RATE_Instance (MAN:=ManualMode,
HALT:=HaltMode, X:=InputVariable,
GAIN:=DifferentialGain, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue,
Y=>DifferentiatorOutputWithDelay)

Representation in ST
Representation:
SMOOTH_RATE_Instance (MAN:=ManualMode,
HALT:=HaltMode, X:=InputVariable,
GAIN:=DifferentialGain, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue,
Y=>DifferentiatorOutputWithDelay) ;

33002543 10/2019 111


SMOOTH_RATE

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1" = Manual operating mode
HALT BOOL "1" = Halt mode
X REAL Input variable
GAIN REAL Gain of the differentiation
LAG TIME Delayed time constants
YMAN REAL Manually manipulated value

Description of output parameters:

Parameter Data type Description


Y REAL Output derivative unit with smoothing

Runtime error
For a list of all block error codes and values, see CLC, page 614.

112 33002543 10/2019


SMOOTH_RATE

Formulas for the SMOOTH_RATE function block

Transfer function
The transfer function for Y is:

Output Y
The output Y is determined as follows:

Explanation of formula variables


Meaning of the variables in the above formulas:

Variable Meaning
dt is the time differential between the current cycle and the previous cycle
Value of the input X from the current cycle

Value of input X from the previous cycle

Value of input Y from the previous cycle

33002543 10/2019 113


SMOOTH_RATE

Detailed description

Parametering
The parameter assignments of the function block are made by defining the GAIN, the differentiator
and the time constant LAG, by which the output Y is delayed.
For very short sampling times and a unit jump at the X input (input X jumps from 0 to 1.0), the output
Y jumps to the GAIN value (in theory - in reality somewhat smaller, due to the sampling time not
being infinitely small), and then returns to 0 with the delay time constant LAG.

Operating modes
The function block SMOOTH_RATE has 3 operating mode: Automatic, manual and halt.
The operating mode are selected via the inputs MAN and HALT:

Operating mode MAN HALT Meaning


Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The input YMAN will be transferred directly to the
output Y.
Halt 0 1 The output Y will be held at the last calculated
value.

114 33002543 10/2019


SMOOTH_RATE

Example
The following illustration shows the jump response of the function block SMOOTH_RATE when GAIN
= 1 and LAG = 10 s:

33002543 10/2019 115


SMOOTH_RATE

116 33002543 10/2019


EcoStruxure™ Control Expert
THREE_STEP_CON1
33002543 10/2019

Chapter 13
THREE_STEP_CON1: Three step controller

THREE_STEP_CON1: Three step controller

Introduction
This chapter describes the THREE_STEP_CON1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 118
Detailed description 122

33002543 10/2019 117


THREE_STEP_CON1

Description

Function description
The function block replicates a three-point step controller, and exhibits a PD-like behavior due to
a dynamic feedback path.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block THREE_STEP_CON1 has the following properties:
 Reset and automatic operating modes
 One internal feedback path (delay 1st Order)

Representation in FBD
Representation:

118 33002543 10/2019


THREE_STEP_CON1

Representation in LD
Representation:

Representation in IL
Representation:
CAL THREE_STEP_CON1_Instance (R:=ResetMode,
SP:=SetPointInput, PV:=ProcessVariable,
GAIN:=ProportionalRate, TI:=ResetTime,
T_PROC:=NominalControllerTime, HYS:=Hysteresis,
DB:=Deadband, Y_POS=>PosControlVarAt_ERR_EFF,
Y_NEG=>NegControlVarAt_ERR_EFF,
ERR_EFF=>EffectiveError)

33002543 10/2019 119


THREE_STEP_CON1

Representation in ST
Representation:
THREE_STEP_CON1_Instance (R:=ResetMode,
SP:=SetPointInput, PV:=ProcessVariable,
GAIN:=ProportionalRate, TI:=ResetTime,
T_PROC:=NominalControllerTime, HYS:=Hysteresis,
DB:=Deadband, Y_POS=>PosControlVarAt_ERR_EFF,
Y_NEG=>NegControlVarAt_ERR_EFF,
ERR_EFF=>EffectiveError) ;

Parameter description
Description of input parameters:

Parameter Data type Description


R BOOL "1": Reset mode
SP REAL Setpoint input
PV REAL Actual value input
GAIN REAL Proportional action coefficient (gain)
TI TIME Integral time
T_PROC TIME Nominal actuating time of the controlled valve
HYS REAL Hysteresis from three point switch
DB REAL Dead zone

Description of output parameters:

Parameter Data type Description


ERR_EFF REAL Effective switch value
Y_POS BOOL "1" = positive manipulated variable at output
ERR_EFF
Y_NEG BOOL "1" = negative manipulated variable at output
ERR_EFF

Runtime error
With HYS > 2 * DB an error message is returned.
NOTE: For a list of all block error codes and values, see CLC, page 614.

120 33002543 10/2019


THREE_STEP_CON1

Warning
In the following cases a warning will be returned:

If... Then...
GAIN ≤ 0 the controller operates without feedback.
TI = 0 the controller operates without feedback.
T_PROC = 0 the controller operates with a predetermined value of T_PROC = 60 s.

NOTE: For a list of all block error codes and values, see CLC, page 614.

33002543 10/2019 121


THREE_STEP_CON1

Detailed description

Structure of the controller


Structure of the three-point controller:

Dependency of outputs Y_POS and Y_NEG on the variable Y:

If... Then...
Y=1 Y_POS = 1
Y_NEG = 0
Y=0 Y_POS = 0
Y_NEG = 0
Y = -1 Y_POS = 0
Y_NEG = 1

Meaning of variable K:

122 33002543 10/2019


THREE_STEP_CON1

Principle of the three-point controller


The actual three-point controller will have a dynamic feedback path (PT1-element) added. By
appropriately choosing the time constants TI and T_PROC of these feedback elements, the three-
point controller exhibits a dynamic behavior corresponding to that of a PID controller.
Principle of the three-point controller

The parameter GAIN must > be 0

Dead zone
The DB parameter fixes the operate point for the outputs Y_POS and Y_NEG. If the effective
switching value ERR_EFF = SP - PV - XR is positive and is greater than DB, then the Y_POS output
switches from "0" to "1". If the effective switch value ERR_EFF is negative and is greater than DB,
then the output Y_NEG will switch from "0" to "1". The parameter DB is typically set to 1% of the
maximum control range (max. (SP - PV)).
NOTE: The amount is evaluated from the DB dead zone!

Hysteresis
The parameter HYS indicates the switching hysteresis, i.e. the value which the effective switch
value ERR_EFF outgoing from control point DB must be reduced by, before the output Y_POS
(Y_NEG) is reset to "0". The connection between Y_POS and Y_NEG depending on the effective
switch value ERR_EFF and the parameters DB and HYS is illustrated in the image "Principle of the
three-point controller, page 123". The parameter HYS is typically set to 0.5 % of the maximum
control range (max. (SP - PV)).
NOTE: The amount is evaluated from the HYS hysterisis!

33002543 10/2019 123


THREE_STEP_CON1

Behavior with faulty time constants


Should the time constant TI = 0 or the proportional action coefficient GAIN ≤ 0 (configuration
error), the block will still continue to operate. The functions feedback path is disabled however, so
that the block operates as a conventional three-point switch.
If the time constant T_PROC = 0 (configuration error), the block will still continue to operate. In this
case T_PROC is set to a preset value of T_PROC = 60s (60 000 msec).

Operating modes
There are two operating modes that can be selected through the R parameter input:

Operating mode R Meaning


Automatic 0 The function block will be handled as described above.
Reset 1 The internal value of the feedback element is set to SP - PV.
The outputs Y_POS and Y_NEG are both set to "0".

124 33002543 10/2019


EcoStruxure™ Control Expert
THREEPOINT_CON1
33002543 10/2019

Chapter 14
THREEPOINT_CON1: Three point controller

THREEPOINT_CON1: Three point controller

Introduction
This chapter describes the THREEPOINT_CON1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 126
Detailed description 131

33002543 10/2019 125


THREEPOINT_CON1

Description

Function description
The function block forms a three-point controller, which maintains PID-similar behavior through two
dynamic feedback paths.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block THREEPOINT_CON1 contains the following properties:
 Operating modes Manual, Halt, Automatic
 Two internal feedback paths (delay 1st Order)

126 33002543 10/2019


THREEPOINT_CON1

Representation in FBD
Representation:

33002543 10/2019 127


THREEPOINT_CON1

Representation in LD
Representation:

128 33002543 10/2019


THREEPOINT_CON1

Representation in IL
Representation:
CAL THREEPOINT_CON1_Instance (MAN:=ManualMode,
HALT:=HaltMode,SP:=SetPointInput,
PV:=ProcessVariableInput, GAIN:=FeedbackGain,
LAG_NEG:=RapidFeedbackTimeConstant,
LAG_POS:=SlowFeedbackTimeConstant,
HYS:=HysteresisThreePositionSwitch, DB:=Deadband,
XF_MAN:=FeedbackResetFactor,
YMAN_POS:=ManualControlOutputForY_POS,
YMAN_NEG:=ManualControlOutputForY_NEG,
Y_POS=>PosManipulation, Y_NEG=>NegManipulation,
ERR_EFF=>EffectiveError)

Representation in ST
Representation:
THREEPOINT_CON1_Instance (MAN:=ManualMode,
HALT:=HaltMode,SP:=SetPointInput,
PV:=ProcessVariableInput, GAIN:=FeedbackGain,
LAG_NEG:=RapidFeedbackTimeConstant,
LAG_POS:=SlowFeedbackTimeConstant,
HYS:=HysteresisThreePositionSwitch, DB:=Deadband,
XF_MAN:=FeedbackResetFactor,
YMAN_POS:=ManualControlOutputForY_POS,
YMAN_NEG:=ManualControlOutputForY_NEG,
Y_POS=>PosManipulation, Y_NEG=>NegManipulation,
ERR_EFF=>EffectiveError) ;

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1" = Manual operating mode
HALT BOOL "1" = Halt mode
SP REAL Setpoint input
PV REAL Actual value input
GAIN REAL Feedback gain (Feedback Parameter Set)
LAG_NEG TIME Time constant of the quick feedback (Feedback
Parameter Set)
LAG_POS TIME Time constant of the slow feedback (Feedback
Parameter Set)

33002543 10/2019 129


THREEPOINT_CON1

Parameter Data type Description


HYS REAL Hysteresis from three point switch
DB REAL Dead zone
XF_MAN REAL Feedback path reset value in % (-100 to 100)
YMAN_POS BOOL Manual manipulation for Y_POS
YMAN_NEG BOOL Manual manipulation for Y_NEG

Description of output parameters:

Parameter Data type Description


Y_POS BOOL "1" = positive manipulated variable at output
ERR_EFF
Y_NEG BOOL "1" = negative manipulated variable at output
ERR_EFF
ERR_EFF REAL Effective switch value

Runtime error
With HYS > 2 * DB an error message is returned.
NOTE: For a list of all block error codes and values, see CLC, page 614.

Warning
In the following cases a warning will be returned:

If... Then...
LAG_NEG = 0 and LAG_POS > 0 The controller works as if it had only a positive
feedback with time constant LAG_POS.
LAG_POS < LAG_NEG > 0 The controller works as if it had only a negative
feedback with time constant LAG_NEG.
XF_MAN < -100 or XF_MAN > 100 the controller operates without internal feedback
paths.

NOTE: For a list of all block error codes and values, see CLC, page 614.

130 33002543 10/2019


THREEPOINT_CON1

Detailed description

Structure of the controller


Structure of the three-point controller:

Dependency of outputs Y_POS and Y_NEG on the variable Y:

If... Then...
Y=1 Y_POS = 1
Y_NEG = 0
Y=0 Y_POS = 0
Y_NEG = 0
Y = -1 Y_POS = 0
Y_NEG = 1

33002543 10/2019 131


THREEPOINT_CON1

Principle of the three-point controller


The actual three-point controller will have two dynamic feedbacks (PT1 elements) added. By
appropriately selecting the time constant of these feedback elements, the three-point controller
exhibits a dynamic behavior corresponding to that of a PID controller.
Principle of the three-point controller

The parameter GAIN must > be 0


NOTE: Entries for XF_MAN (percentages from -100% to 100%) must be in the range -100 to 100
inclusive!

Internal feedback paths


The function block has a parameter set for the internal feedback paths consisting of the feedback
gain GAIN and the feedback time constants LAG_NEG and LAG_POS.
The following table provides more exact information about it:

Feedback LAG_NEG LAG_POS


3-Point-Behavior (without feedback) =0 =0
negative feedback >0 =0
negative + positive feedback >0 > LAG_NEG
Warning, regeneration (neg. feedback with LAG_POS) =0 >0
Warning, regeneration (pos. feedback switched off) > LAG_POS >0

Dead zone
The DB parameter fixes the operate point for the outputs Y_POS and Y_NEG. If the effective switch
value ERR_EFF is positive and is greater than DB, then the output Y_POS will switch from "0" to "1".
If the effective switch value ERR_EFF is negative and is greater than DB, then the output Y_NEG
will switch from "0" to "1". The parameter DB is typically set to 1% of the maximum control range
(max. SP - PV).
NOTE: The amount is evaluated from the DB dead zone!

132 33002543 10/2019


THREEPOINT_CON1

Hysteresis
The parameter HYS indicates the switching hysteresis, i.e. the value which the effective switch
value ERR_EFF outgoing from control point DB must be reduced by, before the output Y_POS
(Y_NEG) is reset to "0". The connection between Y_POS and Y_NEG depending on the effective
switch value ERR_EFF and the parameters DB and HYS is illustrated in the image "Principle of the
three-point controller, page 132". The parameter HYS is typically set to 0.5% of the maximum
control range (max. SP - PV).
NOTE: The amount is evaluated from the HYS hysterisis!

Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:

Operating mode MAN HALT Meaning


Automatic 0 0 The function block will be handled as described
above.
Manual mode 1 0 or 1 The outputs Y_POS and Y_NEG are set to the
values YMAN_POS and YMAN_NEG. A priority
logic - Y_NEG is dominant over Y_POS -
prevents both outputs being simultaneously
set.
xf1 and xf2 are calculated using the following
formula:

Halt 0 1 The outputs Y_POS and Y_NEG are held at their


last respective values. xf1 and xf2 are set to
GAIN * Y.

33002543 10/2019 133


THREEPOINT_CON1

134 33002543 10/2019


EcoStruxure™ Control Expert
TWOPOINT_CON1
33002543 10/2019

Chapter 15
TWOPOINT_CON1: Two point controller

TWOPOINT_CON1: Two point controller

Introduction
This chapter describes the TWOPOINT_CON1 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 136
Detailed description 140

33002543 10/2019 135


TWOPOINT_CON1

Description

Function description
The function block forms a two-point controller, which maintains PID-similar behavior through two
dynamic feedback paths.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block TWOPOINT_CON1 has the following properties:
 Operating modes Manual, Halt, Automatic
 Two internal feedback paths (delay 1st Order)

Representation in FBD
Representation:

136 33002543 10/2019


TWOPOINT_CON1

Representation in LD
Representation:

Representation in IL
Representation:
CAL TWOPOINT_CON1_Instance (MAN:=ManualMode,
HALT:=HaltMode,SP:=SetPointInput, PV:=ProcessVariable,
K:=FeedbackGain, LAG_NEG:=RapidFeedbackTimeConstant,
LAG_POS:=SlowFeedbackTimeConstant,
DB:=HysteresisOfTwoPosSwitch,
XF_MAN:=FeedbackResetValue,
YMAN:=ManualValueForERR_EFF, Y=>OutputControlFlag,
ERR_EFF=>EffectiveError)

33002543 10/2019 137


TWOPOINT_CON1

Representation in ST
Representation:
TWOPOINT_CON1_Instance (MAN:=ManualMode,
HALT:=HaltMode,SP:=SetPointInput, PV:=ProcessVariable,
K:=FeedbackGain, LAG_NEG:=RapidFeedbackTimeConstant,
LAG_POS:=SlowFeedbackTimeConstant,
DB:=HysteresisOfTwoPosSwitch,
XF_MAN:=FeedbackResetValue,
YMAN:=ManualValueForERR_EFF, Y=>OutputControlFlag,
ERR_EFF=>EffectiveError) ;

Parameter description
Description of input parameters:

Parameter Data type Description


MAN BOOL "1" = Manual operating mode
HALT BOOL "1" = Halt mode
SP REAL Setpoint input
PV REAL Actual value input
K REAL Feedback boost
LAG_NEG TIME Time constants of the quick feedback
LAG_POS TIME Time constants of the slow feedback
DB REAL Hysteresis from two point switch
XF_MAN REAL Reset value of the feedback in % (0 – 100)
YMAN BOOL "1" = Handwert für ERR_EFF

Description of output parameters:

Parameter Data type Description


Y BOOL "1" = Output manipulated variable
ERR_EFF REAL Effective switch value

Runtime error
With HYS > 2 * DB an error message is returned.
NOTE: For a list of all block error codes and values, see CLC, page 614.

138 33002543 10/2019


TWOPOINT_CON1

Warning
In the following cases a warning will be returned:

If... Then...
LAG_NEG = 0 and LAG_POS > 0 The controller works as if it had only a positive
feedback with time constant LAG_POS.
LAG_POS < LAG_NEG > 0 The controller works as if it had only a negative
feedback with time constant LAG_NEG.
XF_MAN < 0 or XF_MAN > 100 the controller operates without internal feedback
paths.

NOTE: For a list of all block error codes and values, see CLC, page 614.

33002543 10/2019 139


TWOPOINT_CON1

Detailed description

Structure of the controller


Structure of the two-point controller:

140 33002543 10/2019


TWOPOINT_CON1

Principle of the two-point controller


The actual two-point controller will have two dynamic feedback paths (PT1 elements) added. By
appropriately choosing the time constant of these feedback elements, the two-point controller
exhibits a dynamic behavior corresponding to that of a PID controller.
Principle of the two-point controller:

The selected feedback gain K must be greater than zero!


Entries for XF_MAN (percentages from 0 to 100%) must be in the range 0 to 100 inclusive!

Internal feedback paths


The feedback parameter set, consisting of the feedback gain K and the feedback time constants
LAG_NEG and LAG_POS, allows a universal employment of the two-point controller.
The following table provides more exact information about it:

Feedback LAG_NEG LAG_POS


2-Point-Behavior (without feedback) =0 =0
negative feedback >0 =0
negative + positive feedback >0 > LAG_NEG
Warning, regeneration (neg. feedback with LAG_POS) =0 >0
Warning, regeneration (pos. feedback switched off) > LAG_POS >0

Hysteresis
The parameter DB indicates the switching-hysteresis, i.e. the value which the effective switch value
ERR_EFF outgoing from control point DB/2 must be reduced by, before the output Y is reset to "0".
The dependence of the output Y depending of the effective switch value ERR_EFF and the
Parameter DB, becomes clear in the illustration "Principle of the two-point controller, page 141".
The parameter DB is typically set to 1% of the maximum control range [max. (SP - PV)].

33002543 10/2019 141


TWOPOINT_CON1

Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:

Operating mode MAN HALT Meaning


Automatic 0 0 The function block will be handled as described
above.
Manual mode 1 0 or 1 The output Y is set to the YMAN value.
xf1 and xf2 are calculated using the following
formula:

Halt 0 1 The output Y is held at its last value. xf1 and xf2
are set to GAIN * Y.

142 33002543 10/2019


EcoStruxure™ Control Expert
CLC_PRO
33002543 10/2019

Part III
CLC_PRO

CLC_PRO

Overview
This part describes the elementary functions and elementary function blocks in the family
CLC_PRO.

What Is in This Part?


This part contains the following chapters:
Chapter Chapter Name Page
16 ALIM: Velocity limiter: 2nd order 145
17 COMP_PID: Complex PID controller 151
18 DEADTIME: Deadtime device 173
19 DERIV: Differentiator with smoothing 181
20 FGEN: Function generator 189
21 INTEG: Integrator with limit 205
22 LAG: Delay element 1st order 213
23 LAG2: Delay element 2nd order 219
24 LEAD_LAG: PD device with smoothing 227
25 PCON2: Two point controller 235
26 PCON3: Three point controller 243
27 PD_OR_PI: Structure changeover PD/PI controller 253
28 PDM: Pulse duration modulation 267
29 PI: PI controller 277
30 PID: PID controller 287
31 PID_P: PID controller with parallel structure 301
32 PIP: PIP cascade controller 313
33 PPI: PPI cascade controller 327
34 PWM: Pulse width modulation 339
35 QPWM: Pulse width modulation (simple) 351
36 SCON3: Three step controller 359
37 VLIM: Velocity limiter 1st order 367

33002543 10/2019 143


CLC_PRO

144 33002543 10/2019


EcoStruxure™ Control Expert
ALIM
33002543 10/2019

Chapter 16
ALIM: Velocity limiter: 2nd order

ALIM: Velocity limiter: 2nd order

Introduction
This chapter describes the ALIM block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 146
Detailed description 149

33002543 10/2019 145


ALIM

Description

Function description
The function block produces an acceleration limiter of the 2nd order.
The function block individually contains the following properties:
 Operating modes Manual, Halt, Automatic
 Output limiting

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouput may deliver a wrong value.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

146 33002543 10/2019


ALIM

Representation in LD
Representation:

Representation in IL
Representation:
CAL ALIM_Instance (X:=Input, MODE:=OperatingMode,
PARA:=Parameter, YMAN:=ManualManipulatedY, Y=Output)

Representation in ST
Representation:
ALIM_Instance (X:=Input, MODE:=OperatingMode,
PARA:=Parameter, YMAN:=ManualManipulatedY, Y:=Output) ;

ALIM parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input
MODE Mode_MH Operating mode
PARA Para_ALIM Parameter
YMAN REAL Manual value for output Y

Description of input / output parameters:

Parameter Data type Description


Y REAL Output

33002543 10/2019 147


ALIM

Parameter description Mode_MH


Data structure description:

Element Data type Description


man BOOL "1" = Manual operating mode
halt BOOL "1" = Halt mode

Parameter description Para_ALIM


Data structure description:

Element Data type Description


max_v REAL Maximum velocity (maximum x’)
Unit: 1/[s]
max_a REAL Maximum acceleration (maximum x’’)
Unit:

Runtime error
An error message is returned if
 an invalid floating point number lies at input YMAN or X,
 max_a or max_v ≤ is 0.

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

148 33002543 10/2019


ALIM

Detailed description

Parametering
The parameters for the function block can be set by determining the maximum velocity max_v and
the maximum acceleration max_a. The maximum velocity specifies how much output Y can
change within one second. The maximum acceleration specifies the maximum amount that output
Y can change.
The value of Y follows the value of X, but is limited by the maximum permitted velocity and
acceleration.

Operating mode
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 A new value for Y will be constantly calculated
and output.
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y.
Halt 0 1 The output Y will be held at the last calculated
value. The output will no longer be changed, but
can be overwritten by the user.

33002543 10/2019 149


ALIM

Example
In the diagram the dynamic behavior of the function block is displayed as well as the reaction during
HALT operating mode:

A jump on input X causes the function block to accelerate the increase of output Y. Output Y is
accelerated using the value set for parameter max_a. Should the velocity reach the max_v value,
acceleration stops, but output Y continues to follow input X with the maximum velocity max_v (see
the straight section in the middle of the figure).
If the value of output Y is close enough to input signal value, the output is reversed to brake at a
negative speed increase of -max_a, so that the output does not come to an abrupt stop, but slowly
approximates the terminal point.

150 33002543 10/2019


EcoStruxure™ Control Expert
COMP_PID
33002543 10/2019

Chapter 17
COMP_PID: Complex PID controller

COMP_PID: Complex PID controller

Introduction
This chapter describes the COMP_PID block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 152
Complex PID controller structure diagram 158
Setting parameters for the COMP_PID controller 159
Anti-windup for COMP_PID 162
Controller type selection for COMP_PID 163
Bumpless operating mode switchover 164
Selecting the operating mode of the COMP_PID 167
Detailed formulas 169

33002543 10/2019 151


COMP_PID

Description

Function description
The function block represents a complex PID controller that in its design specifically includes
cascade treatment. The control structure is displayed in theStructure diagram, page 158.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 real PID controller with independent gain, ti, td setting
 Manual, halt, automatic, cascade, reset, manual value operating modes tracking
 Velocity limit for manual operation
 Adjustable manual manipulated value tracking
 Velocity limit for reference variable
 bumpless changeover between manual and automatic
 Manipulated variable limiting
 bumpless, individually connectable P, I and D components
 bumpless gain modification
 Choice of anti-windup reset and anti-windup halt
 Displacement of anti-windup limits compared to control limits
 Anti-windup measure with an active I component only
 definable delay of the D component
 D component connectable to controlled variable PV or system deviation ERR
 Dead zone with gain reduction
 external operating point (in P, PD and D operation)
 Choice of bump/bumpless manual/automatic switchover

152 33002543 10/2019


COMP_PID

Transfer function
The transfer function is:

Explanation of the variables:

Variable Description
YD D component (only when en_d = 1)
YI I component (only when en_i= 1)
YP P component (only when en_p= 1)

Representation in FBD
Representation:

33002543 10/2019 153


COMP_PID

Representation in LD
Representation:

154 33002543 10/2019


COMP_PID

Representation in IL
Representation:
CAL COMP_PID_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable,
SP_CAS:=CascadeReferenceVariable, MODE:=OperatingModes,
PARA:=Parameters, YMAN:=ManuallyManipulatedValue,
YRESET:=Y_ResetValue, FEED_FWD:=DisturbanceInput,
OFF:=OffsetFor_P_PD_Operation, Y:=ManipulatedVariable,
SP_CAS_N:=CascadeReferenceVariable,
YMAN_N:=ManuallyManipulatedValue,
OFF_N:=OffsetFor_P_PD_Operation, ERR=>SystemDeviation,
STATUS=>OutputStatus)

Representation in ST
Representation:
COMP_PID_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable,
SP_CAS:=CascadeReferenceVariable, MODE:=OperatingModes,
PARA:=Parameters, YMAN:=ManuallyManipulatedValue,
YRESET:=Y_ResetValue, FEED_FWD:=DisturbanceInput,
OFF:=OffsetFor_P_PD_Operation, Y:=ManipulatedVariable,
OFF_N:=OffsetFor_P_PD_Operation, ERR=>SystemDeviation,
STATUS=>OutputStatus) ;

Parameter description COMP_PID


Description of the input parameters:

Parameter Data type Description


SP REAL Reference variable
PV REAL Controlled variable
SP_CAS REAL Cascade reference variable
MODE Mode_COMP_PID Operating mode
PARA Para_COMP_PID Parameter
YMAN REAL Manually manipulated value
YRESET REAL Manipulated variable reset value
FEED_FWD REAL Disturbance input
OFF REAL Offset for P/PD operation

33002543 10/2019 155


COMP_PID

Description of input / output parameters:

Parameters Data type Meaning


Y REAL Manipulated variable
SP_CAS_N REAL Cascade reference variable
YMAN_N REAL Manually manipulated value
OFF_N REAL Offset for P/PD operation

Description of the output parameters:

Parameters Data type Description


ERR REAL System deviation
STATUS Stat_COMP_PID Output status

Parameter description Mode_COMP_PID


Data structure description

Element Data type Description


r BOOL "1": Reset mode
man BOOL "1": Manual mode
halt BOOL "1": Halt mode
cascade BOOL "1": Cascade mode
en_p BOOL "1": P component on
en_i BOOL "1": I component on
en_d BOOL "1": D component
d_on_pv BOOL "1": D component on controlled variable
"0": D component on system deviation
halt_aw BOOL "1": Anti-windup Halt
"0": Anti-windup reset
bump BOOL "0": Bumpless operating mode switchover
ymanc BOOL "1": YMAN tracking

156 33002543 10/2019


COMP_PID

Parameter description Para_COMP_PID


Data structure description

Element Data type Description


gain REAL Proportional action coefficient (gain)
ti TIME Integral time
td TIME Derivative time
td_lag TIME D component delay time
db REAL Dead zone
gain_red REAL Gain reduction in dead zone (db)
rate_sp REAL Setpoint velocity (SP) [1/s]
rate_man REAL Manually manipulated velocity value (YMAN) [1/s]
ymax REAL Upper threshold for Y
ymin REAL Lower threshold for Y
delt_aw REAL Limit expansion for anti-windup

Parameter description Stat_COMP_PID


Data structure description

Element Data type Description


st_r BOOL "1": COMP_PID is in reset mode
st_man BOOL "1": COMP_PID is in manual mode
st_halt BOOL "1": COMP_PID is in halt mode
st_auto BOOL "1": COMP_PID is in automatic mode
st_cascade BOOL "1": COMP_PID is in cascade mode
st_max BOOL "1": Y ≥ Para_COMP_PID.ymax
st_min BOOL "1": Y ≤ Para_COMP_PID.ymin

Runtime error
An error message is returned if
 an unauthorized floating point number is placed at the input PV
 gain_red > 1 or gain_red < is 0
 db < is 0
 ymax < is ymin

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 157


COMP_PID

Complex PID controller structure diagram

Structure diagram
The following is the structure diagram of the COMP_PID controller:

158 33002543 10/2019


COMP_PID

Setting parameters for the COMP_PID controller

Setting Parameters
The COMP_PID control structure is displayed in the Structure diagram, page 158.
Setting function block parameters is initially performed by the pure PID parameters, i.e. the
proportional action coefficient gain, the reset time ti and the derivative time td.
The D component is delayed by the time td_lag. The td/td_lag ratio is termed the differential
gain, and is generally selected between 3 and 10. The D component can either be based upon the
system deviation ERR (d_on_pv = "0") or the controlled variable PV (d_on_pv = "1"). Should the
D component be determined by the controlled variable PV, then the D component will not be able
to cause jumps when reference variable fluctuations (changes in input SP) take place. Generally,
the D component only affects disturbances and process variances.
NOTE: The EFB has 3 I/O parameters (SP_CAS, OFF, YMAN) that are updated by the function
itself in cascade mode. To use the block in cascade mode, you have to establish the connection
between these inputs and the appropriate outputs (SP_CAS_N, OFF_N, YMAN_N) through
variables.

Control direction reversal


A reversed behavior of the controller can be achieved by reversing the sign of gain. A positive
value on gain causes the manipulated variable to rise when there is a positive disturbance. A
negative value on gain causes the manipulated variable to drop when there is a positive
disturbance.

Forming the system deviation


In cascade mode, the ERR system deviation is formed by SP_CAS and PV:
 sp_intern = SP_CAS
 ERR = sp_intern - PV

The system deviation in automatic mode is formed by sp_intern and PV, whereby sp_intern
is set to the value of parameter SP via a velocity limiter. The internal reference variable sp_intern
is driven in ramp-type fashion toward the SP parameter value using the velocity specified in
parameter rate_sp (unit 1/s).
The amount will be evaluated for parameter rate_sp. The function of the velocity limiter for SP is
disabled if rate_sp = 0. SP is transferred directly to sp_intern.
System deviation is determined by the condition of parameter cascade when in reset, manual and
halt modes.
If cascade = 1, sp_intern is set to the PV parameter value and ERR goes to 0.
If cascade = 0 and the setting is bumpless operation (bump = 0), sp_intern is set to the SP
parameter value. Otherwise (bump = 1), sp_intern is also set to the PV parameter value.

33002543 10/2019 159


COMP_PID

Gain reduction for small system deviation values


Parameter db determines the size of a dead zone in which the proportional action coefficient gain
is not effective, but rather a proportional action coefficient reduced by the parameter gain_red.
The parameter db has an effect on the system deviation ERR = SP - PV in the form shown in
the illustration Representation of the dead zone, page 160. Unnecessary actuator loads caused by
small controlled variable disturbances or measurement noise can be reduced by the dead zone.
Enter the db parameter as positive.
Enter values between 0 and 1 for gain_red.

Tracking of manual value YMAN


When manual tracking mode is enabled (ymanc = 1), the input YMAN is tracked to the manipulated
variable value Y when in automatic and cascade modes, this means: YMAN = Y. If manual tracking
mode is disabled (ymanc = 0), the YMAN value remains unchanged.

Representation of the dead zone


Dead zone:

1 Gradient 1
2 Gradient gain_red

160 33002543 10/2019


COMP_PID

Manipulated variable limiting


The limits ymax and ymin retain the manipulated variable within the prescribed range. Therefore
ymin ≤ Y ≤ ymax.
The elements st_qmax and st_min signal that the manipulated variable has reached a limit, and
thus been capped:
 st_max = 1 if Y ≥ ymax
 st_min = 1 if Y ≤ ymin.

For limiting the manipulated variable, the upper limit ymax should be greater than the lower limit
ymin.

33002543 10/2019 161


COMP_PID

Anti-windup for COMP_PID

Definition
The anti-windup measure ensures that the Integral component does not grow too much causing
the controller to lock if it has been limited at a control limit too long. Anti-windup measures are only
performed for an active I component of the controller.
Limits for the anti-windup measure are by default the manipulated variables of the controller
(delt_aw = 0). The parameter delt_aw can be used to either increase (delt_aw > 0) or
decrease (delt_aw < 0) the limits with regard to the control limits (ymax, ymin).
Therefore, the limits used for the anti-windup measure are:
 AWMAX = ymax + delt_aw
 AWMIN = ymin - delt_aw.

Through displacement of the anti windup limits in relation to the control limits (in particular with very
noisy signals), the manipulated variable Y can be stopped from repeatedly 'jumping away' from the
control limit (D component effect to disturbances) and subsequently returning to the limiting
position (I component effect with system deviation ERR ≠ 0). If the control limits are to be
simultaneously effective for the anti-windup measure, select the parameter delt_aw = 0.
By utilizing negative delt_aw values, anti-windup limits can be kept smaller than control limits
(useful for anti-windup halt).

Anti-windup reset (halt_aw = 0)


The anti-windup measure disregards the D component, to avoid the capping of the D component
peaks through the anti-windup measure. The anti-windup-reset measure corrects the I component
such that: AWMIN ≤ YP + FEED_FWD + YI ≤ AWMAX.

Anti-windup halt (halt_aw = 1)


The anti-windup measure only considers the I component. When anti-windup halt and I component
are enabled, the anti-windup halt measure corrects the I component such that: AWMIN ≤ YI ≤
AWMAX.
The parameters rate_sp and rate_man represent velocity limiters for the manual values SP and
YMAN (see also function block VLIM). A 0 value disables the functionality of the corresponding
velocity limiter (rate_sp = 0 or rate_man = 0, respectively). The SP and YMAN values are then
utilized without delay.

162 33002543 10/2019


COMP_PID

Controller type selection for COMP_PID

Controller types
There are four different control types, which are selected via the parameters en_p, en_i and
en_d.

Controller type en_p en_i en_d


P controller 1 0 0
PI controller 1 1 0
PD controller 1 0 1
PID controller 1 1 1
I controller 0 1 0

The I component can also be disabled with ti = 0.


The D contribution can also be disabled with td = 0.

OFF parameter influence


If the I component is enabled (en_i = 1), the manipulated variable Y is determined from the
summation of the components YP, YI, YD, and FEED_FWD. Offset is not included in the calculation
when the I component is enabled.
However, if the I component is disabled (en_i = 0), the manipulated variable is formed from the
summation of the components YP, YD, FEED_FWD, and the offset OFF.
NOTE: The OFF parameter is only designed for P, D, or PD controllers.

33002543 10/2019 163


COMP_PID

Bumpless operating mode switchover

Method of switching over


Bumpless on/off switching of the various components (P, I, D) is implemented.

Bumpless switching with connected I component


If the P component is connected/disconnected, the internal I component will be corrected by the P
component. This way, the connection/disconnection of the P component is bumpless even if the
system deviation is not 0.
If the D component is disconnected, the internal I component takes over the remaining D
component. If the D component is connected, it is set to 0.

Bumpless switching for disconnected D component


Bumpless switching for a disconnected D component is only implemented if parameter bump = 0.
In this case, the OFF parameter is used to achieve the bumpless switchover.
If the P component is connected/disconnected, the value in the OFF parameter is corrected by the
P component. This way, the connection/disconnection of the P component is bumpless even if the
system deviation is not 0.
If the D component is disconnected, the remaining D component is added to the OFF parameter
value. If the D component is connected, it is set to 0 (OFF remains unchanged).

Bumpless I component switching


Bumpless I component disconnection is only performed if parameter bump = 0. In this case, the
OFF parameter as well as the internal I component (YI) are used to make the bumpless switchover
possible.

Bumpless switchover from a PI(D) to a P(D) controller


The principle consideration for bumpless switching from a PI(D) to P(D) controller is based on the
assumption that the PI(D) controller has reached a static condition. In this case, the process is in
an idle state. The I component has a specific value in this case. To allow a bumpless switch to P(D)
operation now, the I contribution of the PI(D) controller would have to serve as the PD controller
operating point (offset), thus allowing the switch to take place without equalization processes (new
transient condition) taking place. Based on the above consideration, bumpless I component
disconnection is implemented in such a way that the OFF parameter retrieves its value.
Value of the manipulated variable Y depending on en_i:

If... Then...
en_i = 1 Y = YP + YI + YD + FEED_FWD
en_i = 0 Y = YP + OFF + YD + FEED_FWD

164 33002543 10/2019


COMP_PID

Starting up the I component


I component enabling is based on a similar consideration. The internal I component is set to the
OFF parameter value. This allows the I component to be connected without giving rise to
equalization processes.
NOTE: If the OFF parameter is calculated by a previous function block (EFB or DFB output, e.g.
MOVE), the corrections for bumpless switching become ineffective (at the latest, when this function
block is edited).

Example of a bumpless switchover of the D component


In order to achieve the bumpless P(D) controller switchover as well as OFF parameter modification
by the user program, the following example can serve as a starting point.

In this example, the OFF parameter is set to the new_off variable value via a velocity limiter VLIM
in ramp form using the velocity provided in pvlim.rate.

33002543 10/2019 165


COMP_PID

Note on the example


In this example, it is important to note the use of the off variable at the YMAN input of the VLIM as
well as at the Y output of the VLIM, and the link of the output from VLIM to the OFF input of
COMP_PID. The link between the Y output from VLIM and the OFF input from COMP_PID causes
the VLIM function block to be processed prior to the COMP_PID function block (this is a prerequisite
for proper operation). As long as the manual mode (mvlim.man = 1) is enabled in the VLIM, the
manual value of the VLIM function block is transferred to the COMP_PID OFF parameter. The
COMP_PID function block is now able to modify the content of the variable for bumpless handling.
In the next cycle, this modified value is now available at the YMAN input of the VLIM function block.
At an appropriate time, the manual mode in the VLIM function block can be disabled, and the
function block drives up the value of the off variable in ramp form from its current value to that of
new_off. In the example above, manual mode enabling is controlled in the function block OR. As
long as COMP_PID has connected the I component (mkpid.en_i = 1), the VLIM function block
remains in manual mode.
NOTE: If mkpid.en_i = 1, the OFF parameter from COMP_PID will not be included in the calculation
of the COMP_PID output.
In the above example, the OR function block requires a second condition in order to change off to
new_off: The variable change_off must be 1.

Bumpless alteration of gain


Modification of the proportional action coefficient gain is bumpless. As in the
connection/disconnection of operating modes, this requires an internal correction to be carried out.
If the I component is connected (en_i = 1 and ti > 0), the internal I component will be corrected
by the expected P component jump which is caused by the gain modification.
If the I component is disconnected, the value in the OFF parameter will be corrected by the
expected P component jump, provided the parameter bump = 0. If bump = 1, OFF is not modified
and a P(D) controller gain variation leads to equalization processes.

166 33002543 10/2019


COMP_PID

Selecting the operating mode of the COMP_PID

Operating mode
There are five operating modes selectable through r, man, halt, and cascade.

Operating r man halt cascade


mode
Reset 1 1 or 0 1 or 0 1 or 0
Manual mode 0 1 1 or 0 1 or 0
Halt 0 0 1 1 or 0
Cascade 0 0 0 1
Automatic 0 0 0 0

Automatic and cascade modes


In automatic mode, the manipulated variable Y is determined through the discrete PID closed-loop
control algorithm subject to controlled variable X and reference variable SP.
In cascade mode, the manipulated variable Y is determined through the discrete PID closed-loop
control algorithm subject to controlled variable X and reference variable SP_CAS.
The distinction between these two operating modes, automatic and cascade, is only external in
their different use of the reference variable SP. SP_CAS refers to cascade, SP to all other operating
modes (with velocity limit). The SP_CAS variable is an input in cascade mode only, in all other
modes it is an output. In SP_CAS, the X variable is returned to the master controller when in the
modes reset, manual, halt or automatic as well as during startup, permitting bumpless switching
from, for instance, fixed setpoint control to cascade control.
In both operating modes, the manipulated variable Y is limited by ymax and ymin. The control
limits for the anti-windup measure can be extended using the parameter delt_aw.

Manual mode
In manual mode, the manual manipulated value YMAN is transferred to the manipulated variable Y
with a velocity limiter. The manipulated variable Y is set to the YMAN parameter value in ramp form
using the velocity (unit 1/s) rate set in the parameter rate_man.
The amount will be evaluated for parameter rate_man. The function of the velocity limiter for YMAN
is disabled if rate_man = 0. YMAN is transferred directly to the manipulated variable. The
manipulated variable is limited by ymax and ymin.
Internal variables will be manipulated in such a manner that the controller changeover from manual
to automatic (with I component enabled) can be bumpless. The Anti-windup measure is designed
just like in automatic mode.
In this operating mode the D component is automatically set to 0.

33002543 10/2019 167


COMP_PID

Reset mode
In Reset mode, the reset value YRESET is transferred directly to the manipulated variable Y. The
manipulated variable is limited by ymax and ymin. Internal variables will be manipulated in such a
manner that the controller changeover from manual to automatic (with I component enabled) can
be bumpless. The Anti-windup measure is performed just like in automatic mode.

Halt mode
In halt mode, the control output remains as is, i.e. the function block does not change the
manipulated variable Y. Internal variables will be manipulated in such a manner that the controller
can be driven smoothly from it's current position. Manipulated variable limits and Anti-windup
measures are as those in automatic mode. Halt mode is also useful in allowing an external operator
device to adjust control output Y, whereby the controller's internal components are given the
chance to continuously react to the external influence.
In this operating mode the D component is automatically set to 0.

Non-bumpless operation (bump = 0)


The definition of non-bumpless operation is when the controller exhibits a jump during operating
mode switchover (e.g. manual to automatic) due to the P component in the manipulated variable
Y. Depending on the controller's area of utilization, it might be useful for the controller to make a
jump-type correction of the manipulated variable when switching over, for instance from manual to
automatic, provided the system deviation is not equal to 0.
The jump height corresponds to the P component of the controller and is:

Bumpless operation (bump = 1)


The definition of bumpless operation is, the controller does not produce a discontinuity in the
manipulated variable Y during an operating mode switchover. That is, it should continue at exactly
the same location where it was positioned last. In this operating mode, the internal I component is
corrected by the P contribution. If no I component is enabled, bumpless operation is achieved by
tracing the operating point OFF such that the controller can continue during operating mode change
without a bump in spite of system deviation being not equal to 0.

168 33002543 10/2019


COMP_PID

Detailed formulas

Explanation of formula variables


Meaning of the variables in the following formulas:

Variable Meaning
Time differential between the present cycle and the previous cycle

The current internally formed System deviation

System deviation value from the current sampling step

System deviation value from the previous sampling step

FEED_FWD Disturbance (only in P, D or PD controllers)


OFF Offset
Value of controlled variable from the current sampling step

Value of controlled variable from the previous sampling step

Y current output (halt mode) or YMAN (manual mode)


YD D component (only when en_d = 1)
YI I component (only when en_i= 1)
YP P component (only when en_p= 1)

Manipulated variable
The manipulated variable consists of various terms which are dependent on the operating mode:

After summation of the components manipulated variable limiting takes place, so that:

33002543 10/2019 169


COMP_PID

Overview of the calculation of the control components


The following is an overview on the different calculations of the control components in relation to
the elements en_p, en_i and en_d:
 P component YP for manual, halt, automatic and cascade modes
 I component YI for automatic mode
 I component YI for manual and halt modes
 D component YD for automatic and cascade mode
 D component YD for manual and halt modes

P component YP for all operating mode


YP for manual, halt, automatic and cascade modes is determined as follows:
For en_p = 1 the following applies:

For en_p = 0 the following applies:

I component YI for automatic mode


YI for automatic mode is determined as follows:
For en_i = 1 the following applies:

For en_i = 0 the following applies:

The I component is formed according to the trapezoid rule.

I component YI for manual and halt modes


YI for manual, halt and automatic modes is determined as follows:
For en_i = 1 the following applies:

For en_i = 0 the following applies:

170 33002543 10/2019


COMP_PID

D component YD for automatic and cascade mode


YD for automatic mode and cascade is determined as follows:
For en_d = 1 and d_on_pv = 0 the following applies:

For en_d = 1 and d_on_pv = 1 the following applies:

For en_d = 0 the following applies:

D component YD for manual and halt modes


YD for manual, halt and automatic modes is determined as follows:

33002543 10/2019 171


COMP_PID

172 33002543 10/2019


EcoStruxure™ Control Expert
DEADTIME
33002543 10/2019

Chapter 18
DEADTIME: Deadtime device

DEADTIME: Deadtime device

Introduction
This chapter describes the DEADTIME block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 174
Operating mode 177
Example for behavior of the function block 179

33002543 10/2019 173


DEADTIME

Description

Function description
With this function block an input signal is delayed by a time, the so-called deadtime.
The function block delays the signal X by the deadtime T_DELAY before it appears again at Y.
The function block utilizes a 128 element delay buffer to hold a sequence of X values, i.e. during
the T_DELAY time 128 discrete X values are detained. The buffer is used in such a way that it
corresponds with the operating mode.
Whether the system is started cold or warm, the value of Y remains unchanged. The internal values
are set to the value of X.
After a change of deadtime T_DELAY or a cold or warm system start, the output READY goes to
"0". This means: that the buffer is empty and not ready.
The function block has the following operating mode:
 Manual mode
 Halt
 Automatic.

EN and ENO can be configured as additional parameters.


NOTE: The delay time continues to run even if the block is disabled via the EN parameter, because
the block calculates its time differences according to the system clock.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Formula
The transfer function is:

174 33002543 10/2019


DEADTIME

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL DEADTIME_Instance (X:=InputValue, MODE:=OperatingModes,
T_DELAY:=DeadTime, YMAN:=ManualManipulatedValue,
Y=>Output, READY=>InternalBufferFlag)

Representation in ST
Representation:
DEADTIME_Instance (X:=InputValue, MODE:=OperatingModes,
T_DELAY:=DeadTime, YMAN:=ManualManipulatedValue,
Y=>Output, READY=>InternalBufferFlag) ;

33002543 10/2019 175


DEADTIME

DEADTIME parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input value
MODE Mode_MH Operating mode
T_DELAY TIME Deadtime
YMAN REAL Manually manipulated value

Description of output parameters:

Parameter Data type Description


Y REAL Output
READY BOOL "1" = internal buffer is full
"0" = internal buffer is not full (e.g. after warm/cold
start or modification of deadtime)

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1" = Manual operating mode
halt BOOL "1" = Halt mode

Runtime error
An error message is returned when an invalid floating point number lies at input YMAN or X.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

176 33002543 10/2019


DEADTIME

Operating mode

Selecting the operating modes


There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt


Automatic 0 0
Manual mode 1 0 or 1
Halt 0 1

Automatic operating mode


In the automatic mode, the function block operates according to the following rules:

If... Then...
the current X value is transferred to the buffer, and the oldest
Scan time >
X value in the buffer is placed on the output Y. If the scan time
is more than T_DELAY / 128, resolution is less than 128
causing a systematic error, i.e. some X values are double-
stored (see the following Example).
not all X values can be stored in the buffer. In this case the X
Scan time <
value is not saved in some cycles. After completion of
T_DELAY, output Y may correspondingly remain unchanged
in two (or more) consecutive cycles.

Example of automatic mode


In the example the following values are accepted:
Cycle time = 100 ms
T_DELAY = 10 s
tin = T_DELAY / 128 = 78 ms
As the reading time tin is shorter than the cycle time, each X value is transferred to the buffer. On
the fourth execution of the function block (after 400 ms) the X value is saved twice rather than once
(as 3 x 78 = 312 and 4 x 78 = 390).

Manual mode
In manual mode the manual value YMAN is consistently transferred to the control output Y. The
internal buffer is charged with the manual value YMAN. The buffer is marked as charged (READY
=1).

33002543 10/2019 177


DEADTIME

Halt mode
The output Y is held at the last calculated value in Halt mode. The output will no longer be changed,
but can be overwritten by the user. The internal buffer still continues to operate as in automatic
mode.

178 33002543 10/2019


DEADTIME

Example for behavior of the function block

Example
The following diagram shows an example for behavior of the function block. Input X follows a ramp
function from one value to a new value. Delayed by the deadtime T_DELAY, X values appear at Y.
Function block diagram DEADTIME

33002543 10/2019 179


DEADTIME

180 33002543 10/2019


EcoStruxure™ Control Expert
DERIV
33002543 10/2019

Chapter 19
DERIV: Differentiator with smoothing

DERIV: Differentiator with smoothing

Introduction
This chapter describes the DERIV block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 182
Formulas 185
Detailed description 186
Example for the function block 187

33002543 10/2019 181


DERIV

Description

Function description
The function block is a differential element with a delayed output Y respecting the delay time
constant lag.
The function block contains the following operating mode: Manual, halt and automatic mode.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouput may deliver a wrong value.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

182 33002543 10/2019


DERIV

Representation in LD
Representation:

Representation in IL
Representation:
CAL DERIV_Instance (X:=InputVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=DifferentiatorOutput)

Representation in ST
Representation:
DERIV_Instance (X:=InputVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=DifferentiatorOutput) ;

DERIV parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input variable
MODE Mode_MH Operating mode
PARA Para_DERIV Parameter
YMAN REAL Manually manipulated value

33002543 10/2019 183


DERIV

Description of input / output parameters:

Parameter Data type Description


Y REAL Output derivative unit with smoothing

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1" = Manual operating mode
halt BOOL "1" = Halt mode

Parameter description Para_DERIV


Data structure description

Element Data type Description


gain REAL Gain of the differentiation
lag TIME Delayed time constants

Runtime error
An error message is returned when an invalid floating point number lies at input YMAN or X.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

184 33002543 10/2019


DERIV

Formulas

Transfer function
The transfer function for Y is:

Calculation formula for Y


The calculation formula for Y is:

Special case: lag =0


This amounts to pure differentiation without a 1st order time limiter.
In this situation the transfer function is:

The formula of calculation is:

Meaning of the sizes


The meaning of the formula sizes is as follows:

Variable Meaning
the input X value for the current cycle

the input X value from the previous cycle

the output Y value from the previous cycle

is the time differential between the current cycle and the previous cycle

33002543 10/2019 185


DERIV

Detailed description

Parametering
The parameter assignments of the function block are effected by the determination of gain, the
differentiator and the time constant lag, by which the output Y is delayed.
For very short sampling times and an input X unit step (input X jumps from 0 to 1.0), the output Y
jumps to the value gain (in theory - in reality somewhat smaller, due to the sampling time not being
infinitely small), and then returns to 0 with the delay time constant lag.

Operating mode
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The input YMAN will be transferred directly to the
output Y.
Halt 0 1 The output Y will be held at the last calculated
value. The output will no longer be changed, but
can be overwritten by the user.

186 33002543 10/2019


DERIV

Example for the function block

Example DERIV
The following example shows the step response of the DERIV function block.
Jump response with gain = 1 and lag = 10 s

33002543 10/2019 187


DERIV

188 33002543 10/2019


EcoStruxure™ Control Expert
FGEN
33002543 10/2019

Chapter 20
FGEN: Function generator

FGEN: Function generator

Introduction
This chapter describes the FGEN block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 190
Parametering 193
Function selection 194
Function definition 195
Diagrams of the individual functions 198
Special cases 202
Timing diagrams 203

33002543 10/2019 189


FGEN

Description

Function description
The function block FGEN represents a function generator. It generates a signal form at the Y output
which is defined in the data structure Para_FGEN. The function block can be cascaded, i.e. if
several of these EFBs are used, various signal forms can be created and laid over one another.
The following 8 different signal forms can be generated:
 Jump function
 Ramp function
 Delta function
 Saw-tooth function
 Square wave function
 Trapezoid function
 Sine function
 Random Number

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

190 33002543 10/2019


FGEN

Representation in LD
Representation:

Representation in IL
Representation:
CAL FGEN_Instance (R:=ResetFlag, START:=StartFlag,
PARA:=Parameter, YOFF:=Output_Y_Offset,
Y=>FunctionGeneratorOutput,
ACTIVE=>FunctionGeneratorActiv, N=>NumberOfPeriods)

Representation in ST
Representation:
FGEN_Instance (R:=ResetFlag, START:=StartFlag,
PARA:=Parameter, YOFF:=Output_Y_Offset,
Y=>FunctionGeneratorOutput,
ACTIVE=>FunctionGeneratorActiv, N=>NumberOfPeriods) ;

FGEN parameter description


Description of input parameters:

Parameter Data type Description


R BOOL 1: Reset
START BOOL 1: Start function generator
PARA Para_FGEN Parameter
YOFF REAL Offset for output Y

33002543 10/2019 191


FGEN

Description of output parameters:

Parameter Data type Description


Y REAL Function generator output
ACTIVE BOOL ACTIVE = 1: Function generator is active
N INT Number of intervals since start

Parameter description Para_FGEN


Data structure description

Element Data type Description


func_no INT Generator function choice (1-8)
amplitude REAL Function amplitude
halfperiod TIME Half cycle duration
t_off TIME Idle time constant
t_rise TIME Rise time constant
t_acc TIME Smoothing time
unipolar BOOL "1 "= Signal unipolar
"0 "= Signal bipolar

Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.

192 33002543 10/2019


FGEN

Parametering

Reset
Parameter R stands for RESET. If this parameter is set (R = 1), all running functions will be
immediately terminated and output Y goes to the value of parameter YOFF (offset). Simultaneously
the cycle counter N is also reset to 0 and ACTIVE returns to "0".

Starting the function generator.


The parameter START (START = 1) starts the function defined with the data structure. Output N is
incremented with the beginning of each new cycle. If the parameter START returns to "0", the active
cycle of the selected function runs to completion. As long as the function is running, output ACTIVE
is "1". If the period is ended, output ACTIVE is also reset to "0".

Offset
Waveforms produced by the function generator have an amplitude with the value of parameter
amplitude, i.e. values range from -amplitude to amplitude for bipolar operation (unipolar
= "0") resp. from 0 to amplitude in unipolar operation (unipolar = "1"). Waveform values can
be shifted away from the zero reference point through the parameter YOFF.
NOTE: Should the output of another function generator be applied to parameter YOFF, the
waveforms produced by both function generators are overlaid.

Rise time t_rise


Rise time t_rise is used only by the functions "ramp" and "trapezoid". In the "saw-tooth" function
rise time is determined by halfperiod - t_off. Rise time is 0.5 * (halfperiod - t_off)
for the "delta" function.

33002543 10/2019 193


FGEN

Function selection

Selection
There are a total of 8 functions which can be produced by the function generator. Function
selection is made through func_no. At a function change the last selected running function still
proceeds to completion.
The following function numbers are allowed:

func_no Function
1 Jump
2 Ramp
3 Saw-tooth
4 Delta
5 Square
6 Trapezoid
7 Sine
8 Random Number

194 33002543 10/2019


FGEN

Function definition

Definition
The function is defined completely in the data structure Para_FGEN. First of all the waveform must
be determined (refer to Function selection, page 194).
Trapezoid (Delta, Saw-tooth, Square) unipolar/bipolar is selected as the basic type for the
definition.

Function amplitude is determined in the parameter amplitude. It should be noted that this
declaration applies to unipolar operation. Amplitude in bipolar operation is doubled and consists of
amplitude and -amplitude.
The parameter halfperiod defines the half cycle duration.
Parameter t_off defines an idle time. A half cycle of the function is then output within the time
halfperiod - t_off.
For the trapezoid function definition the rise time t_rise is also required. This is the time in which
the signal should accelerate from 0 to amplitude. This time is also taken for the descent from
amplitude back to 0.

"Smoothing" a function
If a function in ramp form is to rise or decline, the transitions are first of all always made in a sharp
crease. The gradient is not constant in this case. "Smoothing" is used to achieve a soft rise and
descent, i.e. the ramp turns into an S-curve.

33002543 10/2019 195


FGEN

"Smoothing" a function

This is then divided into three sections. Section I "accelerates" directly from 0. Section II is
traversed with the velocity attained at the end of section I. In section III, the acceleration from
section I is used to brake, and thus approach the terminal point softly. The size of the section is
user-definable. They are defined by specifying t_acc and t_rise.
The acceleration involved is calculated by the following formulas:

with

and

It then follows that:

NOTE: Smoothing is used only by the functions "Ramp", "Saw-Tooth", "Delta" and "trapezoid".
"Jump", "Square" and "Sine" are not "smoothable" functions.

196 33002543 10/2019


FGEN

Individual Parameter Usage


Parameter use within the various functions.

Function amplitude halfperiod t_off t_rise t_acc unipolar


Jump X
Ramp X X X
Saw-tooth X X X halfperiod X X
- t_acc
Delta X X X ((halfperiod X X
- t_acc)/2
Square X X X X
Trapezoid X X X X X X
Sine X X X X
Random X X
Number

Function diagrams can be found in the section Diagrams of the individual functions, page 198

Unipolar operation
The unipolar parameter defines whether the selected function should be output as a unipolar or
bipolar function. Particular attention should be paid to the fact that in unipolar operation a cycle is
still characterized by 2 "unipolar" half waves.

Altering function parameters


During a currently executing cycle, all function parameters may be altered. However, any
alterations made will not take effect until the cycle has completed. Should, for example, the idle
time t_off be altered during the running cycle, it does not apply until the start of the next cycle.

Altering a function
If the parameter func_no is changed during a currently executing cycle, it will also not take effect
until the cycle has completed with the previously selected function. The new function is then
started. This resets the cycle counter N, which indicates the period number, to 0.

33002543 10/2019 197


FGEN

Diagrams of the individual functions

Jump function
Representation of the Jump function

Ramp function
Representation of the Ramp function

198 33002543 10/2019


FGEN

Saw-tooth function
Representation of the Saw-tooth function

Delta function
Representation of the Delta function

33002543 10/2019 199


FGEN

Square wave function


Representation of the Square wave function

Trapezoid function
Representation of the Trapezoid function

200 33002543 10/2019


FGEN

Sine function
Representation of the Sine function

33002543 10/2019 201


FGEN

Special cases

Jump function
On the "Jump" function the output goes to
the value Y = YOFF if START = 0
and
the value Y = YOFF + amplitude if START = 1
set
The time specifications (t_off, t_rise, t_acc) do not play a role in this function.
Output N is incremented for every new 0 → 1 transition of input START.
This function only runs in unipolar operation. For this reason, the parameter unipolar must be
set to 1 non-explicitly.

Ramp function
In the "Ramp" function output Y ramps upward from value YOFF to YOFF + amplitude. While
START is unchanged at 1, output Y remains at the value YOFF + amplitude. Output Y jumps back
to value YOFF if START be taken back to 0.
Run up is determined by the times t_rise and t_acc. The time needed for run up from Y = YOFF
to Y = YOFF + amplitude is specified by t_rise. "Smoothing" can be influenced by t_acc.
Output N is incremented for every new 0 → 1 transition of input START.
This function only runs in unipolar operation. For this reason, the parameter unipolar must be
set to 1 non-explicitly.

Random Number
In the "Random number" function output Y is set to a number resulting "by chance" between
YOFF ≤ Y ≤ YOFF + amplitude, in unipolar operation
and
YOFF - amplitude ≤Y ≤ YOFF + amplitude , in bipolar operation
.
The time specifications (t_off, t_rise, t_acc) do not play a role in this function.
Output N is incremented for every new 0 → 1 transition of input START.

202 33002543 10/2019


FGEN

Timing diagrams

Bipolar operation
The following parameter specifications represent the various functions in bipolar operation:

Parameter Specification
amplitude 1
halfperiod 10
t_off 2
t_rise 2
t_acc 0
unipolar 0

Bipolar operation

Unipolar operation
The following parameter specifications represent the various functions in unipolar operation:

Parameter Specification
amplitude 1
halfperiod 10
t_off 2
t_rise 2
t_acc 0
unipolar 1

33002543 10/2019 203


FGEN

Unipolar operation

Trapezoid function
The following parameter specification represents the trapezoid function:

Parameter Specification
amplitude 1
halfperiod 10
t_off 1
t_rise 4
t_acc 1.5

Trapezoid function

204 33002543 10/2019


EcoStruxure™ Control Expert
INTEG
33002543 10/2019

Chapter 21
INTEG: Integrator with limit

INTEG: Integrator with limit

Introduction
This chapter describes the INTEG block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 206
Detailed description 210

33002543 10/2019 205


INTEG

Description

Function description
The function block replicates a limited integrator.
The function block has the following properties:
 Operating modes Manual, Halt, Automatic
 Manipulated variable limiting in automatic mode

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Formula
The transfer function is:

The formula of calculation is:

Meaning of the sizes

Variable Description
Value of input X from the previous cycle

Value of the output Y from the previous cycle

dt is the time differential between the current cycle and the previous cycle

206 33002543 10/2019


INTEG

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL INTEG_Instance (X:=InputVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=Output, STATUS=>Output_Y_Status)

Representation in ST
Representation:
INTEG_Instance (X:=InputVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=Output, STATUS=>Output_Y_Status) ;

33002543 10/2019 207


INTEG

INTEG parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input variable
MODE Mode_MH Operating mode
PARA Para_INTEG Parameter
YMAN REAL Manually manipulated value

Description of input / output parameters:

Parameter Data type Description


Y REAL Output

Description of output parameters:

Parameter Data type Description


STATUS Stat_MAXMIN Output status

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1" = Manual operating mode
halt BOOL "1" = Halt mode

Parameter description Para_INTEG


Data structure description

Element Data type Description


gain REAL Integral gain (units/second)
ymax REAL Upper limit
ymin REAL Lower limit

208 33002543 10/2019


INTEG

Parameter description Stat_MAXMIN


Data structure description

Element Data type Description


qmin BOOL "1" = Y has reached the lower control limit
qmax BOOL "1" = Y has reached the upper control limit

Runtime error
An error message is returned if
 an invalid floating point number lies at input YMAN or X
 ymax < is ymin

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 209


INTEG

Detailed description

Parametering
The parameter assignments of the function block are satisfied by the determination of the integral
gain and the limiting values ymax and ymin for output Y.
The values ymax and ymin limit the output within the prescribed range. Therefore ymin ≤ Y ≤
ymax
If the threshold value is reached or the output signal is limited this will be indicated by qmax and
qmin.
 qmax = 1 if Y ≥ ymax
 qmin = 1 if Y ≤ ymin

Operating mode
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y. The control output is, however,
limited by ymax and ymin.
Halt 0 1 The output Y will be held at the last calculated
value. The output will no longer be changed, but
can be overwritten by the user.

210 33002543 10/2019


INTEG

Example
The input signal is integrated via the time. If there is a jump on input X the output increases (for
positive X values) or decreases (for negative X values) according to a ramp function. Y is always
between ymax and ymin; if Y is equal to ymax or ymin, this is shown accordingly in qmax or qmin.
Representation of the integrator jump response

33002543 10/2019 211


INTEG

212 33002543 10/2019


EcoStruxure™ Control Expert
LAG
33002543 10/2019

Chapter 22
LAG: Delay element 1st order

LAG: Delay element 1st order

Introduction
This chapter describes the LAG block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 214
Detailed description 217

33002543 10/2019 213


LAG

Description

Function description
The function block represents a delay element 1st Order (low pass)
The function block contains the following operating modes:
 Manual mode
 Halt
 Automatic

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouput may deliver a wrong value.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Formula
The transfer function is:

The formula of calculation is:

Meaning of the sizes

Variable Description
Value of input X from the previous cycle

Value of the output Y from the previous cycle

dt is the time differential between the current cycle and the previous cycle

214 33002543 10/2019


LAG

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL LAG_Instance (X:=InputValue, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=Output)

Representation in ST
Representation:
LAG_Instance (X:=InputValue, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=Output) ;

33002543 10/2019 215


LAG

LAG parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input value
MODE Mode_MH Operating modes
PARA Para_LAG Parameter
YMAN REAL Manually manipulated value

Description of input / output parameters:

Parameter Data type Description


Y REAL Output

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1" = Manual operating mode
halt BOOL "1" = Halt mode

Parameter description Para_LAG


Data structure description

Element Data type Description


gain REAL Gain factor
lag TIME Delayed time constants

Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.

216 33002543 10/2019


LAG

Detailed description

Parametering
Setting parameters for the function block is achieved through specification of the factor gain as
well as setting parameters for the delayed time constant lag.
The unit jump at input X (jump at input X from 0 to 1.0) follows output Y with a delay. Along an e-
function

it will approximate the value .

Operating mode
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y.
Halt 0 1 The output Y will be held at the last calculated
value. The output will no longer be changed, but
can be overwritten by the user.

33002543 10/2019 217


LAG

Example
The diagram shows an example of the jump response of the function block. Input X jumps to a new
value and output Y follows an e-function for input X.
Jump response for function block LAG if gain = 1

218 33002543 10/2019


EcoStruxure™ Control Expert
LAG2
33002543 10/2019

Chapter 23
LAG2: Delay element 2nd order

LAG2: Delay element 2nd order

Introduction
This chapter describes the LAG2 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 220
Detailed description 224
Timing diagrams 225

33002543 10/2019 219


LAG2

Description

Function description
The function block LAG2 represents a delay element 2nd order.
The function block contains the following operating mode:
 Manual mode
 Halt
 Automatic

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouput may deliver a wrong value.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Formula
The transfer function is:

The calculation formula is:

where

220 33002543 10/2019


LAG2

and

Meaning of the sizes

Variable Description
Value of the output Y from the previous cycle

Value of the output Y from the previous cycle

dt is the time differential between the current cycle and the previous cycle

Representation in FBD
Representation:

33002543 10/2019 221


LAG2

Representation in LD
Representation:

Representation in IL
Representation:
CAL LAG2_Instance (X:=Input, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulated_Y_Value,
Y:=Output)

Representation in ST
Representation:
LAG2_Instance (X:=Input, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulated_Y_Value,
Y:=Output) ;

LAG2 parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input value
MODE Mode_MH Operating mode
PARA Para_LAG2 Parameter
YMAN REAL Manual manipulated value for output

222 33002543 10/2019


LAG2

Description of input / output parameters:

Parameter Data type Description


Y REAL Output

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1" = Manual operating mode
halt BOOL "1" = Halt mode

Parameter description Para_LAG2


Data structure description

Element Data type Description


gain REAL Gain factor
dmp REAL Dampening
freq REAL Natural frequency

Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 223


LAG2

Detailed description

Parametering
The parameter assignments of the function block are satisfied by the determination of the factor
gain, and the values for dampening dmp, and natural frequency freq.
Dampening dmp and natural frequency freq must have positive values.
Output Y follows input X jumps in a dampened oscillation. The period of undampened oscillation is
T = 1/freq. For dampening values dmp < 1 reference is made to a dampened oscillation. For
dampening values ≥ 1 reference is made to non-resonant behavior (i.e. without oscillation); in this
case the output follows the input in the same way as with 2 LAG function blocks, which are switched
in series.

Operating modes
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y.
Halt 0 1 The output Y will be held at the last calculated
value. The output will no longer be changed, but
can be overwritten by the user.

224 33002543 10/2019


LAG2

Timing diagrams

Overview
The following diagrams show examples of the LAG2 device’s jump response with varying
parameters.

Dampening dmp = 1
For a dampening of dmp = 1 the output Y follows input X with a non-periodic action.

33002543 10/2019 225


LAG2

Dampening dmp = 0.5


For a dampening of dmp = 0.5 the output Y follows input X with a dampened periodic action.

Dampening dmp = 0.2


For a dampening of dmp = 0.2 it is clear that the jump response is considerably less dampened.

226 33002543 10/2019


EcoStruxure™ Control Expert
LEAD_LAG
33002543 10/2019

Chapter 24
LEAD_LAG: PD device with smoothing

LEAD_LAG: PD device with smoothing

Introduction
This chapter describes the LEAD_LAG block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 228
Detailed description 231
Examples of function blocks LEAD_LAG 232

33002543 10/2019 227


LEAD_LAG

Description

Function description
The function block implements a PD element with following low-pass filter.
The function block has the following properties:
 Definable delay of the D-component
 Operating modes Manual, Halt, Automatic

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouput may deliver a wrong value.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Formula
The transfer function is:

The formula of calculation is:

Meaning of the sizes

Variable Description
Value of input X from the previous cycle

Value of the output Y from the previous cycle

dt is the time differential between the current cycle and the previous cycle

228 33002543 10/2019


LEAD_LAG

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL LEAD_LAG_Instance (X:=Input, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualControlValue, Y:=Output)

Representation in ST
Representation:
LEAD_LAG_Instance (X:=Input, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualControlValue, Y:=Output) ;

33002543 10/2019 229


LEAD_LAG

Parameter description LEAD_LAG


Description of input parameters:

Parameter Data type Description


X REAL Input
MODE Mode_MH Operating mode
PARA Para_LEAD_LAG Parameter
YMAN REAL Manual value manipulated value

Description of input / output parameters:

Parameter Data type Description


Y REAL Output

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1" = Manual operating mode
halt BOOL "1" = Halt mode

Parameter description Para_LEAD_LAG


Data structure description

Element Data type Description


gain REAL Gain factor
lead TIME Derivative time constant
lag TIME Delayed time constants

Runtime error
An error message is returned when an invalid floating point number lies at input YMAN or X.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

230 33002543 10/2019


LEAD_LAG

Detailed description

Parametering
The parameter assignments of the function block are satisfied by the determination of the factor
gain, and the values the derivative time constant lead and delayed time constant lag.
For very small sample times and the unit jump at input X (jump at input X from 0 to 1.0) output Y
will jump to the value (theoretical value - actual slightly smaller, due to the not
infinitely small sample times), using the time constant lag to approximate the value .

Operating modes
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 The function block operates as described in
"Parametering".
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y.
Halt 0 1 The output Y will be held at the last calculated
value. The output will no longer be changed, but
can be overwritten by the user.

33002543 10/2019 231


LEAD_LAG

Examples of function blocks LEAD_LAG

Example overview
The following examples are presented in the following diagrams:
 lead = lag
 lead=lag * 0.5, gain = 1
 lead/lag = 2, gain = 1

lead = lag
The function blocks behave like a pure multiplication block with the multiplier gain.
Function block LEAD_LAG with lead = lag

232 33002543 10/2019


LEAD_LAG

lead=lag * 0.5, gain = 1


The output Y jumps in this case to half the end value in order to run into the end value with the
delayed time constant lag (gain * X).
Function block LEAD_LAG with lead/lag = 0.5 and gain = 1

lead/lag = 2, gain = 1
The output Y jumps in this case to twice the end value in order to run into the end value with the
delayed time constant lag (gain * X).
Function block LEAD_LAG with lead/lag = 2 and gain = 1

33002543 10/2019 233


LEAD_LAG

234 33002543 10/2019


EcoStruxure™ Control Expert
PCON2
33002543 10/2019

Chapter 25
PCON2: Two point controller

PCON2: Two point controller

Introduction
This chapter describes the PCON2 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 236
Detailed description 240

33002543 10/2019 235


PCON2

Description

Function description
The function block forms a two-point controller, which maintains PID-similar behavior through two
dynamic feedback paths.
EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 Operating modes Manual, Halt, Automatic
 Two internal feedback paths (delay 1st Order)

Representation in FBD
Representation:

236 33002543 10/2019


PCON2

Representation in LD
Representation:

Representation in IL
Representation:
CAL PCON2_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulated_ERR_EFF,
Y=>ManipulatedOutput, ERR_EFF=>EffectiveError)

Representation in ST
Representation:
PCON2_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulated_ERR_EFF,
Y=>ManipulatedOutput, ERR_EFF=>EffectiveError) ;

33002543 10/2019 237


PCON2

PCON2 parameter description


Description of input parameters:

Parameter Data type Description


SP REAL Setpoint input
PV REAL Actual value input
MODE Mode_MH Operating mode
PARA Para_PCON2 Parameter
YMAN BOOL "1" = Manual value for ERR_EFF

Description of output parameters:

Parameter Data type Description


Y BOOL "1" = Output manipulated variable
ERR_EFF REAL Effective switch value

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1" = Manual mode
halt BOOL "1" = Halt mode

Parameter description Para_PCON2


Data structure description

Element Data type Description


gain REAL Feedback boost
lag_neg TIME Time constants of the quick feedback
lag_pos TIME Time constants of the slow feedback
hys REAL Hysteresis from two point switch
xf_man REAL Reset value of the feedback in % (0 – 100)

238 33002543 10/2019


PCON2

Runtime error
In the following cases a warning is given:

Causes Behavior of the controller


lag_neg = 0 and lag_pos > 0 The controller works as if it had only a negative
feedback with time constant lag_pos.
lag_pos < lag_neg > 0 The controller works as if it had only a negative
feedback with time constant lag_neg.
xf_man < 0 or xf_man > 100 The controller works without internal feedback paths.

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 239


PCON2

Detailed description

Structure of the controller


Structure of the two-point controller:

Principle of the two-point controller


The actual two-point controller will have 2 dynamic feedback paths (PT1-element) added. Through
appropriate selection of the time constants of the feedback element, the two-point controller
maintains dynamic behavior that corresponds to the behavior of a PID controller.

240 33002543 10/2019


PCON2

Feedback
The feedback parameter set, made up of the feedback gain and the feedback time constants
lag_neg and lag_pos, allows universal usage of the two point controller.
The following table provides more exact information about it:

Feedback lag_neg lag_pos


2-Point-Behavior (without feedback) =0 =0
negative feedback >0 =0
negative + positive feedback >0 > lag_neg
Warning, regeneration (neg. feedback with lag_pos) =0 >0
Warning, regeneration (pos. feedback switched off) > lag_pos >0

Set feedback gain greater than zero!


Enter xf_man (meaning 0% to 100%) values between 0 and 100!

Hysteresis
The parameter hys indicates the switching hysteresis, i.e. the value that the effective switch value
ERR_EFF outgoing from control point hys/2 must be reduced by, before the output Y is reset to"0".
The dependence of the output Y depending of the effective switch value ERR_EFF and the
Parameter hys, becomes clear in the picture Principle of the two-point controller, page 240. The
value of the hys parameter is typically set to 1% of the maximum control area [max. (SP - PV].

Operating modes
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 The function block will be handled as described
above.
Manual mode 1 0 or 1 The output Y is set to the value YMAN. xfl and xf2
are calculated using the following formula:
xf1 = xf_man * gain /100
xf2 = xf_man * gain /100
Halt 0 1 Output Y will be held at the last value.
xf1 and xf2 are set to gain * Y.

33002543 10/2019 241


PCON2

242 33002543 10/2019


EcoStruxure™ Control Expert
PCON3
33002543 10/2019

Chapter 26
PCON3: Three point controller

PCON3: Three point controller

Introduction
This chapter describes the PCON3 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 244
Detailed description 248
Runtime error 251

33002543 10/2019 243


PCON3

Description

Function description
The function block forms a three-point controller, which maintains PID-similar behavior through two
dynamic feedback paths.
EN and ENO can be configured as additional parameters.

Properties
The function block PCON3 contains the following properties:
 Operating modes Manual, Halt, Automatic
 Two internal feedback paths (delay 1st Order)

Representation in FBD
Representation:

244 33002543 10/2019


PCON3

Representation in LD
Representation:

Representation in IL
Representation:
CAL PCON3_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN_POS:=ManManipulated_Y_POS,
YMAN_NEG:=ManManipulated_Y_NEG,
Y_POS=>PosManipulated_ERR_EFF,
Y_NEG=>NegManipulated_ERR_EFF,
ERR_EFF=>EffectiveError)

Representation in ST
Representation:
PCON3_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN_POS:=ManManipulated_Y_POS,
YMAN_NEG:=ManManipulated_Y_NEG,
Y_POS=>PosManipulated_ERR_EFF,
Y_NEG=>NegManipulated_ERR_EFF,
ERR_EFF=>EffectiveError) ;

33002543 10/2019 245


PCON3

PCON3 parameter description


Description of input parameters:

Parameter Data type Description


SP REAL Setpoint input
PV REAL Actual value input
MODE Mode_MH Operating mode
PARA Para_PCON3 Parameter
YMAN_POS BOOL Manual manipulation for Y_POS
YMAN_NEG BOOL Manual manipulation for Y_NEG

Description of output parameters:

Parameter Data type Description


Y_POS BOOL "1" = positive manipulated variable at output
ERR_EFF
Y_NEG BOOL "1" = negative manipulated variable at output
ERR_EFF
ERR_EFF REAL Effective switch value

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1" = Manual mode
halt BOOL "1" = Halt mode

Parameter description Para_PCON3


Data structure description

Element Data type Description


gain REAL Feedback gain (feedback parameter set)
lag_neg TIME Time constant of the quick feedback (Feedback
Parameter Set)
lag_pos TIME Time constant of the slow feedback (Feedback
Parameter Set)
hys REAL Hysteresis from three point switch
db REAL Dead zone
xf_man REAL Reset value of the feedback in % (0 – 100)

246 33002543 10/2019


PCON3

Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 247


PCON3

Detailed description

Structure of the controller


Structure of the three-point controller:

Hence:

If... Then...
Y=1 Y_POS = 1
Y_NEG = 0
Y=0 Y_POS = 0
Y_NEG = 0
Y = -1 Y_POS = 0
Y_NEG = 1

248 33002543 10/2019


PCON3

Principle of the three-point controller


The actual three-point controller will have 2 dynamic feedback paths (PT1-elements) added.
Through appropriate selection of the time constants of the feedback-element, the three-point
controller maintains dynamic behavior that corresponds to the behavior of a PID controller.

Feedback
The function block has a parameter sequence for the internal feedback paths, comprised of the
feedback gain and the reset time constant lag_neg and lag_pos.
The following table provides more exact information about it:

Feedback lag_neg lag_pos


3-Point-Behavior (without feedback) =0 =0
negative feedback >0 =0
negative + positive feedback >0 > lag_neg
Warning, regeneration (neg. feedback with lag_pos) =0 >0
Warning, regeneration (pos. feedback switched off) > lag_pos >0

The parameter gain must be > 0


The amount will be resolved from the Hysterisis hys and the dead zone db!
For xf_man (meaning -100 to 100%) values between -100 and 100 are to be entered!

Dead zone
The parameter db sets the connection point for the outputs Y_POS and Y_NEG. If the effective
switch value ERR_EFF is positive and is greater than db, then the output Y_POS will switch from
"0" to "1". If the effective switch value ERR_EFF is negative and is smaller than db, then the output
Y_NEG will switch from "0" to "1". The value of the db parameter is typically set to 1% of the
maximum control area (max. SP - PV).

33002543 10/2019 249


PCON3

Hysteresis
The parameter hys indicates the switching hysteresis, i.e. the value which the effective switch
value ERR_EFF outgoing from control point db must be reduced, before the output Y_POS (Y_NEG)
is reset to "0". The connection between Y_POS and Y_NEG depending on effective switch value
ERR_EFF and the parameters db and hys is illustrated in the image Principle of the three-point
controller, page 249. The value of the hys parameter is typically set to 0.5% of the maximum
control area (max. SP - PV).

Operating modes
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 The function block will be handled as described
above.
Manual mode 1 0 or 1 The outputs Y_POS and Y_NEG are set to the
values YMAN_POS and YMAN_NEG. In this case,
the built in priority logic - Y_NEG is dominant
over Y_POS, which prohibits both outputs from
being set simultaneously.
xf1 and xf2 are calculated using the following
formula:
xf1 = xf_man * gain /100
xf2 = xf_man * gain /100
Halt 0 1 In Halt mode, both outputs Y_POS and Y_NEG
will be held at the last value.
xf1 and xf2 are set to gain * Y.

250 33002543 10/2019


PCON3

Runtime error

Error message
If hys > 2 * db, an error message appears.

Warning
In the following cases a warning is given:

Causes Behavior of the controller


lag_neg = 0 and lag_pos > 0 The controller works as if it had only a negative
feedback with time constant lag_pos.
lag_pos < lag_neg > 0 The controller works as if it had only a negative
feedback with time constant lag_neg.
xf_man < 0 or xf_man > 100 The controller works without internal feedback paths.

33002543 10/2019 251


PCON3

252 33002543 10/2019


EcoStruxure™ Control Expert
PD_OR_PI
33002543 10/2019

Chapter 27
PD_OR_PI: Structure changeover PD/PI controller

PD_OR_PI: Structure changeover PD/PI controller

Introduction
This chapter describes the PD_OR_PI block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 254
Structure diagram for the function block PD_OR_PI 259
Detailed description 260
Detailed formulas 263

33002543 10/2019 253


PD_OR_PI

Description

Function description
The function block PD_OR_PI can work equally well as either PD controller or PI controller.
Depending on the system deviation (SP - PV) and a specified switch value, trig_err will
automatically perform a structural changeover from PD- to PI-Controller and vice-versa from PI- to
PD-Controller.
This EFB is particularly suitable for starting control purposes. When the process is started, the
controller reacts as a P(D) controller, whereby the controlled variable is to reach the adjusted
reference variable value as fast as possible. Shortly before the given setpoint value is reached, the
control algorithm is switched over and an I component makes sure that the remaining control
deviation fades out.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 PI controller with independent gain, ti adjustment
 PD controller with independent gain, ti adjustment
 Manipulated variable limiting in automatic mode
 Anti-windup reset in PI operation
 definable delay of the D component
 Operating modes Manual, Halt, Automatic
 bumpless changeover between manual and automatic
 Automatic bumpless changeover from PD to PI operation and back

254 33002543 10/2019


PD_OR_PI

The PI controller transfer function


The PI controller transfer function is:

The PD controller transfer function


The PD controller transfer function is:

Representation in FBD
Representation:

33002543 10/2019 255


PD_OR_PI

Representation in LD
Representation:

Representation in IL
Representation:
CAL PD_OR_PI_Instance (SP:=SetpointInput,
PV:=ProcessVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedVariable,
FEED_FWD:=Disturbance, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y)

Representation in ST
Representation:
PD_OR_PI_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulatedVariable,
FEED_FWD:=Disturbance, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y) ;

256 33002543 10/2019


PD_OR_PI

Parameter description PD_OR_PI


Description of input parameters:

Parameter Data type Description


SP REAL Setpoint input (reference variable)
PV REAL Process variable (controlled variable)
MODE Mode_MH Operating mode
PARA Para_PD_or_PI Parameter
YMAN REAL Manual manipulated variable
FEED_FWD REAL Disturbance variable

Description of input / output parameters:

Parameter Data type Description


Y REAL Manipulated variable

Description of output parameters:

Parameter Data type Description


ERR REAL System deviation
STATUS Stat_MAXMIN Output status

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1": Manual mode
halt BOOL "1": Halt mode

33002543 10/2019 257


PD_OR_PI

Parameter description Para_PD_PI


Data structure description

Element Data type Description


trig_err REAL Changeover switching value for PDPI controller
gain_d REAL PD controller proportional action coefficient (gain)
td TIME PD controller rate time
td_lag TIME Delay of the PD controller rate time
gain_i REAL PI controller proportional action coefficient (gain)
ti TIME PI controller reset time
ymax REAL Upper limit
ymin REAL Lower limit

Parameter description Stat_MAXMIN


Data structure description

Element Data type Description


qmax BOOL "1" = Y has reached the upper control limit
qmin BOOL "1" = Y has reached the lower control limit

Runtime error
An error message is returned if
 an unauthorized floating point number is placed at the input PV
 ymax < is ymin

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

258 33002543 10/2019


PD_OR_PI

Structure diagram for the function block PD_OR_PI

Structure diagram
The following is the structure diagram of the PD_OR_PI block:

33002543 10/2019 259


PD_OR_PI

Detailed description

Determination of switching value


Setting parameters for the function block begins with the determination of switching value
trig_err. This parameter determines when the function block is automatically changed from PD
to PI operation.
When the absolute value of system deviation ERR = SP - PV is smaller than the switching value
trig_err, the controller switches automatically from PD operation into PI operation.
When the system deviation ERR is larger than the switching value trig_err, the controller
switches automatically form PI operation into PD operation.
It then follows that:
 PD controller: ERR > trig_err
 PI controller: ERR ≤ trig_err

Each controller type is linked to a parameter set, which must be configured as well. The control
algorithm changeover is practically a switch from one parameter set to the other. The changeover
is bumpless.

PD controller
PD controller parameter settings are accomplished by configuration of the proportional action
coefficient gain_d and rate time td.
For PD controller operation the D component is delayed by the time constant value td_lag. The
td/td_lag ratio is termed the differential gain, and is generally selected between 3 and 10. The
D component directly determined by the system deviation ERR, such that for reference variable
fluctuations (variations at input SP) a jump attributed to the D component is produced.
The D component can be disabled by setting td = 0.

PI controller
PI controller parameter settings are accomplished by configuration of the proportional action
coefficient gain_i and reset time ti.
In general during the start-up procedure with the PD algorithm, the proportional action coefficient
is set considerably higher than in the practically stationary operation with the PI algorithm. This
circumstance is conceded to by the designation of two independent proportional action
coefficients.
The I component can be disabled by setting ti = 0.

260 33002543 10/2019


PD_OR_PI

Manipulated variable limiting


The limits ymax and ymin retain the manipulated variable within the prescribed range.
It therefore holds that: ymin ≤ Y ≤ ymax
The outputs qmax and qmin signal that the manipulated variable has reached a limit, and thus
been limited:
 qmax = 1, if Y ≥ ymax
 qmin = 1, if Y ≤ ymin

For limiting the manipulated variable, the upper limit ymax should be greater than the lower limit
ymin.

Anti-windup reset
Should limiting of the manipulated variable take place while the PI control algorithm is active, the
anti-windup reset should ensure that the I component "cannot go berserk". Anti-windup measures
are taken only for I component values other than 0. Anti-windup limits are identical to those for the
manipulated variable.
The anti-windup reset measure corrects the I component such that:
 YI ≥ ymin - gain_i * (SP - PV) - FEED_FWD
 YI ≤ ymax - gain_i * (SP - PV) - FEED_FWD

33002543 10/2019 261


PD_OR_PI

Operating modes
There are three operating mode selectable through the man and halt parameter inputs:

Operating mode man halt Meaning


Automatic 0 0 The manipulated variable output Y is
determined through the discrete PI or PD
closed-loop control algorithms, based on the
controlled variable PV and reference variable
SP. The manipulated variable is limited by ymax
and ymin. The controller output limits also
serve as limits for the antiwindup reset.
Manual mode 1 0 or 1 The manual manipulated value YMAN is passed
on directly to the manipulated variable Y. The
manipulated variable is limited by ymax and
ymin. Internal variables will be so manipulated,
that the controller changeover from manual to
automatic can be bumpless.
Halt 0 1 The manipulated variable remains unchanged,
the block does not influence the manipulated
variable Y. Internal variables will be
manipulated in such a manner that the
controller can be driven smoothly from it's
current position. Manipulated variable limits and
antiwindup measures are as those in automatic
mode Halt mode is also useful in allowing an
external operator device to adjust control output
Y, whereby the controller's internal components
are given the chance to continuously react to
the external influence.

262 33002543 10/2019


PD_OR_PI

Detailed formulas

Explanation of formula variables


Meaning of the variables in the following formulas:

Variable Meaning
Present sample time

System deviation

System deviation value from the previous sampling step

FEED_FWD Disturbance variable


Y Current output (halt mode) or YMAN (manual mode)
YD D component
Value of the D-component from the previous sampling step

YI I component
Value of the I component from the previous sampling step

YP P component

System deviation
The system deviation will be determined as follows:

Manipulated variable
The manipulated variable consists of various terms which are dependent on the operating mode:

After summation of the components manipulated variable limiting takes place, so that:

33002543 10/2019 263


PD_OR_PI

Overview of the calculation of the control components


Following this an overview on the different calculations of the control components in relation to the
elements trig_err can be found:

Controller type Controller components


PI controller (ERR ≤ trig_err) YP and YD for manual, halt and automatic modes
YI for automatic operating mode
YI for manual and halt operating mode
PD controller (ERR> trig_err ) YP and YI for manual, halt and automatic modes
YD for automatic mode
YD for manual and halt operating mode

PI controller: YP and YD for all operating mode


YP and YD for manual, halt, automatic and cascade modes are located as follows:

PI controller: I component for automatic mode


YI for automatic mode is determined as follows (ti > 0):

The I component is formed according to the trapezoid rule.

PI controller: I component YI for manual and halt modes


YI for manual and halt are located as follows

PD controller: YP and YI for all modes


YP and YI for manual, halt, and automatic modes are determined as follows

264 33002543 10/2019


PD_OR_PI

PD controller: D component for automatic mode


YD for automatic mode is determined as follows:

PD controller: D component for manual and halt operating mode


YD for manual, halt and automatic modes is determined as follows:

33002543 10/2019 265


PD_OR_PI

266 33002543 10/2019


EcoStruxure™ Control Expert
PDM
33002543 10/2019

Chapter 28
PDM: Pulse duration modulation

PDM: Pulse duration modulation

Introduction
This chapter describes the PDM block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 268
Detailed description 272

33002543 10/2019 267


PDM

Description

Using the block


Actuators are driven not only by analog quantities, but also through binary actuating signals. The
conversion of analog values into binary output signals is achieved for example, through pulse width
modulation (PWM) or pulse duration modulation (PDM).
The actuator adjusted average energy (actuator energy) should be in accord with the modulation
block's analog input value (IN).

Function description
The function block PDM converts analog values into digital output signals.
In the function block PDM, a 1 signal of constant duration is output within a variable cycle time which
depends on the analog value X. The adjusted average energy corresponds to the quotient of the
fixed duty cycle t_on and the variable cycle time period.
In order that the adjusted average energy also corresponds to the analog input variable IN, the
following must apply:

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

268 33002543 10/2019


PDM

General information about the actuator drive


In general, the binary actuator drive is performed by two Boolean signals Y_POS and Y_NEG. On a
motor the output Y_POS corresponds to the signal "clockwise rotation" and the output Y_NEG the
signal "counter-clockwise rotation". For an oven the outputs Y_POS and Y_NEG could be
interpreted as corresponding to "heating" and "cooling".
Should the actuating drive in question be a motor, it is possible that to avoid overtravel for non-self-
locking gearboxes, a brake pulse must be output after the engage signal.
In order to protect the power electronics, there must be a pause time t_pause after switching on
t_on and before the brake pulse t_brake so as to avoid short circuits.

Formula
For correct operation when setting parameters the following rules should be observed:

and

Representation in FBD
Representation:

33002543 10/2019 269


PDM

Representation in LD
Representation:

Representation in IL
Representation:
CAL PDM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameter, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput)

Representation in ST
Representation:
PDM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameter, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput) ;

PDM parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input variable
R BOOL Reset mode
PARA Para_PDM Parameter

Description of output parameters:

Parameter Data type Description


Y_POS BOOL Output for positive X values
Y_NEG BOOL Negative X value output

270 33002543 10/2019


PDM

Parameter description Para_PDM


Data structure description

Element Data type Description


t_on TIME Pulse duration (in s)
t_pause TIME Pause time (in s)
t_brake TIME Braking time (in s)
pos_up_x REAL Upper limit for positive X
pos_t_min TIME Minimum cycle time for Y_POS (where x = pos_up_x)
(in s)
pos_lo_x REAL Lower limit for positive X
pos_t_max TIME Maximum cycle time for Y_POS (where x = pos_lo_x)
(in s)
neg_up_x REAL Upper limit for negative X
neg_t_min TIME Minimum cycle time for Y_NEG (where x = -neg_up_x)
(in s)
neg_lo_x REAL Lower limit for negative X
neg_t_max TIME Maximum cycle time for Y_NEG (where x = -neg_lo_x)
(in s)

Runtime error
An error message is returned if
 |up_x| ≤ |lo_x|
 t_max ≤ t_min

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 271


PDM

Detailed description

Block mode of operation


The pulse duration t_on determines the time span in which the output Y_POS resp. Y_NEG has 1
signal. For a positive input signal X the output Y_POS is set, for a negative input signal X the output
Y_NEG is set. Only one output can carry 1 signal. It is advisable to perform a freely definable pause
time of t_pause = 10 or 20 ms between the actuating and brake pulses to protect the power
electronics (hopefully preventing simultaneous firing of the antiparallel connected thyristors).
A possible brake pulse of duration time t_brake follows the output pulse duration after a pause
time t_pause. Within the pause time both outputs carry 0 signals. During the braking time the
output opposite that carrying the previous pulse goes to 1 signal. A pause time of t_pause = 20
ms (t_pause =0.02) corresponds to an interruption of the firing angle control for two half waves.
That should guarantee a sufficiently large safety margin for the prevention of short-circuits resp.
triggering of the suppressor circuitry as a consequence of antiparallel thyristors firing.
Thereafter follows a period in which both outputs carry 0 signal (delay).

Period

This delay, together with the pulse, pause and brake times, all makeup a period , which
depending on lo_x and t_min, is calculated according to the following formulas:

Requirements Equation Explanation of formula variables


lo_x <> 0

lo_x = 0
t_min > 0

lo_x = 0
t_min = 0

272 33002543 10/2019


PDM

The following holds for all three cases:

Requirements lo_x up_x t_min t_max


pos_lo_x pos_up_x pos_t_min pos_t_max

neg_lo_x neg_up_x neg_t_min neg_t_max

NOTE: From the parameters up_x (-pos/-neg) and lo_x (-pos/-neg) only the (absolute) value is
evaluated.

Cycle time
The parameter t_min - for every output there is a separate value - gives the minimum period, i.e.
the time span, which passes from the beginning of one actuating pulse until the start of the next.
This time span appears when input X goes beyond value up_x - this time there is a separate value
for each sign.
The parameter t_max places an upper limit on the maximum period. Should the input cross below
the value pos_lo_x or neg_lo_x, the actuating pulse output is terminated until the until the input
exceeds the value pos_lo_x or neg_lo_x again. The values pos_lo_x and neg_lo_x define
what is in principle a dead zone, in which the function block outputs are not activated.
The parameters (pos_t_min, pos_up_x) and (pos_t_max, pos_lo_x) are valid for positive
input signals X. The output Y_POS is set. The parameters Parameter (neg_t_min, neg_up_x)
and (neg_t_max, neg_lo_x) are valid for negative input signals X. The output Y_NEG is set.

33002543 10/2019 273


PDM

Time ratio display


An overview of the ratio between times is shown in the following diagram:

Time-span dependency
The time-span dependency from the input variable X, in which the output Y_POS (Y_NEG) carries
1 signal, is displayed in the picture "Output dependency on X, page 275" and the picture "Output
dependency on X (Special case), page 276".

274 33002543 10/2019


PDM

Output dependency on X
In the following picture the dependency of the output on X is shown:

33002543 10/2019 275


PDM

Output dependency on X (Special case)


In the following picture the special case t_min = 0, lo_x = 0 is shown:

Operating modes
In reset mode R = "1", outputs Y_POS and Y_NEG are set to 0 signal. The internal time meters are
also standardized, so that the function block begins the transfer to R=0 with the output of a new 1
signal on the associated output.

Boundary conditions
If the PDM function block is operated together with a PID controller, then the maximum period
t_max should be selected so that it corresponds to the PID controller's scan time. It is then
guaranteed that every new actuating signal from the PID controller within the period time can be
fully processed.
The PDM scan time t_scan should be in proportion with the period vs. pulse time. Though this, the
smallest possible actuating pulse is be determined.
The following ratio is recommended:

276 33002543 10/2019


EcoStruxure™ Control Expert
PI
33002543 10/2019

Chapter 29
PI: PI controller

PI: PI controller

Introduction
This chapter describes the PI block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 278
Formulas 282
Parametering 283
Operating modes 285
Example of a PI controller 286

33002543 10/2019 277


PI

Description

Function description
The function block represents a simple PI controller.
A system deviation ERR is formed by the difference between the reference variable SP and the
controlled variable PV. This deviation ERR causes the manipulated variable Y to change.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 Operating modes Manual, Halt, Automatic
 bumpless changeover between manual and automatic
 Manipulated variable limiting
 Anti-windup reset (only for an active I component)

Representation in FBD
Representation:

278 33002543 10/2019


PI

Representation in LD
Representation:

Representation in IL
Representation:
CAL PI_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulatedVariable, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y)

Representation in ST
Representation:
PI_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulatedVariable, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y) ;

33002543 10/2019 279


PI

PI parameter description
Description of input parameters:

Parameter Data type Description


SP REAL Setpoint input / reference variable
PV REAL Process variable / controlled variable
MODE Mode_MH Operating mode
PARA Para_PI Parameter
YMAN REAL Manual value

Description of input / output parameters:

Parameter Data type Description


Y REAL Manipulated variable

Description of output parameters:

Parameter Data type Description


ERR REAL System deviation
STATUS Stat_MAXMIN Y output status

Parameter description Mode_MH


Data structure description

Element Data type Description


man BOOL "1": Manual mode
halt BOOL "1": Halt mode

Parameter description Para_PI


Data structure description

Element Data type Description


gain REAL Proportional action coefficient (gain)
ti TIME Integral time
ymax REAL Upper limit
ymin REAL Lower limit

280 33002543 10/2019


PI

Parameter description Stat_MAXMIN


Data structure description

Element Data type Description


qmax BOOL "1" = Y has reached the upper control limit
qmin BOOL "1" = Y has reached the lower control limit

Runtime error
An error message is returned if
 an invalid floating point number lies at input YMAN or X,
 ymax < ymin.

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 281


PI

Formulas

Transfer function
The transfer function is:

Calculation formulas
The calculation formulas are:

Output signal Y
The output signal Y is then:

The I component is formed according to the trapezoid rule.

Explanation of formula variables


The meaning of the formula variables is given in the following table:

Variable Meaning
Present sample time

System deviation (SP - PV)

System deviation value from the previous sampling step

YI I component
YP P component

282 33002543 10/2019


PI

Parametering

Structure diagram
The following is the structure diagram of the PI controller:

Parametering
The PI control structure is displayed in theStructure diagram, page 283. Setting parameters for the
function block takes place first of all for the elemental PI parameters: the proportional action
coefficient gain and reset time ti.
The I component can be disabled by setting ti = 0.
The values ymax and ymin limit the output within the prescribed range. Therefore ymin ≤ Y ≤
ymax.
The outputs qmax and qmin signal that the output has reached a limit, and thus been capped.
 qmax = 1 if Y ≥ ymax
 qmin = 1 if Y ≤ ymin

Manipulated variable limiting


After summation of the components manipulated variable limiting takes place, so that: ymin ≤ Y
≤ ymax

33002543 10/2019 283


PI

Anti-windup reset
Should limiting of the manipulated variable take place, the antiwindup reset should ensure that the
integral component "cannot go berserk". The antiwindup measure is only implemented if the I
component of the controller is not disabled. Anti-windup limits are identical to those for the
manipulated variable. The anti-windup-reset measure corrects the I component such that: ymin -
YP ≤ YI ≤ ymax - YP

284 33002543 10/2019


PI

Operating modes

Selecting the operating modes


There are three operating mode selectable through the man and halt parameter inputs.

Operating mode man halt


Automatic 0 0
Manual mode 1 1 or 0
Halt 0 1

Automatic operating mode


In automatic mode the control output Y is determined through the closed-loop control based on the
controlled variable PV and reference variable SP. The manipulated variable is limited by ymax and
ymin. The control limits are also limits for the Anti-windup reset.
The changeover from automatic to manual is normally not bumpless, since output Y can take on
any value between ymax and ymin, and Y goes directly to YMAN at the changeover.
If the changeover from automatic to manual is to be bumpless in spite of these problems, there are
two exemplary possibilities shown for a PID controller (see page 296).

Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the control output
Y. However, the manipulated variable is limited by ymax and ymin. Internal variables will be
manipulated in such a manner that the controller changeover from manual to automatic (with I
component enabled) can be bumpless. The control limits are also limits for the Anti-windup reset

Halt mode
In halt mode the control output remains unchanged; the function block does not influence the
control output Y, i.e. Y = Y(old). Internal variables will be manipulated in such a manner that the
component sum corresponds with the manipulated variable, thus allowing the controller to be
driven smoothly from its current position. The control limits are also limits for the Anti-windup reset.
Halt mode is also useful in allowing an external operator device to adjust control output Y, whereby
the controller's internal components are given the chance to continuously react to the external
influence.

33002543 10/2019 285


PI

Example of a PI controller

Example
The jump response of the PI controller is shown in the following Diagram (see page 286) as an
example.
In the first part of the figure the function block response to MAN operating mode can be seen: The
output Y jumps to the YMAN value.
The second part of the diagram shows the reaction of the function block in automatic mode (MAN
= 0 and HALT= 0) both with a positive ERR system deviation and with a negative ERR system
deviation. For constant positive system deviation, Y ramps upward until the upper output limit is
reached.
Y is then limited to the value ymax. Limiting is signaled by qmax. The system deviation then jumps
to a negative value whose absolute value is greater than the previous positive value.
The input jumps to the value ); through the P component, then there
is a ramp decrease in Y. The absolute value of the gradient is greater than under the previous
positive system deviation. This can be attributed to the now greater absolute value of the system
deviation.

PI controller jump response


Presentation of the jump response of the PI controller

286 33002543 10/2019


EcoStruxure™ Control Expert
PID
33002543 10/2019

Chapter 30
PID: PID controller

PID: PID controller

Introduction
This chapter describes the PID block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 288
PID function block structure diagram 293
Setting parameters for the PID controller 294
Operating modes 296
Detailed formulas 298

33002543 10/2019 287


PID

Description

Function description
The function block produces a PID controller.

Initialization Requirements
This function block performs an internal initialization in the first program cycle after a warm start or
cold start (e.g. application download or power cycle) of the PLC program.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.


For the proportional part of the controller to behave properly, the integral action must be reset (the
input coefficient en_i set to zero) for at least one scan time after a warm start or cold start.
If the integral action coefficient en_i is set to a non-zero value at initialization, the function block
behaves like an I or ID controller with no proportional part.

Properties
The function block has the following properties:
 real PID controller with independent gain, ti, td setting
 Operating modes Manual, Halt, Automatic
 bumpless changeover between manual and automatic
 Manipulated variable limiting in automatic mode
 Separately enabled P, I and D component
 Anti-Windup-Reset
 Anti-windup measures taken only for an active I component
 definable delay of the D component
 D component connectable to controlled variable PV or system deviation ERR

288 33002543 10/2019


PID

Transfer function
The transfer function is:

Explanation of the variables:

Variable Description
YD D component (only when en_d = 1)
YI I component (only when en_i= 1)
YP P component (only when en_p= 1)

Representation in FBD
Representation:

33002543 10/2019 289


PID

Representation in LD
Representation:

Representation in IL
Representation:
CAL PID_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, MODE:=OperatingModes,
PARA:=Parameter, FEED_FWD:=Disturbance,
YMAN:=ManualManipulatedValue, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y)

Representation in ST
Representation:
PID_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, MODE:=OperatingModes,
PARA:=Parameter, FEED_FWD:=Disturbance,
YMAN:=ManualManipulatedValue, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y) ;

290 33002543 10/2019


PID

PID parameter description


Description of input parameters:

Parameter Data type Description


SP REAL Reference variable
PV REAL Controlled variable
MODE Mode_PID Operating mode
PARA Para_PID Parameter
FEED_FWD REAL Disturbance variable
YMAN REAL Manually manipulated value

Description of input / output parameters:

Parameter Data type Description


Y REAL Manipulated variable

Description of output parameters:

Parameter Data type Description


ERR REAL System deviation
STATUS Stat_MAXMIN Y output status

Parameter description Mode_PID


Data structure description

Element Data type Description


man BOOL "1": Manual mode
halt BOOL "1": Halt mode
en_p BOOL "1": P component on
en_i1 BOOL "1": I component on
en_d BOOL "1": D component on
d_on_pv BOOL "1": D component in relation to the controlled
variable
"0": D component in relation to the system deviation

1Refer to Initialization Requirements (see page 288).

33002543 10/2019 291


PID

Parameter description Para_PID


Data structure description

Element Data type Description


gain REAL Proportional action coefficient (gain)
ti TIME Integral time
td TIME Derivative time
td_lag TIME Delay of the D component
ymax REAL Upper limit
ymin REAL Lower limit

Parameter description Stat_MAXMIN


Data structure description

Element Data type Description


qmax BOOL "1" = Y has reached the upper control limit
qmin BOOL "1" = Y has reached the lower control limit

Error message
An error message is returned if
 an invalid floating point number lies at input YMAN or PV
 ymax < ymin

NOTE: For a list of all block error codes and values, see Tables of Error Codes for the Obsolete
Library (see page 616).

292 33002543 10/2019


PID

PID function block structure diagram

Structure diagram
The following is the structure diagram of the PID block:

33002543 10/2019 293


PID

Setting parameters for the PID controller

Parametering
The PID control structure is displayed in Structure diagram, page 293.
Setting function block parameters is initially performed by the pure PID parameters, i.e. the
proportional action coefficient gain, the reset time ti and the rate time td.
The D component is delayed by the time td_lag. The td/td_lag ratio is termed the differential
gain, and is generally selected between 3 and 10. The D component can either be based upon the
system deviation ERR (d_on_pv = "0") or the controlled variable PV (d_on_pv = "1"). Should the
D component be determined by the controlled variable PV, then the D component will not be able
to cause jumps when reference variable fluctuations (changes in input SP) take place. In principle
the D component only influences disturbances and process changes.

Control direction reversal


A reversed behavior of the controller can be achieved by reversing the sign of gain. A positive
value on gain causes the increase of the output value, for a positive error variable. A negative
value on gain causes the increase of the output value, for a positive error variable.

Manipulated variable limiting


The limits ymax and ymin limit the output within the prescribed range. Therefore ymin ≤ Y ≤
ymax.
The outputs qmax and qmin signal that the limit value has been reached, i.e. that the output signal
is limited.
 qmax = 1 if Y ≥ ymax
 qmin = 1 if Y ≤ ymin

The upper limit ymax for limiting the manipulated variable must be greater than the lower limit
ymin, otherwise the function block reports an error and does not function.

Anti-windup reset
Should limiting of the manipulated variable take place, the anti-windup reset should ensure that the
I component "cannot go berserk". Anti-windup measures are only taken if the controller I
component is not switched off. Anti-windup limits are identical to those for the manipulated
variable. The anti-windup measures disregard D component values, to avoid being falsely
triggered by D component peaks.
The anti-windup measures correct the I component in such a way that:

294 33002543 10/2019


PID

Selecting the control types


There are four different control types, which are selected via the elements en_p, en_i and en_d:

Controller type en_p en_i en_d


P controller 1 0 0
PI controller 1 1 0
PD controller 1 0 1
PID controller 1 1 1
I controller 0 1 0

The I component can also be disabled with ti = 0.

33002543 10/2019 295


PID

Operating modes

Selecting the operating modes


There are three operating mode selectable through the man and halt elements:

Operating mode man halt


Automatic 0 0
Manual mode 1 0 or 1
Halt 0 1

Automatic operating mode


In automatic mode, the manipulated variable Y is determined through the discrete PID closed-loop
control algorithm subject to controlled variable PV and reference variable SP. The manipulated
variable is limited by ymax and ymin. The control limits are also limits for the Anti-windup reset.

Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the manipulated
variable Y. However, the manipulated variable is limited by ymax and ymin. Internal variables will
be manipulated in such a manner that the controller changeover from manual to automatic (with I
component enabled) can be bumpless. The control limits are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.

Halt mode
In halt mode the control output remains unchanged; the function block does not influence the
manipulated variable Y, i.e. Y = Y(old). The internal sizes are tracked in such a way that the
controller (on connecting to the I component) bumplessly proceeds from its current position. The
control limits are also limits for the Anti-windup reset. The halt operating mode is also useful for
setting the control output Y via an external operator device, whereby the internal components are
tracked correctly in the controller.
In this operating mode the D component is automatically set to 0.

Switching from automatic to manual


The changeover from automatic to manual is normally not bumpless, since output Y can take on
any value between ymax and ymin, and Y goes directly to YMAN at the changeover.
There are two possibilities if, nevertheless, a bumpless changeover from automatic to manual is
required:
 Switching with the help of the MOVE function
 Switching with the help of the function block increase limit VLIM

296 33002543 10/2019


PID

Switching via MOVE


Using function MOVE set the value of YMAN to the value of Y:

The MOVE function is only performed when the PID controller is in automatic mode (Mode.man =
0). If only one changeover from automatic to manual takes place it is bumpless, as the value of
YMAN is equal to the value of Y in this cycle. In the manual mode the value of YMAN can slowly be
changed.

Switching via VLIM


If you do not want to change YMAN, e.g. because it is a constant, then the previous solution can be
implemented using a velocity limiter (function block VLIM):

In automatic mode (MPID.man = 0) the velocity limiter is in manual mode (MOVE function). That way
the PID controller manual value (YMAN from PID) can be set to the Y value of the PID controller
via the velocity limiter manual value (YMAN from VLIM). If only one changeover from automatic to
manual takes place, it is bumpless, as the value of YMAN (of the PID) is equal to the value of Y (of
the PID) in this cycle. The PID controller YMAN value, starting at your adjustment value (Para.rate),
are compared with the actual manual value (on VLIM) beginning with the next cycle.

33002543 10/2019 297


PID

Detailed formulas

Explanation of formula variables


Meaning of the variables in the following formulas:

Variable Meaning
is the time differential between the current cycle and the previous cycle

System deviation (SP - PV)

System deviation value from the current sampling step

System deviation value from the previous sampling step

FEED_FWD Disturbance variable


Value of controlled variable from the current sampling step

Value of controlled variable from the previous sampling step

Y current output (halt mode) or YMAN (manual mode)


YD D component
YI I component
YP P component

Manipulated variable
The manipulated variable consists of various terms which are dependent on the operating mode:

After summation of the components manipulated variable limiting takes place, so that:

Overview of the calculation of the control components


The following is an overview on the different calculations of the control components in relation to
the elements en_p, en_i and en_d:
 P component YP for manual, Halt and automatic mode
 I component YI for automatic mode
 I component YI for manual and halt modes
 D component YD for automatic mode
 D component YD for manual and halt modes

298 33002543 10/2019


PID

P component YP for all operating mode


YP for manual, Halt and automatic are located as follows
For en_p = 1 the following applies:

For en_p = 0 the following applies:

I component YI for automatic mode


YI for automatic mode is determined as follows:
For en_i = 1 the following applies:

For en_i = 0 the following applies:

The I component is formed according to the trapezoid rule.

I component YI for manual and halt modes


YI for manual, halt and automatic modes is determined as follows:
For en_i = 1 the following applies:

For en_i = 0 the following applies:

33002543 10/2019 299


PID

D component YD for automatic mode


YD for automatic mode and cascade is determined as follows:
For en_d = 1 and d_on_pv = 0 the following applies:

For en_d = 1 and d_on_pv = 1 the following applies:

For en_d = 0 the following applies:

D component YD for manual and halt modes


YD for manual, halt and automatic modes is determined as follows:
YD = 0

300 33002543 10/2019


EcoStruxure™ Control Expert
PID_P
33002543 10/2019

Chapter 31
PID_P: PID controller with parallel structure

PID_P: PID controller with parallel structure

Introduction
This chapter describes the PID_P block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 302
Setting parameters for the PID_P controller 307
Operating modes 309
Detailed formulas 310

33002543 10/2019 301


PID_P

Description

Function description
The function block replicates a PID controller in parallel structure.
A system deviation ERR is formed by the difference between the reference variable SP and the
controlled variable PV. The deviation ERR causes the manipulated variable Y to change.

Initialization Requirements
This function block performs an internal initialization in the first program cycle after a warm start or
cold start (e.g. application download or power cycle) of the PLC program.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.


For the proportional part of the controller to behave properly, the integral action must be reset (the
input coefficient KI set to zero) for at least one scan time after a warm start or cold start.
If the integral action coefficient KI is set to a non-zero value at initialization, the function block
behaves like an I or ID controller with no proportional part.

Properties
The function block has the following properties:
 PID controller in pure parallel structure
 Independent gains for P-. I and D component
 Each component P, I and D can be individually enabled
 Limiting control limits in automatic mode
 Anti-windup measure with an active I component only
 Anti-windup reset
 Operating modes Manual, Halt, Automatic
 bumpless changeover between manual and automatic
 D component connectable to input variable PV or system deviation ERR
 D component with variable delay

302 33002543 10/2019


PID_P

Transfer function
The transfer function is:

Explanation of the variables:

Variable Description
YD D component
YI I component
YP P component

Representation in FBD
Representation:

33002543 10/2019 303


PID_P

Representation in LD
Representation:

Representation in IL
Representation:
CAL PID_P_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualValue,
FEED_FWD:=Disturbance, Y:=ManipulatedVariable,
ERR=>OutputSystemDeviation, STATUS=>StatusOfOutput_Y)

Representation in ST
Representation:
PID_P_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualValue,
FEED_FWD:=Disturbance, Y:=ManipulatedVariable,
ERR=>OutputSystemDeviation, STATUS=>StatusOfOutput_Y) ;

304 33002543 10/2019


PID_P

Parameter description PID_P


Description of input parameters:

Parameter Data type Description


SP REAL Reference variable
PV REAL Controlled variable
MODE Mode_PID_P Operating mode
PARA Para_PID_P Parameter
YMAN REAL Manually manipulated value
FEED_FWD REAL Disturbance input

Description of input / output parameters:

Parameter Data type Description


Y REAL Manipulated variable

Description of output parameters:

Parameter Data type Description


ERR REAL System deviation
STATUS Stat_MAXMIN Y output status

Parameter description Mode_PID_P


Data structure description

Element Data type Description


man BOOL "1": Manual mode
halt BOOL "1": Halt mode
d_on_pv BOOL "1": D component in relation to the controlled
variable
"0": D component in relation to the system deviation
reverse BOOL "1": Output reversed

33002543 10/2019 305


PID_P

Parameter description Para_PID_P


Data structure description

Element Data type Description


kp REAL Proportional action coefficient (gain = P component)
ki 1 REAL Integral action coefficient (gain = I component) [1/s]
kd REAL Rate of differentiation (gain = D component) [s]
td_lag TIME Delay, D component
ymax REAL Upper limit
ymin REAL Lower limit

1
Refer to Initialization Requirements (see page 302).

Parameter description Stat_MAXMIN


Data structure description

Element Data type Description


qmax BOOL "1" = Y has reached the upper control limit
qmin BOOL "1" = Y has reached the lower control limit

Runtime error
An error message is returned if
 an invalid floating point number lies at input YMAN or X
 ymax < ymin.

NOTE: For a list of all block error codes and values, see Tables of Error Codes for the Obsolete
Library (see page 616).

306 33002543 10/2019


PID_P

Setting parameters for the PID_P controller

Structure diagram
The following is the structure diagram of the PIDP block:

Parametering
The PID_P control structure is displayed in theStructure diagram, page 307.
Setting parameters for the PID_P controller takes place first of all for the pure PID parameters, that
is to say, the proportional action coefficient kp, the integral action coefficient ki and rate of
differentiation kd.
The P, I and D components can be disabled individually by setting the corresponding input (kp, ki
or kd) to 0.
The D component is delayed by the time constant td_lag. The D component can either be based
upon the system deviation ERR (d_on_pv = "0") or the controlled variable PV (d_on_pv = "1").
Should the D component be determined by the controlled variable PV, then the D component will
not be able to cause jumps when reference variable fluctuations (changes in input SP) take place.
In principle, the D component only affects disturbances and process variances.

33002543 10/2019 307


PID_P

Control direction reversal


Reversed behavior by the controller can be obtained by setting the reverse input. reverse = 0
has the effect that the output value increases with a positive disturbance. reverse = 1 has the
effect that the output value decreases with a positive disturbance.

Manipulated variable limiting


The limits ymax and ymin limit the output within the prescribed range. Therefore ymin ≤ Y ≤
ymax.
The outputs qmax and qmin signal that the limit value has been reached, i.e. that the output signal
is limited.
 qmax = 1 if Y ≥ ymax
 qmin = 1 if Y ≤ ymin

The upper limit ymax for limiting the manipulated variable must be greater than the lower limit
ymin, otherwise the function block reports an error and does not function.

Anti-windup reset
If manipulated variable limiting takes place, the anti-windup reset should make sure that the
integral component cannot exceed all limits. The anti-windup measure is only implemented if the I
component of the controller is not disabled. Anti-windup limits are identical to those for the
manipulated variable. The D component is not taken into consideration for anti-windup measures,
so that peaks, caused by the D component, are not capped by the anti-windup measure.
The anti-windup reset measure corrects the I component in the form, which means:

Selecting the control types


Several controller variants can be selected over the parameters kp, ki and kd:

Controller type kp ki kd
P controller >0 =0 =0
PI controller >0 >0 =0
PD controller >0 =0 >0
PID controller >0 >0 >0
I controller =0 >0 =0

308 33002543 10/2019


PID_P

Operating modes

Selecting the operating modes


There are three operating mode selectable through the man and halt elements:

Operating mode man halt


Automatic 0 0
Manual mode 1 0 or 1
Halt 0 1

Automatic operating mode


In automatic mode, the manipulated variable Y is determined through the discrete PID closed-loop
control algorithm subject to controlled variable PV and reference variable SP. The manipulated
variable is limited by ymax and ymin. The control limits are also limits for the Anti-windup reset.
The changeover from automatic to manual is normally not bumpless, since output Y can take on
any value between ymax and ymin, and Y goes directly to YMAN at the changeover.
If the changeover from automatic to manual is to be bumpless in spite of this, there are two
exemplary possibilities shown for a PID controller (see page 296).

Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the manipulated
variable Y. However, the manipulated variable is limited by ymax and ymin. Internal variables will
be manipulated in such a manner that the controller changeover from manual to automatic (with I
component enabled) can be bumpless. The control limits are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.

Halt mode
In halt mode the control output remains unchanged; the function block does not influence the
manipulated variable Y, i.e. Y = Y(old). Internal variables will be manipulated in such a manner that
the controller (with I component enabled) can be driven smoothly from its current position. The
control limits are also limits for the Anti-windup reset. The halt operating mode is also useful for
setting the control output Y via an external operator device, whereby the internal components are
tracked correctly in the controller.
In this operating mode the D component is automatically set to 0.

33002543 10/2019 309


PID_P

Detailed formulas

Explanation of formula variables


Meaning of the variables in the formulas:

Variable Meaning
is the time differential between the current cycle and the previous cycle

System deviation (SP - PV)

System deviation value from the current sampling step

System deviation value from the previous sampling step

FEED_FWD Disturbance variable


Value of controlled variable from the current sampling step

Value of controlled variable from the previous sampling step

Y current output (halt mode) or YMAN (manual mode)


YD D component
YI I component
YP P component

Manipulated variable
The manipulated variable is composed of various terms:

After summation of the components manipulated variable limiting takes place, so that:

System deviation
The system deviation will be determined as follows:
ERR = SP - PV, if reverse = 0
ERR = PV - SP, if reverse = 1

310 33002543 10/2019


PID_P

Overview of the calculation of the control components


Following this an overview on the different calculations of the control components in relation to the
gains kp, ki and kd can be found:
 P component YP for manual, halt and automatic modes
 I component YI for automatic mode
 I component YI for manual and halt modes
 D component YD for automatic mode
 D component YD for manual and halt modes

P component YP for all operating modes


YP for manual, halt and automatic modes is determined as follows:

I component YI for automatic mode


YI for automatic mode is determined as follows:
For ki > 0 the following applies:

For ki = 0 the following applies:

The I component is formed according to the trapezoid rule.

I component YI for manual and halt modes


YI for manual, halt and automatic modes is determined as follows:
For ki > 0 the following applies:

For ki = 0 the following applies:

33002543 10/2019 311


PID_P

D component YD for automatic mode


YD for automatic mode and cascade is determined as follows:
For kd > 0 and d_on_pv = 0 the following applies:

For kd > 1 and d_on_pv = 0 the following applies:

For kd = 0 the following applies:

D component YD for manual and halt modes


YD for manual, halt and automatic modes is determined as follows:

312 33002543 10/2019


EcoStruxure™ Control Expert
PIP
33002543 10/2019

Chapter 32
PIP: PIP cascade controller

PIP: PIP cascade controller

Introduction
This chapter describes the PIP block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 314
PIP function block structure diagram 319
Setting parameters for the PIP cascade controller 320
Operating modes 322
Detailed formulas 324

33002543 10/2019 313


PIP

Description

Function description
The function block displays a cascade-controller, consisting of a PI-master controller and a P-sub
controller.
A system deviation ERR is formed by the difference between the reference variable SP and the
controlled variable PV.
The master controller generates a sub controller setpoint value SP2 through this system deviation.
Due to the difference between SP2 and PV2 the sub controller generates the manipulated variable
Y.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 PI as master controller and P as sub controller
 Manipulated variable limiting
 Anti-windup reset (PI controller)
 Operating modes, fixed setpoint control, manual, halt, automatic

Transfer function
The transmission function for the controller says:

Controller Transfer function


Master controller (PI-
controller)

Sub controller (P controller)

314 33002543 10/2019


PIP

Proportional action coefficient


The proportional action coefficient of the master controller is determined as follows:

Representation in FBD
Representation:

33002543 10/2019 315


PIP

Representation in LD
Representation:

Representation in IL
Representation:
CAL PIP_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, PV2:=AuxiliaryControlVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualValue, SP_FIX:=FixedValue, OFF:=Offset,
Y:=ManipulatedVariable, ERR=>OutputSystemDeviation,
SP2=>SubControllerSetpointValue,
STATUS=>StatusOfOutput_Y)

316 33002543 10/2019


PIP

Representation in ST
Representation:
PIP_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, PV2:=AuxiliaryControlVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualValue, SP_FIX:=FixedValue, OFF:=Offset,
Y:=ManipulatedVariable, ERR=>OutputSystemDeviation,
SP2=>SubControllerSetpointValue,
STATUS=>StatusOfOutput_Y) ;

PIP parameter description


Description of input parameters:

Parameter Data type Description


SP REAL Reference variable
PV REAL Controlled variable for the master controller
PV2 REAL Controlled variable for the sub controller (auxiliary
control variable)
MODE Mode_PIP Operating mode
PARA Para_PIP Parameter
YMAN REAL Manual value (of output Y)
SP_FIX REAL Fixed value (reference variable as manual value
for the sub controller)
OFF REAL Offset at the output of the P-controller

Description of input / output parameters:

Parameter Data type Description


Y REAL Manipulated variable

Description of output parameters:

Parameter Data type Description


ERR REAL System deviation
SP2 REAL Sub controller setpoint value
STATUS Stat_MAXMIN Y output status

33002543 10/2019 317


PIP

Parameter description Mode_PIP


Data structure description

Element Data type Description


man BOOL "1": Manual mode
halt BOOL "1": Halt mode
fix BOOL "1": Fixed setpoint control

Parameter description Para_PIP


Data structure description

Element Data type Description


gain1 REAL Proportional action coefficient (gain) for PI controller
ti TIME PI controller reset time
gain2 REAL Proportional action coefficient (gain) for P controller
ymax REAL Upper limit
ymin REAL Lower limit

Parameter description Stat_MAXMIN


Data structure description

Element Data type Description


qmax BOOL "1" = Y has reached the upper control limit
qmin BOOL "1" = Y has reached the lower control limit

Runtime error
An error message is returned if
 an invalid floating point number lies at input PV, PV2, YMAN or SP_FIX
 ymax < ymin.

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

318 33002543 10/2019


PIP

PIP function block structure diagram

Structure diagram
The following is the structure diagram of the PIP block:

33002543 10/2019 319


PIP

Setting parameters for the PIP cascade controller

Structure diagram
Structure diagram of the PIP cascade controller

Parametering
The PIP control structure is displayed in theStructure diagram, page 320.
Setting parameters for the function block takes place firstly through the pure PI – parameter, that
is to say the proportional correction value gainl and the reset time ti.
The I component can be disabled by setting ti = 0.
Subsequently setting parameters for the P controller takes place through the proportional
correction value gain2.

Manipulated variable limiting


Manipulated variable limiting takes place at the output of the sub controller, which means:
ymin ≤ Y ≤ ymax

320 33002543 10/2019


PIP

Anti-windup reset (PI controller)


If manipulated variable limiting takes place, the anti-windup reset should make sure that the
integral component of the master controller "is not able to exceed all limits". The anti-windup
measure can only be used if the I-component of the controller is not disabled (ti = 0).
The anti-windup limits for the PI master controller are adjusted dynamically to the present system
deviation of the sub controller and the ymax and ymin limits.
If manipulated variable limiting takes place, the integral component will be limited as follows:
 on reaching the upper limit:

 on reaching the lower limit:

33002543 10/2019 321


PIP

Operating modes

Selecting the operating modes


There are four operating mode, which are selected via the elements man, halt and fix:

Operating mode man halt fix


Automatic 0 0 0
Manual mode 1 0 or 1 0
Halt 0 1 0
Fixed setpoint control 0 0 1

Automatic operating mode


In the automatic mode, the control output Y is determined through the PI closed-loop control, based
on the controlled variables PV, PV2 and the reference variables SP, SP2. The control output is
limited by ymax and ymin.
The changeover from automatic to manual is normally not bumpless, since output Y can take on
any value between ymax and ymin, and Y goes directly to YMAN at the changeover.
If the changeover from automatic to manual is to be bumpless in spite of this, there are two
exemplary possibilities shown for a PID controller (see page 296).

Manual mode
The P controller works in manual mode. The PI controller I component is manipulated to permit
bumpless switching.
In the manual mode the manual manipulated value YMAN is passed on directly to the control output
Y. The control output is, however, limited by ymax and ymin. the integral component of the master
controller is tracked in such a way that the controller (on connecting to the I-component) can be
switched bumplessly from manual to automatic.

Halt mode
In halt mode the control output remains unchanged; the function block does not influence the
control output Y, i.e. Y = Y(old). Halt mode is also useful in allowing an external operator device to
adjust control output Y. the internal components are so manipulated that the controller can be
driven smoothly from it’s current position. The control output is, however, limited by ymax and
ymin.

322 33002543 10/2019


PIP

Fixed setpoint control


In fixed setpoint control mode the P controller works in automatic mode and the PI-controller works
in halt mode.
The fixed setpoint SP_FIX is passed on directly to the control output of the PI controller Y1 (= SP2).
The control output of the PIP controller Y is limited through ymax and ymin. The integral
component of the master controller is tracked in such a way that the controller (on connecting to
the I-component) can be switched smoothly from fixed setpoint control to automatic.

33002543 10/2019 323


PIP

Detailed formulas

Explanation of formula variables


Meaning of the variables in the following formulas:

Variable Meaning
is the time differential between the current cycle and the previous cycle

System deviation (SP - PV)

System deviation value from the current sampling step

System deviation value from the previous sampling step

OFF Offset at the output of the P-controller


Y Manipulated variable
Y1 Y of the master controller
YI I component
YP P component

Overview of the calculation of the control components


There now follows an overview of the varying calculations on control components and outputs for
the various modes:
 YI, Y, SP2 in the automatic mode
 YI, Y, SP2 in the manual mode
 YI, Y, SP2 in the manual mode
 YI, Y, SP2 in the fixed setpoint control mode

Automatic operating mode


The output signal Y of the cascade controller is:

The input signal SP2 of the sub controller is:

The integral component Y1 of the master controller for the automatic mode is determined as
follows:

The I component is formed according to the trapezoid rule.

324 33002543 10/2019


PIP

Manual mode
The output signal Y of the cascade controller is:

The input signal SP2 of the sub controller is:

The integral component Y1 of the master controller for the manual mode is determined as follows:

Halt mode
The output signal Y of the cascade controller is:

The input signal SP2 of the sub controller is:

The integral component Y1 of the master controller for the halt mode is determined as follows:

Fixed setpoint control


The output signal Y of the cascade controller is:

The input signal SP2 of the sub controller is:

The integral component Y1 of the master controller for the fixed setpoint control mode is
determined as follows:

33002543 10/2019 325


PIP

326 33002543 10/2019


EcoStruxure™ Control Expert
PPI
33002543 10/2019

Chapter 33
PPI: PPI cascade controller

PPI: PPI cascade controller

Introduction
This chapter describes the PPI block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 328
PPI function block structure diagram 333
Setting parameters for the PPI cascade controller 334
Operating modes 336
Detailed formulas 337

33002543 10/2019 327


PPI

Description

Function description
The function block displays a cascade-controller, consisting of a P-master controller and a PI-sub
controller.
A system deviation ERR is formed by the difference between the reference variable SP and the
controlled variable PV.
The master controller generates a sub controller setpoint value SP2 through this system deviation.
Due to the difference between SP2 and PV2 the sub controller generates the manipulated variable
Y.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 P as master controller and PI as sub controller
 Manipulated variable limiting
 Anti-windup reset (PI controller)
 Operating modes, fixed setpoint control, manual, halt, automatic

328 33002543 10/2019


PPI

Transfer function
The transmission function for the controller says:

Controller Transfer function


Master controller (P-controller)

Sub controller (PI controller)

Proportional action coefficient


The proportional action coefficient is determined as follows:

Representation in FBD
Representation:

33002543 10/2019 329


PPI

Representation in LD
Representation:

Representation in IL
Representation:
CAL PPI_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, PV2:=AuxiliaryControlVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualValue, SP_FIX:=FixedValue, OFF:=Offset,
Y:=ManipulatedVariable, ERR=>OutputSystemDeviation,
SP2=>SubControllerSetpointValue,
STATUS=>StatusOfOutput_Y)

330 33002543 10/2019


PPI

Representation in ST
Representation:
PPI_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, PV2:=AuxiliaryControlVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualValue, SP_FIX:=FixedValue, OFF:=Offset,
Y:=ManipulatedVariable, ERR=>OutputSystemDeviation,
SP2=>SubControllerSetpointValue,
STATUS=>StatusOfOutput_Y) ;

PPI parameter description


Description of input parameters:

Parameter Data type Description


SP REAL Reference variable for the master controller
PV REAL Controlled variable for the master controller
PV2 REAL Controlled variable for the sub controller (auxiliary
control variable)
MODE Mode_PPI Operating mode
PARA Para_PPI Parameter
YMAN REAL Manual value (of output Y)
SP_FIX REAL Fixed value (reference variable as manual value
for the sub controller)
OFF REAL Offset at the output of the P-controller

Description of input / output parameters:

Parameter Data type Description


Y REAL Manipulated variable

Description of output parameters:

Parameter Data type Description


ERR REAL System deviation
SP2 REAL Sub controller setpoint value
STATUS Stat_MAXMIN Y output status

33002543 10/2019 331


PPI

Parameter description Mode_PPI


Data structure description

Element Data type Description


man BOOL "1": Manual mode
halt BOOL "1": Halt mode
fix BOOL "1": Fixed setpoint control

Parameter description Para_PPI


Data structure description

Element Data type Description


gain1 REAL Proportional action coefficient (gain) for P controller
ti TIME PI controller reset time
gain2 REAL Proportional action coefficient (gain) for PI controller
ymax REAL Upper limit
ymin REAL Lower limit

Parameter description Stat_MAXMIN


Data structure description

Element Data type Description


qmax BOOL "1" = Y has reached the upper control limit
qmin BOOL "1" = Y has reached the lower control limit

Runtime error
An error message is returned if
 an invalid floating point number lies at input PV, PV2, YMAN or SP_FIX
 ymax < ymin.

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

332 33002543 10/2019


PPI

PPI function block structure diagram

Structure diagram
The following is the structure diagram of the PPI block:

33002543 10/2019 333


PPI

Setting parameters for the PPI cascade controller

Block diagram
Block diagram of the PPI cascade controller

Parametering
The PPI control structure is displayed in theBlock diagram, page 334.
Setting parameters for the function block takes place firstly through the proportional correction
value (gain1) and the offset for the output of the p-controller (OFF).
Subsequently setting parameters for the PI controller takes place through the proportional
correction value gain2 and the reset time ti.
The I component can be disabled by setting ti = 0.
The limits ymax and ymin limit the output within the prescribed range.
The outputs qmax and qmin signal that the output has reached a limit, and thus been capped.
 qmax = 1, if Y ≥ ymax
 qmin = 1, if Y ≤ ymin

Manipulated variable limiting


After summation of the components manipulated variable limiting takes place, so that: ymin ≤ Y
≤ ymax

334 33002543 10/2019


PPI

Anti-windup reset (PI controller)


If manipulated variable limiting takes place, the anti-windup reset should make sure that the
integral component of the master controller "is not able to exceed all limits". The anti-windup
measure can only be used if the I component of the sub-controller is not disabled.
The anti-windup reset takes place if:
Y ≥ ymax or Y ≤ ymin
In this case, it is:
YI = Y - YP

33002543 10/2019 335


PPI

Operating modes

Selecting the operating modes


There are four operating mode, which are selected via the elements man, halt and fix:

Operating mode man halt fix


Automatic 0 0 0
Manual mode 1 0 or 1 0
Halt 0 1 0
Fixed setpoint control 0 0 1

Automatic operating mode


In the automatic mode, the control output Y is determined through the PI closed-loop control, based
on the controlled variables PV, PV2 and the reference variables SP, SP2. The control output is
limited by ymax and ymin.
The changeover from automatic to manual is normally not bumpless, since output Y can take on
any value between ymax and ymin, and Y goes directly to YMAN at the changeover.
If the changeover from automatic to manual is to be bumpless in spite of this, there are two
exemplary possibilities shown for a PID controller (see page 296).

Manual mode
In the manual mode the manual manipulated value YMAN is passed on directly to the control output
Y. The control output is, however, limited by ymax and ymin. Internal variables will be manipulated
in such a manner that the controller changeover from manual to automatic (with I component
enabled) can be bumpless.

Halt mode
In halt mode the control output remains unchanged; the function block does not influence the
control output Y, i.e. Y = Y(old). Halt mode is also useful in allowing an external operator device to
adjust control output Y. the internal components are so manipulated that the controller can be
driven smoothly from it’s current position. The control output is, however, limited by ymax and
ymin.

Fixed setpoint control


In this operating mode the fixed setpoint SP_FIX is passed on directly to the setpoint input of the
PI controller (SP2). The PI controller works in the automatic mode.

336 33002543 10/2019


PPI

Detailed formulas

Explanation of formula variables


Meaning of the variables in the following formulas:

Variable Meaning
Present sample time

System deviation (SP - PV)

System deviation (SP2-PV2)

System deviation value from the previous sampling step

OFF Offset at the output of the P-controller


Y Manipulated variable
YI I component
YP P component

Master controller output


The output of the master controller is determined as follows:

Overview of the calculation of the control components


There now follows an overview of the varying calculations on control components and outputs
based on the various modes:
 YI and Y in the automatic mode
 YI, Y, SP2 in the manual mode
 YI, Y, SP2 in the manual mode
 YI, YP, Y and SP2 in the fixed setpoint control mode

Automatic operating mode


The output signal Y of the cascade controller is:

The integral component Y1 of the sub controller for the automatic mode is determined as follows:

The I component is formed according to the trapezoid rule.

33002543 10/2019 337


PPI

Manual mode
The output signal Y of the cascade controller is:

The input signal SP2 of the sub controller is:

The integral component Y1 of the sub controller for the manual mode is determined as follows:

Halt mode
The output signal Y of the cascade controller is:

The input signal SP2 of the sub controller is:

The integral component Y1 of the sub controller for the halt mode is determined as follows:

Fixed setpoint control


The output signal Y of the cascade controller is:

The input signal SP2 of the sub controller is:

The integral component Y1 of the sub controller for the fixed setpoint control mode is determined
as follows:

The proportional action coefficient YP is determined as follows:

338 33002543 10/2019


EcoStruxure™ Control Expert
PWM
33002543 10/2019

Chapter 34
PWM: Pulse width modulation

PWM: Pulse width modulation

Introduction
This chapter describes the PWM block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 340
Detailed description 344
Example for the PWM block 347

33002543 10/2019 339


PWM

Description

Using the block


Actuators are driven not only by analog quantities, but also by binary actuating signals. The
conversion of analog values into binary output signals is achieved for example, through pulse width
modulation (PWM) or pulse duration modulation (PDM).
The actuator adjusted average energy (actuator energy) should be in accord with the modulation
block's analog input value (IN).

Function description
The PWM function block is used to convert analog values into digital output signals for
Control Expert.
In the pulse width modulation (PWM1) a "1" signal of variable persistence proportional to the analog
value X is output within a fixed cycle period. The adjusted average energy corresponds to the
quotient of the switch on duration T_on and the cycle time t_period.
In order that the adjusted average energy also corresponds to the analog input variable IN, the
following must apply:

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

340 33002543 10/2019


PWM

General information about the actuator drive


In general, the binary actuator drive is performed by two binary signals Y_POS and Y_NEG.
On a motor the output Y_POS corresponds to the signal "clockwise rotation" and the output Y_NEG
the signal "counter-clockwise rotation". For an oven the outputs Y_POS and Y_NEG could be
interpreted as corresponding to "heating" and "cooling".
Should the actuating drive in question be a motor, it is possible that to avoid overtravel for non-self-
locking gearboxes, a brake pulse must be output after the engage signal. In order to protect the
power electronics, there must be a pause time after switching on T_on and before the brake pulse
t_brake to avoid short circuits.

Pulse length formulas for Y_POS and Y_NEG


The pulse length T_on for outputs Y_POS and Y_NEG is determined by the following equations:

Output Formula Condition


Y_POS

Y_NEG

Parametering rules
For correct operation the following rules should be observed:

 From the parameters up_pos and up_neg only the value is evaluated.

Representation in FBD
Representation:

33002543 10/2019 341


PWM

Representation in LD
Representation:

Representation in IL
Representation:
CAL PWM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameters, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput)

Representation in ST
Representation:
PWM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameters, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput) ;

PWM parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input variable
R BOOL Reset mode ("1" = Reset)
PARA Para_PWM Parameter

Description of output parameters:

Parameter Data type Description


Y_POS BOOL Output for positive X values
Y_NEG BOOL Negative X value output

342 33002543 10/2019


PWM

Parameter description Para_PWM


Data structure description

Element Data type Description


t_period TIME Length of period
t_pause TIME Pause time
t_brake TIME Braking time
t_min TIME Minimum actuating pulse time (in sec)
t_max TIME Maximum actuating pulse time (in sec)
up_pos REAL Upper limit value for positive X values
up_neg REAL Upper limit value for negative X values

Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 343


PWM

Detailed description

Block mode of operation


The period determines the time, in which the actuating pulses (1-signal on output Y_POS or Y_NEG)
are regularly output, i.e. in a constant time-slot pattern.
The parameter t_min specifies the minimum pulse length, i.e. the shortest time span for which the
output Y_POS or Y_NEG should carry 1-signal. If the length of the pulse calculated according to the
equation in the section Pulse length formulas for Y_POS and Y_NEG, page 341 is shorter than
t_min, then there will be no pulse throughout the whole period.
The parameter t_max specifies the maximum pulse length, i.e. the time span for which the output
Y_POS or Y_NEG should carry 1-signal. If the value calculated for the pulse duration according to
the above formula is greater than t_max, the pulse duration is limited to t_max. It is advisable to
perform a freely definable pause time of t_pause = 10 or 20 ms between the actuating and brake
pulses to protect the power electronics (hopefully preventing simultaneous firing of the anti-parallel
connected converters).
Parameter t_pause specifies the time interval that should be waited after the "1" signal on output
Y_POS (Y_NEG), before the opposite output Y_NEG (Y_POS) goes to "1" signal for time span
t_brake. The action in question here is a brake pulse, which should take place after the pause
time. A pause time of t_pause = 20 ms (t_pause =0.02) corresponds to an interruption of the
firing angle control for two half waves.
That should guarantee a sufficiently large safety margin for the prevention of short-circuits resp.
triggering of the suppressor circuitry as a consequence of anti-parallel thrystors firing.

344 33002543 10/2019


PWM

Time ratio display


An overview of the ratio between times is shown in the following diagram:

1 Variable turn-on time

The parameters up_pos mark the point of input variable X, with which the output Y_POS would
continuously carry a 1-signal, when the input variable X is positive.
t_pause = t_brake = 0
and
t_max = t_period.
The parameters up_neg mark the point of input variable X, with which the output Y_NEG
continuously carries a 1-signal, when the input variable X is negative.
t_pause = t_brake = 0
and
t_max = t_period.

33002543 10/2019 345


PWM

Time-span dependency
The dependency of the time duration in which the output Y_POS (Y_NEG) carries a 1-signal, on the
input variable X is illustrated in the following diagram (again the figure has put t_pause =
t_brake = 0).

Operating modes
In reset mode R = 1, outputs Y_POS and Y_NEG are set to "0" signal. The internal time meters are
also standardized, so that the function block begins the transfer to R=0 with the output of a new 1
signal on the associated output.

Boundary conditions
If the PWM block is operated together with a PID controller, then the period t_period should be
so selected, that it corresponds to the PID controller’s scan time. It is then guaranteed that every
new actuating signal from the PID controller within the period time can be fully processed.
The PWM scan time should be in proportion with the period vs. pulse time. Though this the smallest
possible actuating pulse will be specified.
The following ratio is recommended:

346 33002543 10/2019


PWM

Example for the PWM block

Overview
In the example, the signal sequences on the outputs Y_POS and Y_NEG are shown for various X
input signal values. The examples differ with respect to their selected parameter assignments.
The following examples on the PMW function block are to be found in this section
 Jump response 1
 Jump response 2

Jump response 1
The following parameter specifications apply to the jump response 1 display:

Parameters Specification
t_period 4s
t_min 0.2 s
t_max 3.8 s
t_pause 0.1 s
t_brake 0.2 s
up_pos 10
up_neg 10

Jump response 1 timing diagram

X analog signal

33002543 10/2019 347


PWM

It is easily seen that the time span in which output Y_POS carries "1" signal is directly proportional
to input signal X. In addition, it can be seen that a short Y_NEG signal (output Y_NEG to 1-Signal)
follows every Y_POS signal. This can be attributed to the non-"0" t_brake parameters. With
negative X input signals, the signal duration for Y_NEG is proportional X. A short Y_POS pulse as
brake pulse also follows the Y_NEG pulse here as well.

Jump response 2
The following parameter specifications apply to the jump response 2 display:

Parameters Specification
t_period 4s
t_min 0.5 s
t_max 4s
t_pause 0s
t_brake 0s
up_pos 10
up_neg 10

Jump response 2 timing diagram

X analog signal

348 33002543 10/2019


PWM

In contrast to the example "Jump response 1", here the pause and brake pulses are dropped, as
the appropriate parameters were configured to "0". It is noticeable that pulses are no longer output
for very small X input signals. This is directly attributable to the effect of time t_min. Moreover a
continuous pulse is output for large X input signals (X = up_pos/up_neg). This is related to having
selected t_max = t_period.

33002543 10/2019 349


PWM

350 33002543 10/2019


EcoStruxure™ Control Expert
QPWM
33002543 10/2019

Chapter 35
QPWM: Pulse width modulation (simple)

QPWM: Pulse width modulation (simple)

Introduction
This chapter describes the QPWM block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 352
Detailed description 356
Example for the QPWM block 358

33002543 10/2019 351


QPWM

Description

Using the block


Actuators are driven not only by analog quantities, but also through binary actuating signals. The
conversion of analog values into binary output signals is achieved for example, through pulse width
modulation ( QPWM) or pulse duration modulation (PDM).
The actuator adjusted average energy (actuator energy) should be in accord with the modulation
block's analog input value (IN).

Function description
The function block QPWM converts analog values into digital output signals.
In pulse width modulation (QPWM), a 1-signal is emitted, at a constant clock rate, for a duration that
is a function of the analog value. The adjusted average energy corresponds to the quotient of the
switch on duration T_on and the cycle time t_period.
In order that the adjusted average energy also corresponds to the analog input variable IN, the
following must apply:

NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

352 33002543 10/2019


QPWM

General information about the actuator drive


In general, the binary actuator drive is performed by two binary signals Y_POS and Y_NEG.
On a motor the output Y_POS corresponds to the signal "clockwise rotation" and the output Y_NEG
the signal "counter-clockwise rotation". The outputs Y_POS and Y_NEG for an oven can be
interpreted as corresponding to "heating" and "cooling".

Pulse length formulas for Y_POS and Y_NEG


The pulse length T_on for outputs Y_POS and Y_NEG is determined by the following equations:

Output Formula Condition


Y_POS

Y_NEG

Parametering rules
For correct operation when setting parameters the following rules should be observed:
t_min ≤ t_period

Representation in FBD
Representation:

33002543 10/2019 353


QPWM

Representation in LD
Representation:

Representation in IL
Representation:
CAL QPWM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameter, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput)

Representation in ST
Representation:
QPWM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameter, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput) ;

QPWM parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input variable
R BOOL Reset mode ("1" = Reset)
PARA Para_QPWM Parameter

Description of output parameters:

Parameter Data type Description


Y_POS BOOL Output for positive X values
Y_NEG BOOL Negative X value output

354 33002543 10/2019


QPWM

Parameter description Para_QPWM


Data structure description

Element Data type Description


t_period TIME Length of period
t_min TIME Minimum actuating pulse time (in sec)
x_max REAL Upper limit for positive/negative X values

Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.

33002543 10/2019 355


QPWM

Detailed description

Block mode of operation


The period determines the time, in which the actuating pulses (1-signal on output Y_POS or Y_NEG)
are regularly output, i.e. in a constant time-slot pattern.
The parameter t_min specifies the minimum pulse length, i.e. the shortest time span for which the
output Y_POS or Y_NEG should carry 1-signal. If the length of the pulse calculated according to the
equation in the section Pulse length formulas for Y_POS and Y_NEG, page 353 is shorter than
t_min, then there will be no pulse throughout the whole period.

Time ratio display


An overview of the ratio between times is shown in the following diagram:

1 Variable turn-on time

The parameters x_max mark the point of input variable X, with which the output Y_POS would
continuously carry a 1-signal, when the input variable X is positive.

356 33002543 10/2019


QPWM

Time-span dependency
The dependency of the time duration in which the output Y_POS (Y_NEG) carries a 1-signal; the
input variable X is illustrated in the following diagram:

Operating modes
In reset mode R = 1, outputs Y_POS and Y_NEG are set to "0" signal. The internal time meters are
also standardized, so that the function block begins the transfer to R=0 with the output of a new 1
signal on the associated output.

Boundary conditions
If the QPWM block is operated together with a PID controller, then the period t_period should be
so selected, that it corresponds to the PID controller’s scan time. It is then guaranteed that every
new actuating signal from the PID controller within the period time can be fully processed.
The QPWM scan time should be in proportion with the period vs. pulse time. The smallest possible
actuating pulse is determined this way.
The following ratio is recommended:

33002543 10/2019 357


QPWM

Example for the QPWM block

Jump response
In the example, the signal sequences on the outputs Y_POS and Y_NEG are shown for various X
input signal values.
The following parameter specifications apply to the jump response display:

Parameters Specification
t_period 4s
t_min 0.5 s
x_max 10

Jump response timing diagram

X Analog signal

It is noticeable that pulses are no longer output for very small X input signals. This is directly
attributable to the effect of time t_min. A continuous pulse is output for large X (X = x_max)
signals.

358 33002543 10/2019


EcoStruxure™ Control Expert
SCON3
33002543 10/2019

Chapter 36
SCON3: Three step controller

SCON3: Three step controller

Introduction
This chapter describes the SCON3 block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 360
Detailed description 363

33002543 10/2019 359


SCON3

Description

Function description
The function block replicates a three-point step controller, and exhibits a PD-like behavior due to
a dynamic feedback path.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block SCON3 has the following properties:
 Reset and automatic operating modes
 One internal feedback path (delay 1st Order)

Representation in FBD
Representation:

360 33002543 10/2019


SCON3

Representation in LD
Representation:

Representation in IL
Representation:
CAL SCON3_Instance (SP:=SetpointInput, PV:=ProcessVariable,
PARA:=Parameters, R:=ResetModeFlag,
Y_POS=>PosManipulated_ERR_EFF,
Y_NEG=>NegManipulated_ERR_EFF,
ERR_EFF=>EffectiveError)

Representation in ST
Representation:
SCON3_Instance (SP:=SetpointInput, PV:=ProcessVariable,
PARA:=Parameters, R:=ResetModeFlag,
Y_POS=>PosManipulated_ERR_EFF,
Y_NEG=>NegManipulated_ERR_EFF,
ERR_EFF=>EffectiveError) ;

33002543 10/2019 361


SCON3

SCON3 parameter description


Description of input parameters:

Parameter Data type Description


SP REAL Setpoint input
PV REAL Actual value input
PARA Para_SCON3 Parameter
R BOOL "1" = Reset mode

Description of output parameters:

Parameter Data type Description


Y_POS BOOL "1" = positive manipulated variable at output
ERR_EFF
Y_NEG BOOL "1" = negative manipulated variable at output
ERR_EFF
ERR_EFF REAL Effective switch value

Parameter description Para_SCON3


Data structure description

Element Data type Description


gain REAL Proportional action coefficient (gain)
ti TIME Integral time
t_proc TIME Nominal actuating time of the controlled valve
hys REAL Hysteresis from three point switch
db REAL Dead zone

Runtime error
If hys > 2 * db, an error message is shown in the diagnostic viewer (Tools → Diagnostic viewer).
NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

Warning
In the following cases, a warning is shown in the diagnostic viewer (Tools → Diagnostic viewer):
 gain ≤ 0 : The controller operates without feedback response.
 ti = 0: The controller operates without feedback response.
 t_proc = 0: The controller operates with a predetermined value of t_proc = 60 s.

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

362 33002543 10/2019


SCON3

Detailed description

Structure of the controller


Structure of the three-point controller:

Dependency of outputs Y_POS and Y_NEG on the variable Y:

If... Then...
Y=1 Y_POS = 1
Y_NEG = 0
Y=0 Y_POS = 0
Y_NEG = 0
Y = -1 Y_POS = 0
Y_NEG = 1

Meaning of variable K:

33002543 10/2019 363


SCON3

Principle of the three-point controller


The actual three-point controller will have a dynamic feedback (PT1-element) added. By
appropriately choosing the time constants ti and t_proc of these feedback elements, the three-
point controller exhibits a dynamic behavior corresponding to that of a PID controller.

The gain parameter must be greater than zero.

Dead zone
The parameter db sets the connection point for the outputs Y_POS and Y_NEG. If the effective
switching value ERR_EFF = SP - PV - XR is positive and is greater than db, then the Y_POS output
switches from "0" to "1". If the effective switch value ERR_EFF is negative and is less than db, then
the output Y_NEG will switch from "0" to "1". The parameter db is typically set to 1% of the maximum
control range (max. (SP - PV)).
NOTE: The amount is evaluated from the db dead zone!

Hysteresis
The parameter hys indicates the connector-hysteresis, i.e. the value which the effective switch
value ERR_EFF outgoing from control point db must be reduced by, before the output Y_POS
(Y_NEG) is reset to "0". The connection between Y_POS and Y_NEG depending on the effective
switch value ERR_EFF and the parameters db and hys is illustrated in the image "Principle of the
three-point controller, page 364". The parameter hys is typically set to 0.5 % of the maximum
control range (max. (SP - PV)).
NOTE: The amount is evaluated from the hys hysterisis!

364 33002543 10/2019


SCON3

Behavior with faulty time constants


Should the time constant ti = 0 or the proportional action coefficient gain ≤ 0 (configuration
error), the block will still continue to operate. The functions feedback path is disabled however, so
that the block operates as a conventional three-point switch.
If the time constant t_proc = 0 (configuration error), the block will still continue to operate. In this
case t_proc is set to a preset value of t_proc = 60s (60 000 msec).

Operating modes
There are two operating modes that can be selected through the R parameter input:

Operating mode R Meaning


Automatic 0 The function block will be handled as described above.
Reset 1 The internal value of the feedback element is set to SP - PV.
The outputs Y_POS and Y_NEG are both set to "0".

33002543 10/2019 365


SCON3

366 33002543 10/2019


EcoStruxure™ Control Expert
VLIM
33002543 10/2019

Chapter 37
VLIM: Velocity limiter 1st order

VLIM: Velocity limiter 1st order

Introduction
This chapter describes the VLIM block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 368
Detailed description 371

33002543 10/2019 367


VLIM

Description

Function description
The function block produces a velocity limiter of the 1st order with limiting of the manipulated
variable.
The output Y follows the input X, but at the maximum gradient rate. Furthermore, the Y output is
limited by ymax and ymin. This allows the function block to adjust signals to the technologically
limited pace and limits from controlling elements.
NOTE: This function block performs an internal initialization in the first program cycle after a warm
start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In
case of inkoving the function block in a later program cycle, the internal initialization will not be
performed and the ouputs may deliver wrong values.

WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Properties
The function block has the following properties:
 Operating modes Manual, Halt, Automatic
 Manipulated variable limiting

Representation in FBD
Representation:

368 33002543 10/2019


VLIM

Representation in LD
Representation:

Representation in IL
Representation:
CAL VLIM_Instance (X:=Input, MODE:=OperatingMode,
PARA:=Parameters, YMAN:=ManualManipulatedValue,
Y:=Output, STATUS:=Output_Y_Status)

Representation in ST
Representation:
VLIM_Instance (X:=Input, MODE:=OperatingMode,
PARA:=Parameters, YMAN:=ManualManipulatedValue,
Y:=Output, STATUS:=Output_Y_Status)

VLIM parameter description


Description of input parameters:

Parameter Data type Description


X REAL Input
MODE Mode_MH Operating mode
PARA Para_VLIM Parameter
YMAN REAL Manually manipulated value

33002543 10/2019 369


VLIM

Description of input / output parameters:

Parameter Data type Description


Y REAL Output

Description of output parameters:

Parameter Data type Description


STATUS Stat_MAXMIN Y output status

Parameter description Mode_VLIM


Data structure description

Element Data type Description


man BOOL "1": Manual mode
halt BOOL "1": Halt mode

Parameter description Para_VLIM


Data structure description

Element Data type Description


rate REAL Maximum velocity (maximum x’ / sec)
ymax REAL Upper limit
ymin REAL Lower limit

Parameter description Stat_MAXMIN


Data structure description

Element Data type Description


qmax BOOL "1" = Y has reached the upper control limit
qmin BOOL "1" = Y has reached the lower control limit

Runtime error
An error message is returned if
 an invalid floating point number lies at input YMAN or X,
 ymax < ymin.

NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.

370 33002543 10/2019


VLIM

Detailed description

Parametering
The parameter assignments of the function block are defined by the determination of the maximum
gain rate as well as the ymax and ymin thresholds for the Y output. The maximum velocity rate
indicates the maximum by which the output may change within one second.
The amount will be evaluated by the rate parameter.

Exception when rate = 0


If rate = 0 is configured, then the Y output follows the X input immediately (Y=X).

Limits
The limits ymax and ymin limit the output within the prescribed range. Therefore ymin ≤ Y ≤
ymax.
The outputs qmax and qmin indicate that the output has reached a limit or that the output signal
has been capped.
 qmax = 1 if Y ≥ ymax
 qmin = 1 if Y ≤ ymin

Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:

Operating mode MAN HALT Meaning


Automatic 0 0 The current value for Y is constantly calculated
and displayed.
Manual mode 1 0 or 1 The manual value YMAN will be transmitted fixed
to the output Y. The control output is, however,
limited by ymax and ymin.
Halt 0 1 The output Y will be held at the last value. The
output will no longer be changed, but can be
overwritten by the user.

33002543 10/2019 371


VLIM

Example
Illustration of the dynamic behavior of the VLIM function block.

The function block follows the jump to input X with maximum change in speed (rate). Output Y
remains at a standstill in Halt mode, in order to subsequently move on from the position at which
it has stopped. It is also clear to see the limits of output Y durch ymax and ymin with the relevant
messages qmax and qmin.

372 33002543 10/2019


EcoStruxure™ Control Expert
Extension/Compatibility
33002543 10/2019

Part IV
Extension/Compatibility

Extension/Compatibility

Overview
This part describes the elementary functions and elementary function blocks in the family
Extension/Compatibility.

What Is in This Part?


This part contains the following chapters:
Chapter Chapter Name Page
38 ADD_***_PL7 : Add a period 377
39 AKF_FL: Detection of any edge 381
40 AKF_TA: Switch off delay 383
41 AKF_TE: Switch-on delay 387
42 AKF_TI: Pulse 391
43 AKF_TS: Storing switch on delay 395
44 AKF_TV: Extended pulse 399
45 AKF_ZR: Decremental counter 403
46 AKF_ZV: Incremental counter 407
47 AKF_ZVR: Incremental/decremental counter 411
48 COMPARE: Comparing two integers 415
49 DATE_DINT_TO_STRING: Conversion of a date (DATE PL7) into a character 417
string
50 DAY_OF_WEEK : Day of the week 419
51 DELTA_***: Difference between two dates 421
52 DT_ARINT_TO_STRING: Converting a PL7 date into a character string 423
53 END: Unconditional end of program 427
54 FIFO: First In/First Out stack register 429
55 FPULSOR: Generation of rectangular signals 433
56 FSTEP_PL7_DRUM : Forcing a drum to a step 437
57 FTOF: Deactivation timer 439
58 FTON: Activation timer 443
59 FTP: Pulse timer 447
60 GET_3X: Read %IW Words (3x-Register) 451

33002543 10/2019 373


Extension/Compatibility

Chapter Chapter Name Page


61 GET_4X: Read %MW Words (4x-Register) 453
62 GET_BIT: Reading bit 455
63 HIGH_INT: Extracting the most significant word of a double integer 457
64 IEC_BMDI: Block move 459
65 IEC_BMDI_M: Block move 467
66 LIFO: Last In/First Out stack register 475
67 LOW_INT: Extracting the least significant word of a double integer 479
68 MUX_DINTARR_125: Multiplexer for arrays of the data type DIntArr125 481
69 PL7_COUNTER : Counter/downcounter 483
70 PL7_DRUM : Drum 489
71 PL7_MONOSTABLE : Monostable 495
72 PL7_REGISTER_32 : 32 word memory register 501
73 PL7_REGISTER_255 : 255 word memory register 505
74 PL7 and Control Expert Timers Comparison 509
75 PL7_TOF : TOF type timer 511
76 PL7_TON : TON type timer 517
77 PL7_TP : TP type timer 523
78 PL7_3_TIMER : Conversion timer for % Ti’s of PL7 529
79 PUT_4X: Write 4x register 535
80 R_INT_WORD: Type conversion (REAL -> INT -> WORD) (R_INT_WORD: 537
Type conversion (REAL -> INT -> WORD))
81 R_UINT_WORD: Type conversion (REAL -> UINT -> WORD) 539
(R_UINT_WORD: Type conversion (REAL -> UINT -> WORD))
82 R2T_***: Register to table 541
83 READ_PCMCIA: Reading data in the memory card 547
84 ROR1_ARB: Right shift of one byte from a table of bytes 553
85 RRTC: Reading the system date 555
86 SCOUNT: Up/down counting with overshoot signaling 557
87 SET_BIT: Set bit 563
88 SET_PCMCIA: Initialization of the archiving zone 565
89 SHL_RBIT_***: Left shift on an integer or double integer 567
90 SHR_RBIT_***: Right shift on an integer or double integer 569
91 SHRZ_***: Right shift on an integer or double integer 571
92 SHRZ_RBIT_***: Right shift on an integer or double integer 573
93 SRCH: Search 575

374 33002543 10/2019


Extension/Compatibility

Chapter Chapter Name Page


94 STR_ROUND: Approximate value of a floating point number 581
95 SUB_***_PL7 : Subtract a period 583
96 SYSSTATE: System state 587
97 T2T: Table to table 589
98 TIME_DINT_TO_STRING: Conversion of a variable to DINT format 595
99 TOD_DINT_TO_STRING: Conversion of a variable to TOD format 597
100 TRANS_TIME: Conversion of a duration into DINT format 599
101 W_INT_REAL: Type conversion (WORD -> INT -> REAL) (W_INT_REAL: Type 601
conversion (WORD -> INT -> REAL))
102 W_UINT_REAL: Type conversion (WORD -> UINT -> REAL) (W_UINT_REAL: 603
Type conversion (WORD -> UINT -> REAL))
103 WRITE_PCMCIA: Writing data to the memory card 605
104 WRTC: Updating the system date 609

33002543 10/2019 375


Extension/Compatibility

376 33002543 10/2019


EcoStruxure™ Control Expert
SUB_***_PL7
33002543 10/2019

Chapter 38
ADD_***_PL7 : Add a period

ADD_***_PL7 : Add a period

Description

Description of the function


The ADD_***_PL7 function adds a period to a date or to a time expressed in the DT format or TOD
format of PL7.
The additional parameters EN and ENO can be configured.

Available functions
The available functions are as follows:
 ADD_DT_PL7,
 ADD_TOD_PL7.

Representation in FBD
Representation applied to a time of day:

Representation in LD
Representation applied to a time of day:

33002543 10/2019 377


SUB_***_PL7

Representation in IL
Representation applied to a time of day:
LD Source_Value
ADD_TOD_PL7 Time_to_Add
ST Result_Value

Representation in ST
Representation applied to a time of day:
Result_Value := ADD_TOD_PL7(Source_Value, Time_to_Add);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Source_Value DINT, Date or time.
ARRAY [0..3] Table of 4 integers.
OF INT
Time_to_Add DINT Period to be added to Source_Value

Note : this time is expressed in the TIME format of PL7


and this with an accuracy of the order of one tenth of a
second. As Source_Value is expressed to the
nearest second, Time_to_Add is rounded to the
nearest second.

The following table describes the output parameters:

Parameter Type Comment


Result_Value DINT, Result_Value is of the same type as
ARRAY [0..3] Source_Value.
OF INT Table of 4 integers.

NOTE: management of leap years must be provided for in the application.

378 33002543 10/2019


SUB_***_PL7

Execution errors
When Source_Value is in the DINT format (TOD of PL7), there is a change of day if
Result_Value is greater than 24:00:00. In this case the system bit %S18 is set at 1 and the value
of Result_Value is only significant with a modulo 24:00:00.
When Source_Value is in the ARRAY [0..3] OF INT format (DT of PL7) and if Result_Value is
outside the authorized range of values, the system bit %S18 is set at 1 and the value of
Result_Value is also at the maximum limit.
If one of the input parameters cannot be interpreted and is inconsistent with the function format
then the system bit %S18 is set at 1 and Result_Value is:
 00:00:00 for the TOD type.
 00001-01-01-00:00:00 for the DT type.

33002543 10/2019 379


SUB_***_PL7

380 33002543 10/2019


EcoStruxure™ Control Expert
AKF_FL
33002543 10/2019

Chapter 39
AKF_FL: Detection of any edge

AKF_FL: Detection of any edge

Description

Function description
The derived function block detects any edge (1 -> 0 and 0 -> 1) on the CLK input.
Output Q is "1" for a cycle if there is a transition from "0" to "1" or a transition from "1" to "0" on CLK;
otherwise it remains "0".
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL AKF_FL_Instance (CLK:=ClockInput, Q=>DisplaysAnyEdge)

33002543 10/2019 381


AKF_FL

Representation in ST
Representation:
AKF_FL_Instance (CLK:=ClockInput, Q=>DisplaysAnyEdge) ;

Parameter description
Description of the input parameters:

Parameters Data type Meaning


CLK BOOL Timing input

Description of the output parameters:

Parameters Data type Meaning


Q BOOL Display of any edge

382 33002543 10/2019


EcoStruxure™ Control Expert
AKF_TA
33002543 10/2019

Chapter 40
AKF_TA: Switch off delay

AKF_TA: Switch off delay

Description

Function description
The derived function block is used as switch off delay.
The delay time comprises a time base ZB and a factor SW. The delay time is calculated from ZB x
SW.
The actual value is displayed at the TIW output and is calculated according to the following formula:
TIW = expired time / ZB
With a 0 -> 1 edge at the IN input, the delay time is transferred to the TSW output and the Q output
is set to "1".
With a 1 -> 0 at the IN input, the internal timer is started and the current state is displayed at the
TIW output. When TIW equals TSW, the Q output is set to "0".
With a 0 -> 1 edge at the R input the internal timer is reset and the Q output is set to "0".
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

33002543 10/2019 383


AKF_TA

Representation in LD
Representation:

Representation in IL
Representation:
CAL AKF_TA_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorDelayTime, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)

Representation in ST
Representation:
AKF_TA_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorDelayTime, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;

Parameter description
Description of input parameters:

Parameter Data type Description


IN BOOL Start delay
ZB TIME Time basis of delay time
SW INT Delay time factor
R BOOL Reset input

384 33002543 10/2019


AKF_TA

Description of output parameters:

Parameter Data type Description


Q BOOL Output
TIW INT internal time (actual timer value)
TSW INT Timer setpoint at time of 0 -> 1 edge at IN

Timing diagram
Timing diagram of the TA disconnection delay:

(1) If IN becomes "1", Q becomes "1".


(2) If IN becomes "0", the internal timer (TIW) is started.
(3) If the internal timer TIW reaches the value of TSW, Q becomes "0".
(4) If IN becomes "1", Q becomes "1" and the internal timer is stopped/reset.
(5) If IN becomes "1" before the internal Timer TIW has reached the value of TSW, the internal time is
stopped/reset, without Q becoming "0".
(6) If R becomes "1" and IN is "0", Q becomes "0" and the internal timer is stopped/reset.
(7) If R becomes "1" and IN is "1", Q becomes "0".
(8) If R becomes "0" and IN is "1", Q becomes "1".
(9) If R becomes "1", the internal timer is stopped/reset.
(10) If IN becomes "1" and R is "1", Q remains at "0".

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

33002543 10/2019 385


AKF_TA

386 33002543 10/2019


EcoStruxure™ Control Expert
AKF_TE
33002543 10/2019

Chapter 41
AKF_TE: Switch-on delay

AKF_TE: Switch-on delay

Description

Function description
The derived function block is used as switch on delay.
The delay time comprises a time base ZB and a factor SW. The delay time is calculated from ZB x
SW.
The actual value is displayed at the TIW output and is calculated according to the following formula:
TIW = expired time / ZB
With a 0 -> 1 edge at the IN input the delay time is transferred to the TSW output, the internal timer
is started, and the current state is displayed at the TIW output.
When TIW equals TSW, the Q output is set to "1".
With a 0 -> 1 edge at the R input or a 1 -> 0 edge at the IN input, the internal timer is reset and the
Q output is set to "0".
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

33002543 10/2019 387


AKF_TE

Representation in LD
Representation:

Representation in IL
Representation:
CAL AKF_TE_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorDelayTime, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)

Representation in ST
Representation:
AKF_TE_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorDelayTime, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;

Parameter description
Description of input parameters:

Parameter Data type Description


IN BOOL Start delay
ZB TIME Time basis of delay time
SW INT Delay time factor
R BOOL Reset input

388 33002543 10/2019


AKF_TE

Description of output parameters:

Parameter Data type Description


Q BOOL Output
TIW INT internal time (actual timer value)
TSW INT Timer setpoint at time of 0 -> 1 edge at IN

Timing diagram
Timing diagram for activation delay TE:

(1) If IN becomes "1", the internal timer (TIW) is started.


(2) If the internal timer (TIW) reaches the value of TSW, Q becomes "1".
(3) If IN becomes "0", Q becomes "0" and the internal timer is stopped/reset.
(4) If IN becomes "0" before the internal timer (TIW) has reached the value of TSW, the internal timer is
stopped/reset without Q becoming "1".
(5) If R becomes "1", the internal timer is stopped/reset.
(6) If R becomes "1", Q becomes "0" and the internal timer is stopped/reset.
(7) If IN becomes "1" and R is "1", the internal timer is not started.

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

33002543 10/2019 389


AKF_TE

390 33002543 10/2019


EcoStruxure™ Control Expert
AKF_TI
33002543 10/2019

Chapter 42
AKF_TI: Pulse

AKF_TI: Pulse

Description

Function description
The derived function block is used to generate a pulse that has a defined maximum duration.
The maximum pulse duration comprises a time base ZB and a factor SW. The maximum pulse
duration is calculated from ZB x SW.
The actual value is displayed at the TIW output and is calculated according to the following formula:
TIW = expired time / ZB
With a 0 -> 1 edge at the IN input, the maximum pulse duration is transferred to the TSW output,
the internal timer is started and the Q output is set to "1".
If TIW equals TSW, the Q output is set to "0", independent of the IN input.
With a 0 -> 1 edge at the R input the internal timer is reset and the Q output is set to "0".
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

33002543 10/2019 391


AKF_TI

Representation in LD
Representation:

Representation in IL
Representation:
CAL AKF_TI_Instance (IN:=StartingPulse, ZB:=TimeBaseOfPulse,
SW:=FactorOfPulse, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)

Representation in ST
Representation:
AKF_TI_Instance (IN:=StartingPulse, ZB:=TimeBaseOfPulse,
SW:=FactorOfPulse, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;

Parameter description
Description of input parameters:

Parameter Data type Description


IN BOOL Start pulse
ZB TIME Time basis of the pulse
SW INT Pulse factor
R BOOL Reset input

392 33002543 10/2019


AKF_TI

Description of output parameters:

Parameter Data type Description


Q BOOL Output
TIW INT Internal time (actual timer value)
TSW INT Timer setpoint at time of 0 -> 1 edge at IN

Timing diagram
Timing diagram for TI pulse:

(1) If IN becomes "1", Q becomes "1", and the internal timer (TIW) is started.
(2) If the internal timer TIW reaches the value of TSW, Q becomes "0".
(3) If IN becomes "0", the internal timer is stopped/reset.
(4) If IN becomes "0", Q becomes "0" and the internal timer is stopped/reset.
(5) If R becomes "1", Q becomes "0" and the internal timer is stopped/reset.
(6) If R becomes "1", the internal timer, is stopped/reset, independent of IN.
(7) If IN becomes "1" and R is "1", Q remains at "0".

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

33002543 10/2019 393


AKF_TI

394 33002543 10/2019


EcoStruxure™ Control Expert
AKF_TS
33002543 10/2019

Chapter 43
AKF_TS: Storing switch on delay

AKF_TS: Storing switch on delay

Description

Function description
The derived function block is used as stored switch on delay. Resetting of the output can only be
performed with the R input.
The delay time comprises a time base ZB and a factor SW. The delay time is calculated from ZB x
SW.
The actual value is displayed at the TIW output and is calculated according to the following formula:
TIW = expired time / ZB
With a 0 -> 1 edge at the IN input the delay time is transferred to the TSW output, the internal timer
is started, and the current state is displayed at the TIW output.
When TIW equals TSW, the Q output is set to "1".
With a 0 -> 1 edge at the R input the internal timer is reset and the Q output is set to "0".
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

33002543 10/2019 395


AKF_TS

Representation in LD
Representation:

Representation in IL
Representation:
CAL AKF_TS_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorOfDelay, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)

Representation in ST
Representation:
AKF_TS_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorOfDelay, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;

Parameter description
Description of input parameters:

Parameter Data type Description


IN BOOL Start delay
ZB TIME Time basis of delay time
SW INT Delay time factor
R BOOL Reset input

396 33002543 10/2019


AKF_TS

Description of output parameters:

Parameter Data type Description


Q BOOL Output
TIW INT internal time (actual timer value)
TSW INT Timer setpoint at time of 0 -> 1 edge at IN

Timing diagram
Timing diagram for storing activation delay TS

(1) If IN becomes "1", the internal timer (TIW) is started.


(2) If the internal timer (TIW) reaches the value of TSW, Q becomes "1".
(3) Even if IN becomes "0", Q remains "1".
(4) If R becomes "1", the internal timer is stopped/reset and Q is set to "0".
(5) If R becomes "1" before the internal timer (TIW) has reached the value of TSW, the internal timer is
stopped/reset without Q having become "1".
(6) If IN becomes "1" and R is "1", the internal timer is not started.

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

33002543 10/2019 397


AKF_TS

398 33002543 10/2019


EcoStruxure™ Control Expert
AKF_TV
33002543 10/2019

Chapter 44
AKF_TV: Extended pulse

AKF_TV: Extended pulse

Description

Function description
The derived function block is used to generate an extended pulse.
The pulse duration comprises a time base ZB and a factor SW. The pulse duration is calculated from
ZB x SW.
The actual value is displayed at the TIW output and is calculated according to the following formula:
TIW = expired time / ZB
With a 0 -> 1 edge at the IN input, the pulse duration is transferred to the TSW output, the internal
timer is started and the Q output is set to "1".
The Q output remains at "1", independent of IN, until TIW equals TSW. The Q output is now set to
"0".
With a 0 -> 1 edge at the R input the internal timer is reset and the Q output is set to "0".
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

33002543 10/2019 399


AKF_TV

Representation in LD
Representation:

Representation in IL
Representation:
CAL AKF_TV_Instance (IN:=StartingPulse, ZB:=TimeBaseOfPulse,
SW:=FactorOfPulse, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)

Representation in ST
Representation:
AKF_TV_Instance (IN:=StartingPulse, ZB:=TimeBaseOfPulse,
SW:=FactorOfPulse, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;

Parameter description
Description of input parameters:

Parameter Data type Description


IN BOOL Start pulse
ZB TIME Time basis of the pulse
SW INT Pulse factor
R BOOL Reset input

400 33002543 10/2019


AKF_TV

Description of output parameters:

Parameter Data type Description


Q BOOL Output
TIW INT internal time (actual timer value)
TSW INT Timer setpoint at time of 0 -> 1 edge at IN

Timing diagram
Timing diagram for extended pulse TV:

(1) If IN becomes "1", Q becomes "1", and the internal timer (TIW) is started.
(2) If the internal timer (TIW) reaches the value of TSW, Q becomes "0".
(3) If IN becomes "1" again, the internal timer is restarted and Q becomes "1".
(4) If IN becomes "1" again, the internal timer is restarted and Q remains "1".
(5) If R becomes "1", Q becomes "0", independent of IN, and the internal timer is stopped/reset.
(6) If IN becomes "1" and R is "1", Q remains at "0" and the internal timer is not started.

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

33002543 10/2019 401


AKF_TV

402 33002543 10/2019


EcoStruxure™ Control Expert
AKF_ZR
33002543 10/2019

Chapter 45
AKF_ZR: Decremental counter

AKF_ZR: Decremental counter

Description

Function description
The derived function block is used for downwards counting.
With a "1"signal at the R input, the actual value and the Q output are set to"0".
With a 0 -> 1 edge at the S input, the SW input accepts the setpoint value which is then displayed
at the ZSWO output. The actual value is set to the setpoint value. A comparison of setpoint
value/actual value will not take place until a setpoint value has been accepted at least once.
The Q output is set to "1" if the actual value is greater than "0" and less than the setpoint value.
Given a 0 -> 1 edge at the IN input, the actual value (ZIWO) is decreased by 1 (to 0 as a minimum)
and compared to the setpoint value (ZSWO).
The ZIW and ZSW inputs can be used to change the setpoint value (ZSW) and the actual value (ZIW)
online.
NOTE: In order for the counter to work correctly, the variable (actual value) which is established at
ZIW must also be established at ZIWO. The variable (setpoint), which is established at ZSW has
also to be established at ZSWO.
EN and ENO can be configured as additional parameters.

Formula
Q = 1, if 0 < ZIWO < ZSWO

33002543 10/2019 403


AKF_ZR

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL AKF_ZR_Instance (IN:=TriggerInput, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue)

404 33002543 10/2019


AKF_ZR

Representation in ST
Representation:
AKF_ZR_Instance (IN:=TriggerInput, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue) ;

Parameter description
Description of input parameters:

Parameter Data type Description


IN BOOL Trigger input
S BOOL Set input
SW INT Preset setpoint value
R BOOL Reset input
ZIW INT Control of the internal actual value
ZSW INT Control of internal setpoint value

Description of output parameters:

Parameter Data type Description


Q BOOL Output
ZIWO INT Count value (display of actual value)
ZSWO INT Display of setpoint value

NOTE: the same variable should be assigned to the pin ZIW and ZIWO and the same variable
should be assigned to the Pin ZSW and ZSWO also, or the function block can't execute normally.

33002543 10/2019 405


AKF_ZR

Timing diagram
Timing diagram for AKF_ZR backwards counter:

(1) If S becomes "1" and R is "0", the preset setpoint value SW is accepted and displayed at the ZSWO output.
(2) If IN becomes "1", the actual counter value is decreased by "1" and Q set to "1".
(3) If IN becomes "1", the current counter value is decreased by "1".
(4) If IN becomes "1", the current counter value is decreased by "1". If this causes the counter value (ZIWO)
to become "0", the Q output is set to "0".
(5) If R becomes "1", the current counter value is set to "0".
(6) If S becomes "1" and R is "0", the preset setpoint value SW is accepted and Q is set to "0".

406 33002543 10/2019


EcoStruxure™ Control Expert
AKF_ZV
33002543 10/2019

Chapter 46
AKF_ZV: Incremental counter

AKF_ZV: Incremental counter

Description

Function description
The derived function block is used for incrementing.
With a "1"signal at the R input, the actual value and the Q output are set to"0".
With a 0 -> 1 edge at the S input, the SW input accepts the setpoint value which is then displayed
at the ZSWO output. The actual value is set to "0". A comparison of setpoint value/actual value will
not take place until a setpoint value has been accepted at least once.
The Q output is set to "1" if the actual value is greater than "0" and less than the setpoint value.
In the case of -> 1 edge at the IN input, the actual value (ZIWO) is increased by 1 and compared
to the setpoint value (ZSWO).
The ZIW and ZSW inputs can be used to change the setpoint value (ZSW) and the actual value (ZIW)
online.
NOTE: In order for the counter to work correctly, the variable (actual value) which is established at
ZIW must also be established at ZIWO. The variable (setpoint), which is established at ZSW has
also to be established at ZSWO.
EN and ENO can be configured as additional parameters.

Formula
Q = 1, if 0 < ZIWO < ZSWO

33002543 10/2019 407


AKF_ZV

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL AKF_ZV_Instance (IN:=TriggerInput, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue)

408 33002543 10/2019


AKF_ZV

Representation in ST
Representation:
AKF_ZV_Instance (IN:=TriggerInput, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue) ;

Parameter description
Description of input parameters:

Parameter Data type Description


IN BOOL Trigger input
S BOOL Set input
SW INT Preset setpoint value
R BOOL Reset input
ZIW INT Control of the internal actual value
ZSW INT Control of internal setpoint value

Description of output parameters:

Parameter Data type Description


Q BOOL Output
ZIWO INT Count value (display of actual value)
ZSWO INT Display of setpoint value

NOTE: the same variable should be assigned to the pin ZIW and ZIWO and the same variable
should be assigned to the Pin ZSW and ZSWO also, or the function block can't execute normally.

33002543 10/2019 409


AKF_ZV

Timing diagram
Timing diagram for Incremental counter AKF_ZVR:

(1) If IN becomes "1" and R is "0", the actual value is increased by "1" and Q is set to "1".
(2) If R becomes "1", the actual value and Q are set to "0".
(3) If S becomes "1", the preset setpoint value is accepted.
(4) If IN becomes "1", the actual value is increased by "1". If this causes the actual value to reach the setpoint
value, Q is set to "0".
(5) If IN becomes "1", the actual value is increased by "1".
(6) If S becomes "1", the preset setpoint value is accepted and the actual value is set to "0".
(7) If S becomes "1", the preset setpoint value is accepted, and the actual value and Q are set to "0".

410 33002543 10/2019


EcoStruxure™ Control Expert
AKF_ZVR
33002543 10/2019

Chapter 47
AKF_ZVR: Incremental/decremental counter

AKF_ZVR: Incremental/decremental counter

Description

Function description
The derived function block is used for incrementing/decrementing.
With a "1"-signal at the R input, the actual value and the Q output are set to"0".
With a 0 -> 1 edge at the S input, the SW input accepts the setpoint value which is then displayed
at the ZSWO output. The actual value does not change. A comparison of setpoint value/actual value
will not take place until a setpoint value has been accepted at least once.
The Q output is set to "1" if the actual value is greater than or equal to the setpoint.
In the case of -> 1 edge at the IN_F input, the actual value (ZIWO) is increased by 1 and compared
to the setpoint value (ZSWO).
In the case of -> 1 edge at the IN_B input, the actual value (ZIWO) is decreased by 1 and compared
to the setpoint value (ZSWO).
The ZIW and ZSW inputs can be used to change the setpoint value (ZSW) and the actual value (ZIW)
online.
NOTE: In order for the counter to work correctly, the variable (actual value) which is established at
ZIW must also be established at ZIWO. The variable (setpoint), which is established at ZSW has
also to be established at ZSWO.
EN and ENO can be configured as additional parameters.

Formula
Q = 1, if ZIWO ≥ ZSWO

33002543 10/2019 411


AKF_ZVR

Representation in FBD
Representation:

Representation in LD
Representation:

412 33002543 10/2019


AKF_ZVR

Representation in IL
Representation:
CAL AKF_ZVR_Instance (IN_F:=TriggerInputIncrementing,
IN_B:=TriggerInputDecrementing, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue)

Representation in ST
Representation:
AKF_ZVR_Instance (IN_F:=TriggerInputIncrementing,
IN_B:=TriggerInputDecrementing, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue) ;

Parameter description
Description of the input parameters:

Parameters Data type Meaning


IN_F BOOL Trigger input, incrementing
IN_B BOOL Trigger input, decrementing
S BOOL Set input
SW INT Preset setpoint value
R BOOL Reset input
ZIW INT Control of the internal actual value
ZSW INT Control of internal setpoint value

Description of the output parameters:

Parameters Data type Meaning


Q BOOL Output
ZIWO INT Count value (display of actual value)
ZSWO INT Display of setpoint value

NOTE: the same variable should be assigned to the pin ZIW and ZIWO and the same variable
should be assigned to the Pin ZSW and ZSWO also, or the function block can't execute normally.

33002543 10/2019 413


AKF_ZVR

Timing diagram
Timing diagram for Incremental counter AKF_ZVR

(1) If IN_F becomes "1" and R is "0", the current value is increased by "1".
(2) If IN_B becomes "1" and R is "0", the actual value is decreased by "1".
(3) If S becomes "1", the preset setpoint value is accepted.
(4) If IN_F becomes "1" and R is "0", the current value is increased by "1". If this causes the actual value to
reach the setpoint value, Q is set to "1".
(5) If R becomes "1", the actual value and Q are set to "0".
(6) If IN_B becomes "1" and R is "0", the actual value is decreased by "1". If this causes the actual value to fall
below the setpoint value, Q is set to "0".
(7) If IN_B becomes "1" and R is "0", the actual value is decreased by "1". If this causes the actual value to
reach the setpoint value, Q is set to "1".

414 33002543 10/2019


EcoStruxure™ Control Expert
COMPARE
33002543 10/2019

Chapter 48
COMPARE: Comparing two integers

COMPARE: Comparing two integers

Description

Function description
The function COMPARE performs a comparison between two integers.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

33002543 10/2019 415


COMPARE

Representation in IL
Representation:
LD Valid
COMPARE Value1, Value2, Greater_Than, Equal_Values, Less_Than,
Different_Values

Representation in ST
Representation:
COMPARE(Valid, Value1, Value2, Greater_Than, Equal_Values, Less_Than,
Different_Values);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Enable BOOL Validation input. The comparison only takes
place if this input is 1.
Value1 INT First value to compare.
Value2 INT Second value to compare.

The following table describes the output parameters:

Parameter Type Comment


Greater_Than BOOL If Value1 > Value2 then
Greater_Than = 1
Otherwise
Greater_Than = 0
Equal_Values BOOL If Value1 = Value2 then
Equal_Values = 1
Otherwise
Equal_Values = 0
Less_Than BOOL If Value1 < Value2 then
Less_Than = 1
Otherwise
Less_Than = 0
Different_Values BOOL If Value1 ≠ Value2 then
Different_Values = 1
Otherwise
Different_Values = 0

416 33002543 10/2019


EcoStruxure™ Control Expert
DATE_DINT_TO_STRING
33002543 10/2019

Chapter 49
DATE_DINT_TO_STRING: Conversion of a date (DATE PL7) into a character string

DATE_DINT_TO_STRING: Conversion of a date (DATE PL7)


into a character string

Description

Description of the function


The function DATE_DINT_TO_STRING is used to convert a PL7 date (double word) into a
character string.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Date1
DATE_DINT_TO_STRING
ST Result_Str

33002543 10/2019 417


DATE_DINT_TO_STRING

Representation in ST
Representation:
Result_Str:= DATE_DINT_TO_STRING(Date1);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Date1 DINT PL7 date to convert into character string format.

The following table describes the output parameters:

Parameter Type Comment


Result_Str STRING Result_Str is a string of 10 characters containing a
date (not including the time) in the following format:
YYYY-MM-DD.

Example: ’2000-12-27’

Runtime errors
If the string Result_Str is too short to contain the date (length = less than 10 characters), the
date is truncated and the bit %S15 is set to 1.
If Date1 cannot be interpreted and is not consistent in DATE format, the system bit %S18 is set to
1 and Result_Str =’YYYY-MM-DD’.

418 33002543 10/2019


EcoStruxure™ Control Expert
DAY_OF_WEEK
33002543 10/2019

Chapter 50
DAY_OF_WEEK : Day of the week

DAY_OF_WEEK : Day of the week

Description

Description of the function


The function DAY_OF_WEEK provides the result of the day of the week, in the form of a whole
number:
 1 for Monday,
 2 for Tuesday,
 3 for Wednesday,
 4 for Thursday,
 5 for Friday,
 6 for Saturday,
 7 for Sunday.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

33002543 10/2019 419


DAY_OF_WEEK

Representation in IL
Representation:
DAY_OF_WEEK
ST Out_Day_Of_Week

Representation in ST
Representation:
Out_Day_Of_Week := DAY_OF_WEEK();

Description of parameters
The following table describes the output parameters:

Parameter Type Comment


Out_Day_Of_Week INT Whole number from 1 to 7 indicating the day of the
week:
 1 for Monday,
 2 for Tuesday,
 3 for Wednesday,
 4 for Thursday,
 5 for Friday,
 6 for Saturday,
 7 for Sunday.

Runtime errors
If the function cannot update the result following a real-time clock access error, the result sent back
is 0 and the system bit %S18 is set to 1.

420 33002543 10/2019


EcoStruxure™ Control Expert
DELTA_***
33002543 10/2019

Chapter 51
DELTA_***: Difference between two dates

DELTA_***: Difference between two dates

Description

Description of the function


The DELTA_*** function calculates the time variation between two dates or times in PL7 format.
The additional parameters EN and ENO can be configured.

Available functions
The available functions are as follows:
 DELTA_D,
 DELTA_DT,
 DELTA_TOD.

Representation in FBD
Representation applied to a time of day:

Representation in LD
Representation applied to a time of day:

33002543 10/2019 421


DELTA_***

Representation in IL
Representation applied to a time of day:
LD Input_IN1
DELTA_TOD Input_IN2
ST Delay1

Representation in ST
Representation applied to a time of day:
Delay1:= DELTA_TOD(Input_IN1, Input_IN2);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Input_IN1 DINT, Date or time for which we wish to calculate the variation
ARRAY [0...3] from Input_IN2.
OF INT
Input_IN2 DINT, Date or time for which we wish to calculate the variation
ARRAY [0...3] from Input_IN1
OF INT

NOTE: Input_IN1 and Input_IN2 must be of the same type.


The following table describes the output parameters:

Parameter Type Comment


Delay1 DINT Delay1 contains the absolute value of the time elapsed
between the two inputs Input_IN1 and Input_IN2.

Note: this time is expressed with a precision of a tenth


of second.

Runtime errors
If Delay1 exceeds the maximum value allowed for a DINT format, an overflow occurs, in which
case Delay1 = 0 and the system bit %S18 is set to 1.
If one of the input parameters cannot be interpreted and is inconsistent with the function format,
then Delay1 = 0 and the system bit %S18 is set to 1.

422 33002543 10/2019


EcoStruxure™ Control Expert
DT_ARINT_TO_STRING
33002543 10/2019

Chapter 52
DT_ARINT_TO_STRING: Converting a PL7 date into a character string

DT_ARINT_TO_STRING: Converting a PL7 date into a


character string

Description

Description of the function


The function DT_ARINT_TO_STRING converts a PL7 date (table of four words) into a character
string.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Date1
DT_ARINT_TO_STRING
ST Result_Str

33002543 10/2019 423


DT_ARINT_TO_STRING

Representation in ST
Representation:
Result_Str:= DT_ARINT_TO_STRING(Date1);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Date1 ARRAY [0..3] of INT PL7 date (table of 4 words) to convert into character string format.

The following table describes the output parameters:

Parameter Type Comment


Result_Str STRING Result_Str is a string of 19 characters containing a date (including
the time) in the following format: YYYY-MM-DD-HH:MM:SS.

Example: ’2000-12-27-23:15:50’

Runtime errors
If the string Result_Str is too short to contain the date (length = less than 19 characters), the
date is truncated and the bit %S15 is set to 1.
If Date1 cannot be interpreted and is not consistent, the system bit %S18 is set to 1 and
Result_Str =’YYYY-MM-DD-HH:MM:SS’.

424 33002543 10/2019


DT_ARINT_TO_STRING

PL7 DATE_AND_TIME format


The PL7 DATE_AND_TIME (DT) format is displayed as follow:
yyyy-mm-dd-hh:mm:ss
example 2000-05-18-15:45:22
the value is BCD coded on 64 bit. The result is an array of 4 integers.

With the previous example in hexadecimal.

NOTE: Only the DT included between [1990-01-01-00:00:00, 2099-12-31-23:59:59] are allowed.

33002543 10/2019 425


DT_ARINT_TO_STRING

426 33002543 10/2019


EcoStruxure™ Control Expert
END
33002543 10/2019

Chapter 53
END: Unconditional end of program

END: Unconditional end of program

Description

Function description
The END function in an application program is used to define the end of the execution of a program
cycle.
By default (normal mode), when the end of program is activated, outputs are updated and the
program switches to the next cycle.
If polling is periodic, outputs are updated and the program waits until the end of the period then
switches to the next cycle.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

33002543 10/2019 427


END

Representation in IL
Representation:
CAL END

Representation in ST
Representation:
END ();

428 33002543 10/2019


EcoStruxure™ Control Expert
FIFO
33002543 10/2019

Chapter 54
FIFO: First In/First Out stack register

FIFO: First In/First Out stack register

Introduction
This chapter describes the FIFO block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 430
Detailed description 432

33002543 10/2019 429


FIFO

Description

Function description
This function block is a ‘first in – first out’ stack register.
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

Representation in LD
Representation:

430 33002543 10/2019


FIFO

Representation in IL
Representation:
CAL FIFO_Instance (R:=ClearedStackRegister, SET:=WriteValue,
GET:=ReadValue, X:=StackRegisterInput,
N_MAX:=MaxNumberInStack, FULL=>StackRegisterFull,
EMPTY=>StackRegisterEmpty, Y=>StackRegisterOutput)

Representation in ST
Representation:
FIFO_Instance (R:=ClearedStackRegister, SET:=WriteValue,
GET:=ReadValue, X:=StackRegisterInput,
N_MAX:=MaxNumberInStack, FULL=>StackRegisterFull,
EMPTY=>StackRegisterEmpty, Y=>StackRegisterOutput) ;

Parameter description
Description of input parameters:

Parameter Data type Description


R BOOL 1 = stack register will be cleared
SET BOOL 1 = write value to stack register
GET BOOL 1 = read value from stack register
X ANY Stack register input
N_MAX UINT Maximum number of elements in the stack register

Description of output parameters:

Parameter Data type Description


FULL BOOL 1= stack register is full, no further elements can be
put in the stack register
EMPTY BOOL 1 = stack register is empty (number of elements in
the stack register = 0)
Y ANY Stack register output

Runtime error
For a list of all block error codes and values, see here (see page 619).

33002543 10/2019 431


FIFO

Detailed description

Function mode of operation


FIFO is a 'first in/first out' stack register.
The index and stack register are invisible to the user. The stack register is part of the internal state
and can accept up to 2000 bytes with data (i.e. 1000 INT or 500 REAL or 500 TIME elements).
The function block has two Boolean inputs, GET and SET, that are used to either read a value from
or write a value to the stack register. If GET and SET are set simultaneously, SET (write) will be
executed before GET (read). The stack register is cleared when R(eset) = 1.
The input parameters checking the stack must be set in a meaningful order to allow the function
block to work properly.
A meaningful order is, for example:

Cycle Parameters Result


Cycle n R=0, SET=0, GET=0 Stack not initialized
Cycle n+1 R=1, SET=0, GET=0 Stack initialized
Cycle n+2 R=0, SET=0, GET=0 End initializing
Cycle n+3 R=0, SET=1, GET=0 Loading stack with x values
Cycle n+x+1 R=0, SET=0, GET=0 End loading
Cycle n+x+2 R=0, SET=0, GET=1 Getting x values
Cycle n+x+2+x R=0, SET=0, GET=1 Stack not empty

The N_MAX parameter provides the maximum number of elements in the stack register.
In a full stack register (number of elements in the stack register = N_MAX <= 2000 / (size of (X)),
FULL is set to 1 and no more elements can be placed in the stack register. If the stack register is
empty (number of elements in the stack register = 0), then EMPTY is set to 1. The function has an
X input and a Y input for various elementary data types.
X and Y are type ANY, which implies a predefined length. Due to the limited size of the internal stack
register, only input and output types with an element size equal to or smaller than 200 bytes are
accepted. Otherwise a runtime error occurs and an error message is generated that sets ENO to 0.

432 33002543 10/2019


EcoStruxure™ Control Expert
FPULSOR
33002543 10/2019

Chapter 55
FPULSOR: Generation of rectangular signals

FPULSOR: Generation of rectangular signals

Subject of this Chapter


This Chapter describes the function FPulsor.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 434
Detailed description of the operation of the FPULSOR function 436

33002543 10/2019 433


FPULSOR

Description

Description of the function


The function FPULSOR generates a periodic rectangular signal for which it is possible to vary the
pulse width at 1 and at 0 using the program.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Enable
FPULSOR Rise_Time, Fall_Back_Time, Mem_Double_W, OUT_Pulsor,
Current_Value

434 33002543 10/2019


FPULSOR

Representation in ST
Representation:
FPULSOR(Enable, Rise_Time, Fall_Back_Time, Mem_Double_W, OUT_Pulsor,
Current_Value);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Enable BOOL Validation input. The function starts on the
rising edge of Enable and is only executed if
Enable = 1
Rise_Time INT Input word that determines the duration (in
hundredths of a second) of the pulse at 1. This
is used to define a maximum duration of 5 mins
and 27 secs, precise to 10 ms.
Fall_Back_Time INT Input word that determines the duration (in
hundredths of a second) of the pulse at 0. This
is used to define a maximum duration of 5 mins
and 27 secs, precise to 10 ms.

The following table describes the input/output parameters:

Parameter Type Comment


Mem_Double_W DINT Double word for storing internal statuses. It is
imperative that this word be used in order for the
function to operate.

The following table describes the output parameters:

Parameter Type Comment


OUT_Pulsor EBOOL Pulse output at 0 for the duration of
Fall_Back_Time and at 1 for the duration of
Rise_Time.
Current_Value INT Output word that increases from 0 to
Rise_Time + Fall_Back_Time as the timer
counts (in hundredths of a second).

NOTE: a modification of the Rise_Time and the Fall_Back_Time is taken into account even
during the time out. The sum of Rise_Time + Fall_Back_Time has a maximum duration of 5
minutes and 27 seconds (32700).

33002543 10/2019 435


FPULSOR

Detailed description of the operation of the FPULSOR function

Timing diagram
Timing diagram.

Operation
The following table describes the operation of the FPULSOR function:

Phase Action Description


1 Rising edge on the The generation of the rectangular signal is launched: (if the
Enable input signal is not already increasing) its current value increases by
0 towards Rise_Time+Fall_Back_Time (in hundredths of
seconds).
2 As long as the The output bit OUT_Pulsor remains at 0.
Fall_Back_Time time
out has not run out
3 Fall_Back_Time has The output bit OUT_Pulsor changes to 1 until the end of
elapsed, Rise_Time is Rise_Time and the generator loops on steps 2 and 3.
activated
4 Enable switches to 0 Rise_Time and Fall_Back_Time are reset to 0, and the
output OUT_Pulsor switches to 0.

436 33002543 10/2019


EcoStruxure™ Control Expert
FSTEP_PL7_DRUM
33002543 10/2019

Chapter 56
FSTEP_PL7_DRUM : Forcing a drum to a step

FSTEP_PL7_DRUM : Forcing a drum to a step

Description

Description of the function


The FSTEP_PL7_DRUM function positions the drum (see page 489) selected at a defined step.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Step_value
FSTEP_PL7_DRUM Drum_instance

33002543 10/2019 437


FSTEP_PL7_DRUM

Representation in ST
Representation:
FSTEP_PL7_DRUM (Step_value, Drum_instance);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Step_value INT Value of 0 to LEN-1 of the step to be forced.
LEN = Drum step number
Drum_instance PL7_DRUM Instance of the drum on which the function applies.

Execution errors
If the number of the step transmitted does not exist (number higher than or equal to the step
number of the drum), the %S18 bit is set at 1.

438 33002543 10/2019


EcoStruxure™ Control Expert
FTOF
33002543 10/2019

Chapter 57
FTOF: Deactivation timer

FTOF: Deactivation timer

Subject of this Chapter


This Chapter describes the function FTOF.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 440
Detailed description of the operation of the FTOF function 442

33002543 10/2019 439


FTOF

Description

Function description
The function FTOF is a deactivation timer.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Enable
FTOF Presel_Value, Mem_Word, OUT_Ftof, Current_Value

Representation in ST
Representation:
FTOF(Enable, Presel_Value, Mem_Word, OUT_Ftof, Current_Value);

440 33002543 10/2019


FTOF

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Enable BOOL "Arming" input, on the falling edge the time out
starts.
Presel_Value INT Preset value that determines the duration (in
hundredths of a second) of the time out. The
maximum authorized duration is 5 minutes and
27 seconds, precise to 10 ms.

Note: Modification of the Presel_Value


during the time out is immediately taken into
account.

The following table describes the input/output parameters:

Parameter Type Comment


Mem_Word DINT Double integer used in input and output which
enables internal statuses to be stored.
Be careful not to use this variable in another
part of the application.

The following table describes the output parameters:

Parameter Type Comment


OUT _Ftof EBOOL Output set to 1 on rising edge of Enable and
set to 0 at end of time out.
Current_Value INT Current value of the time out (in hundredths of a
second). This variable increases from 0 to
Presel_Value when the timer is launched.

33002543 10/2019 441


FTOF

Detailed description of the operation of the FTOF function

Timing diagram
Timing diagram.

Operation
The following table describes the operation of the FTOF function:

Phase Action Description


1 Rising edge on the The current value takes the value 0 (even if the timer is
Enable input running), and the OUT_Ftof output bit switches to 1 (or
stays at 1).
2 During the rising edge The timer is launched, and the current value increases from
of the Enable input 0 to the Presel_Value (in hundredths of seconds).
3 When the current The OUT_Pulsor output bit returns to 0.
value has reached the
Presel_Value

442 33002543 10/2019


EcoStruxure™ Control Expert
FTON
33002543 10/2019

Chapter 58
FTON: Activation timer

FTON: Activation timer

Subject of this Chapter


This Chapter describes the function FTON.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 444
Detailed description of the operation of the FTON function 446

33002543 10/2019 443


FTON

Description

Function description
The function FTON is an activation timer.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Enable
FTON Presel_Value, Mem_Word, OUT_Fton, Current_Value

Representation in ST
Representation:
FTON(Enable, Presel_Value, Mem_Word, OUT_Fton, Current_Value);

444 33002543 10/2019


FTON

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Enable BOOL "Arming" input, on the rising edge the timer
starts.
Presel_Value INT Preset value that determines the duration (in
hundredths of a second) of the time out. The
maximum authorized duration is 5 minutes and
27 seconds, precise to 10 ms.

Note: Modification of the Presel_Value


during the time out is immediately taken into
account.

The following table describes the input/output parameters:

Parameter Type Comment


Mem_Word DINT Double integer used in input and output which
enables internal statuses to be stored.
Be careful not to use this variable in another
part of the application.

The following table describes the output parameters:

Parameter Type Comment


OUT_Fton EBOOL Output set to 1 at the end of time out.
Current_Value INT Current value of the time out (in hundredths of a
second). This variable increases from 0 to
Presel_Value when the timer is launched.

33002543 10/2019 445


FTON

Detailed description of the operation of the FTON function

Timing diagram
Timing diagram.

Operation
The following table describes the operation of the FTON function:

Phase Action Description


1 Rising edge on the The timer is launched and its current value
Enable input Current_Value increases by 0 towards
Presel_Value (in hundredths of seconds).
2 The current value has The output bit OUT_Fton switches to 1, then remains at 1
reached as long as the Enable input is at 1.
Presel_Value
3 The Enableinput is at 0 The timer is stopped even if in run mode, and the
Current_Value becomes 0.

446 33002543 10/2019


EcoStruxure™ Control Expert
FTP
33002543 10/2019

Chapter 59
FTP: Pulse timer

FTP: Pulse timer

Subject of this Chapter


This Chapter describes the function FTP.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 448
Detailed description of the operation of the FTP function 450

33002543 10/2019 447


FTP

Description

Function description
The function FTP is a timer which enables a pulse of a precise and programmable duration to be
obtained.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Enable
FTP Presel_Value, Mem_Word, OUT_FTP, Current_Value

Representation in ST
Representation:
FTP(Enable, Presel_Value, Mem_Word, OUT_FTP, Current_Value);

448 33002543 10/2019


FTP

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Enable BOOL "Arming" input, on the falling edge the time out
starts.
Presel_Value INT Preset value that determines the duration (in
hundredths of a second) of the time out. The
maximum authorized duration is 5 minutes and
27 seconds, precise to 10 ms.

Note: Modification of the Presel_Value


during the time out is immediately taken into
account.

The following table describes the input/output parameters:

Parameter Type Comment


Mem_Word DINT Double integer used in input and output which
enables internal statuses to be stored.
Be careful not to use this variable in another
part of the application.

The following table describes the output parameters:

Parameter Type Comment


OUT_FTP EBOOL Output set to 0 at the end of time out.
Current_Value INT Current value of the time out (in hundredths of a
second). This variable increases from 0 to
Presel_Value when the timer is launched.

33002543 10/2019 449


FTP

Detailed description of the operation of the FTP function

Timing diagram
Timing diagram.

Operation
The following table describes the operation of the FTP function:

Phase Action Description


1 Rising edge on the EN The timer is launched (if it is not already running) and the
input current value Current_Value increases from 0 to the
Presel_Value (in hundredths of seconds). The OUT_FTP
output bit switches to 1.
2 When the current The OUT_FTP output bit returns to 0.
value has reached the
Presel_Value
3 The Enable input Presel_Value takes the value 0.
and the OUT_FTP
output are at 0

450 33002543 10/2019


EcoStruxure™ Control Expert
GET_3X
33002543 10/2019

Chapter 60
GET_3X: Read %IW Words (3x-Register)

GET_3X: Read %IW Words (3x-Register)

Description

Function description
This function writes values from the %IW register area (3x) of the state RAM to the variable that is
connected to the output pin.
Offset is an offset in the %IW register memory (3x).
The function copies as many bytes as the size of the output data type which is connected to the
output pin.
EN and ENO can be configured as additional parameters.

Example
The output of this function reads the 16-bit value of register %IW120 (register 300120), if Offset
= 120 and the output is of data type INT.
The value in Offset may be modified at runtime.
If Offset lies outside the configured number of %IW (3x), an error message is generated and ENO
is set to 0.

Representation in FBD
Representation:

33002543 10/2019 451


GET_3X

Representation in LD
Representation:

Representation in IL
Representation:
LD Offset
GET_3X
ST Output

Representation in ST
Representation:
Output := GET_3X (Offset);

Parameter description
Description of input parameters:

Parameter Data type Description


Offset UINT Offset in the %IW (3x) register memory.

Description of output parameters:

Parameter Data type Description


Output ANY Output

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

452 33002543 10/2019


EcoStruxure™ Control Expert
GET_4X
33002543 10/2019

Chapter 61
GET_4X: Read %MW Words (4x-Register)

GET_4X: Read %MW Words (4x-Register)

Description

Function description
This function copies values from the %MW register area (4x register area for Quantum CPUs) to
the variable connected to the output pin VAL.
OFF is the word offset in the %MW register area.
The function copies as many bytes as the size of the output data type connected to the output pin
VAL.
The value in OFF may be modified at runtime. If OFF is outside the configured %MW register area,
an error message is generated and ENO is set to 0.
The function copies in any case only until the end of the configured %MW area, even if the
connected data type could take more data. The remaining part of the connected data type remains
untouched by the block in such cases.
EN and ENO can be configured as additional parameters.

Example
This function reads the 16-bit value of register %MW120 (register 400120), if OFF = 120 and the
output is of data type INT.
This function reads only 1 word, if OFF addresses the last configured %MW, even if the connected
data type is of a larger size than a word.

Representation in FBD
Representation:

33002543 10/2019 453


GET_4X

Representation in LD
Representation:

Representation in IL
Representation:
LD Offset
GET_4X
ST Output

Representation in ST
Representation:
Output := GET_4X (Offset);

Parameter description
Description of input parameters:

Parameter Data type Description


Offset UINT Offset in the %MW register memory (4x).

Description of output parameters:

Parameter Data type Description


Output ANY Output

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

454 33002543 10/2019


EcoStruxure™ Control Expert
GET_BIT
33002543 10/2019

Chapter 62
GET_BIT: Reading bit

GET_BIT: Reading bit

Description

Function description
This function reads the bit selected with BitNumber for input InputRegister and writes the
current state to output CurrentState.
The output is the current state of the selected input data bit.
The BitNumber parameter shows which input data bit to select.

EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

33002543 10/2019 455


GET_BIT

Representation in LD
Representation:

Representation in IL
Representation:
LD InputRegister
GET_BIT BitNumber
ST CurrentState

Representation in ST
Representation:
CurrentState := GET_BIT(InputRegister, BitNumber);

Parameter description
Description of input parameters:

Parameter Data type Description


InputRegister WORD Input word
BitNumber UINT Bit number to be read.

Description of output parameters:

Parameter Data type Description


CurrentState BOOL Current state of selected bit.

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

456 33002543 10/2019


EcoStruxure™ Control Expert
HIGH_INT
33002543 10/2019

Chapter 63
HIGH_INT: Extracting the most significant word of a double integer

HIGH_INT: Extracting the most significant word of a double


integer

Description

Description of the function


The function HIGH_INT extracts the most significant word of a double integer.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Double_Int
HIGH_INT
ST High_Int

33002543 10/2019 457


HIGH_INT

Representation in ST
Representation:
High_Int := HIGH_INT(Double_Int);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Double_Int DINT Double integer whose most significant word is
extracted.

The following table describes the output parameters:

Parameter Type Comment


High_Int INT The most significant word extracted from the double
integer Double_Int.

458 33002543 10/2019


EcoStruxure™ Control Expert
IEC_BMDI
33002543 10/2019

Chapter 64
IEC_BMDI: Block move

IEC_BMDI: Block move

Introduction
This chapter describes the IEC_BMDI block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 460
Detailed description 464

33002543 10/2019 459


IEC_BMDI

Description

Function description
This procedure copies the number of elements listed in NumberOfElements wordwise, from
position OffsetInSourceTable in the source table (SourceTable) to position OffsetInDes-
tinationTable in the destination table (DestinationTable).

WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to possible forced
values in the reference data editor. This can produce serious process conditions.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

460 33002543 10/2019


IEC_BMDI

Representation in LD
Representation:

Representation in IL
Representation:
LD SourceTable
IEC_BMDI OffsetInSourceTable, NumberOfElements,
DestinationTable, OffsetInDestinationTable

Representation in ST
Representation:
IEC_BMDI (SourceTable, OffsetInSourceTable,
NumberOfElements, DestinationTable,
OffsetInDestinationTable);

33002543 10/2019 461


IEC_BMDI

Parameter description
Description of input parameters:

Parameter Data type Description


SourceTable UINT Quantum source table having contents copied.
Selection of source table:
0 = Marker-Bits %MX
1 = Input Bits %IX
3 = Input words %IW
4 = Marker words %MW
OffsetInSourceTable UINT Offset in selected source table (SourceTable). As
the copy operation is executed word-by-word,
OffsetInSourceTable must be a multiple of
16+1 for 0x and 1x source tables (e.g. 17, 33, 49
etc.) The offset is subject to upper limit supervision
and must be within the limits of the source table.
NumberOfElements UINT Table size for source and destination table.
NumberOfElements indicates the number of
elements in the source table to be copied. Because
the copy operation is performed word-by-word, 0x
and 1x source tables must have a multiple of 16
(e.g. 16, 32, 48, etc.) for NumberOfElements.
NumberOfElements is subject to upper limit
supervision and must be within the limits of the
source and destination tables. Independent of the
configured limits, the NumberOfElements value
was additionally restricted to the following values to
prevent the copy operation from taking up too much
time:
%MX, %IX Bits: max NumberOfElements = 1600
%IW, %MW Registers: max NumberOfElements
= 100
DestinationTable UINT Destination table to which contents of source table
will be copied. Selection of destination table:
0 = Marker-Bits %MX
4 = Marker words %MW
OffsetInDestina- UINT Offset in selected source table. Because the copy
tionTable operation is performed word-by-word, 0x and 1x
source tables OffsetInDestinationTable
must have a multiple of 16+1 (e.g. 17, 33, 49, etc.).
The offset is subject to upper limit supervision and
must be within the limits of the destination table.

462 33002543 10/2019


IEC_BMDI

Runtime error
The following standard user error messages are used:

User error message Description


E_EFB_USER_ERROR_1 Input value is invalid register type (SourceTable).
E_EFB_USER_ERROR_2 The input offset (OffsetInSourceTable) selects an
address outside acceptable limits.
E_EFB_USER_ERROR_3 The input offset (OffsetInSourceTable) is not 1 or a
multiple of 16+1.
E_EFB_USER_ERROR_4 Output value is invalid register type (DestinationTable).
E_EFB_USER_ERROR_5 The output offset (OffsetInDestinationTable) selects
an address outside acceptable limits.
E_EFB_USER_ERROR_6 The output offset (OffsetInDestinationTable) is not 1
or a multiple of 16+1.
E_EFB_USER_ERROR_7 The value for (NumberOfElements) is 0.
E_EFB_USER_ERROR_8 The value for (NumberOfElements) addresses more than
1600 bits.
E_EFB_USER_ERROR_9 The value for (NumberOfElements) addresses more than
100 words.
E_EFB_USER_ERROR_10 The value for (NumberOfElements) selects a source
address outside the acceptable limits.
E_EFB_USER_ERROR_11 The value for (NumberOfElements) selects a destination
address outside the acceptable limits.
E_EFB_USER_ERROR_12 The value for (NumberOfElements) is not a multiple of 16.
E_EFB_USER_ERROR_13 Warning: Address overlap of input and output addresses.

If there are no errors, the procedure copies the values from the indicated source to the destination
address and sets the ENO output to 1.
The user errors 1 through 12 will block the copy operation and are setting the ENO output to 0.
If user error 13 occurs, the copy operation continues and the ENO output remains at 1 because this
error is treated as a warning.
NOTE: For a list of all block error codes, see Extension/Compatibility, page 619.

33002543 10/2019 463


IEC_BMDI

Detailed description

Function description

WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to possible forced
values in the reference data editor. This can produce serious process conditions.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

IEC_BMDI creates a word-by-word copy of the number of elements listed in LENGTH from the
OFF_IN position in the source table (SEL_IN) to the OFF_OUT position in the destination table
(SEL_OUT). While copying, LENGTH always uses the type of SEL_IN for orientation (%IX, %MX:
LENGTH = Number of Bits; %IW, %MW: LENGTH = number of words)
Copy behavior:
 %MX or %IX to %MX
The source and target lengths are identical during copying of %MX or %IX to %MX
 %IW or %MW to %MW
The source and target lengths are identical during copying of %IW or %MW to %MW
 %MX or %IX to %MW
When copying %MX or %IX to %MW, a WORD-to-WORD copy is made as well. In this, the first
source bit is copied into the MSB (highest bit) of the first %MW register, and so on. LENGTH
defines the number of bits to be copied. The maximum output length is LENGTH/16 registers.
 %IW or %MW to %MX
When copying %IW or %MW to %MX, a WORD-to-WORD copy is made as well. In this, the MSB
(highest bit) of the first register is copied into the first destination bit and so on. LENGTH defines
the number of registers to be copied. The maximum output length is LENGTH x 16 bits.

464 33002543 10/2019


IEC_BMDI

Example 1
In the example, 64 %MX source bits from start address %MX129 are copied into the %MW
destination register (starting at address %MW112). The input range is %MX129 to %MX192 and
the output range is %MW112 to %MW115.

Example 2
In the example, 11 %MW source bits from start address %MW250 are copied into the %MX
destination register (starting at address %MX257). The input range is %MW250 to %MW260 and
the output range is %MX257 to %MX432.

33002543 10/2019 465


IEC_BMDI

Example 3
In the example, 128 %MX source bits from start address %MX001 are copied into the %MX
destination register (starting at address %MX257). The input range is %MX001 to %MX127 and
the output range is %MX257 to %MX384.

Example 4
In the example, 15 %MW source bits from start address %MW250 are copied into the %MW
destination register (starting at address 4:01030). The input range is %MW250 to %MW264, and
the output range is 4:01030 to 4:01044.

466 33002543 10/2019


EcoStruxure™ Control Expert
IEC_BMDI_M
33002543 10/2019

Chapter 65
IEC_BMDI_M: Block move

IEC_BMDI_M: Block move

Introduction
This chapter describes the IEC_BMDI_M block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 468
Detailed description 472

33002543 10/2019 467


IEC_BMDI_M

Description

Function description
This procedure copies the number of elements listed in NumberOfElements wordwise, from
position OffsetInSourceTable in the source table (SourceTable) to position OffsetInDes-
tinationTable in the destination table (DestinationTable).

WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to possible forced
values in the reference data editor. This can produce serious process conditions.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

468 33002543 10/2019


IEC_BMDI_M

Representation in LD
Representation:

Representation in IL
Representation:
LD SourceTable
IEC_BMDI_M OffsetInSourceTable, NumberOfElements,
DestinationTable, OffsetInDestinationTable

Representation in ST
Representation:
IEC_BMDI_M (SourceTable, OffsetInSourceTable,
NumberOfElements, DestinationTable,
OffsetInDestinationTable);

33002543 10/2019 469


IEC_BMDI_M

Parameter description
Description of input parameters:

Parameter Data type Description


SourceTable UINT Quantum source table having contents copied.
Selection of source table:
0 = Marker-Bits %MX
1 = Input Bits %IX
3 = Input words %IW
4 = Marker words %MW
OffsetInSourceTable UINT Offset in selected source table (SourceTable). As
the copy operation is executed word-by-word,
OffsetInSourceTable must be a multiple of
16+1 for 0x and 1x source tables (e.g. 17, 33, 49
etc.) The offset is subject to upper limit supervision
and must be within the limits of the source table.
NumberOfElements UINT Table size for source and destination table.
NumberOfElements indicates the number of
elements in the source table to be copied. Because
the copy operation is performed word-by-word, 0x
and 1x source tables must have a multiple of 16
(e.g. 16, 32, 48, etc.) for NumberOfElements.
NumberOfElements is subject to upper limit
supervision and must be within the limits of the
source and destination tables. Independent of the
configured limits, the NumberOfElements value
was additionally restricted to the following values to
prevent the copy operation from taking up too much
time:
%MX, %IX Bits: max NumberOfElements = 1600
%IW, %MW Registers: max NumberOfElements
= 100
DestinationTable UINT Destination table to which contents of source table
will be copied. Selection of destination table:
0 = Marker-Bits %MX
4 = Marker words %MW
OffsetInDestina- UINT Offset in selected source table. Because the copy
tionTable operation is performed word-by-word, 0x and 1x
source tables OffsetInDestinationTable
must have a multiple of 16+1 (e.g. 17, 33, 49, etc.).
The offset is subject to upper limit supervision and
must be within the limits of the destination table.

470 33002543 10/2019


IEC_BMDI_M

Runtime error
The following standard user error messages are used:

User error message Description


E_EFB_USER_ERROR_1 Input value is invalid register type (SourceTable).
E_EFB_USER_ERROR_2 The input offset (OffsetInSourceTable) selects an
address outside acceptable limits.
E_EFB_USER_ERROR_3 The input offset (OffsetInSourceTable) is not 1 or a
multiple of 16+1.
E_EFB_USER_ERROR_4 Output value is invalid register type (DestinationTable).
E_EFB_USER_ERROR_5 The output offset (OffsetInDestinationTable) selects
an address outside acceptable limits.
E_EFB_USER_ERROR_6 The output offset (OffsetInDestinationTable) is not 1
or a multiple of 16+1.
E_EFB_USER_ERROR_7 The value for (NumberOfElements) is 0.
E_EFB_USER_ERROR_8 The value for (NumberOfElements) addresses more than
1600 bits.
E_EFB_USER_ERROR_9 The value for (NumberOfElements) addresses more than
100 words.
E_EFB_USER_ERROR_10 The value for (NumberOfElements) selects a source
address outside the acceptable limits.
E_EFB_USER_ERROR_11 The value for (NumberOfElements) selects a destination
address outside the acceptable limits.
E_EFB_USER_ERROR_12 The value for (NumberOfElements) is not a multiple of 16.
E_EFB_USER_ERROR_13 Warning: Address overlap of input and output addresses.

If there are no errors, the procedure copies the values from the indicated source to the destination
address and sets the ENO output to 1.
The user errors 1 through 12 will block the copy operation and are setting the ENO output to 0.
If user error 13 occurs, the copy operation continues and the ENO output remains at 1 because this
error is treated as a warning.
NOTE: For a list of all block error codes, see Extension/Compatibility, page 619.

33002543 10/2019 471


IEC_BMDI_M

Detailed description

Function description

WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to possible forced
values in the reference data editor. This can produce serious process conditions.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

IEC_BMDI_M creates a word-by-word copy of the number of elements listed in LENGTH from the
OFF_IN position in the source table (SEL_IN) to the OFF_OUT position in the destination table
(SEL_OUT). While copying, LENGTH always uses the type of SEL_IN for orientation (%IX, %MX:
LENGTH = Number of Bits; %IW, %MW: LENGTH = number of words)
Copy behavior:
 %MX or %IX to %MX
The source and target lengths are identical during copying of %MX or %IX to %MX
 %IW or %MW to %MW
The source and target lengths are identical during copying of %IW or %MW to %MW
 %MX or %IX to %MW
When copying %MX or %IX to %MW, a WORD-to-WORD copy is made as well. In this, the first
source bit is copied into the MSB (highest bit) of the first %MW register, and so on. LENGTH
defines the number of bits to be copied. The maximum output length is LENGTH/16 registers.
 %IW or %MW to %MX
When copying %IW or %MW to %MX, a WORD-to-WORD copy is made as well. In this, the MSB
(highest bit) of the first register is copied into the first destination bit and so on. LENGTH defines
the number of registers to be copied. The maximum output length is LENGTH x 16 bits.

472 33002543 10/2019


IEC_BMDI_M

Example 1
In the example, 64 %MX source bits from start address %MX129 are copied into the %MW
destination register (starting at address %MW112). The input range is %MX129 to %MX192 and
the output range is %MW112 to %MW115.

Example 2
In the example, 11 %MW source bits from start address %MW250 are copied into the %MX
destination register (starting at address %MX257). The input range is %MW250 to %MW260 and
the output range is %MX257 to %MX432.

33002543 10/2019 473


IEC_BMDI_M

Example 3
In the example, 128 %MX source bits from start address %MX001 are copied into the %MX
destination register (starting at address %MX257). The input range is %MX001 to %MX127 and
the output range is %MX257 to %MX384.

Example 4
In the example, 15 %MW source bits from start address %MW250 are copied into the %MW
destination register (starting at address 4:01030). The input range is %MW250 to %MW264, and
the output range is 4:01030 to 4:01044.

474 33002543 10/2019


EcoStruxure™ Control Expert
LIFO
33002543 10/2019

Chapter 66
LIFO: Last In/First Out stack register

LIFO: Last In/First Out stack register

Introduction
This chapter describes the LIFO block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 476
Detailed description 478

33002543 10/2019 475


LIFO

Description

Function description
This function block is a ‘last in – first out’ stack register.
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

Representation in LD
Representation:

476 33002543 10/2019


LIFO

Representation in IL
Representation:
CAL LIFO_Instance (R:=ClearedStackRegister, SET:=WriteValue,
GET:=ReadValue, X:=StackRegisterInput,
N_MAX:=MaxNumberInStack, FULL=>StackRegisterFull,
EMPTY=>StackRegisterEmpty, Y=>StackRegisterOutput)

Representation in ST
Representation:
LIFO_Instance (R:=ClearedStackRegister, SET:=WriteValue,
GET:=ReadValue, X:=StackRegisterInput,
N_MAX:=MaxNumberInStack, FULL=>StackRegisterFull,
EMPTY=>StackRegisterEmpty, Y=>StackRegisterOutput) ;

Parameter description
Description of input parameters:

Parameter Data type Description


R BOOL 1 = stack register will be cleared
SET BOOL 1 = write value to stack register
GET BOOL 1 = read value from stack register
X ANY Stack register input
N_MAX UINT Maximum number of elements in the stack register

Description of output parameters:

Parameter Data type Description


FULL BOOL 1= stack is full, no further elements can be put in the
stack.
EMPTY BOOL 1 = stack register is empty (number of elements in
the stack register = 0)
Y ANY Stack register output

Runtime error
For a list of all block error codes and values, see here (see page 619).

33002543 10/2019 477


LIFO

Detailed description

Function description
LIFO is a 'last in-first out' stack register.
The index and stack registers are invisible to the user. The stack register is part of the internal state
and can accept up to 2000 bytes (i.e. 1000 INT or 500 REAL or 500 TIME elements).
The function block has two Boolean inputs, GET and SET, that are used to either read a value from
or write a value to the stack register. If GET and SET are set simultaneously, SET (write) will be
executed before GET (read).
The stack register will be cleared if R(eset) = 1.
The input parameters checking the stack must be set in a meaningful order to allow the function
block to work properly.
A meaningful order is, for example:

Cycle Parameters Result


Cycle n R=0, SET=0, GET=0 Stack not initialized
Cycle n+1 R=1, SET=0, GET=0 Stack initialized
Cycle n+2 R=0, SET=0, GET=0 End initializing
Cycle n+3 R=0, SET=1, GET=0 Loading stack with x values
Cycle n+x+1 R=0, SET=0, GET=0 End loading
Cycle n+x+2 R=0, SET=0, GET=1 Getting x values
Cycle n+x+2+x R=0, SET=0, GET=1 Stack not empty

An N_MAX parameter defines the maximum number of elements in the stack register.
In a full stack register (number of elements in the stack register = N_MAX <= 2000 / (size of (X)),
FULL is set to 1. Cannot put any more elements onto stack register.
In an empty stack register (number of elements in the stack register = 0), EMPTY is set to 1.
The function has one X input and one Y output for various data types.
X and Y are type ANY, which implies a predefined length. Due to the limited size of the stack
register, only data types with an element size less than or equal to 200 bytes are allowed.
Otherwise a runtime error will be generated and the ENO output is set to 0.

478 33002543 10/2019


EcoStruxure™ Control Expert
LOW_INT
33002543 10/2019

Chapter 67
LOW_INT: Extracting the least significant word of a double integer

LOW_INT: Extracting the least significant word of a double


integer

Description

Description of the function


The function LOW_INT extracts the least significant word of a double integer.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Double_Int
LOW_INT
ST Low_Int

33002543 10/2019 479


LOW_INT

Representation in ST
Representation:
Low_Int := LOW_INT(Double_Int);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Double_Int DINT Double integer whose least significant word is
extracted.

The following table describes the output parameters:

Parameter Type Comment


Low_Int INT The least significant word extracted from the double
integer Double_Int.

480 33002543 10/2019


EcoStruxure™ Control Expert
MUX_DINTARR_125
33002543 10/2019

Chapter 68
MUX_DINTARR_125: Multiplexer for arrays of the data type DIntArr125

MUX_DINTARR_125: Multiplexer for arrays of the data type


DIntArr125

Description

Function description
Use this function to address and select a single element in an array. When addressing arrays, only
constant indexes can be entered in the programming languages FBD and LD.
With the help of this function, variables for indexing can also be used.
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD DIntArray
MUX_DINTARR_125 PositionInArray
ST SelectedElement

33002543 10/2019 481


MUX_DINTARR_125

Representation in ST
Representation:
SelectedElement := MUX_DINTARR_125 (DIntArray,
PositionInArray) ;

Parameter description MUX_DINTARR_125


Description of input parameters:

Parameter Data type Description


DIntArray DIntArr125 Array an element is to be selected from
PositionInArray INT Position in the array where the element to be
selected is placed (range 0 ... 124)

Description of output parameters:

Parameter Data type Description


SelectedElement DINT selected element

Parameter description DIntArr125


Description of the DIntArr125 data type:

Element Data type Description


varname[1] DINT 1. Element of the array
... ... ...
varname[125] DINT 125. Element of the array

Runtime error
If the value range of the PositionInArray input is exceeded, an error message is displayed in
the Diagnostic Viewer (see EcoStruxure™ Control Expert, Operating Modes) and %SW125
(see EcoStruxure™ Control Expert, System Bits and Words, Reference Manual) contains the error
code value.
NOTE: For a list of all block error codes and values, see Extension/Compatibility, page 619.

482 33002543 10/2019


EcoStruxure™ Control Expert
PL7_COUNTER
33002543 10/2019

Chapter 69
PL7_COUNTER : Counter/downcounter

PL7_COUNTER : Counter/downcounter

Object of this chapter


This chapter describes the PL7_COUNTERfunction.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 484
Mode of operation of the PL7_COUNTER function 488

33002543 10/2019 483


PL7_COUNTER

Description

Description of the function


The PL7_COUNTER function block is a counter/down counter that allows counting of pulses up or
down.
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_COUNTER function in online mode. This means
you must be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_COUNTER the application cannot be
transfered in the PLC.

FBD representation
Representation:

484 33002543 10/2019


PL7_COUNTER

LD representation
Representation:

IL representation
Representation:
CAL Counter_1(R := Raz, P := Preselect, CU := Count_Up, CD := Count_Down,
E => Empty, D => Done, F => Full)

ST representation
Representation:
IF Raz THEN
RESET_PL7_COUNTER (Counter_1) ;
END_IF ;

IF Preselect THEN
PRESET_PL7_COUNTER (Counter_1) ;
END_IF ;

IF Count_Up THEN
UP_PL7_COUNTER (Counter_1) ;
END_IF ;

33002543 10/2019 485


PL7_COUNTER

IF Count_Down THEN
DOWN_PL7_COUNTER (Counter_1) ;
END_IF ;

Empty := Counter_1.E ;
Done := Counter_1.D ;
Full := Counter_1.F ;

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


R BOOL Input of reset to zero, if Counter_1.R is equal to 1, the
current value of the counter Counter_1.CV = 0
P BOOL Preset input, if Counter_1.S equals 1,
Counter_1.CV = Counter_1.PV
CU BOOL Count input, the current value is incremented by 1 on
the rising edge of Counter_1.CU.
CD BOOL Down-count input, the current value is decremented by
1 on the rising edge of Counter_1.CD.

The following table describes the output parameters:

Parameter Type Comment


E BOOL Empty counter output. Counter_1.E=1 when
Counter_1.CV changes from 0 to 9999 and then to 0
again if the counter continues to count down.
D BOOL Output which indicates that the counter has reached the
preset value. Counter_1.CD = 1 when
Counter_1.CV = Counter_1.PV.
F BOOL Full counter output. Counter_1.F = 1 when
Counter_1.CV changes from to 9999 to 0 and then to
0 again if the counter continues to count up.

486 33002543 10/2019


PL7_COUNTER

Description of variables
The following table describes the public variables:

Parameter Type Comment


CV INT Current value of counter. This value can be read and
tested but not written by the program.
PV INT This value, which is between 0 and 9999, is known as
the counter preset value. It can be written, read and
tested by the program; the default setting is 9999.

33002543 10/2019 487


PL7_COUNTER

Mode of operation of the PL7_COUNTER function

Description
The following table describes the specific modes of operation of the PL7_COUNTER function:

Effect... Description
of a cold restart (%S0=1) the current value is reset to zero, the outputs are set to
zero and the preset value is initialized at the value defined in
configuration.
of a warm restart, a (%S1=1) has no effect on the current value of the counter.
change to stop,
deactivation of a task
or execution of a
breakpoint
of modifying the preset A modification to the preset value by instruction or adjustment is
taken into account during management of the block by the
application.

NOTE: it is recommended to test the output bits only once in the program.

488 33002543 10/2019


EcoStruxure™ Control Expert
PL7_DRUM
33002543 10/2019

Chapter 70
PL7_DRUM : Drum

PL7_DRUM : Drum

Object of this chapter


This chapter describes the PL7_DRUMfunction.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 490
Mode of operation of the PL7_DRUM timer function 494

33002543 10/2019 489


PL7_DRUM

Description

Description of the function


The PL7_DRUM function block is a drum. Each step is associated with output bits or internal bits
known as order bits. This function block is used to convert PL7 programs; it corresponds to the
conversion of the %DRi’s under PL7.
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_DRUM function in online mode. This means you
must be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_DRUM the application cannot be transfered
in the PLC.

FBD representation
Representation:

LD representation
Representation:

490 33002543 10/2019


PL7_DRUM

IL representation
Representation:
CAL PL7_Drum_1(R := Raz, U := Up, F => Full, W => %MW0)

ST representation
Representation:
IF Raz THEN
RESET_PL7_DRUM(PL7_Drum_1);
END_IF ;
IF RE (Up) THEN
UP_PL7_DRUM(PL7_Drum_1);
END_IF ;

Full := PL7_Drum_1.F ;
%MW0 := PL7_Drum_1.W ;

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


R BOOL "Return to step 0" input, at state 1 initializes the drum at
step 0.
U BOOL "Advance" input, on rising edge causes the drum to
advance by one step and the updating of the order bits.

The following table describes the output parameters:

Parameter Type Comment


F BOOL Output indicating that the final step defined is in
progress.
W INT Current step output value.

33002543 10/2019 491


PL7_DRUM

Description of variables
The following table describes the public variables:

Parameter Type Comment


LEN UINT Number of steps: possible values from 1 to 16 (default
is 16).
ET INT Time out or duration of current step. PL7_Drum_1.ET
is between 0 and 9999. This integer can be reset to zero
for each step change. It can be read and tested, but not
written. The duration of a step is equal to
PL7_Drum1.ET x PL7_Drum_1.TB.
S INT Between 0 and 15, this is the number of the current
step. This integer can be read and tested. It can only be
written from an immediate value.
TB UINT Cyclical programmer time base. Possible values:
 TB = 8: 1 mn (default value),
 TB = 4: 1 s,
 TB = 2: 100 ms,
 TB = 1: 10 ms.

When the program is executed, the value of the time


base (TB defined in offline mode) is rounded down to
the nearest multiple of 2 (between 1 and 8).
W0...Wj INT PL7_Drum_1.Wj is a word representing the state of
(j=LEN-1) step j. This word (type INT) indicates the state of each
order bit for a given step. It is entered by the user using
the data editor.
Note: There are as many Wj as there are steps (LEN).

CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected behavior of the
application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.

492 33002543 10/2019


PL7_DRUM

Chart
Chart of the operation of the PL7_DRUM function block:

The number of the current step is incremented for each rising edge on the input PL7_Drum_1.U
(or activation of the instruction UP_PL7_DRUM(PL7_Drum_1)). This number can be changed by
the program.

33002543 10/2019 493


PL7_DRUM

Mode of operation of the PL7_DRUM timer function

Description
The following table describes the specific modes of operation of the PL7_DRUM function:

Effect... Description
of a cold restart (%S0=1) causes the reinitialization of the programmer to step 0
(with updating of the order bits).
of a warm restart (%S1=1) causes the updating of the order bits according to the
current step.
a program jump, The fact of not scanning the drum does not cause a reset to 0 of the
deactivation of a task order bits.
or execution of a
breakpoint

NOTE: updating of the order bits only takes place when there is a change of step or when there is
a warm or cold start.
NOTE: on resetting to 0:
 In LD and FBD, the history of the input PL7_Drum_1.U is updated with the cabled values.
 In IL, the history of the input PL7_Drum_1.U is not updated; it retains the value it had before
the call.
 In ST, the history of the input PL7_Drum_1.U is updated with 0.

494 33002543 10/2019


EcoStruxure™ Control Expert
PL7_MONOSTABLE
33002543 10/2019

Chapter 71
PL7_MONOSTABLE : Monostable

PL7_MONOSTABLE : Monostable

Object of this chapter


This chapter describes the PL7_MONOSTABLEfunction.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 496
Detailed description of the operation of the PL7_MONOSTABLE function 499
Mode of operation of the PL7_MONOSTABLE monostable function 500

33002543 10/2019 495


PL7_MONOSTABLE

Description

Description of the function


The PL7_MONOSTABLE function block is a monostable that allows a pulse to be generated with a
precise duration.
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_MONOSTABLE function in online mode. This
means you must be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_MONOSTABLE the application cannot be
transfered in the PLC.

FBD representation
Representation:

LD representation
Representation:

496 33002543 10/2019


PL7_MONOSTABLE

IL representation
Representation:
CAL Mn_1(S := Mn_Start, R => Mn_State)

ST representation
Representation:
IF RE(Mn_Start) THEN
START_PL7_MONOSTABLE (Mn_1) ;
END_IF ;

Mn_State := Mn_1.R ;

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


S BOOL "Start" input, on rising edge, starts the monostable.

The following table describes the output parameters:

Parameter Type Comment


R BOOL "Run" output:
 Mn_1.R = 0 if Mn_1.ET = Mn_1.PT or Mn_1.ET = 0.
 Mn_1.R = 1 otherwise.

NOTE: the monostable can be reset on the rising edge of Ma_1.S, on the other hand, the length
of the monostable starting pulse does not change the pulse generated as the monostable is started
on the rising edge.

33002543 10/2019 497


PL7_MONOSTABLE

Description of variables
The following table describes the public variables:

Parameter Type Comment


ET INT Current value of the monostable which runs down over
time from Mn_1.PT to 0. This value can be read and
tested but not written by the program.
PT INT This value, which is between 0 and 9999, is known as
the monostable preset value. It can be written, read and
tested by the program. Its default setting is 9999. The
value of the pulse generated by the monostable is equal
to Mn_PT x TB.
TB UINT Cyclical programmer time base. Possible values:
 TB = 8: 1 mn (default value),
 TB = 4: 1 s,
 TB = 2: 100 ms,
 TB = 1: 10 ms.

When the program is executed, the value of the time


base (TB defined in offline mode) is rounded down to
the nearest multiple of 2 (between 1 and 8).

CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected behavior of the
application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.

498 33002543 10/2019


PL7_MONOSTABLE

Detailed description of the operation of the PL7_MONOSTABLE function

Chart
Chart showing operation of the monostable

Operation
Description of monostable operation

Phase Description
1 Once a rising edge appears on input Mn_1.S of the monostable, the current
value Mn_1.ET takes the preselection value Mn_1.PT.
2 The current value Mn_1.ET decreases to 0 at a rate of one unit for each pulse
of the time base Mn_1.TB
3 The output bit Mn_1.R (Running) switches to 1 once the current value Mn_1.ET
is different to 0.
4 When the current value Mn_1.ET = 0, the output bit Mn_1.R switches back to 0.

33002543 10/2019 499


PL7_MONOSTABLE

Mode of operation of the PL7_MONOSTABLE monostable function

Description
The following table describes the specific modes of operation of the PL7_MONOSTABLE function:

Effect... Description
of a cold restart (%S0=1), causes a reset to zero of the current value, the preset
value is reinitialized to the value defined in the configuration and the
current value is set at the preset value.
of a warm restart (%S1=1) has no effect on the current value of the monostable or on
the preset value. The current value does not change during a power
outage.
a change to stop, Does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the monostable
block is programmed does not freeze the current value that
continues to decrease towards zero.
Similarly the output bit retains it normal function and can thus be
tested by another instruction. On the other hand the output, directly
cabled to the output, is not activated as it is not scanned by the PLC
Output bit test the output bit can change state in mid-cycle.

NOTE: it is recommended to test the output bit of the monostable only once in the program.

500 33002543 10/2019


EcoStruxure™ Control Expert
PL7_REGISTER_32
33002543 10/2019

Chapter 72
PL7_REGISTER_32 : 32 word memory register

PL7_REGISTER_32 : 32 word memory register

Description

Description of the function


The PL7_REGISTER_32 function block is a memory register that can store up to 32 words (of the
INT type).
There are two storage modes:
 FIFO mode (first in, first out), also known as file,
 LIFO mode (last in, first out), also known as pile.
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_REGISTER_32 function in online mode. This
means you must be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_REGISTER_32 the application cannot be
transfered in the PLC.

FBD representation
Representation:

33002543 10/2019 501


PL7_REGISTER_32

LD representation
Representation:

IL representation
Representation:
CAL R_1 (R := Raz, I := In_Pulse, O := Out_Pulse, E => Empty, F => Full)

ST representation
Representation:
IF Raz THEN
RESET_PL7_REGISTER_32 (R_1) ;
END_IF ;

IF RE(In_Pulse) THEN
GET_PL7_REGISTER_32 (R_1) ;
END_IF ;

IF RE(Out_Pulse) THEN
PUT_PL7_REGISTER_32 (R_1) ;
END_IF ;

Empty := R_1.E ;
Full := R_1.F ;

502 33002543 10/2019


PL7_REGISTER_32

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


R BOOL Input of reset to zero, if R_1.R equals 1 the register is
emptied.
I BOOL Storage input, on rising edge, the input word of the
register is stored in the register.
O BOOL Destock input, on rising edge, the input word is written
with the information ready to be destocked from the
register.

The following table describes the output parameters:

Parameter Type Comment


E BOOL Empty register output. When the register is empty, it is
no longer possible to destock information.
F BOOL Full register output. When the register is full, it is no
longer possible to store information.

NOTE: when both inputs (store and destock) are activated simultaneously, storing is carried out
before destocking.

Description of variables
The following table describes the public variables:

Parameter Type Comment


FIFO BOOL Mode of operation of the register:
 True : FIFO.
 False : LIFO (default).

IN W INT Input word of the register; it can be read, tested or


written.
OUT W INT Output word of the register; it can be read, tested or
written.
LEN UINT Number of words of the register.

33002543 10/2019 503


PL7_REGISTER_32

Operating modes
The following table describes the specific modes of operation of the PL7_REGISTER_32 function:

Effect... Description
of a cold restart (%S0=1), causes the initialization of the contents of the register. The
output bit indicating that the register is empty is set at 1.
of a warm restart (%S1=1) has no effect on the content of the register or on the state
of the output bits.
of a reset to zero The effect of the reset to zero differs according to the language
used :
 in LD and FBD, the input histories are updated with the cabled
values,
 in IL, the input histories are not updated and each input retains
the value it had prior to the call.
 in ST, the input histories are set to zero.

504 33002543 10/2019


EcoStruxure™ Control Expert
PL7_REGISTER_255
33002543 10/2019

Chapter 73
PL7_REGISTER_255 : 255 word memory register

PL7_REGISTER_255 : 255 word memory register

Description

Description of the function


The PL7_REGISTER_255 function block is a memory register that can store up to 255 words (of
the INT type).
There are two storage modes:
 FIFO mode (first in, first out), also known as file,
 LIFO mode (last in, first out), also known as pile.
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_REGISTER_255 function in online mode. This
means you must be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_REGISTER_255 the application cannot be
transfered in the PLC.

FBD representation
Representation:

33002543 10/2019 505


PL7_REGISTER_255

LD representation
Representation:

IL representation
Representation:
CAL R_1 (R := Raz, I := In_Pulse, O := Out_Pulse, E => Empty, F => Full)

ST representation
Representation:
IF Raz THEN
RESET_PL7_REGISTER_255 (R_1) ;
END_IF ;

IF RE(In_Pulse) THEN
GET_PL7_REGISTER_255 (R_1) ;
END_IF ;

IF RE(Out_Pulse) THEN
PUT_PL7_REGISTER_255 (R_1) ;
END_IF ;

Empty := R_1.E ;
Full := R_1.F ;

506 33002543 10/2019


PL7_REGISTER_255

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


R BOOL Input of reset to zero, if R_1.R equals 1 the register is
emptied.
I BOOL Storage input, on rising edge, the input word of the
register is stored in the register.
O BOOL Destock input, on rising edge, the input word is written
with the information ready to be destocked from the
register.

The following table describes the output parameters:

Parameter Type Comment


E BOOL Empty register output. When the register is empty, it is
no longer possible to destock information.
F BOOL Full register output. When the register is full, it is no
longer possible to store information.

NOTE: when both inputs (store and destock) are activated simultaneously, storing is carried out
before destocking.

Description of variables
The following table describes the public variables:

Parameter Type Comment


FIFO BOOL Mode of operation of the register:
 True : FIFO.
 False : LIFO (default).

IN W INT Input word of the register; it can be read, tested or


written.
OUT W INT Output word of the register; it can be read, tested or
written.
LEN UINT Number of words of the register.

33002543 10/2019 507


PL7_REGISTER_255

Operating modes
The following table describes the specific modes of operation of the PL7_REGISTER_255 function:

Effect... Description
of a cold restart (%S0=1), causes the initialization of the contents of the register. The
empty register output bit is set at 1.
of a warm restart (%S1=1) has no effect on the content of the register or on the state
of the output bits.
of a reset to zero The effect of the reset to zero differs according to the language
used :
 in LD and FBD, the input histories are updated with the cabled
values,
 in IL, the input histories are not updated and each input retains
the value it had prior to the call.
 in ST, the input histories are set to zero.

508 33002543 10/2019


EcoStruxure™ Control Expert
PL7 and Control Expert Timers Comparison
33002543 10/2019

Chapter 74
PL7 and Control Expert Timers Comparison

PL7 and Control Expert Timers Comparison

Differences between PL7 and Control Expert: Timers

Introduction
This part explains the differences between the PL7 timers and IEC timers available in
Control Expert. Those differences are useful especially when migrating from PL7 software to
Control Expert.
The PL7 timers include:
 PL7_TON
 PL7_TOF
 PL7_TP
The IEC timers include:
 TON
 TOF
 TP

IEC timers and PL7 timers comparison


The table below lists the differences between IEC timers and PL7 timers:

IEC Timers PL7 Timers


Allowed amount of Unlimited 255
timers in application
Programming  No time base  Time base (min, sec, or ms)
 Preset time is a TIME type must be defined with an
(t#1mn20s) integer
 The current value of the  The preset time is an INT type
timer is directly one output (time base factor)
ET of TIME type  The current value is provided
by a public variable
Running Mode The TON instance must be The output is set once the timer is
scanned in the program to launched
refresh the output
Online Mode Online modifications The user cannot:
(add/modify) allowed on TON  Modify the time base
instance  Create new instance

33002543 10/2019 509


PL7 and Control Expert Timers Comparison

510 33002543 10/2019


EcoStruxure™ Control Expert
PL7_TOF
33002543 10/2019

Chapter 75
PL7_TOF : TOF type timer

PL7_TOF : TOF type timer

Object of this chapter


This chapter describes the PL7_TOFfunction.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 512
Detailed description of the operation of the PL7_TOF function 515
Mode of operation of the PL7_TOF timer function 516

33002543 10/2019 511


PL7_TOF

Description

Description of the function


The PL7_TOF function block is a timer of the TOF type (fall-delay time).
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_TOF function in online mode. This means you
must be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_TOF the application cannot be transfered in
the PLC.

FBD representation
Representation:

LD representation
Representation:

512 33002543 10/2019


PL7_TOF

IL representation
Representation:
CAL TOF_Timer_1(S := Timer_Start, Q => Timer_State)

ST representation
Representation:
IF RE(Timer_start) THEN
START_PL7_TOF (TOF_Timer_1) ;
END_IF ;

IF FE(Timer_Start) THEN
DOWN_PL7_TOF (TOF_Timer_1) ;
END_IF ;

Timer_State := TOF_Timer_1.Q ;

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


S BOOL "Activation" input, on rising edge, starts the timer.

The following table describes the output parameters:

Parameter Type Comment


Q BOOL "Timer" output, setting at 1 of this depends on the timer
state.

33002543 10/2019 513


PL7_TOF

Description of variables
The following table describes the public variables:

Parameter Type Comment


ET INT Current value of the timer that runs down over time. This
value can be read and tested but not written by the
program.
PT INT This value, which is between 0 and 9999, is known as
the timer preset value. It can be written, read and tested
by the program. Its default setting is 9999. The delay
created by the timer is equal to PT x TB.
TB UINT Timer time base. Possible values:
 TB = 8: 1 mn (default value),
 TB = 4: 1 s,
 TB = 2: 100 ms,
 TB = 1: 10 ms.

The lower the time base, the greater the timer accuracy.
When the program is executed, the value of the time
base (TB defined in offline mode) is rounded down to
the nearest multiple of 2 (between 1 and 8).

CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected behavior of the
application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.

514 33002543 10/2019


PL7_TOF

Detailed description of the operation of the PL7_TOF function

Chart
Chart.

Operation
The following table describes the operation of the PL7_TOF timer function:

Phase Description
1 The current value TOF_Timer_1.ET takes the value 0, on a rising edge of the
TOF_Timer_1.S input (even if the timer is running at the time).
2 The output bit TOF_Timer_1.Q changes to 1.
3 When there is a falling edge on the TOF_Timer_1.S, input the timer is started.
4 The current value increases towards TOF_Timer_1.PT by one unit for each
pulse of the time base TB.
5 The output bit TOF_Timer_1.Q falls to 0 again as soon as the current value
reaches TOF_Timer_1.PT.

33002543 10/2019 515


PL7_TOF

Mode of operation of the PL7_TOF timer function

Description
The following table describes the specific modes of operation of the PL7_TOF timer function:

Effect... Description
of a cold restart (%S0=1), causes a reset to zero of the current value, a reset to 0 of
the Q output and the preset value is reset to the value defined in the
configuration.
of a warm restart (%S1=1) has no effect on the current value of the timer or on the
preset value. The current value does not change during a power
outage.
a change to stop, Does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the timer block is
programmed does not freeze the current value ET which continues
to increase towards PT.
Similarly bit Q retains it normal function and can thus be tested by
another instruction. On the other hand the output, directly cabled to
the output Q, is not activated as it is not scanned by the PLC
of modifying the preset A modification to the preset value by instruction or adjustment is
only taken into account the next time the timer function is activated.
A modification of the preset value in the variables editor is only taken
into account after a cold restart (%S0=1).

NOTE: it is recommended to test bit Q only once in the program.

516 33002543 10/2019


EcoStruxure™ Control Expert
PL7_TON
33002543 10/2019

Chapter 76
PL7_TON : TON type timer

PL7_TON : TON type timer

Object of this chapter


This chapter describes the PL7_TONfunction.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 518
Detailed description of the operation of the PL7_TON function 521
Mode of operation of the PL7_TON timer function 522

33002543 10/2019 517


PL7_TON

Description

Description of the function


The PL7_TON function block is a timer of the TON type (rise-delay time).
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_TON function in online mode. This means you
must be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_TON the application cannot be transfered in
the PLC.

FBD representation
Representation:

LD representation
Representation:

518 33002543 10/2019


PL7_TON

IL representation
Representation:
LD Timer_Start
CAL TON_Timer_1(S := TON_Timer_1, Q => Timer_State)

ST representation
Representation:
IF RE(Timer_start) THEN
START_PL7_TON (TON_Timer_1) ;
END_IF ;

IF FE(Timer_Start) THEN
DOWN_PL7_TON (TON_Timer_1) ;
END_IF ;

Timer_State := TON_Timer_1.Q ;

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


S BOOL "Activation" input, on rising edge, starts the timer.

The following table describes the output parameters:

Parameter Type Comment


Q BOOL "Timer" output, setting at 1 of this depends on the timer
state.

33002543 10/2019 519


PL7_TON

Description of variables
The following table describes the public variables:

Parameter Type Comment


ET INT Current value of the timer that runs down over time. This
value can be read and tested but not written by the
program.
PT INT This value, which is between 0 and 9999, is known as
the timer preset value. It can be written, read and tested
by the program. Its default setting is 9999. The delay
created by the timer is equal to PT x TB.
TB UINT Timer time base. Possible values:
 TB = 8: 1 mn (default value),
 TB = 4: 1 s,
 TB = 2: 100 ms,
 TB = 1: 10 ms.

The lower the time base, the greater the timer accuracy.
When the program is executed, the value of the time
base (TB defined in offline mode) is rounded down to
the nearest multiple of 2 (between 1 and 8).

CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected behavior of the
application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.

520 33002543 10/2019


PL7_TON

Detailed description of the operation of the PL7_TON function

Chart
Chart.

Operation
The following table describes the operation of the PL7_TON timer function:

Phase Description
1 When there is a rising edge on the TON_Timer_1.S, input the timer is started.
2 The current value TON_Timer_1.ET of the timer increases from 0 towards
TON_Timer_1.PT at a rate of one unit for each pulse of the time base TB.
3 The output bit TON_Timer_1.Q changes to 1 as soon as the current value
reaches TON_Timer_1.PT.
4 The TON_Timer_1.Q output bit remains at 1 while the TON_Timer_1.S input
is at 1.
5 When the TON_Timer_1.S input is at 0, the timer is stopped, even if it was
running at the time: TON_Timer_1.ET takes the value 0.

33002543 10/2019 521


PL7_TON

Mode of operation of the PL7_TON timer function

Description
The following table describes the specific modes of operation of the PL7_TON timer function:

Effect... Description
of a cold restart (%S0=1), causes a reset to zero of the current value, a reset to 0 of
the Q output and the preset value is reset to the value defined in the
configuration.
of a warm restart (%S1=1) has no effect on the current value of the timer or on the
preset value. The current value does not change during a power
outage.
a change to stop, Does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the timer block is
programmed does not freeze the current value ET which continues
to increase towards PT.
Similarly bit Q retains it normal function and can thus be tested by
another instruction. On the other hand the output, directly cabled to
the output Q, is not activated as it is not scanned by the PLC.
of modifying the preset A modification to the preset value by instruction or adjustment is
only taken into account the next time the timer function is activated.
A modification of the preset value in the variables editor is only taken
into account after a cold restart (%S0=1).

NOTE: it is recommended to test bit Q only once in the program.

522 33002543 10/2019


EcoStruxure™ Control Expert
PL7_TP
33002543 10/2019

Chapter 77
PL7_TP : TP type timer

PL7_TP : TP type timer

Object of this chapter


This chapter describes the PL7_TP function.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 524
Detailed description of the operation of the PL7_TP function 527
Mode of operation of the PL7_TP timer function 528

33002543 10/2019 523


PL7_TP

Description

Description of the function


The PL7_TP function block is a TP type timer that allows pulses to be generated with a precise
duration (monostable function).
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_TP function in online mode. This means you must
be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_TP the application cannot be transfered in
the PLC.

FBD representation
Representation:

LD representation
Representation:

524 33002543 10/2019


PL7_TP

IL representation
Representation:
CAL TP_Timer_1(S := Timer_Start, Q => Timer_State)

ST representation
Representation:
IF RE(Timer_start) THEN
START_PL7_TP (TP_Timer_1) ;
END_IF ;

IF FE(Timer_Start) THEN
DOWN_PL7_TP (TP_Timer_1) ;
END_IF ;

Timer_State := TP_Timer_1.Q ;

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


IN BOOL "Activation" input, on rising edge, starts the timer.

The following table describes the output parameters:

Parameter Type Comment


Q BOOL "Timer" output, setting at 1 of this depends on the timer
state.

33002543 10/2019 525


PL7_TP

Description of variables
The following table describes the public variables:

Parameter Type Comment


ET INT Current value of the timer that runs down over time. This
value can be read and tested but not written by the
program.
PT INT This value, which is between 0 and 9999, is known as
the timer preset value. It can be written, read and tested
by the program. Its default setting is 9999. The delay
created by the timer is equal to PT x TB.
TB UINT Timer time base. Possible values:
 TB = 8: 1 mn (default value),
 TB = 4: 1 s,
 TB = 2: 100 ms,
 TB = 1: 10 ms.

The lower the time base, the greater the timer accuracy.
When the program is executed, the value of the time
base (TB defined in offline mode) is rounded down to
the nearest multiple of 2 (between 1 and 8).

CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected behavior of the
application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.

526 33002543 10/2019


PL7_TP

Detailed description of the operation of the PL7_TP function

Chart
Chart.

Operation
The following table describes the operation of the PL7_TP timer function:

Phase Description
1 When there is a rising edge on the TP_Timer_1.S, input the timer is started
2 The output bit TP_Timer_1.Q changes to 1.
3 The current value TP_Timer_1.ET of the timer increases from 0 towards
TP_Timer_1.PT at a rate of one unit for each pulse of the time base TB
4 The output bit TP_Timer_1.Q falls to 0 again as soon as the current value
reaches TP_Timer_1.PT
5 When the TP_Timer_1.IN input and the TP_Timer_1.Q output are at 0,
TP_Timer_1.ET takes the value 0.
6 This monostable cannot be reset.

33002543 10/2019 527


PL7_TP

Mode of operation of the PL7_TP timer function

Description
The following table describes the specific modes of operation of the PL7_TP timer function:

Effect... Description
of a cold restart (%S0=1), causes a reset to zero of the current value, a reset to 0 of
the Q output and the preset value is reset to the value defined in the
configuration.
of a warm restart (%S1=1) has no effect on the current value of the timer or on the
preset value. The current value does not change during a power
outage.
a change to stop, does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the timer block is
programmed does not freeze the current value ET which continues
to increase towards PT.
Similarly bit Q retains it normal function and can thus be tested by
another instruction. On the other hand the output, directly cabled to
the output Q, is not activated as it is not scanned by the PLC
of modifying the preset A modification to the preset value by instruction or adjustment is
only taken into account the next time the timer function is activated.
A modification of the preset value in the variables editor is only taken
into account after a cold restart (%S0=1).

NOTE: it is recommended to test bit Q only once in the program.

528 33002543 10/2019


EcoStruxure™ Control Expert
PL7_3_TIMER
33002543 10/2019

Chapter 78
PL7_3_TIMER : Conversion timer for % Ti’s of PL7

PL7_3_TIMER : Conversion timer for % Ti’s of PL7

Object of this chapter


This chapter describes the PL7_3_TIMER function.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 530
Detailed description of the operation of the PL7_3_TIMER function 533
Mode of operation of the PL7_3_TIMER timer function 534

33002543 10/2019 529


PL7_3_TIMER

Description

Description of the function


The PL7_3_TIMER function block is a timer used for converting the %Ti of PL7 which were
themselves conversions of Ti of PL7_3.
The additional parameters EN and ENO can be configured.
NOTE: you cannot instantiate or modify the PL7_3_TIMER function in online mode. This means
you must be in offline mode and therefore you must transfer the project in the PLC.
NOTE: If you create more than 255 instances of PL7_3_TIMER the application cannot be
transfered in the PLC.

FBD representation
Representation:

LD representation
Representation:

530 33002543 10/2019


PL7_3_TIMER

IL representation
Representation:
CAL PL7_3_Timer_1(E := Timer_Enable, C := Timer_Control, D => Timer_Done,
R => Timer_Run)

ST representation
Representation:
IF Timer_Enable THEN
IF Timer_Control THEN
START_PL7_3_TIMER (PL7_3_Timer_1) ;
ELSE
STOP_PL7_3_TIMER (PL7_3_Timer_1) ;
END_IF
ELSE
PRESET_PL7_3_TIMER (PL7_3_Timer_1) ;
END_IF ;

Timer_Done := PL7_3_Timer_1.D ;
Timer_Run := PL7_3_Timer_1.R ;

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


E BOOL "Enable" input, on state 0 reinitializes the timer.
C BOOL "Control" input on state 0 freezes the progression of the
timer.

The following table describes the output parameters:

Parameter Type Comment


D BOOL "Timer run down" output, set at 1 if the current value is
equal to 0.
R BOOL "Timer running" output, set at 1 if the current value is
between 0 and the preset value and the control input is
at 1.

33002543 10/2019 531


PL7_3_TIMER

Description of variables
The following table describes the public variables:

Parameter Type Comment


ET INT Current value of the timer that runs down over time. This
value can be read and tested but not written by the
program.
PT INT This value, which is between 0 and 9999, is known as
the timer preset value. It can be written, read and tested
by the program. Its default setting is 9999. The delay
created by the timer is equal to PT x TB.
TB UINT Timer time base. Possible values are:
 TB = 8: 1 mn (default value),
 TB = 4: 1 s,
 TB = 2: 100 ms,
 TB = 1: 10 ms.

The lower the time base, the greater the timer accuracy.
When the program is executed, the value of the time
base (TB defined in offline mode) is rounded down to
the nearest multiple of 2 (between 1 and 8).

CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected behavior of the
application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.

532 33002543 10/2019


PL7_3_TIMER

Detailed description of the operation of the PL7_3_TIMER function

Chart
Chart.

E 0 0 1 1
C 0 1 0 1
PT ET = PT ET = PT ET frozen ET decreases by PT to 0
ET
D 0 1 0 1 if timer elapsed
R 0 1 0 1 if timer running

Operation
The following table describes the operation of the PL7_3_TIMER timer function:

Phase Description
1 The current value PL7_3_Timer_1.ET decreases from the preset
PL7_3_Timer_1.PT towards 0, by one unit per base time pulse.
2 The output bit PL7_3_Timer_1.R (Timer running) is then at state 1, the output
bit PL7_3_Timer_1.D (Timer elapsed) is at state 0.
3 When the current value PL7_3_Timer_1.ET = 0, PL7_3_Timer_1.D
changes to state 1 and PL7_3_Timer_1.R resets to state 0.

33002543 10/2019 533


PL7_3_TIMER

Mode of operation of the PL7_3_TIMER timer function

Description
The following table describes the specific modes of operation of the PL7_3_TIMER function:

Effect... Description
of a cold restart (%S0=1), causes the writing of the preset value (defined in
configuration) in the current value and the resetting to zero of the
"Done" output, with any preset value modified during adjustment
(terminal) being lost.
of a warm restart (%S1=1) has no effect on the current value of the timer or on the
preset value.
a change to stop, Does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the timer block is
programmed does not freeze the current value ET which continues
to decrease towards 0.
Similarly the two output bits retain their normal operation and can
thus be tested by another instruction. On the other hand, the coils
directly cabled to the outputs are not activated since they are not
scanned by the PLC.

NOTE: it is recommended to test the output bits only one in the program as they may change state
in mid-cycle.

534 33002543 10/2019


EcoStruxure™ Control Expert
PUT_4X
33002543 10/2019

Chapter 79
PUT_4X: Write 4x register

PUT_4X: Write 4x register

Description

Function description
This function copies values from input variable IN to the %MW register area (4x register area for
Quantum CPUs). OFF is the word offset in the %MW register area.
The function copies as many bytes as the size of the data type connected to the input pin IN.
The value in OFF may be modified at runtime. If OFF is outside the configured %MW register area,
an error message is generated and ENO is set to 0.
The function writes in any case only until the end of the configured %MW area, even if the
connected data type could have more data. The remaining part of the connected data type remains
unread by the block in such cases.
EN and ENO can be configured as additional parameters.

Example
This function writes the 16-bit value of register %MW120 (register 400120), if OFF = 120 and the
input is of data type INT.
This function writes only 1 word, if OFF addresses the last configured %MW, even if the size of the
connected IN variable is of larger size than a word.

Representation in FBD
Representation:

33002543 10/2019 535


PUT_4X

Representation in LD
Representation:

Representation in IL
Representation:
LD OffsetIn4XRegisterMemory
PUT_4X Input

Representation in ST
Representation:
PUT_4X (OffsetIn4XRegisterMemory, Input);

Parameter description
Description of input parameters:

Parameter Data type Description


Offse- UINT Offset in the %MW register memory (4x).
tIn4XRegis-
terMemory
Input ANY Input

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

536 33002543 10/2019


EcoStruxure™ Control Expert
R_INT_WORD
33002543 10/2019

Chapter 80
R_INT_WORD: Type conversion (REAL -> INT -> WORD) (R_INT_WORD: Type conversion (REAL -> INT -> WORD))

R_INT_WORD: Type conversion (REAL -> INT -> WORD)


(R_INT_WORD: Type conversion (REAL -> INT -> WORD))

Description

Function description
This function converts an input value with data type REAL to data type INT and then data type
WORD.
As opposed to the REAL_TO_WORD conversion module (standard library), the R_INT_WORD
module performs a conversion to an INT value prior to output of the WORD value. The result is, for
example, that the input value -1.0 is output as output value FFFF. (Not as with the REAL_TO_WORD
module, for which in this case the output value 0 is set).
As additional parameters, EN and ENO are projected.

Representation in FBD
Representation:

Representation in LD
Appearance:

33002543 10/2019 537


R_INT_WORD

Representation in IL
Appearance:
LD RealValue
R_INT_WORD
ST WordValue

Representation in ST
Appearance:
WordValue := R_INT_WORD (RealValue);

Parameter description
Description of input parameters:

Parameter Data type Description


INP REAL Input value

Description of output parameters:

Parameter Data type Description


OUTP WORD Output value

Runtime error
The system bit %S18 and system words %SW17 (error status) and %SW125 (16#DE87:
Caldulation errors in a floating point value calculation) are set when
 an unauthorized floating point number is set at the input,
 the value range of the data type INT is exceeded,

538 33002543 10/2019


EcoStruxure™ Control Expert
R_UINT_WORD
33002543 10/2019

Chapter 81
R_UINT_WORD: Type conversion (REAL -> UINT -> WORD) (R_UINT_WORD: Type conversion (REAL -> UINT -> WORD))

R_UINT_WORD: Type conversion (REAL -> UINT -> WORD)


(R_UINT_WORD: Type conversion (REAL -> UINT -> WORD))

Description

Function description
This function converts an input value with data type REAL to data type UINT and then data type
WORD.
As opposed to the conversion module REAL_TO_WORD (standard library) the R_UINT_WORD
module performs a conversion to a UINT value before output of a WORD value (value range 0 -
65535). This results in that the input value -1.0 causes an error message, the outputENO is set, and
the output value remains unchanged. (Not as with the REAL_TO_WORD module, for which the
output value 0 is set without error message in this case).
As additional parameters, EN and ENO are projected.

Representation in FBD
Representation:

Representation in LD
Appearance:

33002543 10/2019 539


R_UINT_WORD

Representation in IL
Appearance:
LD RealValue
R_UINT_WORD
ST WordValue

Representation in ST
Appearance:
WordValue := R_UINT_WORD (RealValue);

Parameter description
Description of input parameters:

Parameter Data type Description


INP REAL Input value

Description of output parameters:

Parameter Data type Description


OUTP WORD Output value

Runtime error
The system bit %S18 and system words %SW17 (error status) and %SW125 (16#DE87:
Caldulation errors in a floating point value calculation) are set when
 an unauthorized floating point number is set at the input,
 the value range of the data type UINT is exceeded,
 a negative input value is to be converted.

540 33002543 10/2019


EcoStruxure™ Control Expert
R2T_***
33002543 10/2019

Chapter 82
R2T_***: Register to table

R2T_***: Register to table

Introduction
This chapter describes the R2T_*** block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 542
Detailed description 545

33002543 10/2019 541


R2T_***

Description

Function description
This function block copies the value entered at SRC to the DEST parameter which is interpreted as
a table.
EN and ENO can be configured as additional parameters.

Available functions
The following blocks are available:
 R2T_INT
 R2T_DINT
 R2T_UINT
 R2T_UDINT
 R2T_REAL

Representation in FBD
Representation:

Representation in LD
Representation:

542 33002543 10/2019


R2T_***

Representation in IL
Representation:
CAL R2T_Instance (NOINC:=FreezesPointerValue,
R:=ResetPointerValue, SRC:=SourceData,
OFF:=PositionInTable, END=>PointerStatus,
DEST=>DestinationTable)

Representation in ST
Representation:
R2T_Instance (NOINC:=FreezesPointerValue,
R:=ResetPointerValue, SRC:=SourceData,
OFF:=PositionInTable, END=>PointerStatus,
DEST=>DestinationTable) ;

Parameter description
Description of input parameters:

Parameter Data type Description


NOINC BOOL 1: freezes the pointer value
R BOOL 1: resets the pointer value to zero
SRC INT, DINT, UINT, Source data to be copied in the current cycle
UDINT, REAL

Description of input / output parameters:

Parameter Data type Description


OFF UINT OFF shows the position in the table. OFF is
standardized with a reset (R), i.e. when R=1, OFF is
set to "1". After the restore, OFF is incremented by 1.

33002543 10/2019 543


R2T_***

Description of output parameters:

Parameter Data type Description


END BOOL 1: Pointer value = Table length, i.e. table is full, the
function block performs no further copy functions,
and OFF is no longer incremented. The function
block (and consequently END as well) can be reset
with R=1.
DEST ANY should be array of Destination register where source data will be
INT, DINT, UINT, copied in the cycle.
UDINT or REALe.g.
ARRAY[0..X] of
INT

544 33002543 10/2019


R2T_***

Detailed description

Mode of Operation
R2T_*** copies the value entered at SRC to the DEST parameter which is interpreted as a table.
The OFF parameter, an offset, points to the position in the destination field (array) where the source
value is to be saved.
In each cycle, the function copies the value from SRC to DEST[OFF] and increments the offset value
by the size of the data type in the table, i.e. OFF+1.
The offset value is automatically raised in each cycle as long as the NOINC parameter does not
have the value 1. OFF is of the read/write type, equivalent to the VAR_IN_OUT IEC parameters
Association between OFF, NOINC and R:

OFF NOINC R OFF Comment


(previous cycle) (current
cycle)
n (any value) 0 1 2 The value for OFF is reset to 1
with R=1, and since NOINC=0,
incremented by 1 already in the
same cycle.
n (any value) 1 1 1 The value for OFF is reset to 1
with R=1, and is not incremented
since NOINC=1.
n (any value) 1 0 n If NOINC=1, the value for OFF is
not incremented and the value
from the previous cycle is
maintained.
n (any value) 0 0 n+1 If R=0 and NOINC=0, the value
from the previous cycle is
incremented by 1.

DEST is type ANY which implicates a pre-defined length. The same type is accepted as the data
type for this array as for SRC irrespective of the type entered for the run time (it could be a structure
of various types).
OFF undergoes a boundary check in each cycle. If OFF exceeds the length of the table (internal
parameter size), END is set to 1 and OFF is no longer increased (the function no longer copies until
OFF accepts a value within the table’s boundaries again.

33002543 10/2019 545


R2T_***

546 33002543 10/2019


EcoStruxure™ Control Expert
READ_PCMCIA
33002543 10/2019

Chapter 83
READ_PCMCIA: Reading data in the memory card

READ_PCMCIA: Reading data in the memory card

Subject of this Chapter


This chapter describes the function READ_PCMCIA.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 548
READ_PCMCIA and WRITE_PCMCIA Example 551

33002543 10/2019 547


READ_PCMCIA

Description

Function description
The READ_PCMCIA function transfers data from the user memory card archiving zone to the PLC
RAM memory. The function READ_U_PCMCIA enables to address the PLC zone's beginning to be
copied to the PCMCIA card up to 65 535 (instead of 32 767 for READ_PCMCIA function) and is
therefore recommended to be used instead of READ_PCMCIA function.
The additional parameters EN and ENO can be configured.
An example using the functions READ_PCMCIA and WRITE_PCMCIA is available, READ_PCMCIA
and WRITE_PCMCIA example (see page 551).

Representation in FBD
Representation:

Representation in LD
Representation:

548 33002543 10/2019


READ_PCMCIA

Representation in IL
Representation:
LD Slot_Number
READ_PCMCIA Source_Address, Words_Number, Dest_Address, Read_State

Representation in ST
Representation:
READ_PCMCIA(Slot_Number, Source_Address, Words_Number, Dest_Address,
Read_State);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Slot_Number INT PCMCIA card slot:
 0 = upper slot,
 1 = lower slot
Source_Address DINT First address where the data is read from the
memory card (0...).
Words_Number INT Number of words to be read.
Dest_Address INT First address where the data is written in the
PLC (%MW). The upper limit of the address is:
32 767.

33002543 10/2019 549


READ_PCMCIA

The following table describes the output parameters:

Parameter Type Comment


Read_State INT Code providing the result of the read
command's execution:
 16#0000: read performed correctly,
 16#0102: Dest_Address +
Words_Number -1 is greater than the
maximum number of declared words in the
PLC.
 16#0104: no valid application or no word in
the PLC,
 16#0201: no file zone in the memory card,
 16#0202: memory card error,
 16#0204: memory card write-protected,
 16#0241: Source_Address < 0,
 16#0242: Dest_Address +
Words_Number-1 is greater than the
highest address of the memory card,
 16#0401: Words_Number = 0,
 16#0402: Slot_Number is different from 0
and 1.
 16#0501: Words_Number = unsupported
service.

550 33002543 10/2019


READ_PCMCIA

READ_PCMCIA and WRITE_PCMCIA Example

Objectives
This example shows how to use the READ_PCMCIA and WRITE_PCMCIA function blocks by:
 Writing values from words (%MW100 to %MW109) to a memory card.
 Reading values from the memory card to words (%MW110 to %MW119).
NOTE: In this example, to use those function blocks, a memory card must be connected into the
PLC.

Configuration of the CPU


In this example, the TSX MRP C007M SRAM memory card is connected into the upper slot A of
the CPU (parameter SLOT = 0 for the functions blocks). In addition, for data storage purposes, the
CPU is configured with 2000 kB of memory.
NOTE: The data storage is used for READ_PCMCIA and WRITE_PCMCIA function blocks. The
2000 kB of data storage represents:

The READ_PCMCIA and WRITE_PCMCIA functions are working with word addresses:

Addresses from 0 to 1024000 for the memory card can be used.

33002543 10/2019 551


READ_PCMCIA

Programming the MAST section


In the MAST section of the program, program as follows:
 The memory card is connected into slot 0.
 The WRITE_PCMCIA function writes 10 words to address 10000 on the memory card from
%MW100.
 The READ_PCMCIA reads 10 words from address 10000 on the memory card to %MW110.
Representation of WRITE_PCMCIA and READ_PCMCIA in FBD language:

Representation of WRITE_PCMCIA and READ_PCMCIA in ST language:


WRITE_PCMCIA (0,10000,10,100,Status_write);
READ_PCMCIA (0,10000,10,110,Status_read);

Testing the Example


By using animation tables with words: %MW100 to %MW119, the values from %MW100 to
%MW109 are copied to %MW110 to %MW119 via the memory card.

552 33002543 10/2019


EcoStruxure™ Control Expert
ROR1_ARB
33002543 10/2019

Chapter 84
ROR1_ARB: Right shift of one byte from a table of bytes

ROR1_ARB: Right shift of one byte from a table of bytes

Description

Function Description
The ROR1_ARB function is used to perform a rotation shift to the right of a byte in a PL7 byte table.
Using Control Expert, the PL7 byte tables have become character strings. This is therefore the
rotation shift of a byte to the right in a character string.
The additional parameters EN and ENO can be configured.

FBD representation
Representation:

LD representation
Representation:

IL representation
Representation:
LD String1
ROR1_ARB

33002543 10/2019 553


ROR1_ARB

ST representation
Representation:
ROR1_ARB(String1);

Parameter Description
The following table describes the input/output parameters:

Parameter Type Comment


String1 STRING Character string whose bytes are to be moved.

Caution: this parameter is an input/output. Each time


this instruction occurs, the character string will therefore
be moved by one byte.

NOTE: This function is necessary to process certain communication requests, such as the
SEND_REQ function, which introduces an additional byte at the beginning of the response.
Example:
Objects to read:
16#0201
16#0403
16#0605
16#0807
16#0A09
Reception table after execution of a SEND_REQ (read object):
%MW100=16#0107
%MW101=16#0302
%MW102=16#0504
%MW103=16#0706
%MW104=16#0908
%MW105=16#000A
Reception table after a ROR1_ARB(%MW100:6):
%MW100=16#0201
%MW101=16#0403
%MW102=16#0605
%MW103=16#0807
%MW104=16#0A09
%MW105=16#0700

554 33002543 10/2019


EcoStruxure™ Control Expert
RRTC
33002543 10/2019

Chapter 85
RRTC: Reading the system date

RRTC: Reading the system date

Description

Description of the function


The function RRTC captures the current date from the PLC real-time clock. It is a function used to
convert PL7 applications.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
RRTC
ST Result_Date

Representation in ST
Representation:
RRTC(Result_Date);

33002543 10/2019 555


RRTC

Description of parameters
The following table describes the output parameters:

Parameter Type Comment


Result_Date ARRAY [0...3] Result_Date contains the current date value in PL7
OF INT DT format (array of 4 integers).

PL7 DATE_AND_TIME format


The PL7 DATE_AND_TIME (DT) format is displayed as follow:
yyyy-mm-dd-hh:mm:ss
example 2000-05-18-15:45:22
the value is BCD coded on 64 bit. The result is an array of 4 integers.

With the previous example in hexadecimal.

NOTE: Only the DT included between [1990-01-01-00:00:00, 2099-12-31-23:59:59] are allowed.

556 33002543 10/2019


EcoStruxure™ Control Expert
SCOUNT
33002543 10/2019

Chapter 86
SCOUNT: Up/down counting with overshoot signaling

SCOUNT: Up/down counting with overshoot signaling

Description

Function description
The SCOUNT function carries out up/down counting with overshoot signaling.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

33002543 10/2019 557


SCOUNT

Representation in LD
Representation:

Representation in IL
Representation:
LD Valid
SCOUNT Presel_Value, Count_Up, Count_Down, Minimum, Maximum, Mem_Word,
Output_Qmin, Output_Qmax, Count_Value

Representation in ST
Representation:
SCOUNT(Valid, Presel_Value, Count_Up, Count_Down, Minimum, Maximum,
Mem_Word, Output_Qmin, Output_Qmax, Count_Value);

558 33002543 10/2019


SCOUNT

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Enable BOOL Enable input selected, the function is only
executed if it is Valid = 1.
Presel_Value INT Preset value, that is the initial count value.
Count_Up BOOL Upcounter input, on each pulse, Count_Value
is incremented by 1.
Count_Down BOOL Downcounter input, on each pulse,
Count_Value is decremented by 1.
Minimum INT Minimum count value, when: Count_Value =
Minimum,
Output_Qmin = 1.
Maximum INT Maximum count value, when: Count_Value =
Maximum,
Output_Qmin = 1.

The following table describes the input/output parameters:

Parameter Type Comment


Mem_Word INT Integer used as an input and an output enabling
up/down counter inputs to be stored:
 bit 0, for Count_Up,
 bit 1, for Count_Down

The following table describes the output parameters:

Parameter Type Comment


Output_Qmin EBOOL Output which indicates that the count value has
reached the minimum threshold:
Count_Value = Minimum,
Output_Qmin = 1
Output_Qmax EBOOL Output which indicates that the count value has
reached the maximum threshold:
Count_Value = Maximum,
Output_Qmax = 1
Count_Value INT Current count value.

33002543 10/2019 559


SCOUNT

NOTE:
 If (en) = 0 then the function is no longer enabled and on each call, we have:
Output_Qmin = Output_Qmax = 0
Mem_Word:X0 = Mem_Word:X1 = 0, Count_Value = Presel_Value
 If Maximum > Minimum then:
Count_Value ≥ Maximum entails: Output_Qmax = 1 and Output_Qmin = 0
Minimum < Count_Value < Maximum entails: Output_Qmax = Output_Qmin = 0
Count_Value ≤ Minimum entails: Output_Qmax = 0 and Output_Qmin = 1
 If Maximum < Minimum then:
Maximum ≤ Count_Value ≤ Minimum entails: Output_Qmax = 1 and Output_Qmin = 0
Count_Value < Maximum entails: Output_Qmax = 0 and Output_Qmin = 1
Count_Value > Maximum entails: Output_Qmax = 1 and Output_Qmin = 0
 If Maximum = Minimum then:
Count_Value < Maximum and Minimum entails: Output_Qmax = 0 and Output_Qmin = 1
Count_Value ≥ Maximum and Minimum entails: Output_Qmax = 1 and Output_Qmin = 0
 A modification of the Presel_Value parameter with Enable set to 1 has no impact on
operation.
 A negative value for the Presel_Value and Minimum parameters is interpreted as a nil value.
 A value of less than 1 for the Maximum parameter is interpreted as equal to 1.

560 33002543 10/2019


SCOUNT

Timing diagram
Functional timing diagram:

33002543 10/2019 561


SCOUNT

562 33002543 10/2019


EcoStruxure™ Control Expert
SET_BIT
33002543 10/2019

Chapter 87
SET_BIT: Set bit

SET_BIT: Set bit

Description

Function description
This function sets the bit of the OutputRegister output word selected with BitNumber to the
value of InputData.
The BitNumber parameter provides the bit number in the output data.

WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to possible forced
values in the reference data editor. This can produce serious process conditions.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

33002543 10/2019 563


SET_BIT

Representation in LD
Representation:

Representation in IL
Representation:
LD InputData
SET_BIT BitNumber
ST OutputRegister

Representation in ST
Representation:
OutputRegister := SET_BIT (InputData, BitNumber);

Parameter description
Description of input parameters:

Parameter Data type Description


InputData BOOL Input data
BitNumber UINT Bit number to be written.

Description of output parameters:

Parameter Data type Description


OutputRegister WORD Output

Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.

564 33002543 10/2019


EcoStruxure™ Control Expert
SET_PCMCIA
33002543 10/2019

Chapter 88
SET_PCMCIA: Initialization of the archiving zone

SET_PCMCIA: Initialization of the archiving zone

Description

Function description
The SET_PCMCIA function enables all or part of the user memory card's archiving zone to be
initialized at the desired value.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

33002543 10/2019 565


SET_PCMCIA

Representation in IL
Representation:
LD Slot_Number
SET_PCMCIA Address, Words_Number, Init_Value, Init_State

Representation in ST
Representation:
SET_PCMCIA(Slot_Number, Address, Words_Number, Init_Value, Init_State);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Slot_Number INT PCMCIA card slot:
 0 = upper slot,
 1 = lower slot
Address DINT Address of the archiving zone from which
initialization is performed.
Words_Number INT Number of words to be initialized.
Init_Value INT Initialization value.

The following table describes the output parameters:

Parameter Type Comment


Init_State INT Code providing the result of the initialization
command's execution:
 16#0000: initialization performed correctly,
 16#0201: no file zone in the memory card,
 16#0202: memory card error,
 16#0204: memory card write-protected,
 16#0241: negative address,
 16#0242: Address + Words_Number-1 is
greater than the highest address of the
memory card,
 16#0401: Words_Number ≤ 0,
 16#0402: Slot_Number is different from 0
and 1,
 16#0501: unsupported service.

566 33002543 10/2019


EcoStruxure™ Control Expert
SHL_RBIT_***
33002543 10/2019

Chapter 89
SHL_RBIT_***: Left shift on an integer or double integer

SHL_RBIT_***: Left shift on an integer or double integer

Description

Function description
The function SHL_RBIT_*** performs a shift to the left for an integer or a double integer, with
recovery of the moved bits.
The additional parameters EN and ENO can be configured.

Available functions
List of available functions:
 SHL_RBIT_INT,
 SHL_RBIT_DINT.

Representation in FBD
Representation applied to an integer:

Representation in LD
Representation applied to an integer:

33002543 10/2019 567


SHL_RBIT_***

Representation in IL
Representation applied to an integer:
LD Input_Var
SHL_RBIT_INT Shift_Num, Shifted_Var, Shifted_Bits

Representation in ST
Representation applied to an integer:
SHL_RBIT_INT(Input_Var, Shift_Num, Shifted_Var, Shifted_Bits);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Input_Var INT, DINT Variable on which the shift is to be performed.

Example: Input_Var = 2#0001111101101000.


Shift_Num INT Value of the shift to be performed.

Example: Shift_Num = 4.

The following table describes the output parameters:

Parameter Type Comment


Shifted_Var INT, DINT Shifted_Var contains the value of Input_Var
shifted by the number of bits given by Shift_Num.
The shift register is filled with zeros.

Example: with the data examples of the previous


table, the result is the following Shifted_Var =
2#1111011010000000
Shifted_Bits INT, DINT Shifted_Bits contains the shifted bits.

Example: with the example values of the previous


table, the result is the following Shifted_Bits =
2#0000000000000001

568 33002543 10/2019


EcoStruxure™ Control Expert
SHR_RBIT_***
33002543 10/2019

Chapter 90
SHR_RBIT_***: Right shift on an integer or double integer

SHR_RBIT_***: Right shift on an integer or double integer

Description

Function description
The SHR_RBIT_*** function performs a shift to the right on an integer or a double integer with
sign extension and recovery of the shifted bits.
The additional parameters EN and ENO can be configured.

Available functions
List of available functions:
 SHR_RBIT_INT,
 SHR_RBIT_DINT.

Representation in FBD
Representation applied to a double integer:

Representation in LD
Representation applied to a double integer:

33002543 10/2019 569


SHR_RBIT_***

Representation in IL
Representation applied to a double integer:
LD Input_Var
SHR_RBIT_DINT Shift_Num, Shifted_Var, Shifted_Bits

Representation in ST
Representation applied to a double integer:
SHR_RBIT_DINT(Input_Var, Shift_Num, Shifted_Var, Shifted_Bits);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Input_Var INT, DINT Variable on which the shift is to be performed.

Example: Input_Var =
2#10000000111100010000000011001111.
Shift_Num INT Value of the shift to be performed.

Example: Shift_Num = 6.

The following table describes the output parameters:

Parameter Type Comment


Shifted_Var INT, DINT Shifted_Var contains the value of Input_Var
shifted by the number of bits given by Shift_Num.
With conservation of the sign and propagation of the
sign bit in the bits liberated by the shift.

Example: with the data examples of the previous


table, the result is the following Shifted_Var =
2#1 1111110000000111100010000000011
Shifted_Bits INT, DINT Shifted_Bits contains the shifted bits.

Example: with the data examples of the previous


table, the result is the following Shifted_Bits =
2#00000000000000000000000000001111

570 33002543 10/2019


EcoStruxure™ Control Expert
SHRZ_***
33002543 10/2019

Chapter 91
SHRZ_***: Right shift on an integer or double integer

SHRZ_***: Right shift on an integer or double integer

Description

Function description
The function SHRZ_*** performs a shift to the right on an integer or a double integer and fills the
shift register with zeros.
The additional parameters EN and ENO can be configured.

Available functions
List of available functions:
 SHRZ_INT,
 SHRZ_DINT.

Representation in FBD
Representation applied to an integer:

Representation in LD
Representation applied to an integer:

33002543 10/2019 571


SHRZ_***

Representation in IL
Representation applied to an integer:
LD Input_Var
SHRZ_INT Shift_Num
ST Shifted_Var

Representation in ST
Representation applied to an integer:
Shifted_Var := SHRZ_INT(Input_Var, Shift_Num);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Input_Var INT, DINT Variable on which the shift is to be performed.

Example: Input_Var = 2#1000000011110001.


Shift_Num INT Value of the shift to be performed.

Example: Shift_Num = 4.

The following table describes the output parameters:

Parameter Type Comment


Shifted_Var INT, DINT Shifted_Var contains the value of Input_Var
shifted by the number of bits given by Shift_Num.
The shift register is filled with zeros.

Example: with the data examples of the previous


table, the result is the following Shifted_Var =
2#0000100000001111

572 33002543 10/2019


EcoStruxure™ Control Expert
SHRZ_RBIT_***
33002543 10/2019

Chapter 92
SHRZ_RBIT_***: Right shift on an integer or double integer

SHRZ_RBIT_***: Right shift on an integer or double integer

Description

Function description
The function SHRZ_RBIT_*** performs a shift to the right on an integer or a double integer, fills
the shift register with zeros and recovers the shifted bits.
The additional parameters EN and ENO can be configured.

Available functions
List of available functions:
 SHRZ_RBIT_INT,
 SHRZ_RBIT_DINT.

Representation in FBD
Representation applied to an integer:

Representation in LD
Representation applied to an integer:

33002543 10/2019 573


SHRZ_RBIT_***

Representation in IL
Representation applied to an integer:
LD Input_Var
SHRZ_RBIT_INT Shift_Num, Shifted_Var, Shifted_Bits

Representation in ST
Representation applied to an integer:
SHRZ_RBIT_INT(Input_Var, Shift_Num, Shifted_Var, Shifted_Bits);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Input_Var INT, DINT Variable on which the shift is to be performed.

Example: Input_Var = 2#1000000011110001.


Shift_Num INT Value of the shift to be performed.

Example: Shift_Num = 4.

The following table describes the output parameters:

Parameter Type Comment


Shifted_Var INT, DINT Shifted_Var contains the value of Input_Var
shifted by the number of bits given by Shift_Num.
The shift register is filled with zeros.

Example: with the data examples of the previous


table, the result is the following Shifted_Var =
2#0000100000001111
Shifted_Bits INT, DINT Shifted_Bits contains the shifted bits.

Example: with the data examples of the previous


table, the result is the following Shifted_Bits =
2#0001000000000000

574 33002543 10/2019


EcoStruxure™ Control Expert
SRCH
33002543 10/2019

Chapter 93
SRCH: Search

SRCH: Search

Introduction
This chapter describes the SRCH block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 576
Detailed description 579

33002543 10/2019 575


SRCH

Description

Function description
This function block searches a source table for an entered bit pattern. It increments the directory
in the source table in each released cycle and checks whether the displayed Array element
matches the defined pattern or not.
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

Representation in LD
Appearance:

576 33002543 10/2019


SRCH

Representation in IL
Representation:
CAL SRCH_Instance (TRIG:=StartsSearch, CONT:=ContinueSearch,
SRC:=SourceTable, PATTERN:=BitPatternForSearch,
INDEX:=FindingPlace, FOUND=>FoundPattern)

Representation in ST
Representation:
SRCH_Instance (TRIG:=StartsSearch, CONT:=ContinueSearch,
SRC:=SourceTable, PATTERN:=BitPatternForSearch,
INDEX:=FindingPlace, FOUND=>FoundPattern) ;

Parameter description
Description of input parameters:

Parameter Data type Description


TRIG BOOL TRIG detects the rising edge and starts the search
for the next element in the table.
CONT BOOL CONT defines whether to continue the search or to
resume it at the beginning of the table.
1 = The search will be continued with the next rising
edge of TRIG.
0 = The search position is reset to the beginning of
the table with the next rising edge of TRIG and the
first element of the table will be compared to the
pattern.
SRC ANY should be a field Source table
(array) of type INT,
DINT, UINT, UDINT or
REAL e.g.
ARRAY[0..X] OF
INT
PATTERN INT, DINT, UINT, PATTERN is the bit pattern to be searched for.
UDINT, REAL Note: The length of the bit pattern to be searched for
is always derived from the length of the data type at
the input PATTERN; the length of the Array element
is not considered. To enable correct work methods,
make sure that the data type of PATTERN is identical
to that of the array to be searched for.

33002543 10/2019 577


SRCH

Description of input / output parameters:

Parameter Data type Description


INDEX UINT INDEX displays the Array index of the last search
process. (This means that when the pattern is
found, the INDEX parameter will indicate where the
pattern was found in the table). The value of the
variables at the input can be changed with the
application to change the search position in the
table.
Note: INDEX always displays the Array index to
which the last comparison was applied. It will always
begin counting at 1 for the first Array element,
regardless of the actual Array limits that were
defined in the data editor. INDEX always counts
ascending, even if the index is greater than the
number of Array elements.

Description of output parameters:

Parameter Data type Description


FOUND BOOL 1 = pattern found

578 33002543 10/2019


SRCH

Detailed description

Function description
The SRCH function block searches a source table for an entered bit pattern. It increments the
directory in the source table in each released cycle marked TRIG and checks whether the Array
element displayed with INDEX matches the defined pattern or not. The result is displayed at the
FOUND output.
SRC (source) is type ANY which implicates a pre-defined length. This field (array) is interpreted as
an ARRAY with the same data type (INT, DINT, UINT, UDINT, REAL) as the data type used at the
PATTERN input. To enable correct work methods, make sure that the data type of PATTERN is
identical to that of the array to be searched for. A binary comparison is performed in each cycle
between PATTERN and an Array element. The length of the comparison is always derived from the
length of PATTERN; the length of the Array element is not considered.
TRIG detects the rising edge and starts the search for one cycle. The search will stop after this
cycle until the next rising edge is detected at TRIG.
PATTERN is the bit pattern to be searched for.
The CONT parameter defines whether to continue the search or to resume it at the beginning of the
table after a pattern has been found.
Once the pattern is found, FOUND is set to "1" and the INDEX parameter shows where in the table
the pattern has been found.

33002543 10/2019 579


SRCH

580 33002543 10/2019


EcoStruxure™ Control Expert
STR_ROUND
33002543 10/2019

Chapter 94
STR_ROUND: Approximate value of a floating point number

STR_ROUND: Approximate value of a floating point number

Description

Function description
The STR_ROUND function provides the approximate value of a floating point number expressed in
the form of a character string.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Real_Str
STR_ROUND Pos, Rounded_Str

33002543 10/2019 581


STR_ROUND

Representation in ST
Representation:
STR_ROUND(Real_Str, Pos, Rounded_Str);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Real_Str STRING Character string containing the real number.

Example: ’-1.1354942e-30’
Pos INT Position from which the rounding off is performed. The
position is calculated from the decimal separator, and
the calculation is inclusive of the separator.

Example: 2

The following table describes the output parameters:

Parameter Type Comment


Rounded_Str STRING Result of truncation.

Example: with the data examples of the previous table,


the result is the following ' -1.1000000e-30'

Runtime errors
The length of the original and resulting character strings must be between 15 and 255. Otherwise
, the system bit %S15 is set to 1.
The parameter Pos must be between 0 and 8. Otherwise, the bit %S20 is set to 1. Special case
for Pos = 0 and Pos = 8, the rounding off is not performed, Real_Str = Rounded_Str.
When the last character different to zero is greater than 5, the preceding character is incremented.

582 33002543 10/2019


EcoStruxure™ Control Expert
SUB_***_PL7
33002543 10/2019

Chapter 95
SUB_***_PL7 : Subtract a period

SUB_***_PL7 : Subtract a period

Description

Description of the function


The SUB_***_PL7 function removes a period from a date or from a time expressed in the DT
format or TOD format of PL7.
The additional parameters EN and ENO can be configured.

Available functions
The available functions are as follows:
 SUB_DT_PL7,
 SUB_TOD_PL7.

Representation in FBD
Representation applied to a time of day:

Representation in LD
Representation applied to a time of day:

33002543 10/2019 583


SUB_***_PL7

Representation in IL
Representation applied to a time of day:
LD Source_Value
SUB_TOD_PL7 Time_to_Sub
ST Result_Value

Representation in ST
Representation applied to a time of day:
Result_Value := SUB_TOD_PL7(Source_Value, Time_to_Add);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Source_Value DINT, Date or time.
ARRAY [0..3]
OF INT
Time_to_Sub DINT, Period to be subtracted from Source_Value
ARRAY [0..3]
OF INT Note : this time is expressed in the TIME format of PL7
(with an accuracy of the order of one tenth of a second).
As the DT and TOD types of PL7 (converted under
Control Expert into DINT or tables of 4 INT) are
expressed to the nearest second, Time_to_Sub is
rounded to the nearest second.

The following table describes the output parameters:

Parameter Type Comment


Result_Value DINT, Result_Value is of the same type as
ARRAY [0..3] Source_Value.
OF INT

NOTE: management of leap years must be provided for in the application.

584 33002543 10/2019


SUB_***_PL7

Execution errors
If Source_Value is in the DINT format (TOD of PL7), there is a change of day if Result_Value
is outside of the range of authorized values. In this case the system bit %S18 is set at 1 and the
value of Result_Value is only significant with a modulo 24:00:00.
If Source_Value is in the ARRAY [0..3] OF INT format (DT of PL7), if Result_Value is outside
the authorized range of values, the system bit %S18 is set at 1 and the value of Result_Value
is also at the minimum limit.
If one of the input parameters cannot be interpreted and is inconsistent with the function format
then the system bit %S18 is set at 1 and Result_Value applies:
 00:00:00 for the TOD type of PL7.
 00001-01-01-00:00:00 for the DT type of PL7.

33002543 10/2019 585


SUB_***_PL7

586 33002543 10/2019


EcoStruxure™ Control Expert
SYSSTATE
33002543 10/2019

Chapter 96
SYSSTATE: System state

SYSSTATE: System state

Description

Function description
This function block displays the status of the PLC.
SYSSTATE is task-specific and can be used in MAST, FAST and AUX tasks.
SYSSTATE cannot be used in EVT tasks.
EN and ENO can be configured as additional parameters.

Representation in FBD
Representation:

Representation in LD
Representation:

33002543 10/2019 587


SYSSTATE

Representation in IL
Representation:
CAL SYSSTATE_Instance (COLD=>ColdStartCycle,
WARM=>WarmStartCycle, ERROR=>ErrorInBuffer)

Representation in ST
Representation:
SYSSTATE_Instance (COLD=>ColdStartCycle,
WARM=>WarmStartCycle, ERROR=>ErrorInBuffer) ;

Parameter description
Description of output parameters:

Parameter Data type Description


COLD BOOL Is set for one cycle to "1", when the user task is in a cold
start cycle, i.e. the first start after the project has been
completely loaded.
COLD operates inversely to the user task bit in %SW10
(TSKINIT).
WARM BOOL Is set for one cycle to "1" when the PLC or the user task is
started, i.e. after switching on the power or by starting the
SPS after a stop.
When a STOP->RUN transition of the corresponding tasks
occurs, WARM is set to "1".
After the logic of the corresponding tasks have been
completed, WARM is set to "0".
WARM is identical to the user task specific system bit %S21.
ERROR BOOL Is set to "1" when there are error messages in the
diagnostic buffer that have not yet been acknowledged.
ERROR is set to "1" if %SW78 (DNBERRBUF) is not "0".

NOTE: In cold start cycle both outputs COLD and WARM are set to "1".

588 33002543 10/2019


EcoStruxure™ Control Expert
T2T
33002543 10/2019

Chapter 97
T2T: Table to table

T2T: Table to table

Introduction
This chapter describes the T2T block.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 590
Detailed Description 593

33002543 10/2019 589


T2T

Description

Function description
This function block copies the value from the SRC parameter to the DEST parameter. Both tables
have to be of the same data type.
When setting OFF to 0 the copy operation is blocked. In this case the function block sets END to 1
and doesn't perform any data copying.
If the sum of OFF and SIZE is outside of the DEST table END is also set to 1.
Independent from the data type of SRC and DEST the function block copies on a word base (16
bits). This results in the following behavior:
 In case of arrays defined of data types smaller than 16 bits (e.g. BOOL, EBOOL, BYTE) the
function block copies two values at once. Due to this, the number of elements in the source and
destination table has to be even.
 In case of arrays defined of 32 bits data types (e.g. DINT, UDINT, REAL) the function block has
to copy 2 words per array element. Due to this, the parameters OFF and SIZE has to be
increased by 2 per array element to copy.
In general the copy operation will only be performed for END=0.
If NOINC is set to 0, the value of OFF increases by SIZE after each copy operation.
EN can be configured as additional parameter.
NOTE: ENO is not supported by this function block (value is always 1).

Representation in FBD
Representation:

590 33002543 10/2019


T2T

Representation in LD
Representation:

Representation in IL
Representation:
CAL T2T_Instance (NOINC:=FreezesPointerValue,
R:=Reset, SRC:=SourceData,
SIZE:=NumberOfWordsToCopy, OFF:=Offset,
END=>PointerValue, DEST=>DestinationTable)

Representation in ST
Representation:
T2T_Instance (NOINC:=FreezesPointerValue,
R:=Reset, SRC:=SourceData,
SIZE:=NumberOfWordsToCopy, OFF:=Offset,
END=>PointerValue, DEST=>DestinationTable) ;

33002543 10/2019 591


T2T

Parameter description
Description of input parameters:

Parameter Data type Description


NOINC BOOL 1: Freezes the pointer value. The value of OFF
remains unchanged.
R BOOL 1: Sets the offset variable (OFF) to the first element
and resets the END output before starting the copy
operations.
SRC ANY should be an array of Source data to be copied in the current cycle
the BOOL, BYTE, WORD,
DWORD, INT, DINT, UINT,
UDINT,REAL, TIME types
e.g.ARRAY [0..X] OF
INT
SIZE UINT The variable tells the function block how many
words have to copied every cycle.

Description of input / output parameters:

Parameter Data type Description


OFF UINT Offset in both the source and destination table.

Description of output parameters:

Parameter Data type Description


END BOOL 1: Pointer value = table length (function block
cannot increment any further)
1: If OFF=0 or if the sum of OFF and SIZE is outside
the destination table DEST. Copy operation is
disabled.
DEST ANY should be an array of Destination table where source table will be copied
the BOOL, BYTE, WORD, in the cycle.
DWORD, INT, DINT, UINT,
UDINT,REAL, TIME types
e.g.ARRAY [0..X] OF
INT

592 33002543 10/2019


T2T

Detailed Description

Mode of Operation
This function copies the value from the SRC parameter, which is interpreted as a table, to the DEST
parameter, which is also interpreted as a table.
The parameter OFF points into both tables. It is an index for the source array and the destination
array where the source value should be copied from and to.
In each cycle the function copies the value of SRC[OFF] to DEST[OFF].
The offset will be incremented in each cycle by the number of 16 bit words, which are copied,
unless the parameter NOINC is 1. OFF is of the read/write type, equivalent to the VAR_IN_OUT IEC
parameters
A parameter SIZE tells the EFB how many words have to be copied every cycle.
OFF is reset if the parameter R has the value 1 before copying.
SRC and DEST are type ANY, which implies a predefined length. These variables will be interpreted
as an ARRAY of bytes regardless of the type definition for these parameters (they may be a
structure of different types).
OFF undergoes a boundary check each cycle. If OFF exceeds the length of one of the tables, then
END is set to 1 and OFF is not incremented. The function will not copy any more data until OFF
returns within its boundaries.

Copying Tables with More than 10,000 Words


To copy tables of more than 10,000 words, the T2T function block must be used instead of the
direct assignment :=.
Example: If Tab_1 and Tab_2 are two INT Arrays [1..20000] , do not use Tab_1:=Tab_2;
Instead, use: T2T_Instance(NOINC:=0, R=1, SRC:=Tab_1, SIZE:=20000,
OFF:=Offset, END=>PointerValue, DEST=>Tab_2
NOTE: During the transfer of a large table using the direct copy Tab_1:=Tab_2, some system
words linked to time calculation (for example: %SW30) are not refreshed correctly. This problem
does not occur with the T2T function.

33002543 10/2019 593


T2T

594 33002543 10/2019


EcoStruxure™ Control Expert
TIME_DINT_TO_STRING
33002543 10/2019

Chapter 98
TIME_DINT_TO_STRING: Conversion of a variable to DINT format

TIME_DINT_TO_STRING: Conversion of a variable to DINT


format

Description

Function description
The function TIME_DINT_TO_STRING is used to convert a variable in DINT format (TIME using
PL7) into a character string.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Time1
TIME_DINT_TO_STRING
ST Result_Str

33002543 10/2019 595


TIME_DINT_TO_STRING

Representation in ST
Representation:
Result_Str := TIME_DINT_TO_STRING(Time1);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Time1 DINT Duration to convert into character string format.

The following table describes the output parameters:

Parameter Type Comment


Result_Str String Result_Str is a string of 15 characters containing a
duration in the following format: HHHHHH:MM:SS.D.

Example: ’119304:38:49.5’

Runtime errors
If the string Result_Str is too short to contain the date (length = less than 15 characters), the
date is truncated and the bit %S15 is set to 1.

596 33002543 10/2019


EcoStruxure™ Control Expert
TOD_DINT_TO_STRING
33002543 10/2019

Chapter 99
TOD_DINT_TO_STRING: Conversion of a variable to TOD format

TOD_DINT_TO_STRING: Conversion of a variable to TOD


format

Description

Function description
The function TOD_DINT_TO_STRING is used to convert a TOD format PL7 variable, or DINT
double integer, into a character string.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Time1
TOD_DINT_TO_STRING
ST Result_Str

33002543 10/2019 597


TOD_DINT_TO_STRING

Representation in ST
Representation:
Result_Str := TOD_DINT_TO_STRING(Time1);

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Time1 DINT PL7 time of day to convert into character string format.

The following table describes the output parameters:

Parameter Type Comment


Result_Str String Result_Str is a string of 8 characters containing a
time of day in the following format: HH:MM:SS.

Example: ’04:38:49’

Runtime errors
If the string Result_Str is too short to contain the converted value (length = less than 8
characters), it is truncated and the bit %S15 is set to 1.

598 33002543 10/2019


EcoStruxure™ Control Expert
TRANS_TIME
33002543 10/2019

Chapter 100
TRANS_TIME: Conversion of a duration into DINT format

TRANS_TIME: Conversion of a duration into DINT format

Description

Function description
The function TRANS_TIME is used to convert a duration in DINT format (TIME using PL7) into a
number.
 of hours (HHHH),
 of minutes (MM),
 of seconds (SS).
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Time1
TRANS_TIME
ST Result_DINT

33002543 10/2019 599


TRANS_TIME

Representation in ST
Representation:
Result_DINT := TRANS_TIME(Time1);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Time1 DINT Duration to convert. Time1 is expressed in tenths of
seconds; the value used for the function is therefore
rounded off to the second.

The following table describes the output parameters:

Parameter Type Comment


Result_DINT DINT Result_INT is a double integer that breaks down as follows:
 the most significant word contains the hours in BCD format,
 the least significant word contains the minutes and
seconds:
 the most significant byte contains the minutes in BCD
format,
 the least significant byte contains the seconds in BCD
format.
Example: 16#00233740 corresponds to 23 hours, 37 minutes
and 40 seconds.

Note: Result_DINT ranges between 0000:00:00 and


9999:59:59.

Runtime errors
The maximum possible value is therefore 9999 hours, 59 minutes and 59 seconds, or 359,999,990
tenths of a second.
If Time1 is ≥ 360,000,000, there is an overflow, the bit %S15 switches to 1 and Result_DINT =
16#00000000

600 33002543 10/2019


EcoStruxure™ Control Expert
W_INT_REAL
33002543 10/2019

Chapter 101
W_INT_REAL: Type conversion (WORD -> INT -> REAL) (W_INT_REAL: Type conversion (WORD -> INT -> REAL))

W_INT_REAL: Type conversion (WORD -> INT -> REAL)


(W_INT_REAL: Type conversion (WORD -> INT -> REAL))

Description

Function description
This function converts an input value with data type WORD to data type INT and then data type
REAL.
As opposed to the WORD_TO_REAL conversion module (standard library), the W_INT_REAL
module performs a conversion to an INT value prior to output of the REAL value. The result is, for
example, that the input value FFFF is output as output value -1.0. (Not as with the WORD_TO_REAL
module, for which the output value 9.183409e-41 is set).
As additional parameters, EN and ENO are projected.

Representation in FBD
Representation:

Representation in LD
Appearance:

33002543 10/2019 601


W_INT_REAL

Representation in IL
Appearance:
LD WordValue
W_INT_REAL
ST RealValue

Representation in ST
Appearance:
RealValue := W_INT_REAL (WordValue);

Parameter description
Description of input parameters:

Parameter Data type Description


INP WORD Input value

Description of output parameters:

Parameter Data type Description


OUTP REAL Output value

602 33002543 10/2019


EcoStruxure™ Control Expert
W_UINT_REAL
33002543 10/2019

Chapter 102
W_UINT_REAL: Type conversion (WORD -> UINT -> REAL) (W_UINT_REAL: Type conversion (WORD -> UINT -> REAL))

W_UINT_REAL: Type conversion (WORD -> UINT -> REAL)


(W_UINT_REAL: Type conversion (WORD -> UINT -> REAL))

Description

Function description
This function converts an input value with data type WORD to data type UINT and then data type
REAL.
As opposed to the WORD_TO_REAL conversion module (standard library), the W_UINT_REAL
module performs a conversion to a UINT value prior to output of the REAL value. The result is, for
example, that the input value FFFF is output as output value 65535.0. (Not as with the
WORD_TO_REAL module, for which the output value 9.183409e-41 is set).
As additional parameters, EN and ENO are projected.

Representation in FBD
Representation:

Representation in LD
Appearance:

33002543 10/2019 603


W_UINT_REAL

Representation in IL
Appearance:
LD WordValue
W_UINT_REAL
ST RealValue

Representation in ST
Appearance:
RealValue := W_UINT_REAL (WordValue);

Parameter description
Description of input parameters:

Parameter Data type Description


INP WORD Input value

Description of output parameters:

Parameter Data type Description


OUTP REAL Output value

604 33002543 10/2019


EcoStruxure™ Control Expert
WRITE_PCMCIA
33002543 10/2019

Chapter 103
WRITE_PCMCIA: Writing data to the memory card

WRITE_PCMCIA: Writing data to the memory card

Description

Function description
The WRITE_PCMCIA function transfers data from the PLC's RAM memory to the user memory card
archiving zone. The function WRITE_U_PCMCIA enables to address the PLC zone's beginning to
be copied to the PCMCIA card up to 65 535 (instead of 32 767 for WRITE_PCMCIA function) and
is therefore recommended to be used instead of WRITE_PCMCIA function.
The additional parameters EN and ENO can be configured.
An example using the functions READ_PCMCIA and WRITE_PCMCIA is available, READ_PCMCIA
and WRITE_PCMCIA example (see page 551).

Representation in FBD
Representation:

33002543 10/2019 605


WRITE_PCMCIA

Representation in LD
Representation:

Representation in IL
Representation:
LD Slot_Number
WRITE_PCMCIA Dest_Address, Words_Number, Source_Address, Write_State

Representation in ST
Representation:
WRITE_PCMCIA(Slot_Number, Dest_Address, Words_Number, Source_Address,
Write_State);

Description of the parameters


The following table describes the input parameters:

Parameter Type Comment


Slot_Number INT PCMCIA card slot:
 0 = upper slot,
 1 = lower slot
Dest_Address DINT First address where the data is written in the
memory card.
Words_Number INT Number of words to write.
Source_Address INT First address where the data is read from the
PLC (%MW). The upper limit of the address is:
32767.

606 33002543 10/2019


WRITE_PCMCIA

The following table describes the output parameters:

Parameter Type Comment


Write_State INT Code providing the result of the write
command's execution:
 16#0000: write performed correctly,
 16#0102: Source_Address +
Words_Number - 1 is greater than the
maximum number of declared words in the
PLC,
 16#0104: no valid application or no word in
the PLC,
 16#0201: no file zone in the memory card,
 16#0202: memory card error,
 16#0204: memory card write-protected,
 16#0241: Dest_Address < 0,
 16#0242: Dest_Address +
Words_Number-1 is greater than the
highest address of the memory card,
 16#0401: Words_Number = 0,
 16#0402: Slot_Number is different from 0
and 1,
 16#0501: unsupported service.

33002543 10/2019 607


WRITE_PCMCIA

608 33002543 10/2019


EcoStruxure™ Control Expert
WRTC
33002543 10/2019

Chapter 104
WRTC: Updating the system date

WRTC: Updating the system date

Description

Description of the function


The WRTC function updates the current date in the PLC real-time clock. It is a function used to
convert PL7 applications.
The additional parameters EN and ENO can be configured.

Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
LD Date1
WRTC

Representation in ST
Representation:
WRTC(Date1);

33002543 10/2019 609


WRTC

Description of parameters
The following table describes the input parameters:

Parameter Type Comment


Date1 ARRAY [0...3] Date1 must contain the current value of the date in PL7
OF INT DT format (table of 4 integers). The contents of this
variable must be assigned by program before launching
the function.

610 33002543 10/2019


EcoStruxure™ Control Expert

33002543 10/2019

Appendices

33002543 10/2019 611


612 33002543 10/2019
EcoStruxure™ Control Expert
EFB Error Codes and Values
33002543 10/2019

Appendix A
EFB Error Codes and Values

EFB Error Codes and Values

Introduction
The following tables show the error codes and error values created for the EFBs of the Obsolete
Library.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Tables of Error Codes for the Obsolete Library 614
Common Floating Point Errors 622

33002543 10/2019 613


EFB Error Codes and Values

Tables of Error Codes for the Obsolete Library

Introduction
The following tables show the error codes and error values created for the EFBs of the Obsolete
Library.

CLC
Table of error codes and errors values created for EFBs of the CLC family.

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
DELAY E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
INTEGRATOR1 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
INTEGRATOR1 E_ERR_IB_MAX_MIN F -30102 16#8A6A YMAX < YMIN
INTEGRATOR1 FP_ERROR F - - See table Common Floating Point
Errors, page 622
LAG1 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LAG1 FP_ERROR F - - See table Common Floating Point
Errors, page 622
LEAD_LAG1 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LEAD_LAG1 FP_ERROR F - - See table Common Floating Point
Errors, page 622
LIMV E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LIMV E_ERR_AB1_MAX_MIN F -30101 16#8A6B YMAX < YMIN
LIMV FP_ERROR F - - See table Common Floating Point
Errors, page 622
PI1 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PI1 E_ERR_PI_MAX_MIN F -30103 16#8A69 YMAX < YMIN
PI1 FP_ERROR F - - See table Common Floating Point
Errors, page 622
PID1 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PID1 E_ERR_PID_MAX_MIN F -30104 16#8A68 YMAX < YMIN
PID1 FP_ERROR F - - See table Common Floating Point
Errors, page 622
PIDP1 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number

614 33002543 10/2019


EFB Error Codes and Values

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
PIDP1 E_ERR_PID_MAX_MIN F -30104 16#8A68 YMAX < YMIN
PIDP1 FP_ERROR F - - See table Common Floating Point
Errors, page 622
SMOOTH_RATE E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
SMOOTH_RATE FP_ERROR F - - See table Common Floating Point
Errors, page 622
THREE_- E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
STEP_CON1
THREE_- W_WARN_DSR_TN T 30101 16#7595 TN = 0
STEP_CON1
THREE_- W_WARN_DSR_TSN T 30102 16#7596 TSN = 0
STEP_CON1
THREE_- W_WARN_DSR_KP T 30103 16#7597 KP <= 0
STEP_CON1
THREE_- E_ERR_DSR_HYS F -30105 16#8A67 2 * |UZ| < |HYS|
STEP_CON1
THREE_- FP_ERROR F - - See table Common Floating Point
STEP_CON1 Errors, page 622
THREE- E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
POINT_CON1
THREE- W_WARN_ZDR_XRR F 30105 16#7599 DR: XRR < -100 or XRR > 100
POINT_CON1
THREE- W_WARN_ZDR_T1T2 F 30104 16#7598 T2 > T1
POINT_CON1
THREE- FP_ERROR F - - See table Common Floating Point
POINT_CON1 Errors, page 622
THREE- E_ERR_ZDR_HYS F -30106 16#8A66 2 * |UZ| < |HYS|
POINT_CON1
TWO- E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
POINT_CON1
TWO- W_WARN_ZDR_XRR F 30105 16#7599 DR: XRR < -100 or XRR > 100
POINT_CON1
TWO- W_WARN_ZDR_T1T2 F 30104 16#7598 T2 > T1
POINT_CON1

33002543 10/2019 615


EFB Error Codes and Values

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
TWO- FP_ERROR F - - See table Common Floating Point
POINT_CON1 Errors, page 622
TWO- E_ERR_ZDR_HYS F -30106 16#8A66 2 * |UZ| < |HYS|
POINT_CON1

CLC_PRO
Table of error codes and errors values created for EFBs of the CLC_PRO family.

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
ALIM E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
ALIM WAF_AB2_VMAX F -30111 16#8A61 vmax <= 0
ALIM WAF_AB2_BMAX F -30112 16#8A60 bmax <= 0
ALIM FP_ERROR F - - See table Common Floating Point
Errors, page 622
COMP_PID E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
COMP_PID WAF_KPID_KUZ F -30110 16#8A62 gain_red < 0 or gain_red > 1
COMP_PID WAF_KPID_OGUG F -30104 16#8A68 YMAX < YMIN
COMP_PID WAF_KPID_UZ F -30109 16#8A63 db < 0
COMP_PID FP_ERROR F - - See table Common Floating Point
Errors, page 622
DEADTIME E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
DERIV E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
DERIV FP_ERROR F - - See table Common Floating Point
Errors, page 622
FGEN E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
FGEN WAF_SIG_TV_MAX F -30116 16#8A5C t_acc > t_rise / 2
FGEN WAF_SIG_TH_MAX F -30117 16#8A5B t_rise too big
FGEN WAF_SIG_TA_MAX T 30106 16#759A t_off >= halfperiod
FGEN WAF_SIG_T1_MIN T 30107 16#759B t_max <= t_min

616 33002543 10/2019


EFB Error Codes and Values

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
FGEN WAF_SIG_FKT F -30118 16#8A5A func_no <= 0 or func_no > 8
FGEN FP_ERROR F - - See table Common Floating Point
Errors, page 622
INTEG E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
INTEG E_ERR_IB_MAX_MIN F -30102 16#8A6A YMAX < YMIN
INTEG FP_ERROR F - - See table Common Floating Point
Errors, page 622
LAG E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LAG FP_ERROR F - - See table Common Floating Point
Errors, page 622
LAG2 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LAG2 FP_ERROR F - - See table Common Floating Point
Errors, page 622
LEAD_LAG E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LEAD_LAG FP_ERROR F - - See table Common Floating Point
Errors, page 622
PCON2 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PCON2 W_WARN_ZDR_XRR T 30105 16#7599 DR: XRR < -100 or XRR > 100
PCON2 W_WARN_ZDR_T1T2 T 30104 16#7598 T2 > T1
PCON2 FP_ERROR F - - See table Common Floating Point
Errors, page 622
PCON2 E_ERR_ZDR_HYS F -30106 16#8A66 2 * |UZ| < |HYS|
PCON3 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PCON3 W_WARN_ZDR_XRR T 30105 16#7599 DR: XRR < -100 or XRR > 100
PCON3 W_WARN_ZDR_T1T2 T 30104 16#7598 T2 > T1
PCON3 FP_ERROR F - - See table Common Floating Point
Errors, page 622
PCON3 E_ERR_ZDR_HYS F -30106 16#8A66 2 * |UZ| < |HYS|
PD_OR_PI E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PD_OR_PI WAF_PDPI_OG_UG F -30103 16#8A69 YMAX < YMIN
PD_OR_PI FP_ERROR F - - See table Common Floating Point
Errors, page 622
PDM PDM_TMAX_TMIN F -30115 16#8A5D t_max <= t_min

33002543 10/2019 617


EFB Error Codes and Values

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
PDM PDM_OG_UG F -30114 16#8A69 |pos_up_x| > |pos_lo_x| or |neg_up_x| >
|neg_lo_x|
PDM FP_ERROR F - - See table Common Floating Point
Errors, page 622
PI E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PI E_ERR_PI_MAX_MIN F -30103 16#8A69 YMAX < YMIN
PI FP_ERROR F - - See table Common Floating Point
Errors, page 622
PID E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PID E_ERR_PID_MAX_MIN F -30104 16#8A68 YMAX < YMIN
PID FP_ERROR F - - See table Common Floating Point
Errors, page 622
PID_P E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PID_P E_ERR_PID_MAX_MIN F -30104 16#8A68 YMAX < YMIN
PID_P FP_ERROR F - - See table Common Floating Point
Errors, page 622
PIP E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PIP E_ERR_PI_MAX_MIN F -30103 16#8A69 YMAX < YMIN
PIP FP_ERROR F - - See table Common Floating Point
Errors, page 622
PPI E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
PPI E_ERR_PI_MAX_MIN F -30103 16#8A69 YMAX < YMIN
PPI FP_ERROR F - - See table Common Floating Point
Errors, page 622
PWM WAF_PBM_TMINMAX F -30113 16#8A5F t_min < t_max
PWM FP_ERROR F - - See table Common Floating Point
Errors, page 622
QPWM WAF_PBM_TMINMAX F -30113 16#8A5F t_min < t_max
QPWM FP_ERROR F - - See table Common Floating Point
Errors, page 622
SCON3 E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
SCON3 W_WARN_DSR_TN T 30101 16#7595 TN = 0
SCON3 W_WARN_DSR_TSN T 30102 16#7596 TSN = 0

618 33002543 10/2019


EFB Error Codes and Values

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
SCON3 W_WARN_DSR_KP T 30103 16#7597 KP <= 0
SCON3 E_ERR_DSR_HYS F -30105 16#8A67 2 * |UZ| < |HYS|
SCON3 FP_ERROR F - - See table Common Floating Point
Errors, page 622
VLIM E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
VLIM E_ERR_AB1_MAX_MIN F -30101 16#8A6B YMAX < YMIN
VLIM FP_ERROR F - - See table Common Floating Point
Errors, page 622

Extension/Compatibility
Table of error codes and errors values created for EFBs of the Extension/Compatibility
family.

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
AKF_TA E_AKFEFB_TIMEBASE_ F -30482 16#88EE Time base is zero
IS_ZERO
AKF_TE E_AKFEFB_TIMEBASE_ F -30482 16#88EE Time base is zero
IS_ZERO
AKF_TI E_AKFEFB_TIMEBASE_ F -30482 16#88EE Time base is zero
IS_ZERO
AKF_TS E_AKFEFB_TIMEBASE_ F -30482 16#88EE Time base is zero
IS_ZERO
AKF_TV E_AKFEFB_TIMEBASE_ F -30482 16#88EE Time base is zero
IS_ZERO
FIFO E_INPUT_VALUE_OUT_ F -30183 16#8A19 Input value is out of range
OF_RANGE
GET_3X E_INPUT_VALUE_OUT_ F -30183 16#8A19 Input value is out of range
OF_RANGE
GET_4X E_INPUT_VALUE_OUT_ F -30183 16#8A19 Input value is out of range
OF_RANGE

33002543 10/2019 619


EFB Error Codes and Values

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
GET_BIT E_INPUT_VALUE_OUT_ F -30183 16#8A19 Input value is out of range
OF_RANGE
IEC_BMDI E_EFB_USER_ERROR_ F -30200 16#8A08 Input value is invalid register type
IEC_BMDI_M 1 (SourceTable).
IEC_BMDI E_EFB_USER_ERROR_ F -30201 16#8A07 The input offset (OffsetInSourceTable)
IEC_BMDI_M 2 selects an address outside acceptable
limits.
IEC_BMDI E_EFB_USER_ERROR_ F -30202 16#8A06 The input offset (OFF_IN) is not 1 or a
IEC_BMDI_M 3 multiple of 16+1.
IEC_BMDI E_EFB_USER_ERROR_ F -30203 16#8A05 Output value is invalid register type
IEC_BMDI_M 4 (DestinationTable).
IEC_BMDI E_EFB_USER_ERROR_ F -30204 16#8A04 The output offset
IEC_BMDI_M 5 (OffsetInDestinationTable) selects an
address outside acceptable limits.
IEC_BMDI E_EFB_USER_ERROR_ F -30205 16#8A03 The output offset
IEC_BMDI_M 6 (OffsetInDestinationTable) is not 1 or a
multiple of 16+1.
IEC_BMDI E_EFB_USER_ERROR_ F -30206 16#8A02 The value for (NumberOfElements) is
IEC_BMDI_M 7 0.
IEC_BMDI E_EFB_USER_ERROR_ F -30207 16#8A01 The value for (NumberOfElements)
IEC_BMDI_M 8 addresses more than 1600 bits.
IEC_BMDI E_EFB_USER_ERROR_ F -30208 16#8A00 The value for (NumberOfElements)
IEC_BMDI_M 9 addresses more than 100 words.
IEC_BMDI E_EFB_USER_ERROR_ F -30209 16#89FF The value for (NumberOfElements)
IEC_BMDI_M 10 selects a source address outside the
acceptable limits.
IEC_BMDI E_EFB_USER_ERROR_ F -30210 16#89FE The value for (NumberOfElements)
IEC_BMDI_M 11 selects a destination address outside
the acceptable limits.
IEC_BMDI E_EFB_USER_ERROR_ F -30211 16#89FD The value for (NumberOfElements) is
IEC_BMDI_M 12 not a multiple of 16.
IEC_BMDI E_EFB_USER_ERROR_ F -30212 16#89FC Warning: Address overlap of input and
IEC_BMDI_M 13 output addresses.
LIFO E_INPUT_VALUE_OUT_ F -30183 16#8A19 Input value is out of range
OF_RANGE

620 33002543 10/2019


EFB Error Codes and Values

EFB name Error code ENO Error Error Error description


state value in value in
in Dec Hex
case
of
error
PUT_4X E_INPUT_VALUE_OUT_ F -30183 16#8A19 Input value is out of range
OF_RANGE
MUX_DINTARR_ E_SELECTOR_OUT_OF F -30175 16#8A21 Selector is out of range
125 _RANGE
SET_BIT E_INPUT_VALUE_OUT_ F -30183 16#8A19 Input value is out of range
OF_RANGE

33002543 10/2019 621


EFB Error Codes and Values

Common Floating Point Errors

Introduction
The following table shows the common error codes and error values created for floating point
errors. These error information are displayed in the Diagnostic Viewer and the error code values
are written in %SW125.

Common Floating Point Errors


Table of common floating point errors

Error codes Error value in Error value Error description


Dec in Hex
FP_ERROR -30150 16#8A3A Base value (not apearing as an error value)
E_FP_STATUS_FAILED_IE -30151 16#8A39 Illegal floating point operation
E_FP_STATUS_FAILED_DE -30152 16#8A38 Operand is denormalized - not a valid REAL
number
E_FP_STATUS_FAILED_ZE -30154 16#8A36 Illegal divide by zero
E_FP_STATUS_FAILED_ZE_IE -30155 16#8A35 Illegal floating point operation / Divide by zero
E_FP_STATUS_FAILED_OE -30158 16#8A32 Floating point overflow
E_FP_STATUS_FAILED_OE_IE -30159 16#8A31 Illegal floating point operation / Overflow
E_FP_STATUS_FAILED_OE_ZE -30162 16#8A2E Floating point overflow / Divide by zero
E_FP_STATUS_FAILED_OE_ZE_IE -30163 16#8A2D Illegal floating point operation / Overflow /
Divide by zero
E_FP_NOT_COMPARABLE -30166 16#8A2A Internal error

622 33002543 10/2019


EcoStruxure™ Control Expert
Glossary
33002543 10/2019

Glossary

A
ANY
There is a hierarchy among the various data types. In the DFBs, it is sometimes possible to declare
variables that can contain several types of values. In that case we use ANY_xxx types.
The figure below describes this hierarchical structure:

33002543 10/2019 623


Glossary

B
BCD
BCD is the abbreviation of the Binary Coded Decimal format.
BCD can be used to represent decimal numbers between 0 and 9 using a set of four bits (nybble).
In this format, the four bits used to encode decimal numbers have an unused range of
combinations.
Example of BCD encoding:
 The number 2,450
 is encoded: 0010 0100 0101 0000

BOOL
BOOL is the abbreviation for the Boolean type. This is the basic data type in computing. A BOOL
variable can have either of the following two values: 0 (FALSE) or 1 (TRUE).
A bit extracted from a word is of type BOOL, for example: %MW10.4.

BYTE
When 8 bits are grouped together, they are called a BYTE. You can enter a BYTE either in binary
mode or in base 8.
The BYTE type is encoded in an 8 bit format which, in hexadecimal format, ranges from 16#00 to
16#FF.

D
DATE
The DATE type, encoded in BCD in a 32 bit format, contains the following information:
 the year encoded in a 16 bit field;
 the month encoded in an 8 bit field;
 the day encoded in an 8 bit field.
The DATE type must be entered as follows: D#<Year>-<Month>-<Day>
This table shows the upper/lower limits of each field:

Field Limits Comment


Year [1990,2099] Year
Month [01,12] The leading 0 is displayed; it can be omitted during data entry.
Day [01,31] For months 01/03/05/07/08/10/12
[01,30] For months 04/06/09/11
[01,29] For month 02 (leap years)
[01,28] For month 02 (non-leap years)

624 33002543 10/2019


Glossary

DINT
DINT is the abbreviation of Double INTeger (encoded in 32 bits).
The upper/lower limits are as follows: -(2 to the power of 31) to (2 to the power of 31) - 1.
Example:
-2147483648, 2147483647, 16#FFFFFFFF.

DWORD
DWORD is the abbreviation of Double Word.
The DWORD type is encoded in a 32 bit format.
This table shows the upper/lower limits of each of the bases that can be used:

Base Lower limit Upper limit


Hexadecimal 16#0 16#FFFFFFFF
Octal 8#0 8#37777777777
Binary 2#0 2#11111111111111111111111111111111

Examples of representation:

Data Representation in one of the bases


00000000000010101101110011011110 16#ADCDE
00000000000000010000000000000000 8#200000
00000000000010101011110011011110 2#10101011110011011110

E
EBOOL
EBOOL is the abbreviation of Extended BOOLean. An EBOOL type has a value (0 (FALSE) or 1
(TRUE), but also rising or falling edges and forcing functions.
An EBOOL variable occupies one byte in memory.
The byte contains the following information:
 one bit for the value;
 one bit for the history (whenever the object changes state, the value is copied to the history bit);
 one bit for forcing (equal to 0 if the object is not forced, or 1 if the bit is forced).
The default value of each bit is 0 (FALSE).

33002543 10/2019 625


Glossary

EF
EF is the abbreviation of Elementary Function.
This is a block used in a program which performs a predefined logical function.
A function does not have any information on the internal state. Several calls to the same function
using the same input parameters return the same output values. You find information on the
graphic form of the function call in the "[functional block (instance)]". Unlike a call to a function
block, function calls include only an output which is not named and whose name is identical to that
of the function. In FBD, each call is indicated by a unique [number] via the graphic block. This
number is managed automatically and cannot be modified.
You position and configure these functions in your program in order to execute your application.
You can also develop other functions using the SDKC development kit.
EN
EN stands for ENable; it is an optional block input. When the EN input is enabled, an ENO output is
set automatically.
If EN = 0, the block is not enabled; its internal program is not executed, and ENO is set to 0.
If EN = 1, the block's internal program is run and ENO is set to 1. If an error occurs, ENO is set to 0.
If the EN input is not connected, it is set automatically to 1.

ENO
ENO stands for Error NOtification; this is the output associated with the optional input EN.
If ENO is set to 0 (because EN = 0 or in case of an execution error):
 the status of the function block outputs remains the same as it was during the previous scanning
cycle that executed correctly;
 the output(s) of the function, as well as the procedures, are set to "0".

I
INT
INT is the abbreviation of single INTeger (encoded in 16 bits).
The upper/lower limits are as follows: -(2 to the power of 15) to (2 to the power of 15) - 1.
Example:
-32768, 32767, 2#1111110001001001, 16#9FA4.

626 33002543 10/2019


Glossary

R
REAL
The REAL type is encoded in a 32 bit format.
The possible value ranges are shown in the figure below:

When a result is:


 between -1,175494e-38 and 1,175494e-38, it is considered to be a DEN;
 less than -3.402824e+38, the symbol -INF (for - infinity) is displayed;
 greater than +3.402824e+38, the symbol INF (for + infinity) is displayed;
 undefined (square root of a negative number), the symbolNAN is displayed.
NOTE: The IEC 559 standard defines two classes of NAN: the silent NAN (QNAN) and the
signaling NAN (SNAN). A QNAN is a NAN with a most significant fraction bit while an SNAN is a
NAN without a most significant fraction bit (bit number 22). QNANs can be propagated via most
arithmetic operations without throwing an exception. As for SNANs, they generally indicate n invalid
operation when they are used as operands in arithmetic operations (see %SW17 and %S18).
NOTE: When a DEN (non-standardized number) is used as an operand, the result is not significant.

S
STRING
A STRING variable is a series of ASCII characters. The maximum length of a string is 65,534
characters.

T
TIME
The TIME type expresses a time in milliseconds. Encoded in 32 bits, this type can be used to
obtain times from 0 to 2 32-1 milliseconds.
The TIME type has the following units: days (d), hours (h), minutes (m), seconds (s) and
milliseconds (ms). A literal value of type TIME is represented by a combination of the preceding
types prefixed with T#, t#, TIME# or time#.
Examples: T#25h15m, t#14,7S, TIME#5d10h23m45s3ms

33002543 10/2019 627


Glossary

TOD
TOD is the abbreviation of Time Of Day.
The TOD type, encoded in BCD in a 32 bit format, contains the following information:
 the hour encoded in an 8 bit field;
 the minutes encoded in an 8 bit field;
 the seconds encoded in an 8 bit field.
NOTE: The 8 least significant bits are not used.
The TOD type must be entered as follows: TOD#<Hour>:<Minutes>:<Seconds>
This table shows the upper/lower limits of each field:

Field Limits Comment


Hour [00,23] The leading 0 is displayed; it can be omitted during data entry.
Minute [00,59] The leading 0 is displayed; it can be omitted during data entry.
Second [00,59] The leading 0 is displayed; it can be omitted during data entry.

Example: TOD#23:59:45.

U
UDINT
UDINT is the abbreviation of Unsigned Double INTeger (encoded in 32 bits). The upper/lower limits
are as follows: 0 to (2 to the power of 32) - 1.
Example:
0, 4294967295, 2#11111111111111111111111111111111, 8#37777777777,
16#FFFFFFFF.

UINT
UINT is the abbreviation of the Unsigned INTeger format (encoded in 16 bits). The upper/lower
limits are as follows: 0 to (2 to the power of 16) - 1.
Example:
0, 65535, 2#1111111111111111, 8#177777, 16#FFFF.

628 33002543 10/2019


Glossary

W
WORD
The type WORD is encoded in a 16 bit format and is used to perform processing on series of bits.
This table shows the upper/lower limits of each of the bases that can be used:

Base Lower limit Upper limit


Hexadecimal 16#0 16#FFFF
Octal 8#0 8#177777
Binary 2#0 2#1111111111111111

Examples of representation

Data Representation in one of the bases


0000000011010011 16#D3
1010101010101010 8#125252
0000000011010011 2#11010011

33002543 10/2019 629


Glossary

630 33002543 10/2019


EcoStruxure™ Control Expert
Index
33002543 10/2019

Index

A controller - instructions
COMP_PID, 151
ADD_***_PL7, 377
PCON2, 235
AKF_FL, 381
PCON3, 243
AKF_TA, 383
PD_OR_PI, 253
AKF_TE, 387
PDM, 267
AKF_TI, 391
PI, 277
AKF_TS, 395
PI1, 73
AKF_TV, 399
PID, 287
AKF_ZR, 403
PID_P, 301
AKF_ZV, 407
PID1, 83
AKF_ZVR, 411
PIDP1, 97
ALIM, 145
PIP, 313
array - instructions
PPI, 327
R2T_***, 541
SCON3, 359
T2T, 589
THREE_STEP_CON1, 117
availability of the instructions, 31
THREEPOINT_CON1, 125
TWOPOINT_CON1, 135
C conversion - instructions
DATE_DINT_TO_STRING, 417
COMP_PID, 151 DT_ARINT_TO_STRING, 423
COMPARE, 415 TIME_DINT_TO_STRING, 595
comparison - instructions TOD_DINT_TO_STRING, 597
COMPARE, 415 TRANS_TIME, 599
SRCH, 575 R_INT_WORD, 537
conditioning - instructions R_UINT_WORD, 539
ALIM, 145 R2T_***, 541
DEADTIME, 173 W_INT_REAL, 601
DELAY, 41 W_UINT_REAL, 603
DERIV, 181 counter - instructions
FGEN, 189 SCOUNT, 557
INTEG, 205 AKF_ZR, 403
INTEGRATOR1, 47 AKF_ZV, 407
LAG, 213 AKF_ZVR, 411
LAG1, 53 DOWN_PL7_COUNTER, 483
LAG2, 219 PL7_COUNTER, 483
LEAD_LAG, 227 PRESET_PL7_COUNTER, 483
LEAD_LAG1, 59 RESET_PL7_COUNTER, 483
LIMV, 67 UP_PL7_COUNTER, 483
SMOOTH_RATE, 109
VLIM, 367

33002543 10/2019 631


Index

D I
DATE_DINT_TO_STRING, 417 IEC_BMDI, 459
DAY_OF_WEEK, 419 IEC_BMDI_M, 467
DEADTIME, 173 instructions
DELAY, 41 availability, 31
DELTA_***, 421 INTEG, 205
DERIV, 181 INTEGRATOR1, 47
DOWN_PL7_COUNTER, 483
DOWN_PL7_TOF, 511
DOWN_PL7_TON, 517 L
DOWN_PL7_TP, 523 LAG, 213
drum - instructions LAG1, 53
FSTEP_PL7_DRUM, 437 LAG2, 219
PL7_DRUM, 489 LEAD_LAG, 227
RESET_PL7_DRUM, 489 LEAD_LAG1, 59
UP_PL7_DRUM, 489 LIFO, 475
DT_ARINT_TO_STRING, 423 LIMV, 67
logical - instructions
HIGH_INT, 457
E LOW_INT, 479
END, 427 AKF_FL, 381
error codes, 613 PL7_MONOSTABLE, 495
SET_BIT, 563
START_PL7_MONOSTABLE, 495
F LOW_INT, 479
FGEN, 189
FIFO, 429
FPULSOR, 433 M
FSTEP_PL7_DRUM, 437 mathematical - instructions
FTOF, 439 ADD_***_PL7, 377
FTON, 443 DELTA_***, 421
FTP, 447 IEC_BMDI, 459
IEC_BMDI_M, 467
MUX_DINTARR_125, 481
G STR_ROUND, 581
GET_3X, 451 SUB_***_PL7, 583
GET_4X, 453 T2T, 589
GET_BIT, 455 MUX_DINTARR_125, 481
GET_PL7_REGISTER_255, 505
GET_PL7_REGISTER_32, 501
O
output processing - instructions
H PWM, 339
HIGH_INT, 457 QPWM, 351

632 33002543 10/2019


Index

register management - instructions


P FIFO, 429
PCMCIA card - instructions GET_3X, 451
READ_PCMCIA, 547 GET_4X, 453
SET_PCMCIA, 565 GET_BIT, 455
WRITE_PCMCIA, 605 GET_PL7_REGISTER_255, 505
PCON2, 235 GET_PL7_REGISTER_32, 501
PCON3, 243 LIFO, 475
PD_OR_PI, 253 PL7_REGISTER_255, 505
PDM, 267 PL7_REGISTER_32, 501
PI, 277 PUT_4X, 535
PI1, 73 PUT_PL7_REGISTER_255, 505
PID, 287 PUT_PL7_REGISTER_32, 501
PID_P, 301 RESET_PL7_REGISTER_255, 505
PID1, 83 RESET_PL7_REGISTER_32, 501
PIDP1, 97 ROR1_ARB, 553
PIP, 313 SHL_RBIT_***, 567
PL7_3_TIMER, 529 SHR_RBIT_***, 569
PL7_COUNTER, 483 SHRZ_***, 571
PL7_DRUM, 489 SHRZ_RBIT_***, 573
PL7_MONOSTABLE, 495 RESET_PL7_COUNTER, 483
PL7_REGISTER_255, 505 RESET_PL7_DRUM, 489
PL7_REGISTER_32, 501 RESET_PL7_REGISTER_255, 505
PL7_TOF, 511 RESET_PL7_REGISTER_32, 501
PL7_TON, 517 ROR1_ARB, 553
PL7_TP, 523 RRTC, 555
PPI, 327
PRESET_PL7_3_TIMER, 529
PRESET_PL7_COUNTER, 483 S
PUT_4X, 535
SCON3, 359
PUT_PL7_REGISTER_255, 505
SCOUNT, 557
PUT_PL7_REGISTER_32, 501
SET_BIT, 563
PWM, 339
SET_PCMCIA, 565
SHL_RBIT_***, 567
SHR_RBIT_***, 569
Q SHRZ_***, 571
QPWM, 351 SHRZ_RBIT_***, 573
SMOOTH_RATE, 109
SRCH, 575
R START_PL7_3_TIMER, 529
R_INT_WORD, 537 START_PL7_MONOSTABLE, 495
R_UINT_WORD, 539 START_PL7_TOF, 511
R2T_***, 541 START_PL7_TON, 517
READ_PCMCIA, 547 START_PL7_TP, 523
STOP_PL7_3_TIMER, 529

33002543 10/2019 633


Index

STR_ROUND, 581 timer - instructions


string management - instructions DOWN_PL7_TON, 517
DATE_DINT_TO_STRING, 417 FPULSOR, 433
DT_ARINT_TO_STRING, 423 FTOF, 439
END, 427 FTON, 443
TIME_DINT_TO_STRING, 595 FTP, 447
TOD_DINT_TO_STRING, 597 PL7_TON, 517
STR_ROUND, 581 START_PL7_TON, 517
SUB_***_PL7, 583 AKF_TA, 383
SYSSTATE, 587 AKF_TE, 387
system specials - instructions AKF_TI, 391
SYSSTATE, 587 AKF_TS, 395
system time and date - instructions AKF_TV, 399
DAY_OF_WEEK, 419 DOWN_PL7_TOF, 511
RRTC, 555 DOWN_PL7_TP, 523
WRTC, 609 PL7_3_TIMER, 529
PL7_TOF, 511
PL7_TP, 523
T PRESET_PL7_3_TIMER, 529
T2T, 589 START_PL7_3_TIMER, 529
THREE_STEP_CON1, 117 START_PL7_TOF, 511
THREEPOINT_CON1, 125 START_PL7_TP, 523
TIME_DINT_TO_STRING, 595 STOP_PL7_3_TIMER, 529
TOD_DINT_TO_STRING, 597
TRANS_TIME, 599
TWOPOINT_CON1, 135

U
UP_PL7_COUNTER, 483
UP_PL7_DRUM, 489

V
VLIM, 367

W
W_INT_REAL, 601
W_UINT_REAL, 603
WRITE_PCMCIA, 605
WRTC, 609

634 33002543 10/2019

You might also like