Obsolete - Block Library
Obsolete - Block Library
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.
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.
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
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.
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
Overview
This chapter describes the different block types and their applications.
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
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
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
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:
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:
33002543 10/2019 29
Block Types and their Applications
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.
30 33002543 10/2019
EcoStruxure™ Control Expert
Availability of Blocks
33002543 10/2019
Chapter 2
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:
Legend:
+ Yes
- No
33002543 10/2019 31
Availability of Blocks
CLC_PRO
Availability of the blocks:
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
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.
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.
33002543 10/2019 39
CLC
40 33002543 10/2019
EcoStruxure™ Control Expert
DELAY
33002543 10/2019
Chapter 4
DELAY: Deadtime device
Introduction
This chapter describes the DELAY block.
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:
Runtime error
For a list of all block error codes and values, see CLC, page 614.
44 33002543 10/2019
DELAY
Operating mode
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.
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
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
Introduction
This chapter describes the INTEGRATOR1 block.
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.
Formula
The transfer function is:
Variable Description
Value of input X 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:
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:
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
Introduction
This chapter describes the LAG1 block.
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.
Formula
The transfer function is:
Variable Description
Value of input X 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:
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
Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:
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
Introduction
This chapter describes the LEAD_LAG1 block.
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.
Formula
The transfer function is:
Variable Description
Value of input X 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:
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:
33002543 10/2019 63
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 = 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
Introduction
This chapter describes the LIMV block.
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.
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:
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:
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.
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.
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:
76 33002543 10/2019
PI1
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:
Calculation formulas
The calculation formulas are:
Output signal Y
The output signal Y is then:
Variable Meaning
Present sample time
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
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
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
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.
82 33002543 10/2019
EcoStruxure™ Control Expert
PID1
33002543 10/2019
Chapter 10
PID1: PID controller
Introduction
This chapter describes the PID1 block.
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.
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:
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:
33002543 10/2019 87
PID1
1
Refer to Initialization Requirements (see page 84).
Description of output parameters:
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
Structure diagram
The following is the structure diagram of the PID1block:
33002543 10/2019 89
PID1
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.
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
33002543 10/2019 91
PID1
Operating modes
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.
92 33002543 10/2019
PID1
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.
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
Variable Meaning
Time differential between the present cycle and the previous cycle
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:
94 33002543 10/2019
PID1
33002543 10/2019 95
PID1
96 33002543 10/2019
EcoStruxure™ Control Expert
PID_P1
33002543 10/2019
Chapter 11
PIDP1: PID Controller with Parallel Structure
At a Glance
This chapter describes the PIDP1 block.
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.
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:
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:
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:
1
Refer to Initialization Requirements (see page 98).
Description of the output parameters:
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).
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.
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:
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
Operating modes
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.
Detailed formulas
Variable Description
Time differential between the present cycle and the previous cycle
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
Chapter 12
SMOOTH_RATE: Differentiator with smoothing
Introduction
This chapter describes the SMOOTH_RATE block.
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.
Representation in FBD
Representation:
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) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see CLC, page 614.
Transfer function
The transfer function for Y is:
Output Y
The output Y is determined as follows:
Variable Meaning
dt is the time differential between the current cycle and the previous cycle
Value of the input X from the current cycle
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:
Example
The following illustration shows the jump response of the function block SMOOTH_RATE when GAIN
= 1 and LAG = 10 s:
Chapter 13
THREE_STEP_CON1: Three step controller
Introduction
This chapter describes the THREE_STEP_CON1 block.
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.
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:
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)
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:
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...
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.
Detailed description
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:
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!
Operating modes
There are two operating modes that can be selected through the R parameter input:
Chapter 14
THREEPOINT_CON1: Three point controller
Introduction
This chapter describes the THREEPOINT_CON1 block.
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.
Properties
The function block THREEPOINT_CON1 contains the following properties:
Operating modes Manual, Halt, Automatic
Two internal feedback paths (delay 1st Order)
Representation in FBD
Representation:
Representation in LD
Representation:
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:
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.
Detailed description
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
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!
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:
Chapter 15
TWOPOINT_CON1: Two point controller
Introduction
This chapter describes the TWOPOINT_CON1 block.
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.
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:
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)
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:
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 < 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.
Detailed description
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)].
Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:
Halt 0 1 The output Y is held at its last value. xf1 and xf2
are set to GAIN * Y.
Part III
CLC_PRO
CLC_PRO
Overview
This part describes the elementary functions and elementary function blocks in the family
CLC_PRO.
Chapter 16
ALIM: Velocity limiter: 2nd order
Introduction
This chapter describes the ALIM block.
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.
Representation in FBD
Representation:
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) ;
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.
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:
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.
Chapter 17
COMP_PID: Complex PID controller
Introduction
This chapter describes the COMP_PID block.
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.
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
Transfer function
The transfer function is:
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:
Representation in LD
Representation:
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) ;
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.
Structure diagram
The following is the structure diagram of 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.
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.
1 Gradient 1
2 Gradient gain_red
For limiting the manipulated variable, the upper limit ymax should be greater than the lower limit
ymin.
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).
Controller types
There are four different control types, which are selected via the parameters en_p, en_i and
en_d.
If... Then...
en_i = 1 Y = YP + YI + YD + FEED_FWD
en_i = 0 Y = YP + OFF + YD + FEED_FWD
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.
Operating mode
There are five operating modes selectable through r, man, halt, and cascade.
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.
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.
Detailed formulas
Variable Meaning
Time differential between the present cycle and the previous cycle
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:
Chapter 18
DEADTIME: Deadtime device
Introduction
This chapter describes the DEADTIME block.
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.
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:
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) ;
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.
Operating mode
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.
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 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.
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
Chapter 19
DERIV: Differentiator with smoothing
Introduction
This chapter describes the DERIV block.
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.
Representation in FBD
Representation:
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) ;
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.
Formulas
Transfer function
The transfer function for Y is:
Variable Meaning
the input X value for the current cycle
is the time differential between the current cycle and the previous cycle
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:
Example DERIV
The following example shows the step response of the DERIV function block.
Jump response with gain = 1 and lag = 10 s
Chapter 20
FGEN: Function generator
Introduction
This chapter describes the FGEN block.
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.
Representation in FBD
Representation:
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) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.
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".
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.
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
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.
"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
NOTE: Smoothing is used only by the functions "Ramp", "Saw-Tooth", "Delta" and "trapezoid".
"Jump", "Square" and "Sine" are not "smoothable" functions.
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 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.
Jump function
Representation of the Jump function
Ramp function
Representation of the Ramp function
Saw-tooth function
Representation of the Saw-tooth function
Delta function
Representation of the Delta function
Trapezoid function
Representation of the Trapezoid function
Sine function
Representation of the Sine function
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.
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
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
Chapter 21
INTEG: Integrator with limit
Introduction
This chapter describes the INTEG block.
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.
Formula
The transfer function is:
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
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) ;
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.
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:
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
Chapter 22
LAG: Delay element 1st order
Introduction
This chapter describes the LAG block.
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.
Formula
The transfer function is:
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
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) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.
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
Operating mode
There are three operating mode selectable through the man and halt parameter inputs:
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
Chapter 23
LAG2: Delay element 2nd order
Introduction
This chapter describes the LAG2 block.
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.
Formula
The transfer function is:
where
and
Variable Description
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:
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) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.
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:
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.
Chapter 24
LEAD_LAG: PD device with smoothing
Introduction
This chapter describes the LEAD_LAG block.
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.
Formula
The transfer function is:
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
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) ;
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.
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:
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
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
Chapter 25
PCON2: Two point controller
Introduction
This chapter describes the PCON2 block.
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:
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) ;
Runtime error
In the following cases a warning is given:
NOTE: For a list of all block error codes and values, see CLC_PRO, page 616.
Detailed description
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:
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:
Chapter 26
PCON3: Three point controller
Introduction
This chapter describes the PCON3 block.
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:
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) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.
Detailed description
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
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:
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).
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:
Runtime error
Error message
If hys > 2 * db, an error message appears.
Warning
In the following cases a warning is given:
Chapter 27
PD_OR_PI: Structure changeover PD/PI controller
Introduction
This chapter describes the PD_OR_PI block.
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.
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
Representation in FBD
Representation:
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) ;
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.
Structure diagram
The following is the structure diagram of the PD_OR_PI block:
Detailed description
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.
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
Operating modes
There are three operating mode selectable through the man and halt parameter inputs:
Detailed formulas
Variable Meaning
Present sample time
System deviation
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:
Chapter 28
PDM: Pulse duration modulation
Introduction
This chapter describes the PDM block.
Description
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.
Formula
For correct operation when setting parameters the following rules should be observed:
and
Representation in FBD
Representation:
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) ;
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.
Detailed description
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:
lo_x = 0
t_min > 0
lo_x = 0
t_min = 0
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.
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".
Output dependency on X
In the following picture the dependency of the output on X 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:
Chapter 29
PI: PI controller
PI: PI controller
Introduction
This chapter describes the PI block.
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.
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:
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) ;
PI parameter description
Description of input parameters:
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.
Formulas
Transfer function
The transfer function is:
Calculation formulas
The calculation formulas are:
Output signal Y
The output signal Y is then:
Variable Meaning
Present sample time
YI I component
YP P component
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
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
Operating modes
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.
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.
Chapter 30
PID: PID controller
Introduction
This chapter describes the PID block.
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.
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
Transfer function
The transfer function is:
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:
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) ;
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).
Structure diagram
The following is the structure diagram of the PID block:
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.
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:
Operating modes
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.
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.
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.
Detailed formulas
Variable Meaning
is the time differential between the current cycle and the previous cycle
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:
Chapter 31
PID_P: PID controller with parallel structure
Introduction
This chapter describes the PID_P block.
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.
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
Transfer function
The transfer function is:
Variable Description
YD D component
YI I component
YP P component
Representation in FBD
Representation:
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) ;
1
Refer to Initialization Requirements (see page 302).
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).
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.
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:
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
Operating modes
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.
Detailed formulas
Variable Meaning
is the time differential between the current cycle and the previous cycle
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
Chapter 32
PIP: PIP cascade controller
Introduction
This chapter describes the PIP block.
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.
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:
Representation in FBD
Representation:
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)
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) ;
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.
Structure diagram
The following is the structure diagram of the PIP block:
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.
Operating modes
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.
Detailed formulas
Variable Meaning
is the time differential between the current cycle and the previous cycle
The integral component Y1 of the master controller for the automatic mode is determined as
follows:
Manual mode
The output signal Y of the cascade 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 integral component Y1 of the master controller for the halt mode is determined as follows:
The integral component Y1 of the master controller for the fixed setpoint control mode is
determined as follows:
Chapter 33
PPI: PPI cascade controller
Introduction
This chapter describes the PPI block.
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.
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
Transfer function
The transmission function for the controller says:
Representation in FBD
Representation:
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)
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) ;
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.
Structure diagram
The following is the structure diagram of the PPI block:
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
Operating modes
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.
Detailed formulas
Variable Meaning
Present sample time
The integral component Y1 of the sub controller for the automatic mode is determined as follows:
Manual mode
The output signal Y of the cascade 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 integral component Y1 of the sub controller for the halt mode is determined as follows:
The integral component Y1 of the sub controller for the fixed setpoint control mode is determined
as follows:
Chapter 34
PWM: Pulse width modulation
Introduction
This chapter describes the PWM block.
Description
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.
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:
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) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.
Detailed description
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.
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:
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
X analog signal
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
X analog signal
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.
Chapter 35
QPWM: Pulse width modulation (simple)
Introduction
This chapter describes the QPWM block.
Description
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.
Y_NEG
Parametering rules
For correct operation when setting parameters the following rules should be observed:
t_min ≤ t_period
Representation in FBD
Representation:
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) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 616.
Detailed description
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.
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:
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
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.
Chapter 36
SCON3: Three step controller
Introduction
This chapter describes the SCON3 block.
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.
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:
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) ;
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.
Detailed description
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:
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!
Operating modes
There are two operating modes that can be selected through the R parameter input:
Chapter 37
VLIM: Velocity limiter 1st order
Introduction
This chapter describes the VLIM block.
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.
Properties
The function block has the following properties:
Operating modes Manual, Halt, Automatic
Manipulated variable limiting
Representation in FBD
Representation:
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)
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.
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.
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:
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.
Part IV
Extension/Compatibility
Extension/Compatibility
Overview
This part describes the elementary functions and elementary function blocks in the family
Extension/Compatibility.
Chapter 38
ADD_***_PL7 : Add a period
Description
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:
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:
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.
Chapter 39
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)
Representation in ST
Representation:
AKF_FL_Instance (CLK:=ClockInput, Q=>DisplaysAnyEdge) ;
Parameter description
Description of the input parameters:
Chapter 40
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:
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:
Timing diagram
Timing diagram of the TA disconnection delay:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.
Chapter 41
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:
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:
Timing diagram
Timing diagram for activation delay TE:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.
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:
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:
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.
Chapter 43
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:
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:
Timing diagram
Timing diagram for storing activation delay TS
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.
Chapter 44
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:
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:
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.
Chapter 45
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
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)
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:
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.
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".
Chapter 46
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
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)
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:
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.
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".
Chapter 47
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
Representation in FBD
Representation:
Representation in LD
Representation:
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:
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.
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".
Chapter 48
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:
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);
Chapter 49
DATE_DINT_TO_STRING: Conversion of a date (DATE PL7) into a character string
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Date1
DATE_DINT_TO_STRING
ST Result_Str
Representation in ST
Representation:
Result_Str:= DATE_DINT_TO_STRING(Date1);
Description of parameters
The following table describes the input parameters:
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’.
Chapter 50
DAY_OF_WEEK : Day of the week
Description
Representation in FBD
Representation:
Representation in LD
Representation:
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:
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.
Chapter 51
DELTA_***: Difference between two dates
Description
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:
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:
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.
Chapter 52
DT_ARINT_TO_STRING: Converting a PL7 date into a character string
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Date1
DT_ARINT_TO_STRING
ST Result_Str
Representation in ST
Representation:
Result_Str:= DT_ARINT_TO_STRING(Date1);
Description of parameters
The following table describes the input parameters:
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’.
Chapter 53
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:
Representation in IL
Representation:
CAL END
Representation in ST
Representation:
END ();
Chapter 54
FIFO: First In/First Out stack register
Introduction
This chapter describes the FIFO block.
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:
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:
Runtime error
For a list of all block error codes and values, see here (see page 619).
Detailed description
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.
Chapter 55
FPULSOR: Generation of rectangular signals
Description
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
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:
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).
Timing diagram
Timing diagram.
Operation
The following table describes the operation of the FPULSOR function:
Chapter 56
FSTEP_PL7_DRUM : Forcing a drum to a step
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Step_value
FSTEP_PL7_DRUM Drum_instance
Representation in ST
Representation:
FSTEP_PL7_DRUM (Step_value, Drum_instance);
Description of parameters
The following table describes the input parameters:
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.
Chapter 57
FTOF: Deactivation timer
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);
Timing diagram
Timing diagram.
Operation
The following table describes the operation of the FTOF function:
Chapter 58
FTON: Activation timer
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);
Timing diagram
Timing diagram.
Operation
The following table describes the operation of the FTON function:
Chapter 59
FTP: Pulse timer
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);
Timing diagram
Timing diagram.
Operation
The following table describes the operation of the FTP function:
Chapter 60
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:
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:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.
Chapter 61
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:
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:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.
Chapter 62
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.
Representation in FBD
Representation:
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:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.
Chapter 63
HIGH_INT: Extracting the most significant word of a double integer
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Double_Int
HIGH_INT
ST High_Int
Representation in ST
Representation:
High_Int := HIGH_INT(Double_Int);
Description of parameters
The following table describes the input parameters:
Chapter 64
IEC_BMDI: Block move
Introduction
This chapter describes the IEC_BMDI block.
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.
Representation in FBD
Representation:
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);
Parameter description
Description of input parameters:
Runtime error
The following standard user error messages are used:
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.
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.
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.
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.
Chapter 65
IEC_BMDI_M: Block move
Introduction
This chapter describes the IEC_BMDI_M block.
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.
Representation in FBD
Representation:
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);
Parameter description
Description of input parameters:
Runtime error
The following standard user error messages are used:
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.
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.
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.
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.
Chapter 66
LIFO: Last In/First Out stack register
Introduction
This chapter describes the LIFO block.
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:
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:
Runtime error
For a list of all block error codes and values, see here (see page 619).
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:
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.
Chapter 67
LOW_INT: Extracting the least significant word of a double integer
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Double_Int
LOW_INT
ST Low_Int
Representation in ST
Representation:
Low_Int := LOW_INT(Double_Int);
Description of parameters
The following table describes the input parameters:
Chapter 68
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
Representation in ST
Representation:
SelectedElement := MUX_DINTARR_125 (DIntArray,
PositionInArray) ;
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.
Chapter 69
PL7_COUNTER : Counter/downcounter
PL7_COUNTER : Counter/downcounter
Description
FBD representation
Representation:
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 ;
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:
Description of variables
The following table describes the public variables:
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.
Chapter 70
PL7_DRUM : Drum
PL7_DRUM : Drum
Description
FBD representation
Representation:
LD representation
Representation:
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:
Description of variables
The following table describes the public variables:
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.
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.
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.
Chapter 71
PL7_MONOSTABLE : Monostable
PL7_MONOSTABLE : Monostable
Description
FBD representation
Representation:
LD representation
Representation:
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:
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.
Description of variables
The following table describes the public variables:
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.
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.
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.
Chapter 72
PL7_REGISTER_32 : 32 word memory register
Description
FBD representation
Representation:
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 ;
Description of parameters
The following table describes the input parameters:
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:
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.
Chapter 73
PL7_REGISTER_255 : 255 word memory register
Description
FBD representation
Representation:
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 ;
Description of parameters
The following table describes the input parameters:
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:
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.
Chapter 74
PL7 and Control Expert Timers Comparison
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
Chapter 75
PL7_TOF : TOF type timer
Description
FBD representation
Representation:
LD representation
Representation:
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:
Description of variables
The following table describes the public variables:
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.
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.
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).
Chapter 76
PL7_TON : TON type timer
Description
FBD representation
Representation:
LD representation
Representation:
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:
Description of variables
The following table describes the public variables:
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.
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.
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).
Chapter 77
PL7_TP : TP type timer
Description
FBD representation
Representation:
LD representation
Representation:
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:
Description of variables
The following table describes the public variables:
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.
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.
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).
Chapter 78
PL7_3_TIMER : Conversion timer for % Ti’s of PL7
Description
FBD representation
Representation:
LD representation
Representation:
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:
Description of variables
The following table describes the public variables:
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.
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.
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.
Chapter 79
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:
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:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.
Chapter 80
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:
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:
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,
Chapter 81
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:
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:
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.
Chapter 82
R2T_***: Register to table
Introduction
This chapter describes the R2T_*** block.
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:
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:
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:
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.
Chapter 83
READ_PCMCIA: Reading data in the memory card
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:
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);
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.
The READ_PCMCIA and WRITE_PCMCIA functions are working with word addresses:
Chapter 84
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
ST representation
Representation:
ROR1_ARB(String1);
Parameter Description
The following table describes the input/output parameters:
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
Chapter 85
RRTC: Reading the system date
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
RRTC
ST Result_Date
Representation in ST
Representation:
RRTC(Result_Date);
Description of parameters
The following table describes the output parameters:
Chapter 86
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:
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);
Description of parameters
The following table describes the input parameters:
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.
Timing diagram
Functional timing diagram:
Chapter 87
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.
Representation in FBD
Representation:
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:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 619.
Chapter 88
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:
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);
Chapter 89
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:
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);
Example: Shift_Num = 4.
Chapter 90
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:
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);
Example: Input_Var =
2#10000000111100010000000011001111.
Shift_Num INT Value of the shift to be performed.
Example: Shift_Num = 6.
Chapter 91
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:
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);
Example: Shift_Num = 4.
Chapter 92
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:
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);
Example: Shift_Num = 4.
Chapter 93
SRCH: Search
SRCH: Search
Introduction
This chapter describes the SRCH block.
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:
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:
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.
Chapter 94
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
Representation in ST
Representation:
STR_ROUND(Real_Str, Pos, Rounded_Str);
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
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.
Chapter 95
SUB_***_PL7 : Subtract a period
Description
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:
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:
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.
Chapter 96
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:
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:
NOTE: In cold start cycle both outputs COLD and WARM are set to "1".
Chapter 97
T2T: Table to table
Introduction
This chapter describes the T2T block.
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:
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) ;
Parameter description
Description of input parameters:
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.
Chapter 98
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
Representation in ST
Representation:
Result_Str := TIME_DINT_TO_STRING(Time1);
Description of parameters
The following table describes the input parameters:
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.
Chapter 99
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
Representation in ST
Representation:
Result_Str := TOD_DINT_TO_STRING(Time1);
Description of parameters
The following table describes the input parameters:
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.
Chapter 100
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
Representation in ST
Representation:
Result_DINT := TRANS_TIME(Time1);
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
Chapter 101
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:
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:
Chapter 102
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:
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:
Chapter 103
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:
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);
Chapter 104
WRTC: Updating the system date
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Date1
WRTC
Representation in ST
Representation:
WRTC(Date1);
Description of parameters
The following table describes the input parameters:
33002543 10/2019
Appendices
Appendix A
EFB Error Codes and Values
Introduction
The following tables show the error codes and error values created for the EFBs of 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.
CLC_PRO
Table of error codes and errors values created for EFBs of the CLC_PRO family.
Extension/Compatibility
Table of error codes and errors values created for EFBs of the Extension/Compatibility
family.
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.
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:
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:
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:
Examples of representation:
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).
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.
R
REAL
The REAL type is encoded in a 32 bit format.
The possible value ranges are shown in the figure below:
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
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:
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.
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:
Examples of representation
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
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
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