Control Block Library
Control Block Library
33002535 09/2020
EcoStruxure™ Control
Expert
Control Block Library
Original instructions
09/2020
33002535.16
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.
© 2020 Schneider Electric. All rights reserved.
2 33002535 09/2020
Table of Contents
Safety Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Part I General Information . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 1 Block Types and their Applications. . . . . . . . . . . . . . . . . 17
Block Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
FFB Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
EN and ENO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Chapter 2 Block Availability on the Various Hardware Platforms . . 27
Block Availability on the Various Hardware Platforms . . . . . . . . . . . . . 27
Chapter 3 General information about the Control block library . . . . 31
Operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Scanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Error management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Part II Conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Chapter 4 DTIME: Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Initialization and Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Example for measuring a rate of flow . . . . . . . . . . . . . . . . . . . . . . . . . 48
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Chapter 5 INTEGRATOR: Integrator with limit . . . . . . . . . . . . . . . . 51
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 6 LAG_FILTER: Time lag device: 1st order . . . . . . . . . . . . 57
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Chapter 7 LDLG: PD device with smoothing . . . . . . . . . . . . . . . . . . 63
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Examples of function block LDLG . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Chapter 8 LEAD: Differentiator with smoothing. . . . . . . . . . . . . . . . 71
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
33002535 09/2020 3
Chapter 9 MFLOW: Mass flow block. . . . . . . . . . . . . . . . . . . . . . . . . 77
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Runtime error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter 10 QDTIME: Deadtime device . . . . . . . . . . . . . . . . . . . . . . . 85
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Chapter 11 SCALING: Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Runtime error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Chapter 12 TOTALIZER: Integrator . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Runtime error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Chapter 13 VEL_LIM: Velocity limiter . . . . . . . . . . . . . . . . . . . . . . . . . 107
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Part III Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Chapter 14 AUTOTUNE: Automatic tuner setting . . . . . . . . . . . . . . . . 115
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Principle of autotuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Identification principle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Controller coupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Diagnosis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Causes of autotuning termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Generating a test after stopping the autotuning . . . . . . . . . . . . . . . . . . 133
Runtime error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Chapter 15 IMC: Model corrector . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Delay management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Block diagram of the IMC controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Execution Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
4 33002535 09/2020
Chapter 16 PI_B: Simple PI controller . . . . . . . . . . . . . . . . . . . . . . . . 151
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Detailed equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Chapter 17 PIDFF: Complete PID controller . . . . . . . . . . . . . . . . . . . 163
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Structure diagram of the PIDFF controller . . . . . . . . . . . . . . . . . . . . . 171
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Detailed equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Detailed equations: Incremental algorithm PID controller . . . . . . . . . . 179
Detailed equations: Incremental algorithms in integral mode . . . . . . . 181
Example for the PIDFF block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Chapter 18 SAMPLETM: Sample time . . . . . . . . . . . . . . . . . . . . . . . 191
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Chapter 19 STEP2: Two point controller . . . . . . . . . . . . . . . . . . . . . . 193
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Chapter 20 STEP3: Three point controller . . . . . . . . . . . . . . . . . . . . 201
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Part IV Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Chapter 21 COMP_DB: Comparison. . . . . . . . . . . . . . . . . . . . . . . . . 211
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Chapter 22 K_SQRT: Square root. . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Chapter 23 MULDIV_W: Multiplication/Division. . . . . . . . . . . . . . . . . 221
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Chapter 24 SUM_W: Summer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
33002535 09/2020 5
Part V Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Chapter 25 AVGMV: Moving average with fixed window size. . . . . . . 231
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Chapter 26 AVGMV_K: Moving average with frozen correction factor 237
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Chapter 27 DEAD_ZONE, DEAD_ZONE_REAL: Dead zone . . . . . . . 243
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Chapter 28 LOOKUP_TABLE1: Polygon with interpolation of the 1st
order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Chapter 29 SAH: Detecting and holding a rising edge . . . . . . . . . . . . 255
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Chapter 30 HYST_***: Indicator signal for maximum value delimiters
with hysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Chapter 31 INDLIM_***: Indicator signal for delimiters with hysteresis 261
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Part VI Output Processing . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Chapter 32 MS: Manual control of an output . . . . . . . . . . . . . . . . . . . 269
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Runtime error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Chapter 33 MS_DB: Manually controlling and output with dead zone 281
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Runtime error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Chapter 34 PWM1: Pulse width modulation . . . . . . . . . . . . . . . . . . . . 293
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Example of the PWM1 block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
6 33002535 09/2020
Chapter 35 SERVO: Control for servo motors. . . . . . . . . . . . . . . . . . 301
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
SERVO function block algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Examples of function block SERVO . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Chapter 36 SPLRG: Controlling 2 actuators . . . . . . . . . . . . . . . . . . . 319
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Part VII Setpoint management. . . . . . . . . . . . . . . . . . . . . . . . 327
Chapter 37 RAMP: Ramp generator . . . . . . . . . . . . . . . . . . . . . . . . . 329
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Chapter 38 RATIO: Ratio controller. . . . . . . . . . . . . . . . . . . . . . . . . . 335
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Chapter 39 SP_SEL: Setpoint switch . . . . . . . . . . . . . . . . . . . . . . . . 341
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Runtime error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Appendices ......................................... 349
Appendix A EFB Error Codes and Values . . . . . . . . . . . . . . . . . . . . . 351
Tables of Error Codes for the CONT_CTL Library . . . . . . . . . . . . . . . 352
Common Floating Point Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Glossary ......................................... 361
Index ......................................... 365
33002535 09/2020 7
8 33002535 09/2020
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.
33002535 09/2020 9
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.
10 33002535 09/2020
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.
33002535 09/2020 11
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.
12 33002535 09/2020
About the Book
At a Glance
Document Scope
This document describes the functions and function blocks of the Control library.
Validity Note
This document is valid for EcoStruxure™ Control Expert 15.0 or later.
Related Documents
You can download these technical publications and other technical information from our website
at www.schneider-electric.com/en/download.
33002535 09/2020 13
14 33002535 09/2020
EcoStruxure™ Control Expert
General Information
33002535 09/2020
Part I
General Information
General Information
Overview
This section contains general information about the Control library.
NOTE: For a detailed description of system objects (%S and %SW), refer to EcoStruxure™ Control
Expert, System Bits and Words, Reference Manual.
33002535 09/2020 15
General Information
16 33002535 09/2020
EcoStruxure™ Control Expert
Block Types and their Applications
33002535 09/2020
Chapter 1
Block Types and their Applications
Overview
This chapter describes the different block types and their applications.
33002535 09/2020 17
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.
18 33002535 09/2020
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.
33002535 09/2020 19
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.
20 33002535 09/2020
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.
33002535 09/2020 21
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:
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.
22 33002535 09/2020
Block Types and their Applications
33002535 09/2020 23
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.
Functions/Procedures
24 33002535 09/2020
Block Types and their Applications
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:
33002535 09/2020 25
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.
26 33002535 09/2020
EcoStruxure™ Control Expert
Availability of the blocks
33002535 09/2020
Chapter 2
Block Availability on the 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.
Conditioning
Availability of the blocks:
Legend:
+ Yes
- No
33002535 09/2020 27
Availability of the blocks
Controller
Availability of the blocks:
Legend:
+ Yes
- No
Mathematics
Availability of the blocks:
Legend:
+ Yes
- No
28 33002535 09/2020
Availability of the blocks
Measurement
Availability of the blocks:
Legend:
+ Yes
- No
Output Processing
Availability of the blocks:
Legend:
+ Yes
- No
33002535 09/2020 29
Availability of the blocks
Legend:
+ Yes
- No
30 33002535 09/2020
EcoStruxure™ Control Expert
Introduction
33002535 09/2020
Chapter 3
General information about the Control block library
Overview
This section contains general information about the Control block library.
33002535 09/2020 31
Introduction
Operating mode
Operating mode
Several function blocks have integrated operating mode control available.
A choice can be made between the following operating modes:
Tracking
Manual/Automatic
Tracking
This operating mode makes it possible to set a function block to the ’Sub Controller’ operating
mode. Two inputs make it possible to control this operating mode: a binary input TR_S (TRacking
Switch), and a signal input TR_I (TRacking Input). If a function block is in tracking mode (TR_S =
1), its main output (e.g. OUT with a PIDFF controller) is assigned the input value TR_I and the
internal variables of the different algorithms are updated. In this way a bumpless changeover is
guaranteed when the function block is switched to manual or automatic mode.
The OUT output of the FFB is controlled with the TR_I input in tracking mode.
Tracking mode
32 33002535 09/2020
Introduction
Manual/Automatic
If a function block is in automatic mode, its algorithm calculates the value to be assigned to the
output. Manual mode can be used to block the adjustment of the main output (OUT) of a function
block, to permit control via a user dialog, for example. The MAN_AUTO input permits control of this
operating mode (0 : Manual, 1: Automatic).
Manual/Automatic mode
The function block reads this output and therefore permits a bumpless changeover between the
Manual <-> Automatic modes. A limit can be assigned to the function block’s output if it is in manual
or automatic mode: this should be decided individually for each function block.
The connections between the function and the operating mode of the function block are not
displayed to ensure a better overview. The same applies to the effectively assigned setpoint.
33002535 09/2020 33
Introduction
Scanning
Scanning
The control algorithms are based on scan values where the time interval between two consecutive
scans should be taken into account. The function blocks calculate the value of this interval
automatically, which means they can be placed anywhere in the section without having to take the
time management into consideration.
Set time intervals provide the following advantages:
Run time optimization of the PLC program by dividing the control operations into several cycles,
improved control quality, where scanning the servo-loop too frequently is prevented
Minimizing the demands on the actuators
For example, the SAMPLETM function block can be used, which should be attached to the input EN
of the function block to be scanned.
If the scan interval of the servo-loop exceeds 1 second, the function block MS: Manual control of
an output, page 269 should be switched to the function blocks PIDFF: Complete PID controller,
page 163 and PI_B: Simple PI controller, page 151 so that the servo-loops can be controlled
manually independently of the scan interval.
34 33002535 09/2020
Introduction
Error management
Principle
This section describes the error recording and notification routines of
function blocks in the Conditioning, Controller, Output Processing and setpoint
processing families.
Most function blocks in these families are provided with a STATUS output word.
Each bit of the STATUS parameter can be used for notifying an error, an alarm or some information.
The meaning of the first 8 bits of the STATUS word is the same for all function blocks. The meaning
of the subsequent bits (bits 8 to 15) is different for each function block.
Status word
The following table shows the meaning of the bits common to all the function blocks in the first byte
of the STATUS word. Further information can be found in the description of each function block.
33002535 09/2020 35
Introduction
Note 2 (thresholds)
NOTE: If the upper and lower threshold parameters of an output have been invented (e.g.
out_min ≥ out_max), the function block switches the output to the lowest value (i.e. auf
out_max).
36 33002535 09/2020
Introduction
Convention
33002535 09/2020 37
Introduction
38 33002535 09/2020
EcoStruxure™ Control Expert
Conditioning
33002535 09/2020
Part II
Conditioning
Conditioning
Overview
This section describes the elementary functions and elementary function blocks of the
Conditioning family.
33002535 09/2020 39
Conditioning
40 33002535 09/2020
EcoStruxure™ Control Expert
DTIME
33002535 09/2020
Chapter 4
DTIME: Delay
DTIME: Delay
Introduction
This chapter describes the DTIME block.
33002535 09/2020 41
DTIME
Description
Function description
The DTIME function block generates a delay when transfering the numerical input value [IN]. The
numerical output variable OUT generates the same behavior as the numerical input value when the
delay T_DELAY, which can vary, is included.
Behavior of the function block DTIME:
Formula
This function block implements the following transfer function :
Representation in FBD
Representation:
42 33002535 09/2020
DTIME
Representation in LD
Representation:
Representation in IL
Representation:
CAL DTIME_Instance (IN:=ValueToDelay,
T_DELAY:=RequiredDelay, TR_I:=InitializationInput,
TR_S:=InitializationSequence, OUT=>DelayedOutput,
BUFFER=>DelayValueBuffer, STATUS=>StatusWord)
Representation in ST
Representation:
DTIME_Instance (IN:=ValueToDelay,
T_DELAY:=RequiredDelay, TR_I:=InitializationInput,
TR_S:=InitializationSequence, OUT=>DelayedOutput,
BUFFER=>DelayValueBuffer, STATUS=>StatusWord) ;
33002535 09/2020 43
DTIME
Parameter description
Input parameter description:
44 33002535 09/2020
DTIME
Parametering
NOTE: As soon as a variable has been connected to the BUFFER output, it can only be replaced
by a variable of the same type. To replace it with a greater variable, which would enable a higher
delay value to be reached for example, the function block must be deleted and a new one put in
place.
33002535 09/2020 45
DTIME
Step Action
1 Define a new derived data type, e.g. a table with 200 floating point values
2 Declare a variable of this type and link it to the BUFFER parameter of the DTIME
function block.
3 In this case, the maximum delay corresponds to 200 times the sampling interval
of the function block
If the T_DELAY value is too great in relation to the BUFFER size, it is no longer possible to save
enough input values to attain the delay desired. In this case the delay remains at the longest time
possible (bit 8 of the status word then goes to 1 over).
To prevent this problem it is advisable to define the dimensions of the variable assigned to the
BUFFER parameter so that a possible increase in the T_DELAY can be provided for.
When T_DELAY = 0, the OUT output always corresponds to the IN input.
46 33002535 09/2020
DTIME
33002535 09/2020 47
DTIME
The product amount P2 is regulated, but the weight in the container is P1+P2. P1 should be
removed. The amount P2 corresponds to the amount measured minus the amount P1 dosed 20 s
beforehand.
Measuring the servo loop at P2 corresponds to the following illustration:
48 33002535 09/2020
DTIME
Runtime error
Status word
The following messages are displayed in the Status word:
For a list of other possible floating point error codes, see Common Floating Point Errors, page 359.
Error message
This error appears if a non floating point value is entered at an input or if there is a problem with a
floating point calculation. In this case the outputs OUT and BUFFER remain unchanged.
NOTE: For a list of all block error codes and values, see Conditioning, page 352.
Alarm
There will be an alarm if a T_DELAY exceeds the maximum possible value. In this case the function
block uses the maximum value. If an outgoing value is required, which is above the default value,
only the BUFFER-output needs to be linked to a larger variable.
33002535 09/2020 49
DTIME
50 33002535 09/2020
EcoStruxure™ Control Expert
INTEGRATOR
33002535 09/2020
Chapter 5
INTEGRATOR: Integrator with limit
Introduction
This chapter describes the INTEGRATOR block.
33002535 09/2020 51
INTEGRATOR
Description
Function description
The function block replicates a limited integrator.
The function block has the following properties:
Tracking and automatic operating 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
Current value of input IN
52 33002535 09/2020
INTEGRATOR
Variable Description
Value of the output OUT 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:
33002535 09/2020 53
INTEGRATOR
Representation in IL
Representation:
CAL INTEGRATOR_Instance (IN:=InputVariable,
GAIN:=IntegrationGain, OUT_MIN:=LowerOutputLimit,
OUT_MAX:=UpperOutputLimit, TR_I:=InitializationInput,
TR_S:=InitializationType, OUT=>Output,
QMIN=>ReachedLowerLimit, QMAX=>ReachedUpperLimit)
Representation in ST
Representation:
INTEGRATOR_Instance (IN:=InputVariable,
GAIN:=IntegrationGain, OUT_MIN:=LowerOutputLimit,
OUT_MAX:=UpperOutputLimit, TR_I:=InitializationInput,
TR_S:=InitializationType, OUT=>Output,
QMIN=>ReachedLowerLimit, QMAX=>ReachedUpperLimit) ;
Parameter description
Description of input parameters:
Error message
With OUT_MAX < OUT_MIN an error message appears.
NOTE: For a list of all block error codes and values, see Conditioning, page 352.
54 33002535 09/2020
INTEGRATOR
Detailed description
Parametering
Parameter assignment for the function block is accomplished by specifying the integration GAIN
and the limiting values OUT_MAX and OUT_MIN for the output OUT.
The limits OUT_MAX and OUT_MIN limit the upper output as well as the lower output. Hence
OUT_MIN ≤ OUT ≤ OUT_MAX.
The outputs QMAX and QMIN show that the output has reached a limit or the output signal has been
capped.
QMAX = 1 if OUT ≥ OUT_MAX
QMIN = 1 if OUT ≤ OUT_MIN
Operating mode
There are two operating mode selectable through the TR_S parameter input.
33002535 09/2020 55
INTEGRATOR
Example
The input signal is integrated via the time. In the event of a transition at the input IN, the output will
rise (if the IN values are positive) or fall off (if the IN values are negative) along a ramp function.
OUT will always be between OUTMAX and OUT_MIN; if OUT is equal to OUT_MAX or OUT_MIN, it will
be so indicated in QMAX or QMIN.
Representation of the integrator step response:
56 33002535 09/2020
EcoStruxure™ Control Expert
LAG_FILTER
33002535 09/2020
Chapter 6
LAG_FILTER: Time lag device: 1st order
Introduction
This chapter describes the LAG_FILTER block.
33002535 09/2020 57
LAG_FILTER
Description
Function description
The function block represents a delay element 1st order.
The function block contains the following operating mode:
Tracking
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 IN from the previous cycle
dt is the time differential between the current cycle and the previous cycle
58 33002535 09/2020
LAG_FILTER
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LAG_FILTER_Instance (IN:=InputValue, GAIN:=GainFactor,
LAG:=LagTimeConstant, TR_I:=InitializationInput,
TR_S:=InitializationType, OUT=>Output)
33002535 09/2020 59
LAG_FILTER
Representation in ST
Representation:
LAG_FILTER_Instance (IN:=InputValue, GAIN:=GainFactor,
LAG:=LagTimeConstant, TR_I:=InitializationInput,
TR_S:=InitializationType, OUT=>Output) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Conditioning, page 352.
60 33002535 09/2020
LAG_FILTER
Detailed description
Parametering
The parametering of the Function block is achieved through specification of the boost factor GAIN
as well as the parametering of the delayed time constants LAG.
The unit step at the input IN (jump at the input IN from 0 to 1.0) is followed by the output OUT with
a lag time. Along an e-function
Operating mode
Two operating modes can be selected through the TR_S parameter input.
Example
The diagram shows an example of the jump response of the LAG_FILTER function block. The
input IN jumps to a new value and the output OUT follows the input IN along an e-function.
Jump response of the function block LAG_FILTER when GAIN = 1
33002535 09/2020 61
LAG_FILTER
62 33002535 09/2020
EcoStruxure™ Control Expert
LDLG
33002535 09/2020
Chapter 7
LDLG: PD device with smoothing
Introduction
This chapter describes the LDLG block.
33002535 09/2020 63
LDLG
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
Tracking and automatic modes
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 IN from the previous cycle
dt is the time differential between the current cycle and the previous cycle
64 33002535 09/2020
LDLG
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LDLG_Instance (IN:=Input, GAIN:=GainFactor,
LEAD:=DifferentialTimeConstant, LAG:=LagTimeConstant,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT=>Output)
33002535 09/2020 65
LDLG
Representation in ST
Representation:
LDLG_Instance (IN:=Input, GAIN:=GainFactor,
LEAD:=DifferentialTimeConstant, LAG:=LagTimeConstant,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT=>Output) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Conditioning, page 352.
66 33002535 09/2020
LDLG
Detailed description
Parametering
The parametering of the Function block appears through specification of the boost factors GAIN as
well as the parametering of the Derivative time constants LEAD and the delay time constants LAG.
For very small sample times and the unit jump to input IN (jump at line-in IN from 0 to 1.0) output
OUT 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 mode
Two operating modes can be selected through the TR_S parameter input.
33002535 09/2020 67
LDLG
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 block behaves like a pure multiplication block with the multiplier GAIN.
Function block LDLG with LEAD = LAG
68 33002535 09/2020
LDLG
LEAD/LAG = 2, GAIN = 1
In this case the output OUT will jump to double the accumulated value in order to make the
transition to the final value (GAIN * IN) with the delay time constant LAG.
Function block LDLG with LEAD/LAG = 2 and GAIN = 1
33002535 09/2020 69
LDLG
70 33002535 09/2020
EcoStruxure™ Control Expert
LEAD
33002535 09/2020
Chapter 8
LEAD: Differentiator with smoothing
Introduction
This chapter describes the LEAD block.
33002535 09/2020 71
LEAD
Description
Function description
The function block represents a differentiator element with an output OUT delayed by the lag time
constant LAG.
The function block contains the following operating mode:
Tracking
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 for OUT is:
Variable Description
Value of the input IN from the current cycle
dt is the time differential between the current cycle and the previous cycle
72 33002535 09/2020
LEAD
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LEAD_Instance (IN:=InputVariable,
GAIN:=DifferentiationGain, LAG:=TimeDelayConstant,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT=>OutputDerivativeUnit)
33002535 09/2020 73
LEAD
Representation in ST
Representation:
LEAD_Instance (IN:=InputVariable,
GAIN:=DifferentiationGain, LAG:=TimeDelayConstant,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT=>OutputDerivativeUnit) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Conditioning, page 352.
74 33002535 09/2020
LEAD
Detailed description
Parametering
Parameter assignment for this function block is accomplished by selecting the GAIN of the
derivative unit and the lag time constant LAG by which the output OUT will be delayed.
For very small sample times and the unit jump to the IN input (jump in at IN input from 0 to 1.0),
the OUT output jumps to the GAIN value (theoretical value - actual slightly smaller due to the not
infinitely small sample times), in order to return the LAG time constant to 0.
Operating mode
Two operating modes can be selected through the TR_S parameter input.
Example
Representation of the LEAD function block jump response with GAIN = 1 and LAG = 10s:
33002535 09/2020 75
LEAD
76 33002535 09/2020
EcoStruxure™ Control Expert
MFLOW
33002535 09/2020
Chapter 9
MFLOW: Mass flow block
Introduction
This chapter describes the MFLOW block.
33002535 09/2020 77
MFLOW
Description
Function description
The function block MFLOW calculates the mass flow of a gas in a throttle device resulting from the
differential pressure and the temperature and pressure conditions of the gas.
The measure of the differential pressure can be replaced by the speed of the medium or with
another measure with pressure and temperature compensation.
EN and ENO can be configured as additional parameters.
Formula
The full equation (i.e. with en_sqrt = 1, en_pres = 1 and en_temp =1) says as follows:
Variable Meaning
SV Gas pressure in absolute units
TA Absolute gas temperature in Kelvin
Representation in FBD
Representation:
78 33002535 09/2020
MFLOW
Representation in LD
Representation:
Representation in IL
Representation:
CAL MFLOW_Instance (IN:=DifferentialPressure,
PRES:=GasPressure, TEMP:=GasTemperature,
PARA:=Parameters, OUT=>ValueOfMassFlowRate,
STATUS=>StatusWord)
Representation in ST
Representation:
MFLOW_Instance (IN:=DifferentialPressure,
PRES:=GasPressure, TEMP:=GasTemperature,
PARA:=Parameters, OUT=>ValueOfMassFlowRate,
STATUS=>StatusWord) ;
33002535 09/2020 79
MFLOW
80 33002535 09/2020
MFLOW
Detailed description
When the input IN is not a Differential pressure the equation says as follows:
Temperature unit
The temperature TEMP can be printed out in degrees Celsius or degrees Fahrenheit, depending on
the value of the parameter tc_tf :
1 Degrees Fahrenheit
33002535 09/2020 81
MFLOW
Pressure unit
The pressure PRES can be printed out in any unit, as absolute or relative pressure, according to
the value of the parameter pr_pa.
82 33002535 09/2020
MFLOW
Runtime error
Status word
The bits of the status words have the following meaning:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
In the following cases an error will be reported:
An invalid value will be recorded at one of the floating point inputs
Division by zero with calculation in floating point values
Capacity overflow during floating point value calculation
Warning
A warning is given if the parameter pu is negative, in this case with the calculation the block can
use the value 0 in place of the defective value pu.
33002535 09/2020 83
MFLOW
84 33002535 09/2020
EcoStruxure™ Control Expert
QDTIME
33002535 09/2020
Chapter 10
QDTIME: Deadtime device
Introduction
This chapter describes the QDTIME block.
33002535 09/2020 85
QDTIME
Description
Function description
With this function block the input signal is delayed by a deadtime.
The function block delays the signal IN by the deadtime T_DELAY, before it is transmitted to OUT
again.
The function block has a delay puffer for 128 elements (IN values), i.e. 128 IN values can be saved
during the T_DELAY time. 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 OUT remains unchanged. The internal
values are set to the value of IN.
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 both a tracking 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 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:
86 33002535 09/2020
QDTIME
Representation in LD
Representation:
Representation in IL
Representation:
CAL QDTIME_Instance (IN:=InputValue, T_DELAY:=DeadTime,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT=>Output, READY=>InternalBufferFlag)
Representation in ST
Representation:
QDTIME_Instance (IN:=InputValue, T_DELAY:=DeadTime,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT=>Output, READY=>InternalBufferFlag) ;
33002535 09/2020 87
QDTIME
Runtime error
For a list of all block error codes and values, see Conditioning, page 352.
88 33002535 09/2020
QDTIME
Detailed description
If Then
Cycle time > T_DELAY/128 If the current IN value is transferred to the buffer, the oldest
IN value will be displayed on the output OUT. In this case
the solution is smaller than 128 and there is a systematic
error, i.e. some IN values are saved twice (see also
example).
Cycle time < T_DELAY/128 not all IN values can be contained in the buffer. In this case
the IN value is not saved in some cycles and OUT remains
unchanged in this cycle.
Tracking mode
In the tracking mode, the tracking value TR_I is transmitted permanently to the output OUT. The
internal buffer is filled with the tracking value TR_1. The buffer is marked as charged (READY =1).
33002535 09/2020 89
QDTIME
90 33002535 09/2020
EcoStruxure™ Control Expert
SCALING
33002535 09/2020
Chapter 11
SCALING: Scaling
SCALING: Scaling
Introduction
This chapter describes the SCALING block.
33002535 09/2020 91
SCALING
Description
Function description
This function block can be used to change the value range of a numerical variable.
EN and ENO can be configured as additional parameters.
Formula
The function block carries out the following calculation:
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SCALING_Instance (IN:=DigitalVariable,
PARA:=Parameters, OUT=>ScalingOutput,
STATUS=>StatusWord)
92 33002535 09/2020
SCALING
Representation in ST
Representation:
SCALING_Instance (IN:=DigitalVariable, PARA:=Parameters,
OUT=>ScalingOutput, STATUS=>StatusWord) ;
33002535 09/2020 93
SCALING
Parametering
94 33002535 09/2020
SCALING
Runtime error
Status word
The following messages are displayed in the Status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
An error appears in the following cases:
A non-floating value is on an input.
A problem has occurred during a floating point value calculation.
If in_min = in_max
33002535 09/2020 95
SCALING
96 33002535 09/2020
EcoStruxure™ Control Expert
TOTALIZER
33002535 09/2020
Chapter 12
TOTALIZER: Integrator
TOTALIZER: Integrator
Introduction
This chapter describes the TOTALIZER block.
33002535 09/2020 97
TOTALIZER
Description
Function Description
This function block integrates the value of the IN input (typically a flow volume) over time, until an
adjustable limit is reached (typically a volume).
EN and ENO can be configured as additional parameters.
NOTE: When using the EN enable input the following must be taken into account:
If the block has not been called for a long time because the EN enable input is set to FALSE, the
totalizer block runtime is extended until the next call. If the watchdog timeout is exceeded this can
lead to a PLC stop.
To remedy this, the enable input should not be used or set permanently to TRUE, so that the block
is processed during every cycle.
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 invoking the function block in a later program cycle, the internal initialization will not be
performed and the outputs 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
The integration can be temporarily paused and newly installed
Equipment that can also consider very small input values
Division whereby the low limit of the values of IN will no longer be considered
Use in the mode "Reverse of the integral summation": the output OUT decreases from threshold
value to zero (inc_dec = 1)
98 33002535 09/2020
TOTALIZER
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL TOTALIZER_Instance (IN:=DigitalVariable,
MODE:=OperatingMode, PARA:=Parameters,
TR_I:=outc_InitializationInput,
TR_S:=InitializationOrder, OUT=>ResultOfIntegration,
INFO=>AdditionalInformation, STATUS=>StatusWord)
33002535 09/2020 99
TOTALIZER
Representation in ST
Representation:
TOTALIZER_Instance (IN:=DigitalVariable,
MODE:=OperatingMode, PARA:=Parameters,
TR_I:=outc_InitializationInput,
TR_S:=InitializationOrder, OUT=>ResultOfIntegration,
INFO=>AdditionalInformation, STATUS=>StatusWord);
Formulas
Variable Meaning
time elapsed since last block execution
Value of the output OUT at the end of the previous execution of the
controller
Result Explanation
Partial collective index OUT indicates the integral result of input IN from the last threshold value
overflow.
cter Frequency of achieving the threshold value
Collective register (outc) corresponds to the integral result of the input IN since the beginning of the
integral invoice This counter will be updated at every execution via the
following formula:
Detailed description
Further properties
As soon as the output OUT exceeds the threshold value thld, the output done is set to 1. During
the execution of the function block they are set to zero again.
When the counter cter achieves its maximum value (65535), this counter no longer changes. The
outputs OUT continues to function when the threshold value thld is included. However, the output
outc and the counter cter can no longer be used.
Negative values of the input IN are never considered, because they always lie below the division
cutoff.
Timing diagram
Timing diagram of the TOTALIZER block
td Time span
Operating mode
There are 3 individual operating modes for the TOTALIZER function block: Tracking, Reset and
Halt:
NOTE: By simultaneous activation of the inputs TR_S, rst and hold, the tracking mode has
priority over the other operating modes and the reset operating mode has priority over halt.
td Time span
In tracking mode (TR_S = 1) the parameter TR_I will be run on outc and the parameter OUT and
cter will be set so that the following equation applies:
outc = thld x cter + (thld - OUT).
outc is calculated using the following formula: outc = thld x cter + (thld - OUT)
Step Action
1 At the first execution or positive on edge on rst the output OUT will be initiated by thld.
2 Thereafter with each execution the output OUT is calculated with the following formula:
Runtime error
Status word
The following messages are displayed in the status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
A runtime error is signaled if a non floating point value is recorded or if there is a problem with a
floating point calculation. In this case the OUT, outc, cter and done outputs remain
unmodified.
NOTE: For a list of all block error codes and values, see Conditioning, page 352.
Warning Message
In the following cases a warning message is given:
If... Then...
thld < 0 For calculation, the controller uses the value 0
cutoff < 0 For calculation, the controller uses the value 0
cter = 65535 cter is blocked at this value and the output outc no longer has any meaning. The
OUT and done outputs can however continue to be used.
Chapter 13
VEL_LIM: Velocity limiter
Introduction
This chapter describes the VEL_LIM block.
Description
Function description
The function block creates a velocity limiter with manipulated variable limiting.
The gradient of the input variable IN is limited to a predefinable RATE value. It also limits the output
OUT to within OUT_MAX and OUT_MIN. 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:
Tracking and automatic operating modes
Manipulated variable limiting in automatic mode
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL VEL_LIM_Instance (IN:=Input,
RATE:=MaximumVelocityLimitation,
OUT_MIN:=LowerOutputLimit, OUT_MAX:=UpperOutputLimit,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT=>Output, QMIN=>OUT_Reached_OUT_MIN,
QMAX=>OUT_Reached_OUT_MAX)
Representation in ST
Representation:
VEL_LIM_Instance (IN:=Input,
RATE:=MaximumVelocityLimitation,
OUT_MIN:=LowerOutputLimit, OUT_MAX:=UpperOutputLimit,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT=>Output, QMIN=>OUT_Reached_OUT_MIN,
QMAX=>OUT_Reached_OUT_MAX) ;
Parameter description
Description of input parameters:
Runtime error
With OUT_MAX < OUT_MIN an error message appears.
NOTE: For a list of all block error codes and values, see Conditioning, page 352.
Detailed description
Parametering
Parameter assignment for the function block is accomplished by specifying the maximum rising
velocity RATE and the limiting values OUT_MAX and OUT_MIN for the output OUT. The maximum
velocity rate indicates by how much the output may change within one second.
Actual RATE = 0, becomes OUT = IN.
The limits OUT_MAX and OUT_MIN limit the upper output as well as the lower output. Hence
OUT_MIN ≤ OUT ≤ OUT_MAX.
The outputs QMAX and QMIN show that the output has reached a limit or the output signal has been
capped.
QMAX = 1 if OUT ≥ OUT_MAX
QMIN = 1 if OUT ≤ OUT_MIN
Operating mode
Two operating modes can be selected through the TR_S parameter input.
Example
Explanation of the dynamic behavior of the VEL_LIM function block.
The function block follows the transition at the input IN at its maximum velocity change rate. It can
also be clearly seen that the output OUT is limited by OUT_MAX and OUT_MIN with the associated
QMAX and QMIN signals.
Part III
Controller
Controller
Overview
This section describes the elementary functions and elementary function blocks of the
Controller family.
Chapter 14
AUTOTUNE: Automatic tuner setting
Introduction
This chapter describes the AUTOTUNE block.
Description
Function description
This Function block enables the autotuning of the PID controller (PIDFF: Complete PID controller,
page 163, PI_B: Simple PI controller, page 151).
Autotuning stabilizes the control when starting the system and, in so doing, saves time.
EN and ENO can be configured as additional parameters.
Algorithm
The algorithm is based upon heuristic controls, as with the Ziegler Nichols method. Initially, an
analysis corresponding to approximately 2.5 times the reaction time of the open loop is performed.
Through this, the process can be identified as a process of the first order with delay.
Building on this model, a control parameter set based on heuristic controls and historical data is
created.
The parameter range is determined by the ’perf’ criteria. In this individual case, this factor gives
the highest rank to the reaction time to disturbances or stability.
The algorithm is applied to the following process types :
Processes with only one input / output
Processes with natural stability or integral components
Asymmetric processes within the limits authorized by the algorithm of the PID controller
Processes controlled via pulse width modulation output (PWM).
Important characteristics
The block has the following characteristics
Pre-estimation of the control for the types PIDFF and/or PI_B
Diagnostic function
Parametering of the control dynamic
Recovery of previous control settings
Operating mode
The various operating modes of the autotuning and their priorities in descending order of validity
are shown in the following table:
On completion of the autotuning, the TRS output is set to 0, and the servo-loop is reset to its
previous operating mode (manual or automatic). If the autotuning fails, the TRI variable will be set
back to the value before autotuning was started and the servo-loop will be reset to its previous
operating mode.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AUTOTUNE_Instance (PV:=ProcessValue, SP:=Setpoint,
RCPY:=RecopyRealCommand, START:=StartAutotuning,
PREV:=ReturnToPreviousValues, PARA:=Parameters,
TR_I:=InitializationInput, TR_S:=InitializationSequence,
PV_O=>PV_InputImage, SP_O=>SP_InputImage,
PARA_C=>ParametersToBeTuned, TRI=>TR_I_InputImage,
TRS=>TR_S_InputImage, INFO=>Information,
STATUS=>Statusword)
Representation in ST
Representation:
AUTOTUNE_Instance (PV:=ProcessValue, SP:=Setpoint,
RCPY:=RecopyRealCommand, START:=StartAutotuning,
PREV:=ReturnToPreviousValues, PARA:=Parameters,
TR_I:=InitializationInput, TR_S:=InitializationSequence,
PV_O=>PV_InputImage, SP_O=>SP_InputImage,
PARA_C=>ParametersToBeTuned, TRI=>TR_I_InputImage,
TRS=>TR_S_InputImage, INFO=>Information,
STATUS=>Statusword) ;
Principle of autotuning
Identification principle
Identification process
The identification process consists of 3 stages:
a sound and stability analysis of the control process
an initial analysis of the reaction to an actuator pulse, which is shown as the first identification
model: a filter is created on the basis of this first estimate; this is used during the last phase
a second analysis of the reaction to a second actuator pulse gives more precise information
because of the data filter
Finally, a complete process model is created. If the results of the two previous phases are two far
apart, the estimate is abandoned and autotuning fails.
Control principle
After both phases a parameter set is created for the controller being tuned. The resulting control
parameters are based on the gain and on the ratio between reaction time and process delay.
The algorithm must be able to withstand the modification of the gain and the time constants in ratio
2 without losing stability. The asymmetrical processes are supported if they fulfill these conditions.
If not, an error is displayed during diagnosis diag.
Parametering
The following Info_AUTOTUNE structural parameters are valid for PI_B type controllers:
Controller coupling
The AUTOTUNE EFB exchanges with the controller parameter: Access to the controller parameters
is via the link between the output PARA_C of the AUTOTUNE function block and the input PARA of
the controller. The PARA_C output is of the ANY type and enables the connection of the AUTOTUNE
EFB to various controller types (PIDFF or PI_B).
The AUTOTUNE EFB and the controller also share the following interlinkable variables: PV,SP,
TR_I and TR_S. PV, SP, TR_I and TR_S. These variables display AUTOTUNE inputs, which lead
to the corresponding outputs, in order to switch to controller inputs
If the autotune is active, the TRS output transfers to 1 and the manipulated variable is attached at
the TRI output. The purpose of these outputs is to connect to the inputs TR_I and TR_S of the
function blocks following AUTOTUNE. In this way, these can be set to the tracking operation mode
(PIDFF, PI_B, MS,).
Example for connection: Servoloops with simple PID controller and MS function block
If the servoloop contains a MS-EFB, the structure can appear as follows:
When starting the autotune, the AUTOTUNE EFB sets the MS function block to tracking mode and
hence controls the output of the servoloop directly. Using AUTOTUNE and PIDFF blocks’ RCPY
inputs enables a bumpless restart of the servoloop.
Diagnosis
Diagnostic word
This table contains the meaning of the diag elements of the data structure Info_AUTOTUNE
Bit Meaning
Bit 0 = 1 Autotuning is running
Bit 1 = 1 Autotuning aborted
Bit 2 = 1 Parameter error
Bit 3 = 1 Alteration of parameters, which have just been set automatically
Bit 4 = 1 Stop as a consequence of system error
Bit 5 = 1 Process value saturated
Bit 6 = 1 Alteration too small
Bit 7 = 1 Sampling interval invalid
Bit 8 = 1 Incomprehensible reaction
Bit 9 = 1 Non-stabilized measuring at the start
Bit 10 = 1 Length of actuating pulse Stellimpulses (tmax) too short
Bit 1 1= 1 Too much noise/interference
Bit 12 = 1 Length of actuating pulse (tmax) too long
Bit 13 = 1 Process with significant exceeding of the thresholds
Bit 14 = 1 Process without minimum phase
Bit 15 = 1 Asymmetric process
Bit 16 = 1 Process with integral component
Bit Meaning
0 1 = Autotuning running.
(see page 130)
1 1 = Autotuning stopped
(see page 130)
Bit Meaning
2 1 = Parameter error
7 1 = incorrect sampling interval
Overview
The following bits of the diagnostic word (diag element) show the reason for terminating the
autotuning:
Bit Meaning
3 1 = Modification of parameters during tuning
4 1 = Terminated due to system error
5 1 = Process value saturated
6 1 = Ascent too small
8 1 = Illogical reaction
The amplitude of the actuating pulse is too small too influence the process. In this case, the value
of step_ampl can be increased.
The reaction of the control process is incomprehensible (gain factors with various signs). This can
be due to a larger disturbance, coupling with other servo-loops or some other reason.
Overview
The following bits of the diagnostic word (diag element) show the status of the autotuning:
Bit Meaning
9 1 = Initial non-stabilized measurement
10 1 = Length of actuating pulse (tmax) too short
11 1 = Too much noise/interference
12 1 = Length of actuating pulse (tmax) too long
13 1 = Measured value has been significantly exceeded
14 1 = Process without minimum phase
15 1 = Asymmetrical Process
16 1 = Integrating Process
The automatic regulator setting was implemented, although the measurement was not stable. If
the measured change is large relative to the reaction of the actuating pulse, then the test results
will be distorted.
The reaction will not be stabilized before returning to the original manipulated variable. The
calculated parameters are therefore false.
The reaction of the process to the actuating pulse is insufficient relative to the level of
noise/interference. The measurement should be filtered or step_ampl should be increased.
tmax specifies the frequency with which the measurement is taken, i.e. the value that is used to
calculate the coefficients. tmax must be between 1 and 5 times the rise time of the repeated task.
The process includes an integral component or tmax is too small and the process asymmetrical.
The calculated coefficients must correlate to the process with the integral coefficient If this is not
the case, the automatic regulator setting should be restarted, after tmax has been increased.
Runtime error
Status word
The bits of the status words have the following meaning:
Bit Description
Bit 0 = 1 Error in a floating point value calculation
Bit 1 = 1 Invalid value recorded at one of the floating point inputs
Bit 2 = 1 Division by zero with calculation in floating point values
Bit 3 = 1 Capacity overflow during floating point value calculation
Bit 4 = 1 The parameter perf is outside the [0.1] range: the function block uses the
value 0 or 1 for calculations.
Bit 7 = 1 The thresholds pv_inf and pv_sup of the controller to be set are identical
Bit 8 = 1 The PARA_C output is not connected to the parameters of an autotunable
controller
Bit 9 = 1 Autotuning failed
Bit 10 = 1 The last autotune was successful
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
This error is displayed when a non-floating point has been recorded at an input, when a problem
occurs during a calculation with floating points or when the thresholds pv_inf and pv_sup of the
controller are identical. In this case, all the outputs of the function block remain unchanged.
NOTE: For a list of all block error codes and values, see Controller, page 354.
Warning
A warning is issued, if the parameter perf is outside the [0.1] range. In this case, the block can
use either the value 0 or 1 for the purpose of calculations.
Chapter 15
IMC: Model corrector
Description
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
For a correct behaviour you must synchronize the model corrector with the SAMPLE_TM function
and adjust the INTERVAL variable to the same value as T_ECH of IMC
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Block diagram
The block diagram of the algorithm of the model corrector is:
Functionalities
The functionalities other than the control calculation are identical to those of the PID:
Direct or reverse action.
Action Feed forward for the equalization of perturbations.
Dead band on deviation.
High and low output signal limiter.
Output ramp limitation.
High and low alarm on deviation with hysterisis.
Selection of the automatic/manual operating mode.
Mode Tracking.
External output of the model.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL IMC_Instance(PV:=ProcessValue,SP:=SetPoint,
FF:=FeedForward, RCPY:=CopyOfRealAction,
MAN_AUTO:=OperatingModeFlag,PARA:=Parameters,
BUFFER:=SamplesBuffer, TR_I:=InitializationInput,
TR_S:=InitializationOrder, OUT:=AbsoluteOutput,
OUTD=>IncrementalOutput,DMO=>DelayedModelOutput,
MA_O=>CurrentBlockOperatingMode, INFO=>InfoIMC,
STATUS=>StatusWord)
Representation in ST
Representation:
IMC_Instance (PV:=ProcessValue, SP:=SetPoint,
FF:=FeedForward, RCPY:=CopyOfRealAction,
MAN_AUTO:=OperatingModeFlag,PARA:=Parameters,
BUFFER:=SamplesBuffer, TR_I:=InitializationInput,
TR_S:=InitializationOrder, OUT:=AbsoluteOutput,
OUTD=>IncrementalOutput,DMO=>DelayedModelOutput,
MA_O=>CurrentBlockOperatingMode, INFO=>InfoIMC,
STATUS=>StatusWord);
CAUTION
UNEXPECTED BEHAVIOR OF APPLICATION
Do not set the datatype of the PARA input parameter to constant, in the general attributes tab of
the Data Properties window.
Failure to follow these instructions can result in injury or equipment damage.
(1) KS and OL_TIME can not take the value 0 (inconsistent value). They will be forced to the value
1.0.
Delay management
Description
In the processes to which the controller addresses this controller, the delay is:
Variable (For example, transfer of matter depending of the baud rate in a circuit, speed of the
carrier base)
Very great.
Principle
These two cases are dealt with using a register (buffer) of a size that may be parametrized.
Depending on the size of this register, it will be possible to sample either all of the sample periods,
or one period out of two, or one period out of three, etc.
It is possible to increase or reduce the delay T_DELAY during the execution of the program. The
new delay is applied immediately, as long as it is compatible with the size of the register. The delay
sampling period remains unchanged.
If the value T_DELAY becomes too great in relation to the size of the register, it becomes
impossible to adequately store the input values to reach the required delay, if the sampling is
carried out during the same period. The delay sampling period is therefore recalculated and the
output is only valid after a period equal to a new delay. In order to avoid this problem, we advise
you to size the register, taking into account any increases in the delay T_DELAY.
If the delay decreases, by default the sampling does not change. However, it is possible to
command a new sampling calculation if necessary.
In the case of a dynamic modification of the time of the task or the sampling period, the output is
only valid after a period equal to the delay.
Any dynamic modification T_DELAY between 0 s and 30 s is immediately taken into account
without changing the sampling of the register.
Example
Calculation example
Block diagram
The block diagram of the module controller is:
Execution Error
Execution Monitoring
An execution error is signaled in the following cases:
A non-live input data is detected on one of the parameters.
A problem appears in a floating point calculation.
The output scale is inconsistent at the time of the cold start of the controller (OUT_INF >=
OUT_SUP).
In all cases, the error is considered to be serious. The loop output is frozen and the errors are
signaled in the status words.
Status Word
The status word displays the following messages:
Bit Meaning
Bit 0 =1 Error at the time of a calculation with the floating point values
Bit 1 = 1 Non-admissible value detected on one of the floating point inputs
Bit 2 = 1 Division by 0 on a floating point calculation
Bit 4 = 1 The following behaviors are signaled:
The SP input overflows from the zone [pv_inf, pv_sup]: the function block
uses the value pv_inf or pv_sup for the calculation.
The parameter kp or dband is negative: the block function uses the value 0
instead of the incorrect parameter value.
The outbias parameter comes from the zone [(out_min - out_max),
(out_max - out_min)]. The function block uses the value (out_inf - out_sup)
or (out_sup - out_inf) for the calculation
Bit 5 = 1 The OUT output has reached the lower limit out_min
Bit 6 = 1 The OUT output has reached the upper limit out_max or high scale of output
out_sup, whichever is lower
Bit 7 = 1 The limit values pv_inf and pv_sup are the same
Bit 8 = 1 The pure delay buffer does not exist
NOTE: When a floating point calculation error occurs, the status output returns an error code
(see page 359).
Chapter 16
PI_B: Simple PI controller
Introduction
This chapter describes the PI_B block.
Description
Function description
The function block PI_B depicts a PI-algorithm with a mixed structure (series/parallel). Its functions
derive from function block PIDFF (see page 163). These functions enable the function block to
perform most classical control applications, without compromising user friendliness or using too
many system resources. However, for difficult control tasks requiring extended control functions,
the PIDFF block should be used.
EN and ENO can be configured as additional parameters.
Functions
The most important functions of function block PI_B are as follows:
Calculation of the proportional and integral component in incremental form
Actual value, setpoint value, and default value in physical units
Direct or inverse action
Possibility of upgrading a block-external I component (RCPY input)
Dead zone on deviation
Incremental value and absolute value default
Upper and lower limit value of the default signal
Output offset
Selecting manual/automatic mode
Tracking mode
Upper and lower limit of the setpoint value
Extended functions
As is the case with PIDFF these functions can be extended by using various additional function
blocks:
Automatic control setting via the block AUTOTUNE
Internal or external setpoint value selection via the block SP_SEL
Controlling manual operation of the sampled servoloops (see page 34) using the function block
MS
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PI_B_Instance (PV:=ProcessValue, SP:=SetPoint,
RCPY:=CopyOfRealAction, MAN_AUTO:=OperatingModeFlag,
PARA:=Parameters, TR_I:=InitializationInput,
TR_S:=InitializationOrder, OUT:=AbsoluteOutput,
OUTD=>IncrementalOutput,
MA_O=>CurrentBlockOperatingMode, DEV=>ValueOfDeviation,
STATUS=>StatusWord)
Representation in ST
Representation:
PI_B_Instance (PV:=ProcessValue, SP:=SetPoint,
RCPY:=CopyOfRealAction, MAN_AUTO:=OperatingModeFlag,
PARA:=Parameters, TR_I:=InitializationInput,
TR_S:=InitializationOrder, OUT:=AbsoluteOutput,
OUTD=>IncrementalOutput,
MA_O=>CurrentBlockOperatingMode, DEV=>ValueOfDeviation,
STATUS=>StatusWord) ;
CAUTION
UNEXPECTED BEHAVIOR OF APPLICATION
Do not set the datatype of the PARA input parameter to constant, in the general attributes tab of
the Data Properties window.
Failure to follow these instructions can result in injury or equipment damage.
Formulas
Transfer function
The transfer function is:
Calculation formulas
The formulas actually used vary, depending on whether the function block uses the incremental or
the absolute algorithm.
In a simplified form, the function block can use one of the following formulas:
Algorithm ti Formulas
Absolute 0
Incremental >0
Variable Meaning
(new) Value which is calculated on current execution of the function block
(old) Value which is calculated on previous execution of the function block
OUT Absolute value output
OUTD Incremental value output
TermI Value of the integral component (depending on algorithm)
TermP Value of the proportional component (depending on algorithm)
Parametering
Absolute algorithm
The absolute algorithm is used if no I component is available (when ti = 0). In this case the output
OUT is calculated first, and the output modification will then be deducted from this.
Incremental algorithms
Incremental algorithms are used when an I component is available (i.e. when ti > 0). The
particularities of this algorithm are that the output alteration OUTD is calculated first and then an
absolute value output is determined using the following formulas:
For this algorithm, a SERVO function block can be switched to the controller, enabling astatic
control.
In addition to this the incremental algorithm offers the projection of a block-external integral
component for control applications, where the actually upgraded conduct diverts from the conduct
calculated by the controller (during open control cycle). In this case it is advantageous to use this
for the calculation of the real value. If this is available, the RCPY input must be upgraded and the
parameter en_rcpy must be switched to 1. For calculation, therefore, the equation
to
Further properties
The block contains the following properties:
The use of the parameter outbias allows for a precise setting of the work point when no
integral component is available (ti = 0).
The output OUT is limited to the area between out_inf and out_sup for all operation modes.
If a value calculated by the function block (or a written value entered by the user in manual
mode) exceeds these limits, the value of OUT is capped. The incremental output OUTD, however,
does not take this cut into consideration. This enables the PI_B to control a SERVO function
block without having to revert the position of the control element (continuous control).
The choice between direct/inverse action (parameter rev_dir) allows for the adjustment of the
control direction of the link control element/measuring process.
Limiting the setpoint between pv_inf and pv_sup.
The function block can operate in a purely integral mode (with kp = 0).
Operating mode
Function block PI_B has three operating modes: Automatic, Manual and Tracking. The tracking
mode is given preference over the other operating modes.
The operating modes are selected via the inputs MAN_AUTO and TR_S.
Detailed equations
Convention
The following equations use different variables and functions. The variables corresponding with
block parameters are not rewritten at this point.
The most important inter-variables and the applied functions will however be described in the
following table:
Absolute algorithm
The following equations apply for proportional controllers (ti = 0),
Incremental algorithm
The following equations apply for controllers of type PI (ti > 0);
If en_rcpy = 0, then:
If en_rcpy = 1, then:
Runtime error
Status word
The following messages are displayed in the status word:
Bit Description
Bit 4 = 1 The following behavior is displayed:
The SP input lies outside the area [pv_inf, pv_sup]: for calculation the
function block requires the values pv_inf or pv_sup.
The kp or dband parameter is negative. the function block uses the value
0 outside the incorrect parameter value.
The outbias parameter lies outside the area [(out_inf - out_sup),
(out_sup - out_inf)]. For calculation, the function block uses the value
(out_inf - out_sup) or (out_sup - out_inf).
Bit 5 = 1 The output OUT has reached the lower threshold out_min (see Note)
Bit 6 = 1 The output OUT has reached the upper threshold out_max (see Note)
Bit 7 = 1 The thresholds pv_inf and pv_sup are identical.
If an error occurs during floating point processing, it will also be displayed on the Statusoutput.
For the list of possible floating point error codes, see Common Floating Point Errors, page 359.
Error message
An error is displayed when a non-floating point is recorded at an input, when a problem occurs
during a calculation with floating points or when the limit values pv_inf and pv_sup are identical.
The outputs OUT, OUTD, MA_O and DEV remain unchanged.
NOTE: For a list of all block error codes and values, see Controller, page 354.
Warning Message
In the following cases a warning message is given:
One of the kp or dband parameters are negative. the function block uses the value 0 instead
of the incorrect parameter value.
The outbias parameter lies outside the area [(out_inf - out_sup), (out_sup - out_inf)].
For calculation, the function block uses the value (out_inf - out_sup) or (out_sup -
out_inf).
Chapter 17
PIDFF: Complete PID controller
Introduction
This chapter describes the PIDFF block.
Description
Function description
The PIDFF function block is based on a PID algorithm with parallel or mixed structure (series /
parallel).
EN and ENO can be configured as additional parameters.
Functions
It displays numerous functions:
Calculating the proportional, integral and differential component in its incremental form
2 antiwindup measures
Actual value, setpoint and output in physical units
Direct or inverse action
Differential component to process value or deviation
Parametering the transfer gain of the differential component
Weight of the setpoint in the proportional component (reducing the overrun)
Possibility of upgrading a block external integral component (RCPY input)
Feed forward component for disturbance compensation (FF input)
Dead zone on deviation
Incremental value and absolute value output
Upper and lower limit on the output signal (according to operating mode)
Gradient limitation of the output signal
Output offset
Selecting manual/automatic mode
Tracking mode
Upper and lower setpoint limit
Complementary functions
Other function blocks complement these functions when used in conjunction with the PIDFF block:
Autotuning using the AUTOTUNE function block
Selecting an internal or external setpoint via the function block SP_SEL
Controlling manual operation of the sampled control loops (see page 34) using the function
block MS or MS_DB (see page 281).
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PIDFF_Instance (PV:=ProcessVariable, SP:=Setpoint,
FF:=FeedForwardInput, RCPY:=CopyOfRealAction,
MAN_AUTO:=OperatingMode, PARA:=Parameters,
TR_I:=InitializationInput, TR_S:=InitializationOrder,
OUT:=AbsoluteOutput, OUTD=>IncrementalOutput,
MA_O=>CurrentOperatingMode, INFO=>Information,
STATUS=>StatusWord)
Representation in ST
Representation:
PIDFF_Instance (PV:=ProcessVariable, SP:=Setpoint,
FF:=FeedForwardInput, RCPY:=CopyOfRealAction,
MAN_AUTO:=OperatingMode, PARA:=Parameters,
TR_I:=InitializationInput, TR_S:=InitializationOrder,
OUT:=AbsoluteOutput, OUTD=>IncrementalOutput,
MA_O=>CurrentOperatingMode, INFO=>Information,
STATUS=>StatusWord) ;
CAUTION
UNEXPECTED BEHAVIOR OF APPLICATION
Do not set the datatype of the PARA input parameter to constant, in the general attributes tab of
the Data Properties window
Failure to follow these instructions can result in injury or equipment damage.
Formulas
Transfer function
Depending on whether the mixed or parallel structure is being used, the transfer function is as
follows:
Structure Formulas
Mixed
Parallel
with α = scaling
factor
Calculation formulas
The formulas actually used vary depending whether the function block uses the incremental or
absolute form of the algorithm.
In a simplified form, the function block can use one of the following formulas:
Algorithm ti Formulas
Absolute 0
Incremental >0
Variable Meaning
(new) Value which is calculated on current execution of the function block
(old) Value which is calculated on previous execution of the function block
OUT Absolute value output
OUTD Incremental value output
TermD Value of the differential component
TermFF Value of the feed forward component (disturbance compensation)
TermI Value of the integral component
TermP Value of the proportional component
Structure diagram
Structure of the PIDFF controller:
Parametering
If Then
mix_par = 0 there is a mixed structure, i.e. the proportional component is set up in the connection to the
integral and differential component. The gain K set up for the components (see Structure
diagram, page 171) corresponds to kp.
mix_par = 1 the structure is parallel, i.e. the proportional coefficient is set up parallel to the integral and
differential coefficient. In this case, the gain kp does not related to the integral and differential
component. In this case, gain K corresponds to the relationship between the output zone and
the range.
This algorithm form makes it possible to switch a SERVO function block to the controller and thus
to attain astatic control.
Possibility Explanation
External block integral If the real component deviates from the value calculated by the controller (with an
component open servoloop), the real value should be used as the basis for the calculation. If
(with en_rcpy = 1) this value is available, it should be assigned to the RCPY input and the parameter
en_rcpy must be switched to 1. In calculations done by the function block, the
equation
OUT(new) = OUT (old) + OUTD
to
OUT (new) = RCPY+ OUTD
This is particularly beneficial for cascades or cascade-like controls.
Note: In this case the OUT output is not limited.
Expanded anti-windup The incremental form of the PID controller offers as standard an anti-windup
measure measure taken into account in the algorithm. This type is the basis when
aw_type = 0. In this case the output can be saturated and suddenly leave its
threshold, even if the sign of the deviation does not change (e.g. if it is affected by
a brief disturbance during measuring). It is possible to use a second anti-windup
measure (aw_type = 1) which prevents the output from exceeding its threshold
as long as the deviation does not alter the sign.
Value Meaning
0 to the proportional component (classic case) assigned to the deviation (system deviation)
1 for the proportional component (with sensitive processes or processes with an integral effect)
assigned to the measurement (controlled variable).
A specific user example of this function is given in the section "Application example of the Feed
Forward function, page 183".
NOTE: If ff_sup = ff_inf, the calculation of the Feed-Forward component is ignored.
Further properties
The block contains the following properties:
The outbias parameter makes precision at the operating point possible if the process contains
no integral component (ti = 0).
In automatic mode, the OUT output is limited to the range between out_min and out_max, and
to the range between out_inf and out_sup in manual mode. If a value calculated by the
function block (or a written value entered by the user in manual mode) exceeds one of these
limits, the value of OUT is capped. The incremental output OUT_D, however, does not take this
capping into consideration. This enables the PIDFF function block to control a SERVO function
block without having to revert the position of the actuator (continuous control).
The output speed increase is limited by the parameter outrate.
The possibility of selecting between direct/inverse action (parameter rev_dir) allows for the
adjustment of the control direction of the link actuator/ process.
The differential component can affect both the process value (pv_dev = 0), and the deviation
(pv_dev = 1)
pv_inf and pv_sup correspond to the upper and lower thresholds of the setpoint value.
The function block can also have an effect in pure integral mode (with kp = 0).
Operating mode
If Then
bump = 0 the changeover is bumpless.
Note: If ti = 0, the outbias parameter is recalculated. The OUT values can thus re-start
beginning with the last value of the previous operating mode.
bump = 1 the changeover has a bump.
Detailed equations
Overview
The detailed equations are shown for the following situations are shown in this section:
Convention for the most important Interim variables and Functions used in the equations
Absolute algorithm, page 178
Incremental algorithm PID controller, page 179
Normal incremental algorithms (aw_type = 0)
With bumpless anti-windup measure (aw_type = 1)
Incremental algorithms in integral mode, page 181
Normal incremental algorithms (aw_type = 0)
With bumpless anti-windup measure (aw_type = 1)
Convention
Various variables and functions are used in the following equations. The variables corresponding
to the parameters of the function block are not newly described.
The most important Interim variables and the functions used are described in the following tables.
Function Meaning
Control setting The control setting has the following directions of action:
+1
This is an opposite action (rev_dir = 1) i.e. a positive deviation
(PV - SP) generates an increasing output value
-1
This is a direct action (rev_dir = 0) i.e. a positive deviation (PV
- SP) generates a reduction in the output value
Function Δ
Absolute algorithm
The following equations apply for PD controllers ( ti = 0);
Element Meaning
aw_type = 0 Normal incremental algorithms
aw_type = 1 With bumpless anti-windup measures
If en_rcpy = 0, then:
If en_rcpy = 1, then:
If en_rcpy = 1, then:
Element Meaning
aw_type = 0 Normal incremental algorithms
aw_type = 1 With bumpless anti-windup measures
If en_rcpy = 0, then:
If en_rcpy = 1, then:
If en_rcpy = 1, then:
Example overview
This chapter contains the following examples:
Application example of the Feed Forward function, page 183
Classic control examples programmed via the PIDFF function block:
Example of the cascaded arrangement of two controllers, page 185
Example of cascade-like control, page 187
The feed forward input parameters should be adjusted so that the cold water temperature has the
following effect on the steam control valve:
Adjustments to be preset
Element Value
ff_sup 25 °C
ff_inf 5 °C
otff_sup 10 %
otff_inf - 10 %
Runtime error
Status word
The following messages are displayed in the status word:
Bit Description
Bit 4 = 1 The following behavior is displayed:
The SP input lies outside the area [pv_inf, pv_sup]: for calculation the function block
requires the values pv_inf or pv_sup.
One of the kp, dband, gain _kp parameters outrate is negative. the function
block uses the value 0 outside the incorrect parameter value.
kd < 1 (with td <> 0) : the function block uses the value 1 instead of the faulty value of
kd.
The parameter ovs_att is outside the [0.1] range: for calculation, the function block
uses the value 0 or 1.
One of the parameters out_min or out_max is outside the range [out_inf,
out_sup]. For calculation, the function block uses the value out_inf or out_sup.
One of the parameters outbias, otff_inf or otff_sup is outside the range
[(out_min - out_max), (out_max - out_min)]. For calculation, the function block
uses the value (out_min - out_max) or (out_max - out_min).
Bit 5 = 1 The output OUT has reached the lower threshold out_min (see Note)
Bit 6 = 1 The output OUT has reached the upper threshold out_max (see Note)
Bit 7 = 1 The thresholds pv_inf and pv_sup are identical.
If an error occurs during floating point processing, it will also be displayed on the Statusoutput.
For the list of possible floating point error codes, see Common Floating Point Errors, page 359.
Error message
An error is displayed when a non-floating point has been recorded at an input, when a problem
occurs during a calculation with floating points or when the thresholds pv_inf and pv_sup of the
controller are identical. In this case the outputs OUT, OUTD, MA_O and INFO remain unchanged.
NOTE: For a list of all block error codes and values, see Controller, page 354.
Warning Message
In the following cases a warning message is given:
One of the kp, dband, gain _kp parameters outrate is negative. The function block
then uses the value 0 instead of the incorrect parameter value.
kd < 1 (with td <> 0): the function block uses the value 1 instead of the faulty value of kd.
The parameter ovs_att is outside the [0.1] range: for calculation, the function block uses the
value 0 or 1.
The parameter out_min or out_max is outside the range [out_inf, out_sup]. For
calculations, the function block uses the value out_inf or out_sup.
One of the parameters outbias, otff_inf or otff_sup is outside the range [(out_min
- out_max), (out_max - out_min)]. For calculation, the function block uses the value
(out_min - out_max) or (out_max - out_min).
Chapter 18
SAMPLETM: Sample time
Description
Function description
With this function block the function blocks of the control mechanism are released under time
control.
To control, the Q output of the SAMPLETM function block is connected with the EN input of the
function block to be controlled.
The Q output is activated for one program cycle after the stated time at the INTERVAL input has
expired.
The DELSCAN input was created to prevent the simultaneous start of more than one sample time
dependent FFB which are controlled by various SAMPLETM function blocks. At this input the
number of cycles is stated according to which the activation of Q after a cold start is delayed.
Therefore it is possible to release sample time dependent function blocks step by step to reduce
the load on the CPU during the start cycle.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SAMPLETM_Instance (INTERVAL:=ScanTime,
DELSCAN:=NoOfDelayCycles, Q=>Enable)
Representation in ST
Representation:
SAMPLETM_Instance (INTERVAL:=ScanTime,
DELSCAN:=NoOfDelayCycles, Q=>Enable) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Controller, page 354.
Chapter 19
STEP2: Two point controller
Introduction
This chapter describes the STEP2 block.
Description
Function description
This function block is suitable for simple two point controls.
Control of the actuator proceeds according to the direction of the actual/setpoint value deviation in
relation to the upper and lower threshold.
EN and ENO can be configured as additional parameters.
Properties
The control block has the following properties:
Upper and lower limiting of the setpoint value between pv_inf and pv_sup
The control input values (actual value, setpoint and associated parameters) are expressed in
physical units.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL STEP2_Instance (PV:=ProcessValue, SP:=SetPoint,
MAN_AUTO:=OperatingMode, PARA:=Parameters,
OUT=>LogicOutput, DEV=>Deviation,
MA_O=>CurrentOperatingMode, STATUS=>StatusWord)
Representation in ST
Representation:
STEP2_Instance (PV:=ProcessValue, SP:=SetPoint,
MAN_AUTO:=OperatingMode, PARA:=Parameters,
OUT=>LogicOutput, DEV=>Deviation,
MA_O=>CurrentOperatingMode, STATUS=>StatusWord) ;
Detailed description
Structure diagram
The following is a structure diagram of the STEP2 block:
If the deviation (DEV = PV - SP) is less than the lower threshold dev_ll, the configured output OUT
is set to 1. If however the deviation increases again, the output OUT is only set to zero if it exceeds
dev_hl.
NOTE: To ensure that the block functions without errors, the output OUT should not be inverted.
Operating mode
The STEP2 function block has 2 operating modes available according to the value of the
MAN_AUTO parameter :
Runtime error
Status word
The following messages are displayed in the status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
An runtime error appears if a non floating point value is recorded or if there is a problem with a
floating point calculation. The output OUT is then set to 0; the outputs DEV and MA_O remain
unmodified.
NOTE: For a list of all block error codes and values, see Controller, page 354.
Warning
A warning is given if dev_ll > 0 is dev_hl < is 0 In this case the function block uses the value 0.
Chapter 20
STEP3: Three point controller
Introduction
This chapter describes the STEP3 block.
Description
Function description
This function block is suitable for simple three-point step-action controls.
Control of the actuator proceeds according to the direction of the actual/setpoint value deviation in
relation to the upper and lower threshold value. The control of the threshold value describes a
configurable hysteresis.
This controller can also be used for temperature regulation. A traditional controller (such as a PI_B
controller), which a function block such as the PWM1 should be switched to is preferable for complex
regulation.
EN and ENO can be configured as additional parameters.
Properties
The control block has the following properties:
Limiting the setpoint between pv_inf and pv_sup
The control input values (actual value, setpoint, and corresponding parameters) are expressed
in physical units.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL STEP3_Instance (PV:=ProcessValue, SP:=SetPoint,
MAN_AUTO:=OperatingMode, PARA:=Parameters,
OUT_NEG=>LogicOutputNegativ,
OUT_POS=>LogicOutputPositiv, DEV=>Deviation,
MA_O=>CurrentOperatingMode, STATUS=>StatusWord)
Representation in ST
Representation:
STEP3_Instance (PV:=ProcessValue, SP:=SetPoint,
MAN_AUTO:=OperatingMode, PARA:=Parameters,
OUT_NEG=>LogicOutputNegativ,
OUT_POS=>LogicOutputPositiv, DEV=>Deviation,
MA_O=>CurrentOperatingMode, STATUS=>StatusWord) ;
Detailed description
Structure diagram
The following is a structure diagram of the STEP3 block:
td Time span
If the deviation (DEV = PV - SP) climbs above dev_hl, the logical output OUT_POS is set to 1. If the
deviation is less, OUT_POS is then only set to zero if the deviation is less than dev_hl – hyst.
If the deviation is less than dev_ll, the configured output OUT_NEG is set to 1. If the deviation
increases again, OUT_NEG is only set to zero if the deviation exceeds dev_ll + hyst.
NOTE: To ensure that the block functions without errors, the outputs OUT_NEG and OUT_POS
should not be inverted.
Operating mode
The STEP3 function block has 2 operating modes available according to the value of the
MAN_AUTO parameter:
Runtime error
Status word
The following messages are displayed in the status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
An runtime error appears if a non floating point value is recorded or if there is a problem with a
floating point calculation. In this case the outputs OUT_NEG and OUT_POS are set to 0; the DEV and
MA_O outputs remain unmodified.
NOTE: For a list of all block error codes and values, see Controller, page 354.
Warning
In the following cases a warning is given:
dev_ll > 0 or dev_hl < 0: the block uses the value 0.
hyst is outside the [0, Minimum (dev_hl, -dev_ll)] range: the block uses a limited value.
Part IV
Mathematics
Mathematics
Overview
This section describes the elementary functions and elementary function blocks of the
Mathematics family.
Chapter 21
COMP_DB: Comparison
COMP_DB: Comparison
Introduction
This chapter describes the COMP_DB block.
Description
Function description
The COMP_DB function block enables two numerical values IN1 and IN2 to be compared.
Depending whether IN1 is greater than, equal to or less than IN2, the function blocks sets one of
the outputs GREATER, EQUAL or LESS to 1.
The function block takes any dead zone or hysteresis into account.
EN and ENO can be configured as additional parameters.
COMP_DB/COMP_DB_DFB
Creating new programs, always use the COMP_DB function block.
For technical reasons the COMP_DB_DFB may be implemented during converting legacy programs.
But the functionality of COMP_DB and COMP_DB_DFB is exactly the same.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL COMP_DB (IN1=:InputValue1, IN2:=InputValue2,
DBAND=:DeadBand, HYST:=Hysteresis,
GREATER=>GreaterValueIndicator,
EQUAL=>EqualValueIndicator, LESS=>LessValueIndicator)
Representation in ST
Representation:
COMP_DB (IN1=:InputValue1, IN2:=InputValue2,
DBAND=:DeadBand, HYST:=Hysteresis,
GREATER=>GreaterValueIndicator,
EQUAL=>EqualValueIndicator,
LESS=>LessValueIndicator);
Parameter description
Description of input parameters:
Runtime error
An error is displayed in the Diagnostics display (View → Diagnostics View) if a non floating point
value is determined at an input, or if a problem occurs when calculating a floating point value. In
this case the GREATER, EQUAL and LESS outputs remain unchanged.
NOTE: For a list of all block error codes and values, see Mathematics, page 355.
Warning
A warning is displayed in the Diagnostics display (View → Diagnostics Display) if,
the DBAND parameter is negative: the procedure then uses the value DeadBand = 0 for
calculation.
The HYST parameter is outside the [0, DeadBand] range: the procedure then uses the closest
correct value for calculation, i.e. 0, if HYST is less than 0 and DBAND, if HYST is greater than
DBAND.
Detailed description
Dead zone
The DBAND parameter enables a dead zone to be specified, within which deviation between IN1
and Inputvalue2 will be regarded as zero. If the deviation IN1 - IN2 remains within this zone,
the EQUAL output is set to 1.
Dead zone specification
HYST
The HYST parameter enables a hysteresis effect to be generated, if the deviation between IN1 and
IN2 decreases: starting from a situation where the GREATER or LESS has the value 1, the EQUAL
output will only take the value 1 when the deviation IN1 - IN2 is less than DBAND - HYST
Generating a hysteresis effect
Chapter 22
K_SQRT: Square root
Description
Function description
This function calculates the weighted square root of a numerical value. A division can be defined
under which the function issues the value zero.
Taking the square root typically serves to linearize a flow measurement using a throttle device.
EN and ENO can be configured as additional parameters.
Formula
The function performs the following calculation:
Calculation Condition
or
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD DigitalVariable
K_SQRT WeightingCoefficient, Cutoff
ST OUT
Representation in ST
Representation:
Result := K_SQRT (DigitalVariable, WeightingCoefficient,
Cutoff);
Parameter description
Description of input parameters:
Runtime error
An error is displayed if a non floating point value is recorded at input or if there is a problem with
floating point calculation. In this case the output Result remains unchanged.
NOTE: For a list of all block error codes and values, see Mathematics, page 355.
Warning
A warning is given if the Cutoff input is negative. The function block then uses the value 0 for
calculation.
Chapter 23
MULDIV_W: Multiplication/Division
MULDIV_W: Multiplication/Division
Description
Function description
The function MULDIV_W performs a weighted multiplication/division from 3 numerical input
variables.
EN and ENO can be configured as additional parameters.
Formula
The equation says:
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD DigitalInput1
MULDIV_W DigitalInput2, DigitalInput3, Parameters
ST Result)
Representation in ST
Representation:
Result := MULDIV_W (DigitalInput1, DigitalInput2,
DigitalInput3, Parameters);
Runtime error
This error will be signaled if a non floating point value is recorded or if there is a problem with a
floating point calculation. In general, the output Result keeps its previous value, apart from with
a division by 0, where the value corresponds to 1.#INF (infinite) depending on which sign the
counter uses.
NOTE: For a list of all the block error messages and values, see Common Floating Point Errors,
page 359.
Chapter 24
SUM_W: Summer
SUM_W: Summer
Description
Function description
The function performs the weighted summation of 3 numerical input variables according to the
underlying formula.
EN and ENO can be configured as additional parameters.
Formula
The function SUM_W operates as follows:
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD InputValue1
SUM_W InputValue2, InputValue3, Parameters
ST Result
Representation in ST
Representation:
Result := SUM_W (InputValue1, InputValue2, InputValue3,
Parameters);
Runtime error
An runtime error appears if a non floating point value is recorded or if there is a problem with a
floating point calculation. The output Result will not be altered.
NOTE: For a list of all the block error messages and values, see Common Floating Point Errors,
page 359.
Part V
Measurement
Measurement
Overview
This section describes the elementary functions and elementary function blocks of the
Measurement family.
Chapter 25
AVGMV: Moving average with fixed window size
Introduction
This chapter describes the AVGMV block.
Description
Function description
The function block creates a moving average from a fixed number of input values (inputX). The
output is the average of all values between the current X value and the oldest X value (N-1). Up to
50 input values can be stored (N).
The function block has both a manual 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 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 RDY = 1:
or
Variable Description
Y(new) Y Value in current program cycle
Y (old) Y Value from the last program cycle
N Window size (number of values in the buffer)
X(N-1) oldest X value in the buffer
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AVGMV_Instance (MAN:=Mode, X:=InputValue,
N:=WindowSize, YMAN:=ManualValue, Y=>Average,
RDY=>BufferReady)
Representation in ST
Representation:
AVGMV_Instance (MAN:=Mode, X:=InputValue,
N:=WindowSize, YMAN:=ManualValue, Y=>Average,
RDY=>BufferReady) ;
Parameter description
Description of input parameters:
Runtime error
An error message is returned if
N=0 or N>50
NOTE: For a list of all block error codes and values, see Measurement, page 356.
Detailed description
Diagram
Floating mean with limited memory of N = 50 values
Chapter 26
AVGMV_K: Moving average with frozen correction factor
Introduction
This chapter describes the AVGMV_K block.
Description
Function description
The function block creates a moving average value (with frozen correction factor) with up to 10,000
input values.
The function block has both a manual 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 invoking the function block in a later program cycle, the internal initialization will not be
performed, the value Y(old) will not be sure and the output Y(new) 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
Block formula:
Variable Description
Y (new) Y Value in current program cycle
Y (old) Y Value from the last program cycle
K Correction factor
X X Value in current program cycle
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AVGMV_K_Instance (MAN:=Mode, X:=InputValue,
K:=CorrectionFactor, YMAN:=ManualValue, Y=>Average)
Representation in ST
Representation:
AVGMV_K_Instance (MAN:=Mode, X:=InputValue,
K:=CorrectionFactor, YMAN:=ManualValue, Y=>Average) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Measurement, page 356.
Detailed description
Diagram
Moving average with frozen correction factor (K = 50)
Chapter 27
DEAD_ZONE, DEAD_ZONE_REAL: Dead zone
Introduction
This chapter describes the blocks DEAD_ZONE and DEAD_ZONE_REAL.
Description
Function description
These functions are used to specify the dead zone for controlled variables.
EN and ENO can be configured as additional parameters.
Formula
Block formula:
Assuming: DZ ≥ 0
Y = GAIN x X for -DZ ≤ X ≤ DZ
Y = (X - DZ) + GAIN x DZ for X > DZ
Y = (X + DZ) - GAIN x DZ for X < -DZ
Appearance in FBD
Block Presentation DEAD_ZONE:
Appearance in LD
Block Presentation DEAD_ZONE:
Appearance in IL
Block Presentation DEAD_ZONE:
LD Input
DEAD_ZONE HalfWidth, Gradient
ST Output
Appearance in ST
Block Presentation DEAD_ZONE:
Output := DEAD_ZONE (Input, HalfWidth, Gradient) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Measurement, page 356.
Detailed description
Characteristic Curves
The function block has the following characteristic curve:
Dead zone with 0 < GAIN < 1
Chapter 28
LOOKUP_TABLE1: Polygon with interpolation of the 1st order
Introduction
This chapter describes the LOOKUP_TABLE1 block.
Description
Function description
This procedure linearizes characteristic curves using interpolation. The procedure works with
variable support point widths.
The number of X/Y_Coord_SupportPoint_n inputs can be increased from 2 to a maximum of
30 by vertically resizing the block frame. This corresponds to a maximum of 15 support points.
The number of inputs must be even.
The InputVariable values must be in ascending order.
EN and ENO can be configured as additional parameters. It is recommended to use the ENO output
parameter as an error indicator.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD InputVariable
LOOKUP_TABLE1 X_Coord_SupportPoint_1,
Y_Coord_SupportPoint_1, OutputVariable,
IndicatorX_GT_Xm, IndicatorX_LT_X1
Representation in ST
Representation:
LOOKUP_TABLE1 (InputVariable, X_Coord_SupportPoint_1,
Y_Coord_SupportPoint_1, OutputVariable,
IndicatorX_GT_Xm, IndicatorX_LT_X1);
Parameter description
Description of input parameters:
Y_Coord_SupportPoint_(n) REAL
Y coordinate . Support point n=max 30
Runtime error
NOTE: For a list of all block error codes and values, see Tables of Error Codes for the CONT_CLC
Library (see page 356).
Detailed description
Parameter description
Two inputs in sequence (XiYi) represent a support point pair. The first input XiYi corresponds to
X1, the nextY1, the nextX2 etc.
For any X input value falling between these support points, the corresponding Y output is linearly
interpolated.
For X < X 1 is Y = Y 1
For X > X m is Y = Y m
If the value at the X input exceeds the last support pointXm , the QXHI output becomes "1".
If the value at the X input is lower than the value of the first support point X1 , the QXLO output
becomes "1".
Principle of Interpolation
Polygon with interpolation of the 1st order
Interpolation
The following algorithm applies to the Y coordinate:
Chapter 29
SAH: Detecting and holding a rising edge
Description
Function description
The function block passes the input value PV to the output OUT the first time it is called. With a rising
edge (0 to 1) on input CLK, the input value IN is pased on to output Output. This value remains
on the output until the next rising edge loads a new value from IN to OUT.
The data types for the input values IN, PV and the output value Output must be the same.
EN and ENO can be configured as additional parameters.
Note
If a variable and a link are connected to OUT and the variable Output is changed (e.g. by writing
through the program or by forcing), the link follows the Output variable instead of keeping the last
output of the SAH.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SAH_Instance (IN:=InputValue, CLK:=ClockInput,
PV:=PresetValue, OUT=>Output)
Representation in ST
Representation:
SAH_Instance (IN:=InputValue, CLK:=ClockInput,
PV:=PresetValue, OUT=>Output) ;
Parameter description
Input parameter description:
Chapter 30
HYST_***: Indicator signal for maximum value delimiters with hysteresis
Introduction
This chapter describes the HYST_*** block.
Description
Function description
The function block monitors the input variable X to detect whether it exceeds the upper limit.
NOTE: If you need to monitor the lower limit you can use the INDLIM_*** function block.
The data types for all input values must be the same.
EN and ENO can be configured as additional parameters.
Available functions
The following blocks are available:
HYST_DINT
HYST_INT
HYST_UDINT
HYST_UINT
HYST_REAL
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL HYST_Instance (X:=Input, HIGH:=MaxHighLimit,
LOW:=MinHighLimit, IND=>Indicator)
Representation in ST
Representation:
HYST_Instance (X:=Input, HIGH:=MaxHighLimit,
LOW:=MinHighLimit, IND=>Indicator) ;
Parameter description
Input parameter description:
Detailed description
Parameter description
If X exceeds the upper limit HIGH, the function block reports this status with IND = 1.
If X exceeds the lower limit LOW, the function block reports this status with IND = 0.
Function
Function description
INDi = 1, if X > HIGH
INDi = 0, if X < LOW
otherwise
INDi = INDi-1
If LOW is greater than HIGH, no hysterisis is created and IND indicates that X is greater than HIGH.
Diagram
Maximum value delimiter with hysteresis
Chapter 31
INDLIM_***: Indicator signal for delimiters with hysteresis
Introduction
This chapter describes the INDLIM_*** block.
Description
Function description
The function block monitors the input variable X to detect whether it exceeds the upper limit or falls
below the lower limit.
NOTE: If you only want to monitor the upper limit you can use the HYST_*** function block.
The data types for all input values must be the same.
EN and ENO can be configured as additional parameters.
Available functions
The following blocks are available:
INDLIM_DINT
INDLIM_INT
INDLIM_UDINT
INDLIM_UINT
INDLIM_REAL
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL INDLIM_Instance (X:=Input, MX_HIGH:=MaxHighLimit,
MX_LOW:=MinHighLimit, MN_LOW:=MinLowLimit,
MN_HIGH:=MaxLowLimit, MX_IND=>ReachedHighLimit,
MN_IND=>ReachedLowLimit)
Representation in ST
Representation:
INDLIM_Instance (X:=Input, MX_HIGH:=MaxHighLimit,
MX_LOW:=MinHighLimit, MN_LOW:=MinLowLimit,
MN_HIGH:=MaxLowLimit, MX_IND=>ReachedHighLimit,
MN_IND=>ReachedLowLimit) ;
Parameter description
Input parameter description:
Detailed description
Diagram
Delimiter with hysteresis INDLIM
Part VI
Output Processing
Output Processing
Overview
This section describes the elementary functions and elementary function blocks of the Output
Processing family.
Chapter 32
MS: Manual control of an output
Introduction
This chapter describes the MS block.
Description
Function description
This function block serves as the control of a numerical output, which can be switched off via the
function block PWM1 (see page 293) controlled analog output, server motor or controlling element.
The control can appear via server dialog or direct via the PLC software.
In general a control function block is used to control a digital output. The MS block should then be
used, if the control output should be uncoupled from the control of the analog output.
EN and ENO can be configured as additional parameters.
Application possibilities
The function block will mainly be used with the following applications:
For the control of an analog output, which is not controlled via a servo loop (open loop).
Servo loops, with which the control output and the user controlled output have inserted a
processing operation.
For scanning of the output controlled controller, if the scanning period exceeds 1 to 2 seconds.
For control of a server motor: the function block MS is in this case the controller block in order to
insert the server motor.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL MS_Instance (IN:=Instruction, FORC:=OperatingModeFlag,
MA_FORC:=OperatingModeFORC_1,
MAN_AUTO:=OperatingModeFORC_0, PARA:=Parameters,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT:=AbsoluteOutput, OUTD=>IncrementalOutput,
MA_O=>CurrentBlockOperatingMode, STATUS=>StatusWord)
Representation in ST
Representation:
MS_Instance (IN:=Instruction, FORC:=OperatingModeFlag,
MA_FORC:=OperatingModeFORC_1,
MAN_AUTO:=OperatingModeFORC_0, PARA:=Parameters,
TR_I:=InitializationInput, TR_S:=InitializationType,
OUT:=AbsoluteOutput, OUTD=>IncrementalOutput,
MA_O=>CurrentBlockOperatingMode, STATUS=>StatusWord) ;
Parameter description MS
Input parameter description:
Detailed description
Structure diagram
The following diagram displays the structure of the function block:
The output MA_O always indicates the current operating mode of the function block.
bumpless changeover
The bumpless changeover can be annulled with the increasing ramp, when inc_rate is set to 0.
Just as with dec_rate = 0 the changeover is with decreasing ramp with bumps. In both cases the
input IN will travel immediately to output OUT when changed over to automatic mode.
When the parameter Outbias (use_bias = 1) is used, a bumpless manual/automatic changeover
can be achieved without change of the output, when the bumpless parameter is set to 1. In this
case the parameter Outbias will be newly calculated and the deviation between the input IN and
the output OUT will be considered.
Bumpless changeover with the parameter Outbias
The bumpless changeover manual/automatic is advisable when the input of the function block is
not connected to any controller or to a controller output without integral component.
Example
Example
In this example the output of the control block and the output controlled by the server will insert a
processing operation (through the DFB FCT).
In order to guarantee a bumpless changeover between the modes manual/automatic, the reversed
processing operation (R_FCT) will be assigned to the output of the MS function block and the result
led back to the control input RCPY, which remained in automatic mode (MAN_AUTO = 1).
Display of the function plans
Runtime error
Status word
The bits of the status words have the following meaning:
Bit 5 = 1 32 0x0020 True The output OUT has reached the lower threshold
out_min (see Note)
Bit 6 = 1 64 0x0040 True The output OUT has reached the upper threshold
out_max (see Note)
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Note
NOTE: In manual mode these bits stay at 1 for only one program cycle. When the user enters a
value for OUT which exceeds one of the thresholds, the function block sets the Bit 5 or 6 to 1 and
blocks them from the user entered value. With the following execution of the function block the
value of OUT no longer lies outside the area and the Bits 5 and 6 are set to 0 again.
Error message
An error appears if a non floating point value is recorded or if there is a problem with a floating point
calculation. In this case the outputs OUT, OUTD and MA_O remain unchanged.
NOTE: For a list of all block error codes and values, see Output Processing, page 357.
Warning Message
In the following cases a warning message is given:
The parameter inc_rate is negative: in this case the function block uses the value 0 in place
of the faulty value from inc_rate.
The parameter dec_rate is negative: in this case the function block uses the value 0 in place
of the faulty value from dec_rate.
The parameter outbias lies outside the area [(out_min – out_max), (out_max –
out_min)]. In this case for calculating the value the function block uses (out_min -
out_max) or (out_max - out_min).
Chapter 33
MS_DB: Manually controlling and output with dead zone
Introduction
This chapter describes the MS_DB block.
Description
Function description
This function block is used to split a digital output. A common usage is duplicating a PID output to
an actuator.
A dead band can be applied to the deviation between the IN input and the positional copy.
The manual operating mode enables the control to operate with or without positional feedback (by
feeding the output to the input, no deviation will occur on changeover to auto; therefore the start
will be smooth).To switch smoothly from manual mode to auto mode in servo control, feed an
increasing or decreasing ramp to the setpoint input.
EN and ENO can be configured as additional parameters.
Application possibilities
The function block will mainly be used with the following applications:
For the control of an analog output, which is not controlled via a servo loop (open loop).
Servo loops, with which the control output and the user controlled output have inserted a
processing operation.
For scanning of the output controlled controller, if the scanning period exceeds 1 to 2 seconds.
For control of a server motor: the function block MS_DB is in this case the controller block in order
to insert the server motor.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL MS_Instance (IN:=Instruction, FORC:=OperatingModeFlag,
MA_FORC:=OperatingModeFORC_1,
MAN_AUTO:=OperatingModeFORC_0, PARA:=Parameters,
TR_I:=InitializationInput, TR_S:=InitializationType,
RCPY:= PositionalCopy,
OUT:=AbsoluteOutput, OUTD=>IncrementalOutput,
MA_O=>CurrentBlockOperatingMode, STATUS=>StatusWord)
Representation in ST
Representation:
MS_Instance (IN:=Instruction, FORC:=OperatingModeFlag,
MA_FORC:=OperatingModeFORC_1,
MAN_AUTO:=OperatingModeFORC_0, PARA:=Parameters,
TR_I:=InitializationInput, TR_S:=InitializationType,
RCPY:= PositionalCopy,
OUT:=AbsoluteOutput, OUTD=>IncrementalOutput,
MA_O=>CurrentBlockOperatingMode, STATUS=>StatusWord) ;
Parameter description MS
Input parameter description:
Detailed description
Structure diagram
The following diagram displays the structure of the function block:
The output MA_O always indicates the current operating mode of the function block.
bumpless changeover
The bumpless changeover can be annulled with the increasing ramp, when inc_rate is set to 0.
Just as with dec_rate = 0 the changeover is with decreasing ramp with bumps. In both cases the
input IN will travel immediately to output OUT when changed over to automatic mode.
When the parameter Outbias (use_bias = 1) is used, a bumpless manual/automatic changeover
can be achieved without change of the output, when the bumpless parameter is set to 1. In this
case the parameter Outbias will be newly calculated and the deviation between the input IN and
the output OUT will be considered.
Bumpless changeover with the parameter Outbias
The bumpless changeover manual/automatic is advisable when the input of the function block is
not connected to any controller or to a controller output without integral component.
Runtime error
Bit Description
Bit 0 = 1 Error in a calculation in floating point values
Bit 1 = 1 Recording of an invalid value on one of the floating point value inputs
Bit 2 = 1 Division by zero during a floating point value calculation
Bit 3 = 1 Capacity overflow during a floating point value calculation
Bit 4 = 1 The following error will be shown:
One of the following variables is negative: inc_rate, dec_rate.
For calculation, the function block uses the value 0.
The parameter Outbias lies out of the area
.
In this case the function block uses a capped value: or
.
Bit 5 = 1 The output OUT has reached the lower threshold out_min (see Note)
Bit 6 = 1 The output OUT has reached the upper threshold out_max (see Note)
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Note
NOTE: In manual mode these bits stay at 1 for only one program cycle. When the user enters a
value for OUT which exceeds one of the thresholds, the function block sets the Bit 5 or 6 to 1 and
blocks them from the user entered value. With the following execution of the function block the
value of OUT no longer lies outside the area and the Bits 5 and 6 are set to 0 again.
Error message
An error is signaled if a non floating value is detected at an input or if there is a problem with a
floating point calculation. In these cases the OUT, OUTD and MA_O outputs remain unchanged.
NOTE: For a list of all block error codes and values, see Output Processing, page 357.
Warning Message
In the following cases a warning message is given:
The parameter inc_rate is negative: in this case the function block uses the value 0 in place
of the faulty value from inc_rate.
The parameter dec_rate is negative: in this case the function block uses the value 0 in place
of the faulty value from dec_rate.
The parameter outbias lies outside the area [(out_min – out_max), (out_max –
out_min)]. In this case for calculating the value the function block uses (out_min -
out_max) or (out_max - out_min).
Chapter 34
PWM1: Pulse width modulation
Introduction
This chapter describes the PWM1 block.
Description
DANGER
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions will result in death or serious injury.
Function description
The function block PWM1 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:
OUT_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 PWM1_Instance (IN:=InputVariable, RST:=ResetMode,
PARA:=Parameters, OUT_NEG=>OutputNegative_IN_Values,
OUT_POS=>OutputPositive_IN_Values)
Representation in ST
Representation:
PWM1_Instance (IN:=InputVariable, RST:=ResetMode,
PARA:=Parameters, OUT_NEG=>OutputNegative_IN_Values,
OUT_POS=>OutputPositive_IN_Values) ;
Runtime error
NOTE: For a list of all block error codes and values, see Output Processing, page 357.
Detailed description
The parameter in_max marks the point of the input variable IN, for which the output OUT_POS
would continuously carry "1" if the IN input variable is positive.
Time-span dependency
The dependency of the time duration in which the output OUT_POS (OUT_NEG) carries a 1-Signal,
on the input variable IN is illustrated in the following diagram:
Operating mode
In reset mode RST = 1, the outputs OUT_POS and OUT_NEG are set to "0". The internal time
counters are standardized as well so that the function block begins its transition to RST=0 with the
output of a new 1-signal on the associated output.
Boundary conditions
If the PWM1 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 PWM1 scan time should be selected according to how the pulse time compares to the period
length. Though this, the smallest possible actuating pulse is be determined.
The following ratio is recommended:
Jump response
In the examples, the signal sequences on the outputs OUT_POS and OUT_NEG are shown for
various IN input signal values.
The following parameter specifications apply to the jump response display:
Parameter Specification
t_period 4s
t_min 0.5 s
in_max 10
IN Analog signal
It can be seen that pulses are no longer output for very small IN input signals. This is directly
attributable to the effect of time t_min. A continuous pulse is output for large IN (IN = in_max)
signals.
Chapter 35
SERVO: Control for servo motors
Introduction
This chapter describes the SERVO block.
Description
Function description
This function block enables PID control of servo motors with or without positional feedback. The
function block can be switched to be the controller (PIDFF, PI_B) so that the digital outputs
become the two logical outputs RAISE and LOWER.
If the function block uses positional feedback, then positioning controlling of the actuator will be
performed. If positional feedback is not being used, the controller and the SERVO function block
operate a continuous static control together.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SERVO_Instance (SEN:=New_INPD_Or_IN_ValueFlag,
IN:=ControllerOutputOUT, INPD:=VariationOf_IN,
MA_I:=OperatingMode, RCPY:=PositionalCopy,
RST:=BlockReinitialization,
R_STOP:=ReachedEndstopOfRAISE,
L_STOP:=ReachedEndstopOfLOWER, PARA:=Parameters,
RAISE=>TravelDirectionOfRAISE,
LOWER=>TravelDirectionOfLOWER, STATUS=>StatusWord)
Representation in ST
Representation:
SERVO_Instance (SEN:=New_INPD_Or_IN_ValueFlag,
IN:=ControllerOutputOUT, INPD:=VariationOf_IN,
MA_I:=OperatingMode, RCPY:=PositionalCopy,
RST:=BlockReinitialization,
R_STOP:=ReachedEndstopOfRAISE,
L_STOP:=ReachedEndstopOfLOWER, PARA:=Parameters,
RAISE=>TravelDirectionOfRAISE,
LOWER=>TravelDirectionOfLOWER, STATUS=>StatusWord) ;
Parametering
Parametering overview
The following function block modes are explained in sequence:
With positional feedback (en_rcpy = 1), page 306
Without positional feedback (en_rcpy = 0), page 306
Actuator opening time (t_motor), page 306
Minimum impulse length (t_mini), page 306
Sweep / parameter SEN, page 307
Recording the end position, page 307
SEN = Meaning
1 Including a new value
0 no inclusion of a new value
If the controller samples using the function block SAMPLETM, as is the usual case, it suffices to
attach the SERVO block’s SEN input to the SAMPLETM output (see section "Examples of function
block SERVO, page 310").
The following still applies for T_IMP (the length of the pulse sent to the output):
If Then
T_IMP < t_mini the block does not generate a pulse, but stores the value for the next calculation.
This allows correct processing of control applications in which the controller’s
output modifications are weak but continuous.
To ensure that pulses which are too short are not generated, the pulses to be
sent to the output are limited to a minimum length t_mini.
the PID controller is in T_IMP is calculated continuously at every cycle. The calculation takes into
manual mode, consideration the time periods with a limit of t_motor which have previously
been calculated, but not yet assigned. In this way any PID controller output
modification can be considered even if the pulse lasts several cycles.
the PID controller is in the function block SERVO always recalculates the parameter T_IMP if the
automatic mode, controller updates its output, i.e. whenever SEN is set to 1. In this operating
mode the previously calculated time periods are no longer considered.
Operating mode
Manual mode
The user can modify the control output here at any time. In order that a new value can be included
as soon as possible, the function block reads the control output at every cycle.
In this operating mode the user can manually modify variables connected to the OUT output of a
controller or a MS block. If no positional feedback is used this variable can adopt the end position
(100% or 0%) even if the actuator has not reached either of its end positions. It is still possible to
modify the output modification OUTD manually by setting the output OUT of the function block MS to
more than 100% (or to less than 0%). The value inputted for OUT is used for the calculation of OUTD
before it is limited again.
Example overview
In this section the use of the function block SERVO is shown in the following examples:
Automatic mode with positional feedback, page 310
Example of operating mode automatic without positional feedback in manual mode, page 313
Parameter Specification
t_motor 25 s
t_mini 1s
sampling period 4s
Parameter Specification
t_motor 25 s
t_mini 1s
TC2_DEFF Error output of the process value TC2: If TC2 is faulty, the servoloop is forced into manual mode.
Runtime error
Status word
The following messages are displayed in the Status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
An error appears if a non floating point value is recorded or if there is a problem with a floating point
calculation. In this case the outputs RAISE and LOWER are set to zero.
NOTE: For a list of all block error codes and values, see Output Processing, page 357.
Chapter 36
SPLRG: Controlling 2 actuators
Introduction
This chapter describes the SPLRG block.
Description
Function description
This function block should be used when two actuators are in use to enable coverage of the whole
area (when two operating points are far apart: one below and one above).
The controller is also suitable for three-point step action controls, i.e. for cases where the two
actuators work in opposition (one heats, the other cools).
EN and ENO can be configured as additional parameters.
Properties
The function block SPLRG has the following properties:
The possibility of controlling a dead zone or a transition zone where the properties of both
actuators are in line
The IN input is expressed as a percentage (0-100%) and the outputs OUT1 and OUT2 are
expressed in physical units.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SPLRG_Instance (IN:=ValueToBeBrokenDown,
PARA:=Parameters, OUT1=>InstructionByActuator1,
OUT2=>InstructionByActuator2, STATUS=>StatusWord)
Representation in ST
Representation:
SPLRG_Instance (IN:=ValueToBeBrokenDown,
PARA:=Parameters, OUT1=>InstructionByActuator1,
OUT2=>InstructionByActuator2, STATUS=>StatusWord) ;
Detailed description
Parametering
Parametering the function block consists of defining the properties of each actuator, i.e. in the kind
of gradient modification of both control outputs in relation to the input IN.
The following points should be defined for the output OUT1:
Element Meaning
out1_inf Lower threshold range
out1_sup Upper threshold range
out1_th1 Threshold value, i.e the input value IN, for which the following applies:
Output OUT1 = out1_inf
out1_th2 Threshold value, i.e the input value IN, for which the following applies:
Output OUT1 = out1_sup
The modification of the value of OUT1 is linear for both threshold values. With the exception of the
two threshold values, no further output modification can occur; it is limited to out1_inf or
out1_sup.
Depending on the adjustment of the two threshold values, the control properties are designated by
a positive increase (for out1_th1 < out1_th2) or a negative increase (for out1_th2 <
out1_th1).
The following diagrams show the properties of the two actuators with Split range and Three-point
step-action control.
NOTE: The outputs of this controller cannot be used to control a SERVO function block without
positional feedback.
Operating mode
The SPLRG function block is not assigned to any specific operating mode. However both function
block outputs may be controlled manually because an MS is locked on to each output. During
programming the user should ensure a bumpless return to automatic mode.
Runtime error
Status word
The following messages are displayed in the Status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
A runtime error appears in the following cases:
A non-floating value is on an input
A problem has occurred during a floating point value calculation.
Both the thresholds of the same output are identical: out1_th1 = out1_th2 or out2_th1 =
out2_th2
The outputs OUT1 and OUT2 are never modified.
NOTE: For a list of all block error codes and values, seeOutput Processing, page 357.
Warning
A warning is given if one of the parameters out1_th1, out1_th2, out2_th1, out2_th2 is not
in the [0 - 100] range. In this case the function block uses the value 0 or 100 for calculating.
Part VII
Setpoint management
Setpoint management
Overview
This section describes the elementary functions and elementary function blocks of the Setpoint
management family.
Chapter 37
RAMP: Ramp generator
Introduction
This chapter describes the RAMP block.
Description
Function description
The function block RAMP makes it possible to move in ramp form from an initial setpoint value to a
particular target value. The gradients of positive and negative ramps can vary.
A signal (DONE output) indicates the user, whether a target value has already been reached or if
the ramp had been implemented.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL RAMP_Instance (RSP:=RampTargetValue, PARA:=Parameters,
TR_I:=InitialRampValue, TR_S:=RampInitializationOrder,
SP=>Output, DONE=>ProgressFlag, STATUS=>StatusWord)
Representation in ST
Representation:
RAMP_Instance (RSP:=RampTargetValue, PARA:=Parameters,
TR_I:=InitialRampValue, TR_S:=RampInitializationOrder,
SP=>Output, DONE=>ProgressFlag, STATUS=>StatusWord) ;
Detailed description
Parametering
If the value given on input (RSP) exceeds the current value of the SP_output, the function block
increases the value of the output with the velocity inc_rate by as much as is necessary for the
SP value to reach the RSP value. If the inc_rate is zero, the ramp function will not be executed
and the SP is identical to the RSP.
If the value given at an input falls below the current value of SP, the function block lowers the value
of SP with the velocity dec_rate. If the dec_rate is zero, the ramp function will not be executed
and the SP is identical to the RSP.
If the value of RSP changes whilst the ramp is being generated, the function block immediately
attempts to reach this new target value. The ramp function, which is running simultaneously, either
continues or changes its direction.
Operating mode
The tracking operation (TR_S = 1) allows for an initial value to be assigned to the SP output. They
are as follows:
Step Action
1 TR_I set to the desired initial value.
2 When TR_S is set to 1, the TR_I input will continue to be executed at SP.
Note: In the tracking mode (TR_S = 1) the DONE output remains permanently at
zero.
3 If TR_S is set to 0, the function block resumes normal operation: The SP
constantly approaches the RSP, where the value describes a ramp.
DONE display
The DONE output goes above 1, if a ramp function has just been completed. It will be reset to zero,
when a new ramp begins or when the function block is switched to tracking mode.
Timing diagram
Timing diagram for RAMP block
1 Initialization: SP = TR_I
2 Increasing ramp = inc_rate
3 Decreasing ramp = dec_rate
Runtime error
Status word
The following messages are displayed in the Status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
An error is signaled if a non floating value is recorded or if there is a problem with a floating point
calculation. In this case the outputs SP and DONE remain unchanged.
NOTE: For a list of all block error codes and values, see Setpoint Management, page 358.
Warning
A warning appears in the following cases:
The parameter inc_rate is negative: the function block uses the value 0 instead of the faulty
value of inc_rate.
The parameter dec_rate is negative: the function block uses the value 0 instead of the faulty
value of dec_rate.
Chapter 38
RATIO: Ratio controller
Introduction
This chapter describes the RATIO block.
Description
Function description
The function block RATIO carries out ratio control when it is attached to a controller.
The aim of ratio control is to establish a ratio of one process variable PV (controlled variable) to
another PV_TRACK (reference variable). The role of the RATIO function block is to calculate the
Control setpoint corresponding to the control variable.
EN and ENO can be configured as additional parameters.
Properties
The function block contains the following properties:
The ratio can be controlled remotely (K) or (RK)
Upper and lower threshold for K or RK
Upper and lower threshold for the calculated Setpoint SP
Calculation of the real ratio: KACT = (PV - bias) / PV_TRACK
Formula
Calculation of the control setpoint
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL RATIO_Instance (PV:=ProcessVariable,
PV_TRACK:=ControllingProcessVariable,
RK:=ExternalRatioCoefficient,
K_RK:=CoefficientTypeFlag, K:=InternalRatioCoefficient,
PARA:=Parameters, KACT=>RealRatioCoefficient,
SP=>CalculatedOutput, STATUS=>StatusWord)
Representation in ST
Representation:
RATIO_Instance (PV:=ProcessVariable,
PV_TRACK:=ControllingProcessVariable,
RK:=ExternalRatioCoefficient,
K_RK:=CoefficientTypeFlag, K:=InternalRatioCoefficient,
PARA:=Parameters, KACT=>RealRatioCoefficient,
SP=>CalculatedOutput, STATUS=>StatusWord) ;
Detailed description
Structure diagram
Structure diagram of the RATIO
Application
The RATIO function block is upstream of a ratio controller. Its function is to calculate the remote
setpoint SP of one of the controllers upgraded subsequently. The ratio controller must consist of
the function blocks RATIO, SP_SEL and a controller.
Generally, this type of controller is used to regulate a flow in relation to another measured flow; it
observes a specific ratio K between the two flow amounts.
Representation of the ratio controller
Runtime error
Status word
The following messages are displayed in the Status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
The error appears if a non floating value is recorded or if there is a problem with a floating point
calculation. The outputs KACT and SP remain unmodified.
Chapter 39
SP_SEL: Setpoint switch
Introduction
This chapter describes the SP_SEL block.
Description
Function description
This function block allows the selection of setpoint value types used in the servoloop:
Properties
The function block SP_SEL has the following properties:
The switchover between the setpoint values can be bumpless
Operation with adjusting setpoint values if the controller is in manual mode
Upper and lower limit of the setpoint value used
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SP_SEL_Instance (RSP:=RemoteSetPoint,
SP_RSP:=TypeOfSetPoint, PARA:=Parameters,
PV:=ControlledVariable, MA_I:=OperatingMode,
SP:=SetPoint, LSP_MEM=>LocalSetPointMemory,
STATUS=>StatusWord)
Representation in ST
Representation:
SP_SEL_Instance (RSP:=RemoteSetPoint,
SP_RSP:=TypeOfSetPoint, PARA:=Parameters,
PV:=ControlledVariable, MA_I:=OperatingMode,
SP:=SetPoint, LSP_MEM=>LocalSetPointMemory,
STATUS=>StatusWord) ;
Detailed description
If Then
SP_RSP from 0 → 1 the local setpoint is switched to a remote setpoint
SP_RSP from 1 → 0 the remote setpoint is switched to a local setpoint
SP_RSP from 0 → 1
The changeover from local setpoint to remote setpoint is bumpless: the value of the SP output is
increasingly adjusted to correspond to the remote setpoint RSP, and it describes the ramp rate.
If rate rate = 0, there is no ramp and the SP is identical to the RSP.
SP_RSP from 0 → 0
The changeover from remote setpoint to local setpoint depends on the bump element in two ways:
If Then
bump = 0 the changeover is bumpless: The function block stops copying the RSP input to
the SP output. The local setpoint value SP then corresponds to the last remote
setpoint value RSP that was present before the changeover. The user can then
modify this. In this case it is not necessary to attach the LSP_MEM output.
bump = 1 the value of the LSP_MEM output is moved to the SP output during changeover
(bumps can occur here). The value given for LSP_MEM corresponds to the last
setpoint value SP before the function block transfers to remote mode. To restart
the local mode with a different setpoint, it is sufficient to modify LSP_MEM as long
as the block remains in remote mode (for further details see "Function of the
output LSP_MEM, page 346").
Limits
In each operating mode (remote or local) the setpoint value SP used is limited to the range between
sp_min and sp_max.
Example of programming
An example of how to program the SP_SEL function block follows.
Runtime error
Status word
The following messages are displayed in the Status word:
For the list of other possible floating point error codes, see Common Floating Point Errors,
page 359.
Error message
An runtime error appears if a non floating point value is recorded or if there is a problem with a
floating point calculation. The outputs SP and LSP_MEM remain unmodified.
NOTE: For a list of all block error codes and values, see Setpoint Management, page 358.
Warning
A warning is giving if rate is negative; the block then uses the value 0 for calculation.
33002535 09/2020
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 CONT_CTL
Library.
Introduction
The following tables show the error codes and error values created for the EFBs of the CONT_CTL
Library.
Conditioning
Table of error codes and errors values created for EFBs of the Conditioning family.
EFB name Error code ENO Error Error value Error description
state in value in in Hex
case of Dec
error
DTIME W_WARN_OUT_OF_ T 30110 16#759E Parameter out of range
RANGE
DTIME FP_ERROR F - - See table Common Floating Point
Errors, page 359
DTIME Status word values T/F - - For details about the DTIME status
word refer to the DTIME desription
(see page 49)
INTEGRATOR E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
INTEGRATOR E_ERR_IB_MAX_MIN F -30102 16#8A6A YMAX < YMIN
INTEGRATOR FP_ERROR F - - See table Common Floating Point
Errors, page 359
LAG_FILTER E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LAG_FILTER FP_ERROR F - - See table Common Floating Point
Errors, page 359
LDLG E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LDLG FP_ERROR F - - See table Common Floating Point
Errors, page 359
LEAD E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
LEAD FP_ERROR F - - See table Common Floating Point
Errors, page 359
MFLOW W_WARN_OUT_OF_ T 30110 16#759E Parameter out of range
RANGE
MFLOW FP_ERROR F - - See table Common Floating Point
Errors, page 359
MFLOW Status word values T/F - - For details about the MFLOW status
word refer to the MFLOW
desription (see page 83)
EFB name Error code ENO Error Error value Error description
state in value in in Hex
case of Dec
error
QDTIME E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
SCALING E_ERR_NULL_INPUT_ F -30121 16#8A57 Null input scale: max and min limit
SCALE must be different
SCALING FP_ERROR F - - See table Common Floating Point
Errors, page 359
SCALING Status word values T/F - - For details about the SCALING
status word refer to the SCALING
description (see page 95)
TOTALIZER W_WARN_OUT_OF_ T 30110 16#759E Parameter out of range
RANGE
TOTALIZER FP_ERROR F - - See table Common Floating Point
Errors, page 359
TOTALIZER W_WARN_TOTALIZER_ T 30113 16#75A1 Maximum value of cter has been
CTER_MAX reached
TOTALIZER Status word values T/F - - For details about the TOTALIZER
status word refer to the
TOTALIZER description
(see page 106)
VEL_LIM E_ERR_DEN F -30152 16#8A38 Not a valid floating point number
VEL_LIM E_ERR_AB1_MAX_MIN F -30101 16#8A6B YMAX < YMIN
VEL_LIM FP_ERROR F - - See table Common Floating Point
Errors, page 359
Controller
Table of error codes and errors values created for EFBs of the Controller family.
Mathematics
Table of error codes and errors values created for EFBs of the Mathematics family.
EFB name Error code ENO Error Error value Error description
state in value in in Hex
case of Dec
error
COMP_DB W_WARN_OUT_OF_RANGE T 30110 16#759E Parameter out of range
COMP_DB FP_ERROR F - - See table Common Floating Point
Errors, page 359
K_SQRT W_WARN_OUT_OF_RANGE T 30110 16#759E Parameter out of range
K_SQRT FP_ERROR F - - See table Common Floating Point
Errors, page 359
MULDIV_W FP_ERROR F - - See table Common Floating Point
Errors, page 359
SUM_W FP_ERROR F - - See table Common Floating Point
Errors, page 359
Measurement
Table of error codes and errors values created for EFBs of the Measurement family.
EFB name Error code ENO state Error Error Error description
in case of value in value in
error Dec Hex
AVGMV E_ERR_DEN F -30152 16#8A38 Not a valid floating point
number
AVGMV W_WARN_AVGMV T 30108 16#759C AVGMV: N must be <= 50
AVGMV FP_ERROR F - - See table Common Floating
Point Errors, page 359
AVGMV_K E_ERR_DEN F -30152 16#8A38 Not a valid floating point
number
AVGMV_K W_WARN_AVGMV_K T 30109 16#759D AVGMV_K: N must be <=
10000
AVGMV_K FP_ERROR F - - See table Common Floating
Point Errors, page 359
DEAD_ZONE E_ERR_DEN F -30152 16#8A38 Not a valid floating point
number
DEAD_ZONE E_ERR_DZONE F -30119 16#8A59 DZONE: DZ must be >= 0
DEAD_ZONE FP_ERROR F - - See table Common Floating
Point Errors, page 359
LOOKUP_TABLE1 E_ERR_DEN F -30152 16#8A38 Not a valid floating point
number
LOOKUP_TABLE1 E_ERR_POLY_ANZAHL F -30107 16#8A65 number of inputs not even
LOOKUP_TABLE1 E_ERR_POLY_FOLGE F -30108 16#8A64 base point x(i) <= x(i-1)
LOOKUP_TABLE1 FP_ERROR F - - See table Common Floating
Point Errors, page 359
Output Processing
Table of error codes and errors values created for EFBs of the Output Processing family.
Setpoint Management
Table of error codes and errors values created for EFBs of the Setpoint Management 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 (see EcoStruxure™ Control Expert, System Bits and Words, Reference
Manual).
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
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.
D
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.
E
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
INF
Used to indicate that a number exceeds the authorized limits.
For an integer, the value ranges (shown in gray) are as follows:
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:
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
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 DTIME, 41
AUTOTUNE, 115
availability of the instructions, 27
AVGMV, 231
E
error codes, 351
AVGMV_K, 237
C H
HYST_***, 257
COMP_DB, 211
COMP_DB_DFB, 211
COMP_DB/COMP_DB_DFB, 212
conditioning - instructions
I
DTIME, 41 IMC, 139
INTEGRATOR, 51 INDLIM_***, 261
LAG_FILTER, 57 instructions
LDLG, 63 availability, 27
LEAD, 71 INTEGRATOR, 51
MFLOW, 77
QDTIME, 85
SCALING, 91
K
TOTALIZER, 97 K_SQRT, 217
VEL_LIM, 107
controller - instructions
AUTOTUNE, 115 L
general information, 31 LAG_FILTER, 57
IMC, 139 LDLG, 63
MS, 269 LEAD, 71
MS_DB, 281 LOOKUP_TABLE1, 249
PI_B, 151
PIDFF, 163
SAMPLETM, 191 M
SERVO, 301 mathematical - instructions
SPLRG, 319 COMP_DB, 211
STEP2, 193 COMP_DB_DFB, 211
STEP3, 201 K_SQRT, 217
MULDIV_W, 221
SUM_W, 225
D
DEAD_ZONE, 243
DEAD_ZONE_REAL, 243
O V
output processing - instructions VEL_LIM, 107
MS, 269
MS_DB, 281
PWM1, 293
SERVO, 301
SPLRG, 319
P
PI_B, 151
PIDFF, 163
PWM1, 293
Q
QDTIME, 85
R
RAMP, 329
RATIO, 335
S
SAH, 255
SAMPLETM, 191
SCALING, 91
SERVO, 301