Beruflich Dokumente
Kultur Dokumente
Unity Pro
Obsolete
Block Library
05/2010
33002543.09
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.
No part of this document may be reproduced in any form or by any means, electronic
or mechanical, including photocopying, without express written permission of
Schneider Electric.
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.
© 2010 Schneider Electric. All rights reserved.
2 33002543 05/2010
Table of Contents
Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Part I General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 1 Block Types and their Applications . . . . . . . . . . . . . . . . 19
Block Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
FFB Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
EN and ENO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Chapter 2 Availability of the blocks on different hardware
platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Availability of the block on the various hardware platforms. . . . . . . . . . . . 29
Chapter 3 List of obsolete functions described in the other
libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Summary of functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Part II CLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Chapter 4 DELAY: Deadtime device . . . . . . . . . . . . . . . . . . . . . . . . . 41
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Operating mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Example for behavior of the function block . . . . . . . . . . . . . . . . . . . . . . . . 46
Chapter 5 INTEGRATOR1: Integrator with limit . . . . . . . . . . . . . . . 47
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Chapter 6 LAG1: Delay element 1st order . . . . . . . . . . . . . . . . . . . . 53
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Chapter 7 LEAD_LAG1: PD device with smoothing . . . . . . . . . . . . 59
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Examples of function blocks LEAD_LAG1 . . . . . . . . . . . . . . . . . . . . . . . . 64
Chapter 8 LIMV: Velocity limiter 1st order . . . . . . . . . . . . . . . . . . . . 67
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
33002543 05/2010 3
Chapter 9 PI1: PI controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Example of the PI1 controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Chapter 10 PID1: PID controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
PID1 function block structure diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Setting parameters for the PID1 controller . . . . . . . . . . . . . . . . . . . . . . . 90
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Chapter 11 PIDP1: PID Controller with Parallel Structure . . . . . . . . . 99
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Setting parameters for the PIDP1 controller . . . . . . . . . . . . . . . . . . . . . . 105
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Chapter 12 SMOOTH_RATE: Differentiator with smoothing . . . . . . . 111
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Formulas for the SMOOTH_RATE function block . . . . . . . . . . . . . . . . . . . . 115
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Chapter 13 THREE_STEP_CON1: Three step controller . . . . . . . . . . 117
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Chapter 14 THREEPOINT_CON1: Three point controller . . . . . . . . . 125
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Chapter 15 TWOPOINT_CON1: Two point controller. . . . . . . . . . . . . 133
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Part III CLC_PRO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Chapter 16 ALIM: Velocity limiter: 2nd order . . . . . . . . . . . . . . . . . . . 143
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Chapter 17 COMP_PID: Complex PID controller . . . . . . . . . . . . . . . . 149
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Complex PID controller structure diagram . . . . . . . . . . . . . . . . . . . . . . . . 156
Setting parameters for the COMP_PID controller . . . . . . . . . . . . . . . . . . . 157
Anti-windup for COMP_PID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Controller type selection for COMP_PID . . . . . . . . . . . . . . . . . . . . . . . . . 161
Bumpless operating mode switchover . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Selecting the operating mode of the COMP_PID . . . . . . . . . . . . . . . . . . . 166
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
4 33002543 05/2010
Chapter 18 DEADTIME: Deadtime device . . . . . . . . . . . . . . . . . . . . . 173
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Operating mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Example for behavior of the function block . . . . . . . . . . . . . . . . . . . . . . . . 179
Chapter 19 DERIV: Differentiator with smoothing . . . . . . . . . . . . . . 181
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Example for the function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Chapter 20 FGEN: Function generator. . . . . . . . . . . . . . . . . . . . . . . . 189
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Parametering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Function selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Function definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Diagrams of the individual functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Special cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Timing diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Chapter 21 INTEG: Integrator with limit . . . . . . . . . . . . . . . . . . . . . . . 207
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Chapter 22 LAG: Delay element 1st order . . . . . . . . . . . . . . . . . . . . . 215
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Chapter 23 LAG2: Delay element 2nd order . . . . . . . . . . . . . . . . . . . 221
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Timing diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Chapter 24 LEAD_LAG: PD device with smoothing . . . . . . . . . . . . . 229
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Examples of function blocks LEAD_LAG . . . . . . . . . . . . . . . . . . . . . . . . . 235
Chapter 25 PCON2: Two point controller. . . . . . . . . . . . . . . . . . . . . . 237
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Chapter 26 PCON3: Three point controller . . . . . . . . . . . . . . . . . . . . 243
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Runtime error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Chapter 27 PD_OR_PI: Structure changeover PD/PI controller. . . . 251
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Structure diagram for the function block PD_OR_PI . . . . . . . . . . . . . . . . 256
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
33002543 05/2010 5
Chapter 28 PDM: Pulse duration modulation . . . . . . . . . . . . . . . . . . . 263
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Chapter 29 PI: PI controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Parametering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Example of a PI controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Chapter 30 PID: PID controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
PID function block structure diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Setting parameters for the PID controller. . . . . . . . . . . . . . . . . . . . . . . . . 290
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Chapter 31 PID_P: PID controller with parallel structure . . . . . . . . . 299
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Setting parameters for the PID_P controller . . . . . . . . . . . . . . . . . . 305
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Chapter 32 PIP: PIP cascade controller . . . . . . . . . . . . . . . . . . . . . . . 311
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
PIP function block structure diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Setting parameters for the PIP cascade controller . . . . . . . . . . . . . . . . . 318
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Chapter 33 PPI: PPI cascade controller . . . . . . . . . . . . . . . . . . . . . . . 325
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
PPI function block structure diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Setting parameters for the PPI cascade controller . . . . . . . . . . . . . . . . . 332
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Detailed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Chapter 34 PWM: Pulse width modulation . . . . . . . . . . . . . . . . . . . . . 339
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Example for the PWM block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Chapter 35 QPWM: Pulse width modulation (simple) . . . . . . . . . . . . 351
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Example for the QPWM block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Chapter 36 SCON3: Three step controller. . . . . . . . . . . . . . . . . . . . . . 359
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
6 33002543 05/2010
Chapter 37 VLIM: Velocity limiter 1st order . . . . . . . . . . . . . . . . . . . . 367
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Part IV Extension/Compatibility . . . . . . . . . . . . . . . . . . . . . . 373
Chapter 38 ADD_***_PL7 : Add a period . . . . . . . . . . . . . . . . . . . . . . 377
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Chapter 39 AKF_FL: Detection of any edge . . . . . . . . . . . . . . . . . . . 381
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Chapter 40 AKF_TA: Switch off delay . . . . . . . . . . . . . . . . . . . . . . . . 383
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Chapter 41 AKF_TE: Switch-on delay . . . . . . . . . . . . . . . . . . . . . . . . 387
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Chapter 42 AKF_TI: Pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Chapter 43 AKF_TS: Storing switch on delay . . . . . . . . . . . . . . . . . . 395
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Chapter 44 AKF_TV: Extended pulse . . . . . . . . . . . . . . . . . . . . . . . . . 399
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Chapter 45 AKF_ZR: Decremental counter . . . . . . . . . . . . . . . . . . . . 403
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Chapter 46 AKF_ZV: Incremental counter . . . . . . . . . . . . . . . . . . . . . 407
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Chapter 47 AKF_ZVR: Incremental/decremental counter . . . . . . . . 411
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Chapter 48 COMPARE: Comparing two integers . . . . . . . . . . . . . . . 415
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Chapter 49 DATE_DINT_TO_STRING: Conversion of a date (DATE
PL7) into a character string . . . . . . . . . . . . . . . . . . . . . . . 417
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Chapter 50 DAY_OF_WEEK : Day of the week . . . . . . . . . . . . . . . . . 419
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Chapter 51 DELTA_***: Difference between two dates. . . . . . . . . . . 421
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Chapter 52 DT_ARINT_TO_STRING: Converting a PL7 date into a
character string. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Chapter 53 END: Unconditional end of program. . . . . . . . . . . . . . . . 427
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Chapter 54 FIFO: First In/First Out stack register . . . . . . . . . . . . . . . 429
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
33002543 05/2010 7
Chapter 55 FPULSOR: Generation of rectangular signals . . . . . . . . 433
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Detailed description of the operation of the FPULSOR function . . . . . . . 436
Chapter 56 FSTEP_PL7_DRUM : Forcing a drum to a step . . . . . . . 437
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Chapter 57 FTOF: Deactivation timer . . . . . . . . . . . . . . . . . . . . . . . . . 439
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Detailed description of the operation of the FTOF function . . . . . . . . . . . 442
Chapter 58 FTON: Activation timer . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Detailed description of the operation of the FTON function . . . . . . . . . . . 446
Chapter 59 FTP: Pulse timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
Detailed description of the operation of the FTP function . . . . . . . . . . . . 450
Chapter 60 GET_3X: Read %IW Words (3x-Register) . . . . . . . . . . . . 451
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Chapter 61 GET_4X: Read %MW Words (4x-Register) . . . . . . . . . . . 453
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
Chapter 62 GET_BIT: Reading bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Chapter 63 HIGH_INT: Extracting the most significant word of a
double integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Chapter 64 IEC_BMDI: Block move . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Chapter 65 LIFO: Last In/First Out stack register. . . . . . . . . . . . . . . . 467
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Chapter 66 LOW_INT: Extracting the least significant word of a
double integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Chapter 67 MUX_DINTARR_125: Multiplexer for arrays of the data
type DIntArr125 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
Chapter 68 PL7_COUNTER : Counter/downcounter . . . . . . . . . . . . . 475
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Mode of operation of the PL7_COUNTER function . . . . . . . . . . . . . . . . . 479
Chapter 69 PL7_DRUM : Drum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Mode of operation of the PL7_DRUM timer function . . . . . . . . . . . . . . . . 486
8 33002543 05/2010
Chapter 70 PL7_MONOSTABLE : Monostable . . . . . . . . . . . . . . . . . 487
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Detailed description of the operation of the PL7_MONOSTABLE function 491
Mode of operation of the PL7_MONOSTABLE monostable function . . . . 492
Chapter 71 PL7_REGISTER_32 : 32 word memory register. . . . . . . 493
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Chapter 72 PL7_REGISTER_255 : 255 word memory register. . . . . 497
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Chapter 73 PL7 and Unity Timers Comparison . . . . . . . . . . . . . . . . . 501
Differences between PL7 and Unity Pro: Timers . . . . . . . . . . . . . . . . . . . 501
Chapter 74 PL7_TOF : TOF type timer . . . . . . . . . . . . . . . . . . . . . . . . 503
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Detailed description of the operation of the PL7_TOF function. . . . . . . . . 507
Mode of operation of the PL7_TOF timer function . . . . . . . . . . . . . . . . . . 508
Chapter 75 PL7_TON : TON type timer. . . . . . . . . . . . . . . . . . . . . . . . 509
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Detailed description of the operation of the PL7_TON function . . . . . . . . 513
Mode of operation of the PL7_TON timer function . . . . . . . . . . . . . . . . . . 514
Chapter 76 PL7_TP : TP type timer. . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Detailed description of the operation of the PL7_TP function . . . . . . . . . . 519
Mode of operation of the PL7_TP timer function. . . . . . . . . . . . . . . . . . . . 520
Chapter 77 PL7_3_TIMER : Conversion timer for % Ti’s of PL7 . . . 521
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Detailed description of the operation of the PL7_3_TIMER function. . . . . 525
Mode of operation of the PL7_3_TIMER timer function . . . . . . . . . . . . . . 526
Chapter 78 PUT_4X: Write 4x register . . . . . . . . . . . . . . . . . . . . . . . . 527
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Chapter 79 R_INT_WORD: Type conversion (REAL -> INT -> WORD)
(R_INT_WORD: Type conversion (REAL -> INT ->
WORD)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
Chapter 80 R_UINT_WORD: Type conversion (REAL -> UINT ->
WORD) (R_UINT_WORD: Type conversion (REAL ->
UINT -> WORD)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Chapter 81 R2T_***: Register to table . . . . . . . . . . . . . . . . . . . . . . . . 533
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Detailed description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
Chapter 82 READ_PCMCIA: Reading data in the memory card . . . 537
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
READ_PCMCIA and WRITE_PCMCIA Example . . . . . . . . . . . . . . . . . . . 540
33002543 05/2010 9
Chapter 83 ROR1_ARB: Right shift of one byte from a table of bytes 543
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Chapter 84 RRTC: Reading the system date . . . . . . . . . . . . . . . . . . . 545
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Chapter 85 SCOUNT: Up/down counting with overshoot signaling. 547
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
Chapter 86 SET_BIT: Set bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Chapter 87 SET_PCMCIA: Initialization of the archiving zone . . . . . 555
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Chapter 88 SHL_RBIT_***: Left shift on an integer or double integer 557
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Chapter 89 SHR_RBIT_***: Right shift on an integer or double
integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Chapter 90 SHRZ_***: Right shift on an integer or double integer . 561
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Chapter 91 SHRZ_RBIT_***: Right shift on an integer or double
integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Chapter 92 SRCH: Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
Detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
Chapter 93 STR_ROUND: Approximate value of a floating point
number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
Chapter 94 SUB_***_PL7 : Subtract a period . . . . . . . . . . . . . . . . . . . 573
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Chapter 95 SYSSTATE: System state . . . . . . . . . . . . . . . . . . . . . . . . . 577
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Chapter 96 T2T: Table to table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Detailed Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
Chapter 97 TIME_DINT_TO_STRING: Conversion of a variable to
DINT format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Chapter 98 TOD_DINT_TO_STRING: Conversion of a variable to
TOD format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
10 33002543 05/2010
Chapter 99 TRANS_TIME: Conversion of a duration into DINT
format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Chapter 100 W_INT_REAL: Type conversion (WORD -> INT -> REAL)
(W_INT_REAL: Type conversion (WORD -> INT ->
REAL)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Chapter 101 W_UINT_REAL: Type conversion (WORD -> UINT ->
REAL) (W_UINT_REAL: Type conversion (WORD ->
UINT -> REAL)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
Chapter 102 WRITE_PCMCIA: Writing data to the memory card. . . . 595
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Chapter 103 WRTC: Updating the system date . . . . . . . . . . . . . . . . . . 599
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Appendix A EFB Error Codes and Values. . . . . . . . . . . . . . . . . . . . . . 603
Tables of Error Codes for the Obsolete Library. . . . . . . . . . . . . . . . . . . . . 604
Common Floating Point Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Appendix B System Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
System Bit Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Description of System Bits %S15 to %S21 . . . . . . . . . . . . . . . . . . . . . . . . 615
Description of System Words %SW0 to %SW11 . . . . . . . . . . . . . . . . . . . 618
Description of System Words %SW12 to %SW29 . . . . . . . . . . . . . . . . . . 621
Description of System Words %SW70 to %SW100 . . . . . . . . . . . . . . . . . 626
Description of System Words %SW123 to %SW127 . . . . . . . . . . . . . . . . 636
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
33002543 05/2010 11
12 33002543 05/2010
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, or maintain it. The following special
messages may appear throughout this documentation or on the equipment to warn
of potential hazards or to call attention to information that clarifies or simplifies a
procedure.
33002543 05/2010 13
PLEASE NOTE
Electrical equipment should be installed, operated, serviced, and maintained only by
qualified personnel. No responsibility is assumed by Schneider Electric for any
consequences arising out of the use of this material.
A qualified person is one who has skills and knowledge related to the construction
and operation of electrical equipment and the installation, and has received safety
training to recognize and avoid the hazards involved.
14 33002543 05/2010
About the Book
At a Glance
Document Scope
This documentation describes the functions and function blocks in the Obsolete
library.
NOTE: The functions and function blocks in this library are only used to convert from
Concept and PL7 user programs. They should not be used to create new user
programs.
Validity Note
This document is valid from Unity Pro Version 5.0.
User Comments
We welcome your comments about this document. You can reach us by e-mail at
techcomm@schneider-electric.com.
33002543 05/2010 15
16 33002543 05/2010
General
33002543 05/2010
General
I
Overview
This section contains general information about the Obsolete library.
33002543 05/2010 17
General
18 33002543 05/2010
Block Types and their Applications
33002543 05/2010
33002543 05/2010 19
Block Types and their Applications
Block Types
Block Types
Different block types are used in Unity Pro. The general term for the block types is
FFB.
There are the following types of block:
z Elementary Function (EF)
z Elementary Function Block (EFB)
z Derived Function Block (DFB)
z Procedure
NOTE: Motion Function Blocks are not available on the Quantum platform.
Elementary Function
CAUTION
UNEXPECTED BEHAVIOR OF EQUIPMENT
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.
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,
e.g. 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 frame. The name of the function, i.e. the function type,
is shown in the center of the frame.
The number of inputs can be increased with some elementary functions.
NOTE: 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.
20 33002543 05/2010
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.
33002543 05/2010 21
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.
22 33002543 05/2010
Block Types and their Applications
Operation
The operation determines which function is to be executed with the FFB, e.g. shift
register, conversion operations.
Operand
The operand specifies what the operation is to be executed with. With FFBs, this
consists of formal and actual parameters.
Formal/actual parameters
Inputs and outputs are required to transfer values to or from an FFB. These are
called formal parameters.
Objects are linked to formal parameters; these objects contain the current process
states. They are called actual parameters.
At program runtime, the values from the process are transferred to the FFB via the
actual parameters and then output again after processing.
The data type of the actual parameters must match the data type of the input/output
(formal parameters). The only exceptions are generic inputs/outputs whose data
type is determined by the actual parameter. If the actual parameters consist of
literals, a suitable data type is selected for the function block.
33002543 05/2010 23
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):
z When using graphic connections, VAR_IN_OUT outputs can only be connected
with VAR_IN_OUT inputs.
z Only one graphical link can be connected to a VAR_IN_OUT input/output.
z 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.
z No negations can be used on VAR_IN_OUT inputs/outputs.
z A combination of variable/address and graphic connections is not possible for
VAR_IN_OUT outputs.
24 33002543 05/2010
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 Unity Pro, 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):
z Function blocks
z EN/ENO handling with function blocks that (only) have one link as an output
parameter:
33002543 05/2010 25
Block Types and their Applications
z Functions/Procedures
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:
z EN/ENO handling with functions/procedures that (only) have one link as an
output parameter:
26 33002543 05/2010
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.
33002543 05/2010 27
Block Types and their Applications
28 33002543 05/2010
Availability of Blocks
33002543 05/2010
Introduction
Not all blocks are available on all hardware platforms. The blocks available on your
hardware platform can be found in the following tables.
NOTE: The functions and function blocks in this library are not defined in IEC 61131-
3.
CLC
Availability of the blocks:
Legend:
+ Yes
- No
33002543 05/2010 29
Availability of Blocks
CLC_PRO
Availability of the blocks:
Legend:
+ Yes
- No
30 33002543 05/2010
Availability of Blocks
Extension/Compatibility
Availability of the blocks:
33002543 05/2010 31
Availability of Blocks
32 33002543 05/2010
Availability of Blocks
33002543 05/2010 33
Availability of Blocks
Legend:
+ Yes
- No
34 33002543 05/2010
List of obsolete functions described in the other libraries
33002543 05/2010
At a Glance
Despite belonging to the obsolete library, certain functions are described in the
documentation for the general library.
The following table provides a summary of these functions, and indicates the
correspondence between the function family through which they can be accessed
using Unity Pro, and that of the general library where they are described in the
documentation.
33002543 05/2010 35
List of obsolete functions described in the other libraries
Summary table
The following table shows the different functions of the obsolete library which are
described in the general library:
36 33002543 05/2010
List of obsolete functions described in the other libraries
33002543 05/2010 37
List of obsolete functions described in the other libraries
38 33002543 05/2010
CLC
33002543 05/2010
CLC
II
Overview
This part describes the elementary functions and elementary function blocks in the
family CLC.
33002543 05/2010 39
CLC
40 33002543 05/2010
DELAY
33002543 05/2010
4
Introduction
This chapter describes the DELAY block.
33002543 05/2010 41
DELAY
Description
Function description
With this function block the input signal is delayed by a deadtime.
The function block delays the signal X by the deadtime T_DELAY before it appears
again at Y.
The function block incorporates a delay buffer for 128 elements (X values), meaning
that during the time span T_DELAY 128 X values can be stored. The buffer is used
in such a way that it corresponds with the operating mode.
Whether the system is started cold or warm, the value of Y remains unchanged. The
internal values are set to the value of X.
After a change of deadtime T_DELAY or a cold or warm system start, the output
READY goes to "0". This means: that the buffer is not ready because it is empty.
The function block has the following operating mode: Manual, halt and automatic
mode.
EN and ENO can be configured as additional parameters.
NOTE: The delay time continues to run even if the block is disabled via the EN
parameter, because the block calculates its time differences according to the system
clock.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
42 33002543 05/2010
DELAY
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL DELAY_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputValue, T_DELAY:=DelayTime,
YMAN:=ManualControl_Y_Value, Y=>Output,
READY=>InternalBufferFlag)
Representation in ST
Representation:
DELAY_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputValue, T_DELAY:=DelayTime,
YMAN:=ManualControl_Y_Value, Y=>Output,
READY=>InternalBufferFlag) ;
33002543 05/2010 43
DELAY
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see CLC, page 604.
44 33002543 05/2010
DELAY
Operating mode
If... Then...
the current X value is transferred to the buffer, and the oldest
X value in the buffer is placed on the output Y. If a cycle time
is greater than T_DELAY / 128, a resolution of less than 128
will result, causing a systematic error leading to double
storage of some X values. (see the following Example).
not all X values can be stored in the buffer. In this case the X
value is not saved in some cycles, and Y remains unchanged
in these cycles.
Manual mode
In manual mode the manual value YMAN is consistently transferred to the control
output Y. The internal buffer is charged with the manual value YMAN. The buffer is
marked as charged (READY =1).
Halt mode
The output Yis held at the last calculated value in Halt mode. The internal buffer still
continues to operate as in automatic mode.
33002543 05/2010 45
DELAY
Example
The following diagram shows an example for behavior of the function block. Input X
follows a ramp function from one value to a new value. Delayed by the deadtime
T_DELAY, X values appear at Y.
Function block diagram DELAY
46 33002543 05/2010
INTEGRATOR1
33002543 05/2010
33002543 05/2010 47
INTEGRATOR1
Description
Function description
The function block replicates a limited integrator.
The function block has the following properties:
z Manual, halt and automatic modes
z Manipulated variable limiting in automatic mode
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Formula
The transfer function is:
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
48 33002543 05/2010
INTEGRATOR1
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL INTEGRATOR1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputVariable, GAIN:=IntegralGain,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualControlLimit, Y=>Output,
QMAX=>Y_AtUpperLimit, QMIN=>Y_AtLowerLimit)
33002543 05/2010 49
INTEGRATOR1
Representation in ST
Representation:
INTEGRATOR1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputVariable, GAIN:=IntegralGain,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualControlLimit, Y=>Output,
QMAX=>Y_AtUpperLimit, QMIN=>Y_AtLowerLimit) ;
Parameter description
Description of input parameters:
Runtime error
If YMAN < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see CLC, page 604.
50 33002543 05/2010
INTEGRATOR1
Detailed description
Parametering
The parameter assignments of the function block are satisfied by the determination
of the integral GAIN and the limiting values YMAX and YMIN for output Y.
The limits YMAX and YMIN limit the output within the prescribed range. Therefore
YMIN ≤Y ≤YMAX.
The markers QMAX and QMIN signal that the limits have been reached or the output
signal is being limited.
z QMAX = 1 if Y ≥ YMAX
z QMIN = 1 if Y ≤YMIN
Operating mode
There are three operating modes, which are selected via the inputs MAN and HALT:
33002543 05/2010 51
INTEGRATOR1
Example
The input signal is integrated via the time. If there is a jump on input X the output
increases (for positive X values) or decreases (for negative X values) according to a
ramp function. Y is always between YMAX and YMIN; if Y is equal to YMAX or YMIN,
this is shown accordingly in QMAX or QMIN.
It displays the integrator jump response:
52 33002543 05/2010
LAG1
33002543 05/2010
6
Introduction
This chapter describes the LAG1 block.
33002543 05/2010 53
LAG1
Description
Function description
The function block represents a delay element 1st order.
The function block contains the following operating mode:
z Manual mode
z Halt
z 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:
54 33002543 05/2010
LAG1
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
Representation in FBD
Representation:
Representation in LD
Representation:
33002543 05/2010 55
LAG1
Representation in IL
Representation:
CAL LAG1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputValue, GAIN:=GainFactor, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue, Y=>Output)
Representation in ST
Representation:
LAG1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=InputValue, GAIN:=GainFactor, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue, Y=>Output) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see CLC, page 604.
56 33002543 05/2010
LAG1
Detailed description
Parametering
Setting parameters for the function block is achieved through specification of the
factor GAIN as well as setting parameters for the delayed time constant LAG.
The unit jump at input X (jump at input X from 0 to 1.0) follows output Y with a delay.
Along an e-function
Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:
Example
The diagram shows an example of the jump response of the LAG device: Input X
jumps to a new value and output Y follows an e-function for input X.
Jump response for function block LAG1 if GAIN = 1
33002543 05/2010 57
LAG1
58 33002543 05/2010
LEAD_LAG1
33002543 05/2010
33002543 05/2010 59
LEAD_LAG1
Description
Function description
The function block serves as a PD outline with subsequent smoothing.
The function block has the following properties:
z Definable delay of the D-component
z Operating modes Manual, Halt, Automatic
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouput may deliver a wrong value.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Formula
The transfer function is:
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
60 33002543 05/2010
LEAD_LAG1
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LEAD_LAG1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=Input, GAIN:=GainFactor,
LEAD:=DifferentialTimeConstant, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue, Y=>Output)
33002543 05/2010 61
LEAD_LAG1
Representation in ST
Representation:
LEAD_LAG1_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=Input, GAIN:=GainFactor,
LEAD:=DifferentialTimeConstant, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue, Y=>Output) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see CLC, page 604.
62 33002543 05/2010
LEAD_LAG1
Detailed description
Parametering
The parameter assignments of the function block are satisfied by the determination
of the factor GAIN, and the values the derivative time constant LEAD and delayed
time constant LAG.
For very small sample times and the unit jump to input X (jump at input X from 0 to
Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:
33002543 05/2010 63
LEAD_LAG1
Example overview
The following examples are presented in the following diagrams:
z LEAD = LAG
z LEAD=LAG * 0.5, GAIN = 1
z LEAD/LAG = 2, GAIN = 1
LEAD = LAG
The function blocks behave like a pure multiplication block with the multiplier GAIN.
Function block LEAD_LAG1 with LEAD = LAG
64 33002543 05/2010
LEAD_LAG1
LEAD/LAG = 2, GAIN = 1
The output Y jumps in this case to twice the end value in order to run into the end
value with the delayed time constant LAG (GAIN * X).
Function block LEAD_LAG1 with LEAD/LAG = 2 and GAIN = 1
33002543 05/2010 65
LEAD_LAG1
66 33002543 05/2010
LIMV
33002543 05/2010
8
Introduction
This chapter describes the LIMV block.
33002543 05/2010 67
LIMV
Description
Function description
The function block produces an velocity limiter of the 1st order with limiting of the
manipulated variable.
The gradient of the input size X is limited to a specified value RATE. Furthermore,
the output Y will be limited through YMAX and YMIN. This allows the function block
to adjust signals to the 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:
z Operating modes Manual, Halt, Automatic
z Manipulated variable limiting in automatic mode
68 33002543 05/2010
LIMV
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LIMV_Instance (MAN:=ManualMode, HALT:=HaltMode,
X:=Input, RATE:=MaximumRateOfChange,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualControlValue, Y=>Output,
QMAX=>Y_AtUpperLimit, QMIN=>Y_AtLowerLimit)
33002543 05/2010 69
LIMV
Representation in ST
Representation:
LIMV_Instance (MAN:=ManualMode, HALT:=HaltMode, X:=Input,
RATE:=MaximumRateOfChange,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualControlValue, Y=>Output,
QMAX=>Y_AtUpperLimit, QMIN=>Y_AtLowerLimit) ;
Parameter description
Description of input parameters:
Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see CLC, page 604.
70 33002543 05/2010
LIMV
Detailed description
Parametering
The parameter assignments of the function block are created by the determination
of the maximum velocity RATE and the limiting values YMAX and YMIN for output Y.
The maximum velocity rate indicates by how much the output may change within
one second.
The amount will be evaluated for parameter RATE. If RATE = 0, then Y = X.
The limits YMAX and YMIN limit the output within the prescribed range. Therefore
YMIN ≤Y ≤YMAX.
The outputs QMAX and QMIN signal that the limits have been reached or the output
signal is being limited.
z QMAX = 1 if Y ≥ YMAX
z QMIN = 1 if Y ≤YMIN
Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:
33002543 05/2010 71
LIMV
Example
The function block follows the jump to input X with maximum change in speed.
Output Y remains at a standstill in Halt mode, in order to subsequently move on from
the position at which it has stopped. It is also clear to see the limits of output Y
through YMAX and YMIN with the relevant messages QMAX and QMIN.
Dynamic behavior of LIMV:
72 33002543 05/2010
PI1
33002543 05/2010
PI1: PI controller
9
Introduction
This chapter describes the PI1 block.
33002543 05/2010 73
PI1
Description
Function description
The function block represents a simple PI controller.
A system deviation ERR is formed by the difference between the setpoint SP and the
controlled variable PV. This deviation ERR causes the manipulated variable Y to
change.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block has the following properties:
z Operating modes Manual, Halt, Automatic
z bumpless changeover between manual and automatic
z Manipulated variable limiting
z Anti-windup reset
z Anti-windup measure with an active I component only
74 33002543 05/2010
PI1
Representation in FBD
Representation:
Representation in LD
Representation:
33002543 05/2010 75
PI1
Representation in IL
Representation:
CAL PI1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
GAIN:=ProportionalRate, TI:=ResetTime,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualValue, Y=>ManipulatedVariable,
ERR=>OutputSystemDeviation, QMAX=>Y_Reached_YMAX,
QMIN=>Y_Reached_YMIN)
Representation in ST
Representation:
PI1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
GAIN:=ProportionalRate, TI:=ResetTime,
YMAX:=UpperControlLimit, YMIN:=LowerControlLimit,
YMAN:=ManualValue, Y=>ManipulatedVariable,
ERR=>OutputSystemDeviation, QMAX=>Y_Reached_YMAX,
QMIN=>Y_Reached_YMIN) ;
Parameter description
Description of input parameters:
76 33002543 05/2010
PI1
Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see CLC, page 604.
33002543 05/2010 77
PI1
Formulas
Transfer function
The transfer function is:
Calculation formulas
The calculation formulas are:
Output signal Y
The output signal Y is then:
Variable Meaning
Present sample time
YI I component
YP P component
78 33002543 05/2010
PI1
Parametering
Structure diagram
The following is the structure diagram of the PI1 controller:
Parametering
The PI1 control structure is displayed in theStructure diagram, page 79. Setting
parameters for the function block takes place first of all for the elemental PI
parameters: the proportional action coefficient GAIN and reset time TI.
The limits YMAX and YMIN limit the output within the prescribed range. Therefore
YMIN ≤Y ≤YMAX.
The markers QMAX and QMIN signal that the limits have been reached or the output
signal is being limited.
z QMAX = 1 if Y ≥ YMAX
z QMIN = 1 if Y ≤YMIN
33002543 05/2010 79
PI1
Anti-windup reset
Should limiting of the manipulated variable take place, the anti-windup reset should
ensure that the integral component "cannot go berserk". The anti-windup measure
is only implemented if the I component of the controller is not disabled. Anti-windup
limits are identical to those for the manipulated variable. The anti-windup-reset
measure corrects the I component such that: YMIN - YP ≤YI ≤YMAX - YP
80 33002543 05/2010
PI1
Operating modes
Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the
control output Y. However, the manipulated variable is limited by YMAX and YMIN.
Internal variables will be manipulated in such a manner that the controller
changeover from manual to automatic (with I component enabled) can be bumpless.
The control limits are also limits for the Anti-windup reset
Halt mode
In halt mode the control output remains unchanged; the function block does not
influence the control output Y, i.e. Y = Y(old). Internal variables will be manipulated
in such a manner that the component sum corresponds with the manipulated
variable, thus allowing the controller to be driven smoothly from its current position.
The control limits are also limits for the Anti-windup reset.
33002543 05/2010 81
PI1
Example
The jump response of the PI1 controller is shown in the following Diagram
(see page 82) as an example.
In the first part of the figure the function block response to MAN operating mode can
be seen: The output Y jumps to the YMAN value.
The second part of the diagram shows the reaction of the function block in automatic
mode (MAN = 0 and HALT= 0) both with a positive ERR system deviation and with a
negative ERR system deviation. For constant positive system deviation, Y ramps
upward until the upper output limit is reached.
The output is subsequently limited to the YMAX value. The limit is signaled in the
QMAX output. The system deviation then jumps to a negative value whose absolute
value is greater than the previous positive value.
82 33002543 05/2010
PID1
33002543 05/2010
10
Introduction
This chapter describes the PID1 block.
33002543 05/2010 83
PID1
Description
Function description
The function block produces a PID controller.
A system deviation ERR is formed because of the reference variable SP and the
controlled variable PV. This deviation ERR causes the manipulated variable Y to
change.
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:
z real PID controller with independent GAIN, TI, TD setting
z Operating modes Manual, Halt, Automatic
z bumpless changeover between manual and automatic
z Manipulated variable limiting in automatic mode
z Separately enabled P, I and D component
z Anti-Windup-Reset
z Anti-windup measures taken only for an active I component
z definable delay of the D component
z D component connectable to controlled variable PV or system deviation ERR
84 33002543 05/2010
PID1
Transfer function
The transfer function is:
Variable Description
YD D component (only when EN_D = 1)
YI I component (only when EN_I = 1)
YP P component (only when EN_P = 1)
Representation in FBD
Representation:
33002543 05/2010 85
PID1
Representation in LD
Representation:
86 33002543 05/2010
PID1
Representation in IL
Representation:
CAL PID1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
BIAS:=DisturbanceInput, EN_P:=P_Portion_On,
EN_I:=I_Portion_On, EN_D:=D_Portion_On,
D_ON_X:=D_PortionValueFlag, GAIN:=ProportionalRate,
TI:=ResetTime, TD:=DerivativeActionTime,
TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
YMIN:=LowerControlLimit, YMAN:=ManualValue,
Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
QMAX=>Y_Reached_YMAX, QMIN=>Y_Reached_YMIN)
Representation in ST
Representation:
PID1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
BIAS:=DisturbanceInput, EN_P:=P_Portion_On,
EN_I:=I_Portion_On, EN_D:=D_Portion_On,
D_ON_X:=D_PortionValueFlag, GAIN:=ProportionalRate,
TI:=ResetTime, TD:=DerivativeActionTime,
TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
YMIN:=LowerControlLimit, YMAN:=ManualValue,
Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
QMAX=>Y_Reached_YMAX, QMIN=>Y_Reached_YMIN) ;
Parameter description
Description of input parameters:
33002543 05/2010 87
PID1
Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see CLC, page 604.
88 33002543 05/2010
PID1
Structure diagram
The following is the structure diagram of the PID1block:
33002543 05/2010 89
PID1
Parametering
The PID1 control structure is displayed in theStructure diagram, page 89.
Setting function block parameters is initially performed by the pure PID parameters,
i.e. the proportional action coefficient GAIN, the reset time TI and the rate time TD.
The D component is delayed by the time TD_LAG. The ratio between TD/TD_LAG is
called differential gain VD. The D component can either be formed by the system
deviation ERR (D_ON_X = 0) or the controlled variable PV (D_ON_X = 1). Should the
D component be determined by the controlled variable PV, then the D component
will not be able to cause jumps when reference variable fluctuations (changes in
input SP) take place. Generally, the D component only affects disturbances and
process variances.
For limiting the manipulated variable, the upper limit YMAX should be greater than
the lower limit YMIN.
Anti-windup reset
If manipulated variable limiting takes place, the anti-windup reset should make sure
that the integral component cannot exceed all limits. The anti-windup measure is
only implemented if the I component of the controller is not disabled. Anti-windup
limits are identical to those for the manipulated variable. The anti-windup measure
disregards the D component, to avoid the capping of the D component peaks
through the anti-windup measure.
The anti-windup reset measure corrects the I component in the form, which means:
90 33002543 05/2010
PID1
33002543 05/2010 91
PID1
Operating modes
Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the
control output Y. The control output is, however, limited by YMAX and YMIN. Internal
variables will be manipulated in such a manner that the controller changeover from
manual to automatic (with I component enabled) can be bumpless. The control limits
are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.
Halt mode
In halt mode the control output remains unchanged; the function block does not
influence the control output Y, i.e. Y = Y(old). Internal variables will be manipulated
in such a manner that the component sum corresponds to the control output, thus
allowing the controller to be driven smoothly from its current position (when the I
component is enabled). The control limits are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.
92 33002543 05/2010
PID1
NOTE: This type of display was selected purely for clarity of understanding. The
links represented by a dotted line can not be programmed as Links (link objects), as
they form unauthorized (in Unity Pro) loops. In programming, the links must be
established using variables.
The MOVE function is only executed when the PID controller is in automatic or halt
mode (MAN = 0). If only one changeover from automatic to manual takes place it is
bumpless, as the value of YMAN is equal to the value of Y in this cycle. In the manual
mode the value of YMAN can slowly be changed.
33002543 05/2010 93
PID1
NOTE: This type of display was selected purely for clarity of understanding. The
links represented by a dotted line can not be programmed as Links (link objects), as
they form unauthorized (in Unity Pro) loops. In programming, the links must be
established using variables.
The MOVE function is only executed when the PID controller is in automatic or halt
mode (MAN = 0). If only one changeover from automatic to manual takes place, it is
bumpless, as the value of YMAN (of the PID1) is equal to the value of Y (of the PID1)
in this cycle. The PID1 controller YMAN value, starting at your adjustment value
(RATE), are compared with the actual manual value (on LIMV) beginning with the
next cycle.
94 33002543 05/2010
PID1
Detailed formulas
Variable Meaning
Time differential between the present cycle and the previous cycle
Manipulated variable
The manipulated variable consists of various terms which are dependent on the
operating mode:
33002543 05/2010 95
PID1
96 33002543 05/2010
PID1
33002543 05/2010 97
PID1
98 33002543 05/2010
PID_P1
33002543 05/2010
33002543 05/2010 99
PID_P1
Description
Function description
The function block replicates a PID controller in parallel structure.
A system deviation ERR is formed by the difference between the setpoint SP and the
controlled variable PV. The deviation ERR causes the manipulated variable Y to
change.
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:
z PID controller in pure parallel structure
z Each component P, I and D can be individually enabled
z Limiting control limits in automatic mode
z Anti-windup measure with an active I component only
z Anti-windup reset
z Operating modes Manual, Halt, Automatic
z bumpless changeover between manual and automatic
z D component connectable to input variable PV or system deviation ERR
z D component with variable delay
Transfer function
The transfer function is:
Variable Description
YD D component
YI I component
YP P component
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PIDP1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
BIAS:=DisturbanceInput, D_ON_X:=D_PortionValueFlag,
REVERS:=OutputReversed, KP:=ProportionalRate,
KI:=IntegralRate, KD:=DifferentiationRate,
TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
YMIN:=LowerControlLimit, YMAN:=ManualValue,
Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
QMAX=>Y_Reached_YMAX, YMIN=>Y_Reached_YMIN)
Representation in ST
Representation:
PIDP1_Instance (MAN:=ManualMode, HALT:=HaltMode,
SP:=SetpointValueInput, PV:=ProcessVariable,
BIAS:=DisturbanceInput, D_ON_X:=D_PortionValueFlag,
REVERS:=OutputReversed, KP:=ProportionalRate,
KI:=IntegralRate, KD:=DifferentiationRate,
TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
YMIN:=LowerControlLimit, YMAN:=ManualValue,
Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
QMAX=>Y_Reached_YMAX, YMIN=>Y_Reached_YMIN) ;
Parameter description
Description of input parameters:
Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see CLC, page 604.
Structure diagram
The following is the structure diagram of the PIDP1 block:
Setting Parameters
The PIDP1 control structure is displayed in the Structure diagram.
Setting parameters for the PIDP1 controller takes place first of all for the pure PID
parameters, that is to say, the proportional action coefficient KP, the integral action
coefficient KI and rate of differentiation KD.
The P, I and D components can be individually disabled while the corresponding
input (KP, KI oder KD) is set to 0.
The D component is delayed by the time constant TD_LAG. The D component can
either be formed by the system deviation ERR (D_ON_X = 0) or the controlled variable
PV (D_ON_X = 1). Should the D component be determined by the controlled variable
PV, then the D component will not be able to cause jumps when reference variable
fluctuations (changes in input SP) take place. In principle, the D component only
affects disturbances and process variances.
For limiting the manipulated variable, the upper limit YMAX should be greater than
the lower limit YMIN.
Anti-Windup-Reset
If manipulated variable limiting takes place, the anti-windup reset should make sure
that the integral component cannot exceed all limits. The antiwindup measure is only
implemented if the I component of the controller is not disabled. Anti-windup limits
are identical to those for the manipulated variable. The anti-windup measure
disregards the D component, to avoid the capping of the D component peaks
through the anti-windup measure.
The anti-windup reset measure corrects the I component in the form, which means:
Controller type KP KI KD
P controller >0 =0 =0
PI controller >0 >0 =0
PD controller >0 =0 >0
PID controller >0 >0 >0
I controller =0 >0 =0
Operating modes
Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the
control output Y. The control output is, however, limited by YMAX and YMIN. Internal
variables will be manipulated in such a manner that the controller changeover from
manual to automatic (with I component enabled) can be bumpless. The control limits
are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.
Halt mode
In halt mode the control output remains unchanged; the function block does not
influence the control output Y, i.e. Y = Y(old). Internal variables will be manipulated
in such a manner that the component sum corresponds to the control output, thus
allowing the controller to be driven smoothly from its current position (when the I
component is enabled). The control limits are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.
Detailed formulas
Variable Description
Time differential between the present cycle and the previous cycle
Manipulated variable
The manipulated variable is composed of various terms:
System deviation
The system deviation will be determined as follows:
If... Then
REVERSE = 0 ERR = SP - PV
REVERSE = 1 ERR = PV - SP
SMOOTH_RATE: Differentiator
with smoothing
12
Introduction
This chapter describes the SMOOTH_RATE block.
Description
Function description
The function block is a differential element with a delayed output Y respecting the
delay time constant LAG.
The function block contains the following operating mode:
z Manual mode
z Halt
z Automatic
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouput may deliver a wrong value.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SMOOTH_RATE_Instance (MAN:=ManualMode,
HALT:=HaltMode, X:=InputVariable,
GAIN:=DifferentialGain, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue,
Y=>DifferentiatorOutputWithDelay)
Representation in ST
Representation:
SMOOTH_RATE_Instance (MAN:=ManualMode,
HALT:=HaltMode, X:=InputVariable,
GAIN:=DifferentialGain, LAG:=DelayTimeConstant,
YMAN:=ManualControlValue,
Y=>DifferentiatorOutputWithDelay) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see CLC, page 604.
Transfer function
The transfer function for Y is:
Output Y
The output Y is determined as follows:
Variable Meaning
dt is the time differential between the current cycle and the previous cycle
Value of the input X from the current cycle
Detailed description
Parametering
The parameter assignments of the function block are made by defining the GAIN,
the differentiator and the time constant LAG, by which the output Y is delayed.
For very short sampling times and a unit jump at the X input (input X jumps from 0
to 1.0), the output Y jumps to the GAIN value (in theory - in reality somewhat smaller,
due to the sampling time not being infinitely small), and then returns to 0 with the
delay time constant LAG.
Operating modes
The function block SMOOTH_RATE has 3 operating mode: Automatic, manual and
halt.
The operating mode are selected via the inputs MAN and HALT:
Example
The following illustration shows the jump response of the function block
SMOOTH_RATE when GAIN = 1 and LAG = 10 s:
Description
Function description
The function block replicates a three-point step controller, and exhibits a PD-like
behavior due to a dynamic feedback path.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block THREE_STEP_CON1 has the following properties:
z Reset and automatic operating modes
z One internal feedback path (delay 1st Order)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL THREE_STEP_CON1_Instance (R:=ResetMode,
SP:=SetPointInput, PV:=ProcessVariable,
GAIN:=ProportionalRate, TI:=ResetTime,
T_PROC:=NominalControllerTime, HYS:=Hysteresis,
DB:=Deadband, Y_POS=>PosControlVarAt_ERR_EFF,
Y_NEG=>NegControlVarAt_ERR_EFF,
ERR_EFF=>EffectiveError)
Representation in ST
Representation:
THREE_STEP_CON1_Instance (R:=ResetMode,
SP:=SetPointInput, PV:=ProcessVariable,
GAIN:=ProportionalRate, TI:=ResetTime,
T_PROC:=NominalControllerTime, HYS:=Hysteresis,
DB:=Deadband, Y_POS=>PosControlVarAt_ERR_EFF,
Y_NEG=>NegControlVarAt_ERR_EFF,
ERR_EFF=>EffectiveError) ;
Parameter description
Description of input parameters:
Runtime error
With HYS > 2 * DB an error message is returned.
NOTE: For a list of all block error codes and values, see CLC, page 604.
Warning
In the following cases a warning will be returned:
If... Then...
GAIN ≤0 the controller operates without feedback.
TI = 0 the controller operates without feedback.
T_PROC = 0 the controller operates with a predetermined value of T_PROC = 60 s.
NOTE: For a list of all block error codes and values, see CLC, page 604.
Detailed description
If... Then...
Y=1 Y_POS = 1
Y_NEG = 0
Y=0 Y_POS = 0
Y_NEG = 0
Y = -1 Y_POS = 0
Y_NEG = 1
Meaning of variable K:
Dead zone
The DB parameter fixes the operate point for the outputs Y_POS and Y_NEG. If the
effective switching value ERR_EFF = SP - PV - XR is positive and is greater than DB,
then the Y_POS output switches from "0" to "1". If the effective switch value ERR_EFF
is negative and is greater than DB, then the output Y_NEG will switch from "0" to "1".
The parameter DB is typically set to 1% of the maximum control range (max. (SP -
PV)).
NOTE: The amount is evaluated from the DB dead zone!
Hysteresis
The parameter HYS indicates the switching hysteresis, i.e. the value which the
effective switch value ERR_EFF outgoing from control point DB must be reduced by,
before the output Y_POS (Y_NEG) is reset to "0". The connection between Y_POS
and Y_NEG depending on the effective switch value ERR_EFF and the parameters
DB and HYS is illustrated in the image "Principle of the three-point controller,
page 122". The parameter HYS is typically set to 0.5 % of the maximum control
range (max. (SP - PV)).
NOTE: The amount is evaluated from the HYS hysterisis!
Operating modes
There are two operating modes that can be selected through the R parameter input:
Description
Function description
The function block forms a three-point controller, which maintains PID-similar
behavior through two dynamic feedback paths.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block THREEPOINT_CON1 contains the following properties:
z Operating modes Manual, Halt, Automatic
z Two internal feedback paths (delay 1st Order)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL THREEPOINT_CON1_Instance (MAN:=ManualMode,
HALT:=HaltMode,SP:=SetPointInput,
PV:=ProcessVariableInput, GAIN:=FeedbackGain,
LAG_NEG:=RapidFeedbackTimeConstant,
LAG_POS:=SlowFeedbackTimeConstant,
HYS:=HysteresisThreePositionSwitch, DB:=Deadband,
XF_MAN:=FeedbackResetFactor,
YMAN_POS:=ManualControlOutputForY_POS,
YMAN_NEG:=ManualControlOutputForY_NEG,
Y_POS=>PosManipulation, Y_NEG=>NegManipulation,
ERR_EFF=>EffectiveError)
Representation in ST
Representation:
THREEPOINT_CON1_Instance (MAN:=ManualMode,
HALT:=HaltMode,SP:=SetPointInput,
PV:=ProcessVariableInput, GAIN:=FeedbackGain,
LAG_NEG:=RapidFeedbackTimeConstant,
LAG_POS:=SlowFeedbackTimeConstant,
HYS:=HysteresisThreePositionSwitch, DB:=Deadband,
XF_MAN:=FeedbackResetFactor,
YMAN_POS:=ManualControlOutputForY_POS,
YMAN_NEG:=ManualControlOutputForY_NEG,
Y_POS=>PosManipulation, Y_NEG=>NegManipulation,
ERR_EFF=>EffectiveError) ;
Parameter description
Description of input parameters:
Runtime error
With HYS > 2 * DB an error message is returned.
NOTE: For a list of all block error codes and values, see CLC, page 604.
Warning
In the following cases a warning will be returned:
If... Then...
LAG_NEG = 0 and LAG_POS > 0 The controller works as if it had only a positive
feedback with time constant LAG_POS.
LAG_POS < LAG_NEG > 0 The controller works as if it had only a negative
feedback with time constant LAG_NEG.
XF_MAN < -100 or XF_MAN > 100 the controller operates without internal feedback
paths.
NOTE: For a list of all block error codes and values, see CLC, page 604.
Detailed description
If... Then...
Y=1 Y_POS = 1
Y_NEG = 0
Y=0 Y_POS = 0
Y_NEG = 0
Y = -1 Y_POS = 0
Y_NEG = 1
Dead zone
The DB parameter fixes the operate point for the outputs Y_POS and Y_NEG. If the
effective switch value ERR_EFF is positive and is greater than DB, then the output
Y_POS will switch from "0" to "1". If the effective switch value ERR_EFF is negative
and is greater than DB, then the output Y_NEG will switch from "0" to "1". The
parameter DB is typically set to 1% of the maximum control range (max. SP - PV).
NOTE: The amount is evaluated from the DB dead zone!
Hysteresis
The parameter HYS indicates the switching hysteresis, i.e. the value which the
effective switch value ERR_EFF outgoing from control point DB must be reduced by,
before the output Y_POS (Y_NEG) is reset to "0". The connection between Y_POS
and Y_NEG depending on the effective switch value ERR_EFF and the parameters
DB and HYS is illustrated in the image "Principle of the three-point controller,
page 131". The parameter HYS is typically set to 0.5% of the maximum control range
(max. SP - PV).
NOTE: The amount is evaluated from the HYS hysterisis!
Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:
Description
Function description
The function block forms a two-point controller, which maintains PID-similar
behavior through two dynamic feedback paths.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block TWOPOINT_CON1 has the following properties:
z Operating modes Manual, Halt, Automatic
z Two internal feedback paths (delay 1st Order)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL TWOPOINT_CON1_Instance (MAN:=ManualMode,
HALT:=HaltMode,SP:=SetPointInput, PV:=ProcessVariable,
K:=FeedbackGain, LAG_NEG:=RapidFeedbackTimeConstant,
LAG_POS:=SlowFeedbackTimeConstant,
DB:=HysteresisOfTwoPosSwitch,
XF_MAN:=FeedbackResetValue,
YMAN:=ManualValueForERR_EFF, Y=>OutputControlFlag,
ERR_EFF=>EffectiveError)
Representation in ST
Representation:
TWOPOINT_CON1_Instance (MAN:=ManualMode,
HALT:=HaltMode,SP:=SetPointInput, PV:=ProcessVariable,
K:=FeedbackGain, LAG_NEG:=RapidFeedbackTimeConstant,
LAG_POS:=SlowFeedbackTimeConstant,
DB:=HysteresisOfTwoPosSwitch,
XF_MAN:=FeedbackResetValue,
YMAN:=ManualValueForERR_EFF, Y=>OutputControlFlag,
ERR_EFF=>EffectiveError) ;
Parameter description
Description of input parameters:
Runtime error
With HYS > 2 * DB an error message is returned.
NOTE: For a list of all block error codes and values, see CLC, page 604.
Warning
In the following cases a warning will be returned:
If... Then...
LAG_NEG = 0 and LAG_POS > 0 The controller works as if it had only a positive
feedback with time constant LAG_POS.
LAG_POS < LAG_NEG > 0 The controller works as if it had only a negative
feedback with time constant LAG_NEG.
XF_MAN < 0 or XF_MAN > 100 the controller operates without internal feedback
paths.
NOTE: For a list of all block error codes and values, see CLC, page 604.
Detailed description
Hysteresis
The parameter DB indicates the switching-hysteresis, i.e. the value which the
effective switch value ERR_EFF outgoing from control point DB/2 must be reduced
by, before the output Y is reset to "0". The dependence of the output Y depending of
the effective switch value ERR_EFF and the Parameter DB, becomes clear in the
illustration "Principle of the two-point controller, page 138". The parameter DB is
typically set to 1% of the maximum control range [max. (SP - PV)].
Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:
Halt 0 1 The output Y is held at its last value. xf1 and xf2
are set to GAIN * Y.
CLC_PRO
III
Overview
This part describes the elementary functions and elementary function blocks in the
family CLC_PRO.
16
Introduction
This chapter describes the ALIM block.
Description
Function description
The function block produces an acceleration limiter of the 2nd order.
The function block individually contains the following properties:
z Operating modes Manual, Halt, Automatic
z Output limiting
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouput may deliver a wrong value.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL ALIM_Instance (X:=Input, MODE:=OperatingMode,
PARA:=Parameter, YMAN:=ManualManipulatedY, Y=Output)
Representation in ST
Representation:
ALIM_Instance (X:=Input, MODE:=OperatingMode,
PARA:=Parameter, YMAN:=ManualManipulatedY, Y:=Output) ;
Unit:
Runtime error
An error message is returned if
z an invalid floating point number lies at input YMAN or X,
z max_a or max_v ≤is 0.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Parametering
The parameters for the function block can be set by determining the maximum
velocity max_v and the maximum acceleration max_a. The maximum velocity
specifies how much output Y can change within one second. The maximum
acceleration specifies the maximum amount that output Y can change.
The value of Y follows the value of X, but is limited by the maximum permitted
velocity and acceleration.
Operating mode
There are three operating mode selectable through the man and halt parameter
inputs:
Example
In the diagram the dynamic behavior of the function block is displayed as well as the
reaction during HALT operating mode:
A jump on input X causes the function block to accelerate the increase of output Y.
Output Y is accelerated using the value set for parameter max_a. Should the velocity
reach the max_v value, acceleration stops, but output Y continues to follow input X
with the maximum velocity max_v (see the straight section in the middle of the
figure).
If the value of output Y is close enough to input signal value, the output is reversed
to brake at a negative speed increase of -max_a, so that the output does not come
to an abrupt stop, but slowly approximates the terminal point.
Description
Function description
The function block represents a complex PID controller that in its design specifically
includes cascade treatment. The control structure is displayed in theStructure
diagram, page 156.
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:
z real PID controller with independent gain, ti, td setting
z Manual, halt, automatic, cascade, reset, manual value operating modes tracking
z Velocity limit for manual operation
z Adjustable manual manipulated value tracking
z Velocity limit for reference variable
z bumpless changeover between manual and automatic
z Manipulated variable limiting
z bumpless, individually connectable P, I and D components
z bumpless gain modification
z Choice of anti-windup reset and anti-windup halt
z Displacement of anti-windup limits compared to control limits
z Anti-windup measure with an active I component only
z definable delay of the D component
z D component connectable to controlled variable PV or system deviation ERR
z Dead zone with gain reduction
z external operating point (in P, PD and D operation)
z Choice of bump/bumpless manual/automatic switchover
Transfer function
The transfer function is:
Variable Description
YD D component (only when en_d = 1)
YI I component (only when en_i= 1)
YP P component (only when en_p= 1)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL COMP_PID_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable,
SP_CAS:=CascadeReferenceVariable, MODE:=OperatingModes,
PARA:=Parameters, YMAN:=ManuallyManipulatedValue,
YRESET:=Y_ResetValue, FEED_FWD:=DisturbanceInput,
OFF:=OffsetFor_P_PD_Operation, Y:=ManipulatedVariable,
SP_CAS_N:=CascadeReferenceVariable,
YMAN_N:=ManuallyManipulatedValue,
OFF_N:=OffsetFor_P_PD_Operation, ERR=>SystemDeviation,
STATUS=>OutputStatus)
Representation in ST
Representation:
COMP_PID_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable,
SP_CAS:=CascadeReferenceVariable, MODE:=OperatingModes,
PARA:=Parameters, YMAN:=ManuallyManipulatedValue,
YRESET:=Y_ResetValue, FEED_FWD:=DisturbanceInput,
OFF:=OffsetFor_P_PD_Operation, Y:=ManipulatedVariable,
OFF_N:=OffsetFor_P_PD_Operation, ERR=>SystemDeviation,
STATUS=>OutputStatus) ;
Runtime error
An error message is returned if
z an unauthorized floating point number is placed at the input PV
z gain_red > 1 or gain_red < is 0
z db < is 0
z ymax < is ymin
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Structure diagram
The following is the structure diagram of the COMP_PID controller:
Setting Parameters
The COMP_PID control structure is displayed in the Structure diagram, page 156.
Setting function block parameters is initially performed by the pure PID parameters,
i.e. the proportional action coefficient gain, the reset time ti and the derivative time
td.
The D component is delayed by the time td_lag. The td/td_lag ratio is termed
the differential gain, and is generally selected between 3 and 10. The D component
can either be based upon the system deviation ERR (d_on_pv = "0") or the
controlled variable PV (d_on_pv = "1"). Should the D component be determined by
the controlled variable PV, then the D component will not be able to cause jumps
when reference variable fluctuations (changes in input SP) take place. Generally, the
D component only affects disturbances and process variances.
NOTE: The EFB has 3 I/O parameters (SP_CAS, OFF, YMAN) that are updated by
the function itself in cascade mode. To use the block in cascade mode, you have to
establish the connection between these inputs and the appropriate outputs
(SP_CAS_N, OFF_N, YMAN_N) through variables.
The system deviation in automatic mode is formed by sp_intern and PV, whereby
sp_intern is set to the value of parameter SP via a velocity limiter. The internal
reference variable sp_intern is driven in ramp-type fashion toward the SP
parameter value using the velocity specified in parameter rate_sp (unit 1/s).
The amount will be evaluated for parameter rate_sp. The function of the velocity
limiter for SP is disabled if rate_sp = 0. SP is transferred directly to sp_intern.
System deviation is determined by the condition of parameter cascade when in
reset, manual and halt modes.
If cascade = 1, sp_intern is set to the PV parameter value and ERR goes to 0.
If cascade = 0 and the setting is bumpless operation (bump = 0), sp_intern is set
to the SP parameter value. Otherwise (bump = 1), sp_intern is also set to the PV
parameter value.
1 Gradient 1
2 Gradient gain_red
For limiting the manipulated variable, the upper limit ymax should be greater than
the lower limit ymin.
Definition
The anti-windup measure ensures that the Integral component does not grow too
much causing the controller to lock if it has been limited at a control limit too long.
Anti-windup measures are only performed for an active I component of the
controller.
Limits for the anti-windup measure are by default the manipulated variables of the
controller (delt_aw = 0). The parameter delt_aw can be used to either increase
(delt_aw > 0) or decrease (delt_aw < 0) the limits with regard to the control limits
(ymax, ymin).
Therefore, the limits used for the anti-windup measure are:
z AWMAX = ymax + delt_aw
z AWMIN = ymin - delt_aw.
Through displacement of the anti windup limits in relation to the control limits (in
particular with very noisy signals), the manipulated variable Y can be stopped from
repeatedly 'jumping away' from the control limit (D component effect to
disturbances) and subsequently returning to the limiting position (I component effect
with system deviation ERR ≠ 0). If the control limits are to be simultaneously effective
for the anti-windup measure, select the parameter delt_aw = 0.
By utilizing negative delt_aw values, anti-windup limits can be kept smaller than
control limits (useful for anti-windup halt).
Controller types
There are four different control types, which are selected via the parameters en_p,
en_i and en_d.
If... Then...
en_i = 1 Y = YP + YI + YD + FEED_FWD
en_i = 0 Y = YP + OFF + YD + FEED_FWD
In this example, the OFF parameter is set to the new_off variable value via a
velocity limiter VLIM in ramp form using the velocity provided in pvlim.rate.
Operating mode
There are five operating modes selectable through r, man, halt, and cascade.
Manual mode
In manual mode, the manual manipulated value YMAN is transferred to the
manipulated variable Y with a velocity limiter. The manipulated variable Y is set to
the YMAN parameter value in ramp form using the velocity (unit 1/s) rate set in the
parameter rate_man.
The amount will be evaluated for parameter rate_man. The function of the velocity
limiter for YMAN is disabled if rate_man = 0. YMAN is transferred directly to the
manipulated variable. The manipulated variable is limited by ymax and ymin.
Internal variables will be manipulated in such a manner that the controller
changeover from manual to automatic (with I component enabled) can be bumpless.
The Anti-windup measure is designed just like in automatic mode.
In this operating mode the D component is automatically set to 0.
Reset mode
In Reset mode, the reset value YRESET is transferred directly to the manipulated
variable Y. The manipulated variable is limited by ymax and ymin. Internal variables
will be manipulated in such a manner that the controller changeover from manual to
automatic (with I component enabled) can be bumpless. The Anti-windup measure
is performed just like in automatic mode.
Halt mode
In halt mode, the control output remains as is, i.e. the function block does not change
the manipulated variable Y. Internal variables will be manipulated in such a manner
that the controller can be driven smoothly from it's current position. Manipulated
variable limits and Anti-windup measures are as those in automatic mode. Halt
mode is also useful in allowing an external operator device to adjust control output
Y, whereby the controller's internal components are given the chance to
continuously react to the external influence.
In this operating mode the D component is automatically set to 0.
Detailed formulas
Variable Meaning
Time differential between the present cycle and the previous cycle
Manipulated variable
The manipulated variable consists of various terms which are dependent on the
operating mode:
18
Introduction
This chapter describes the DEADTIME block.
Description
Function description
With this function block an input signal is delayed by a time, the so-called deadtime.
The function block delays the signal X by the deadtime T_DELAY before it appears
again at Y.
The function block utilizes a 128 element delay buffer to hold a sequence of X
values, i.e. during the T_DELAY time 128 discrete X values are detained. The buffer
is used in such a way that it corresponds with the operating mode.
Whether the system is started cold or warm, the value of Y remains unchanged. The
internal values are set to the value of X.
After a change of deadtime T_DELAY or a cold or warm system start, the output
READY goes to "0". This means: that the buffer is empty and not ready.
The function block has the following operating mode:
z Manual mode
z Halt
z Automatic.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Formula
The transfer function is:
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL DEADTIME_Instance (X:=InputValue, MODE:=OperatingModes,
T_DELAY:=DeadTime, YMAN:=ManualManipulatedValue,
Y=>Output, READY=>InternalBufferFlag)
Representation in ST
Representation:
DEADTIME_Instance (X:=InputValue, MODE:=OperatingModes,
T_DELAY:=DeadTime, YMAN:=ManualManipulatedValue,
Y=>Output, READY=>InternalBufferFlag) ;
Runtime error
An error message is returned when an invalid floating point number lies at input
YMAN or X.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Operating mode
If... Then...
the current X value is transferred to the buffer, and the oldest
X value in the buffer is placed on the output Y. If the scan time
Scan time > is more than T_DELAY / 128, resolution is less than 128
causing a systematic error, i.e. some X values are double-
stored (see the following Example).
not all X values can be stored in the buffer. In this case the X
value is not saved in some cycles. After completion of
Scan time < T_DELAY, output Y may correspondingly remain unchanged
in two (or more) consecutive cycles.
Manual mode
In manual mode the manual value YMAN is consistently transferred to the control
output Y. The internal buffer is charged with the manual value YMAN. The buffer is
marked as charged (READY =1).
Halt mode
The output Y is held at the last calculated value in Halt mode. The output will no
longer be changed, but can be overwritten by the user. The internal buffer still
continues to operate as in automatic mode.
Example
The following diagram shows an example for behavior of the function block. Input X
follows a ramp function from one value to a new value. Delayed by the deadtime
T_DELAY, X values appear at Y.
Function block diagram DEADTIME
Description
Function description
The function block is a differential element with a delayed output Y respecting the
delay time constant lag.
The function block contains the following operating mode: Manual, halt and
automatic mode.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouput may deliver a wrong value.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL DERIV_Instance (X:=InputVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=DifferentiatorOutput)
Representation in ST
Representation:
DERIV_Instance (X:=InputVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=DifferentiatorOutput) ;
Runtime error
An error message is returned when an invalid floating point number lies at input
YMAN or X.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Formulas
Transfer function
The transfer function for Y is:
Variable Meaning
the input X value for the current cycle
is the time differential between the current cycle and the previous cycle
Detailed description
Parametering
The parameter assignments of the function block are effected by the determination
of gain, the differentiator and the time constant lag, by which the output Y is
delayed.
For very short sampling times and an input X unit step (input X jumps from 0 to 1.0),
the output Y jumps to the value gain (in theory - in reality somewhat smaller, due to
the sampling time not being infinitely small), and then returns to 0 with the delay time
constant lag.
Operating mode
There are three operating mode selectable through the man and halt parameter
inputs:
Example DERIV
The following example shows the step response of the DERIV function block.
Jump response with gain = 1 and lag = 10 s
20
Introduction
This chapter describes the FGEN block.
Description
Function description
The function block FGEN represents a function generator. It generates a signal form
at the Y output which is defined in the data structure Para_FGEN. The function block
can be cascaded, i.e. if several of these EFBs are used, various signal forms can be
created and laid over one another.
The following 8 different signal forms can be generated:
z Jump function
z Ramp function
z Delta function
z Saw-tooth function
z Square wave function
z Trapezoid function
z Sine function
z Random Number
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL FGEN_Instance (R:=ResetFlag, START:=StartFlag,
PARA:=Parameter, YOFF:=Output_Y_Offset,
Y=>FunctionGeneratorOutput,
ACTIVE=>FunctionGeneratorActiv, N=>NumberOfPeriods)
Representation in ST
Representation:
FGEN_Instance (R:=ResetFlag, START:=StartFlag,
PARA:=Parameter, YOFF:=Output_Y_Offset,
Y=>FunctionGeneratorOutput,
ACTIVE=>FunctionGeneratorActiv, N=>NumberOfPeriods) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 606.
Parametering
Reset
Parameter R stands for RESET. If this parameter is set (R = 1), all running functions
will be immediately terminated and output Y goes to the value of parameter YOFF
(offset). Simultaneously the cycle counter N is also reset to 0 and ACTIVE returns to
"0".
Offset
Waveforms produced by the function generator have an amplitude with the value of
parameter amplitude, i.e. values range from -amplitude to amplitude for
bipolar operation (unipolar = "0") resp. from 0 to amplitude in unipolar operation
(unipolar = "1"). Waveform values can be shifted away from the zero reference
point through the parameter YOFF.
NOTE: Should the output of another function generator be applied to parameter
YOFF, the waveforms produced by both function generators are overlaid.
Function selection
Selection
There are a total of 8 functions which can be produced by the function generator.
Function selection is made through func_no. At a function change the last selected
running function still proceeds to completion.
The following function numbers are allowed:
func_no Function
1 Jump
2 Ramp
3 Saw-tooth
4 Delta
5 Square
6 Trapezoid
7 Sine
8 Random Number
Function definition
Definition
The function is defined completely in the data structure Para_FGEN. First of all the
waveform must be determined (refer to Function selection, page 194).
Trapezoid (Delta, Saw-tooth, Square) unipolar/bipolar is selected as the basic type
for the definition.
"Smoothing" a function
If a function in ramp form is to rise or decline, the transitions are first of all always
made in a sharp crease. The gradient is not constant in this case. "Smoothing" is
used to achieve a soft rise and descent, i.e. the ramp turns into an S-curve.
"Smoothing" a function
This is then divided into three sections. Section I "accelerates" directly from 0.
Section II is traversed with the velocity attained at the end of section I. In section III,
the acceleration from section I is used to brake, and thus approach the terminal point
softly. The size of the section is user-definable. They are defined by specifying
t_acc and t_rise.
The acceleration involved is calculated by the following formulas:
with
and
NOTE: Smoothing is used only by the functions "Ramp", "Saw-Tooth", "Delta" and
"trapezoid". "Jump", "Square" and "Sine" are not "smoothable" functions.
Function diagrams can be found in the section Diagrams of the individual functions,
page 199
Unipolar operation
The unipolar parameter defines whether the selected function should be output
as a unipolar or bipolar function. Particular attention should be paid to the fact that
in unipolar operation a cycle is still characterized by 2 "unipolar" half waves.
Altering a function
If the parameter func_no is changed during a currently executing cycle, it will also
not take effect until the cycle has completed with the previously selected function.
The new function is then started. This resets the cycle counter N, which indicates the
period number, to 0.
Jump function
Representation of the Jump function
Ramp function
Representation of the Ramp function
Saw-tooth function
Representation of the Saw-tooth function
Delta function
Representation of the Delta function
Trapezoid function
Representation of the Trapezoid function
Sine function
Representation of the Sine function
Special cases
Jump function
On the "Jump" function the output goes to
the value Y = YOFF if START = 0
and
the value Y = YOFF + amplitude if START = 1
set
The time specifications (t_off, t_rise, t_acc) do not play a role in this
function.
Output N is incremented for every new 0 →1 transition of input START.
This function only runs in unipolar operation. For this reason, the parameter
unipolar must be set to 1 non-explicitly.
Ramp function
In the "Ramp" function output Y ramps upward from value YOFF to YOFF +
amplitude. While START is unchanged at 1, output Y remains at the value YOFF +
amplitude. Output Y jumps back to value YOFF if START be taken back to 0.
Run up is determined by the times t_rise and t_acc. The time needed for run up
from Y = YOFF to Y = YOFF + amplitude is specified by t_rise. "Smoothing" can
be influenced by t_acc.
Output N is incremented for every new 0 →1 transition of input START.
This function only runs in unipolar operation. For this reason, the parameter
unipolar must be set to 1 non-explicitly.
Random Number
In the "Random number" function output Y is set to a number resulting "by chance"
between
YOFF ≤Y ≤YOFF + amplitude, in unipolar operation
and
YOFF - amplitude ≤Y ≤YOFF + amplitude , in bipolar operation
.
The time specifications (t_off, t_rise, t_acc) do not play a role in this
function.
Output N is incremented for every new 0 →1 transition of input START.
Timing diagrams
Bipolar operation
The following parameter specifications represent the various functions in bipolar
operation:
Parameter Specification
amplitude 1
halfperiod 10
t_off 2
t_rise 2
t_acc 0
unipolar 0
Bipolar operation
Unipolar operation
The following parameter specifications represent the various functions in unipolar
operation:
Parameter Specification
amplitude 1
halfperiod 10
t_off 2
t_rise 2
t_acc 0
unipolar 1
Unipolar operation
Trapezoid function
The following parameter specification represents the trapezoid function:
Parameter Specification
amplitude 1
halfperiod 10
t_off 1
t_rise 4
t_acc 1.5
Trapezoid function
21
Introduction
This chapter describes the INTEG block.
Description
Function description
The function block replicates a limited integrator.
The function block has the following properties:
z Operating modes Manual, Halt, Automatic
z Manipulated variable limiting in automatic mode
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Formula
The transfer function is:
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL INTEG_Instance (X:=InputVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=Output, STATUS=>Output_Y_Status)
Representation in ST
Representation:
INTEG_Instance (X:=InputVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=Output, STATUS=>Output_Y_Status) ;
Runtime error
An error message is returned if
z an invalid floating point number lies at input YMAN or X
z ymax < is ymin
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Parametering
The parameter assignments of the function block are satisfied by the determination
of the integral gain and the limiting values ymax and ymin for output Y.
The values ymax and ymin limit the output within the prescribed range. Therefore
ymin ≤Y ≤ymax
If the threshold value is reached or the output signal is limited this will be indicated
by qmax and qmin.
z qmax = 1 if Y ≥ ymax
z qmin = 1 if Y ≤ymin
Operating mode
There are three operating mode selectable through the man and halt parameter
inputs:
Example
The input signal is integrated via the time. If there is a jump on input X the output
increases (for positive X values) or decreases (for negative X values) according to a
ramp function. Y is always between ymax and ymin; if Y is equal to ymax or ymin,
this is shown accordingly in qmax or qmin.
22
Introduction
This chapter describes the LAG block.
Description
Function description
The function block represents a delay element 1st Order (low pass)
The function block contains the following operating modes:
z Manual mode
z Halt
z Automatic
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouput may deliver a wrong value.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Formula
The transfer function is:
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LAG_Instance (X:=InputValue, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=Output)
Representation in ST
Representation:
LAG_Instance (X:=InputValue, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedValue,
Y:=Output) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Parametering
Setting parameters for the function block is achieved through specification of the
factor gain as well as setting parameters for the delayed time constant lag.
The unit jump at input X (jump at input X from 0 to 1.0) follows output Y with a delay.
Along an e-function
Operating mode
There are three operating mode selectable through the man and halt parameter
inputs:
Example
The diagram shows an example of the jump response of the function block. Input X
jumps to a new value and output Y follows an e-function for input X.
Jump response for function block LAG if gain = 1
23
Introduction
This chapter describes the LAG2 block.
Description
Function description
The function block LAG2 represents a delay element 2nd order.
The function block contains the following operating mode:
z Manual mode
z Halt
z Automatic
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouput may deliver a wrong value.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Formula
The transfer function is:
where
and
Variable Description
Value of the output Y from the previous cycle
dt is the time differential between the current cycle and the previous cycle
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LAG2_Instance (X:=Input, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulated_Y_Value,
Y:=Output)
Representation in ST
Representation:
LAG2_Instance (X:=Input, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulated_Y_Value,
Y:=Output) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Parametering
The parameter assignments of the function block are satisfied by the determination
of the factor gain, and the values for dampening dmp, and natural frequency freq.
Dampening dmp and natural frequency freq must have positive values.
Output Y follows input X jumps in a dampened oscillation. The period of
undampened oscillation is T = 1/freq. For dampening values dmp < 1 reference is
made to a dampened oscillation. For dampening values ≥ 1 reference is made to
non-resonant behavior (i.e. without oscillation); in this case the output follows the
input in the same way as with 2 LAG function blocks, which are switched in series.
Operating modes
There are three operating mode selectable through the man and halt parameter
inputs:
Timing diagrams
Overview
The following diagrams show examples of the LAG2 device’s jump response with
varying parameters.
Dampening dmp = 1
For a dampening of dmp = 1 the output Y follows input X with a non-periodic action.
Description
Function description
The function block implements a PD element with following low-pass filter.
The function block has the following properties:
z Definable delay of the D-component
z Operating modes Manual, Halt, Automatic
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouput may deliver a wrong value.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Formula
The transfer function is:
Variable Description
Value of input X from the previous cycle
dt is the time differential between the current cycle and the previous cycle
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LEAD_LAG_Instance (X:=Input, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualControlValue, Y:=Output)
Representation in ST
Representation:
LEAD_LAG_Instance (X:=Input, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualControlValue, Y:=Output) ;
Runtime error
An error message is returned when an invalid floating point number lies at input
YMAN or X.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Parametering
The parameter assignments of the function block are satisfied by the determination
of the factor gain, and the values the derivative time constant lead and delayed
time constant lag.
For very small sample times and the unit jump at input X (jump at input X from 0 to
Operating modes
There are three operating mode selectable through the man and halt parameter
inputs:
Example overview
The following examples are presented in the following diagrams:
z lead = lag
z lead=lag * 0.5, gain = 1
z lead/lag = 2, gain = 1
lead = lag
The function blocks behave like a pure multiplication block with the multiplier gain.
Function block LEAD_LAG with lead = lag
lead/lag = 2, gain = 1
The output Y jumps in this case to twice the end value in order to run into the end
value with the delayed time constant lag (gain * X).
Function block LEAD_LAG with lead/lag = 2 and gain = 1
25
Introduction
This chapter describes the PCON2 block.
Description
Function description
The function block forms a two-point controller, which maintains PID-similar
behavior through two dynamic feedback paths.
EN and ENO can be configured as additional parameters.
Properties
The function block has the following properties:
z Operating modes Manual, Halt, Automatic
z Two internal feedback paths (delay 1st Order)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PCON2_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulated_ERR_EFF,
Y=>ManipulatedOutput, ERR_EFF=>EffectiveError)
Representation in ST
Representation:
PCON2_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulated_ERR_EFF,
Y=>ManipulatedOutput, ERR_EFF=>EffectiveError) ;
Runtime error
In the following cases a warning is given:
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Feedback
The feedback parameter set, made up of the feedback gain and the feedback time
constants lag_neg and lag_pos, allows universal usage of the two point
controller.
The following table provides more exact information about it:
Hysteresis
The parameter hys indicates the switching hysteresis, i.e. the value that the
effective switch value ERR_EFF outgoing from control point hys/2 must be reduced
by, before the output Y is reset to"0". The dependence of the output Y depending of
the effective switch value ERR_EFF and the Parameter hys, becomes clear in the
picture Principle of the two-point controller, page 241. The value of the hys
parameter is typically set to 1% of the maximum control area [max. (SP - PV].
Operating modes
There are three operating mode selectable through the man and halt parameter
inputs:
26
Introduction
This chapter describes the PCON3 block.
Description
Function description
The function block forms a three-point controller, which maintains PID-similar
behavior through two dynamic feedback paths.
EN and ENO can be configured as additional parameters.
Properties
The function block PCON3 contains the following properties:
z Operating modes Manual, Halt, Automatic
z Two internal feedback paths (delay 1st Order)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PCON3_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN_POS:=ManManipulated_Y_POS,
YMAN_NEG:=ManManipulated_Y_NEG,
Y_POS=>PosManipulated_ERR_EFF,
Y_NEG=>NegManipulated_ERR_EFF,
ERR_EFF=>EffectiveError)
Representation in ST
Representation:
PCON3_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN_POS:=ManManipulated_Y_POS,
YMAN_NEG:=ManManipulated_Y_NEG,
Y_POS=>PosManipulated_ERR_EFF,
Y_NEG=>NegManipulated_ERR_EFF,
ERR_EFF=>EffectiveError) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Hence:
If... Then...
Y=1 Y_POS = 1
Y_NEG = 0
Y=0 Y_POS = 0
Y_NEG = 0
Y = -1 Y_POS = 0
Y_NEG = 1
Feedback
The function block has a parameter sequence for the internal feedback paths,
comprised of the feedback gain and the reset time constant lag_neg and
lag_pos.
The following table provides more exact information about it:
Dead zone
The parameter db sets the connection point for the outputs Y_POS and Y_NEG. If the
effective switch value ERR_EFF is positive and is greater than db, then the output
Y_POS will switch from "0" to "1". If the effective switch value ERR_EFF is negative
and is smaller than db, then the output Y_NEG will switch from "0" to "1". The value
of the db parameter is typically set to 1% of the maximum control area (max. SP -
PV).
Hysteresis
The parameter hys indicates the switching hysteresis, i.e. the value which the
effective switch value ERR_EFF outgoing from control point db must be reduced,
before the output Y_POS (Y_NEG) is reset to "0". The connection between Y_POS
and Y_NEG depending on effective switch value ERR_EFF and the parameters db
and hys is illustrated in the image Principle of the three-point controller, page 248.
The value of the hys parameter is typically set to 0.5% of the maximum control area
(max. SP - PV).
Operating modes
There are three operating mode selectable through the man and halt parameter
inputs:
Runtime error
Error message
If hys > 2 * db, an error message appears.
Warning
In the following cases a warning is given:
Description
Function description
The function block PD_OR_PI can work equally well as either PD controller or PI
controller. Depending on the system deviation (SP - PV) and a specified switch
value, trig_err will automatically perform a structural changeover from PD- to PI-
Controller and vice-versa from PI- to PD-Controller.
This EFB is particularly suitable for starting control purposes. When the process is
started, the controller reacts as a P(D) controller, whereby the controlled variable is
to reach the adjusted reference variable value as fast as possible. Shortly before the
given setpoint value is reached, the control algorithm is switched over and an I
component makes sure that the remaining control deviation fades out.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block has the following properties:
z PI controller with independent gain, ti adjustment
z PD controller with independent gain, ti adjustment
z Manipulated variable limiting in automatic mode
z Anti-windup reset in PI operation
z definable delay of the D component
z Operating modes Manual, Halt, Automatic
z bumpless changeover between manual and automatic
z Automatic bumpless changeover from PD to PI operation and back
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PD_OR_PI_Instance (SP:=SetpointInput,
PV:=ProcessVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualManipulatedVariable,
FEED_FWD:=Disturbance, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y)
Representation in ST
Representation:
PD_OR_PI_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulatedVariable,
FEED_FWD:=Disturbance, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y) ;
Runtime error
An error message is returned if
z an unauthorized floating point number is placed at the input PV
z ymax < is ymin
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Structure diagram
The following is the structure diagram of the PD_OR_PI block:
Detailed description
Each controller type is linked to a parameter set, which must be configured as well.
The control algorithm changeover is practically a switch from one parameter set to
the other. The changeover is bumpless.
PD controller
PD controller parameter settings are accomplished by configuration of the
proportional action coefficient gain_d and rate time td.
For PD controller operation the D component is delayed by the time constant value
td_lag. The td/td_lag ratio is termed the differential gain, and is generally
selected between 3 and 10. The D component directly determined by the system
deviation ERR, such that for reference variable fluctuations (variations at input SP) a
jump attributed to the D component is produced.
The D component can be disabled by setting td = 0.
PI controller
PI controller parameter settings are accomplished by configuration of the
proportional action coefficient gain_i and reset time ti.
In general during the start-up procedure with the PD algorithm, the proportional
action coefficient is set considerably higher than in the practically stationary
operation with the PI algorithm. This circumstance is conceded to by the designation
of two independent proportional action coefficients.
The I component can be disabled by setting ti = 0.
For limiting the manipulated variable, the upper limit ymax should be greater than
the lower limit ymin.
Anti-windup reset
Should limiting of the manipulated variable take place while the PI control algorithm
is active, the anti-windup reset should ensure that the I component "cannot go
berserk". Anti-windup measures are taken only for I component values other than 0.
Anti-windup limits are identical to those for the manipulated variable.
The anti-windup reset measure corrects the I component such that:
z YI ≥ ymin - gain_i * (SP - PV) - FEED_FWD
z YI ≤ymax - gain_i * (SP - PV) - FEED_FWD
Operating modes
There are three operating mode selectable through the man and halt parameter
inputs:
Detailed formulas
Variable Meaning
Present sample time
System deviation
YI I component
Value of the I component from the previous sampling step
YP P component
System deviation
The system deviation will be determined as follows:
Manipulated variable
The manipulated variable consists of various terms which are dependent on the
operating mode:
28
Introduction
This chapter describes the PDM block.
Description
Function description
The function block PDM converts analog values into digital output signals.
In the function block PDM, a 1 signal of constant duration is output within a variable
cycle time which depends on the analog value X. The adjusted average energy
corresponds to the quotient of the fixed duty cycle t_on and the variable cycle time
period.
In order that the adjusted average energy also corresponds to the analog input
variable IN, the following must apply:
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Formula
For correct operation when setting parameters the following rules should be
observed:
and
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PDM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameter, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput)
Representation in ST
Representation:
PDM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameter, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput) ;
Runtime error
An error message is returned if
z |up_x| ≤|lo_x|
z t_max ≤t_min
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Period
This delay, together with the pulse, pause and brake times, all makeup a period
, which depending on lo_x and t_min, is calculated according to the following
formulas:
lo_x = 0
t_min > 0
lo_x = 0
t_min = 0
NOTE: From the parameters up_x (-pos/-neg) and lo_x (-pos/-neg) only the
(absolute) value is evaluated.
Cycle time
The parameter t_min - for every output there is a separate value - gives the
minimum period, i.e. the time span, which passes from the beginning of one
actuating pulse until the start of the next. This time span appears when input X goes
beyond value up_x - this time there is a separate value for each sign.
The parameter t_max places an upper limit on the maximum period. Should the
input cross below the value pos_lo_x or neg_lo_x, the actuating pulse output is
terminated until the until the input exceeds the value pos_lo_x or neg_lo_x again.
The values pos_lo_x and neg_lo_x define what is in principle a dead zone, in
which the function block outputs are not activated.
The parameters (pos_t_min, pos_up_x) and (pos_t_max, pos_lo_x) are
valid for positive input signals X. The output Y_POS is set. The parameters
Parameter (neg_t_min, neg_up_x) and (neg_t_max, neg_lo_x) are valid for
negative input signals X. The output Y_NEG is set.
Time-span dependency
The time-span dependency from the input variable X, in which the output Y_POS
(Y_NEG) carries 1 signal, is displayed in the picture "Output dependency on X,
page 271" and the picture "Output dependency on X (Special case), page 271".
Output dependency on X
In the following picture the dependency of the output on X is shown:
Operating modes
In reset mode R = "1", outputs Y_POS and Y_NEG are set to 0 signal. The internal
time meters are also standardized, so that the function block begins the transfer to
R=0 with the output of a new 1 signal on the associated output.
Boundary conditions
If the PDM function block is operated together with a PID controller, then the
maximum period t_max should be selected so that it corresponds to the PID
controller's scan time. It is then guaranteed that every new actuating signal from the
PID controller within the period time can be fully processed.
The PDM scan time t_scan should be in proportion with the period vs. pulse time.
Though this, the smallest possible actuating pulse is be determined.
The following ratio is recommended:
PI: PI controller
29
Introduction
This chapter describes the PI block.
Description
Function description
The function block represents a simple PI controller.
A system deviation ERR is formed by the difference between the reference variable
SP and the controlled variable PV. This deviation ERR causes the manipulated
variable Y to change.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block has the following properties:
z Operating modes Manual, Halt, Automatic
z bumpless changeover between manual and automatic
z Manipulated variable limiting
z Anti-windup reset (only for an active I component)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PI_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulatedVariable, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y)
Representation in ST
Representation:
PI_Instance (SP:=SetpointInput, PV:=ProcessVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualManipulatedVariable, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y) ;
PI parameter description
Description of input parameters:
Runtime error
An error message is returned if
z an invalid floating point number lies at input YMAN or X,
z ymax < ymin.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Formulas
Transfer function
The transfer function is:
Calculation formulas
The calculation formulas are:
Output signal Y
The output signal Y is then:
Variable Meaning
Present sample time
YI I component
YP P component
Parametering
Structure diagram
The following is the structure diagram of the PI controller:
Parametering
The PI control structure is displayed in theStructure diagram, page 279. Setting
parameters for the function block takes place first of all for the elemental PI
parameters: the proportional action coefficient gain and reset time ti.
The I component can be disabled by setting ti = 0.
The values ymax and ymin limit the output within the prescribed range. Therefore
ymin ≤Y ≤ymax.
The outputs qmax and qmin signal that the output has reached a limit, and thus
been capped.
z qmax = 1 if Y ≥ ymax
z qmin = 1 if Y ≤ymin
Anti-windup reset
Should limiting of the manipulated variable take place, the antiwindup reset should
ensure that the integral component "cannot go berserk". The antiwindup measure is
only implemented if the I component of the controller is not disabled. Anti-windup
limits are identical to those for the manipulated variable. The anti-windup-reset
measure corrects the I component such that: ymin - YP ≤YI ≤ymax - YP
Operating modes
Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the
control output Y. However, the manipulated variable is limited by ymax and ymin.
Internal variables will be manipulated in such a manner that the controller
changeover from manual to automatic (with I component enabled) can be bumpless.
The control limits are also limits for the Anti-windup reset
Halt mode
In halt mode the control output remains unchanged; the function block does not
influence the control output Y, i.e. Y = Y(old). Internal variables will be manipulated
in such a manner that the component sum corresponds with the manipulated
variable, thus allowing the controller to be driven smoothly from its current position.
The control limits are also limits for the Anti-windup reset. Halt mode is also useful
in allowing an external operator device to adjust control output Y, whereby the
controller's internal components are given the chance to continuously react to the
external influence.
Example of a PI controller
Example
The jump response of the PI controller is shown in the following Diagram
(see page 282) as an example.
In the first part of the figure the function block response to MAN operating mode can
be seen: The output Y jumps to the YMAN value.
The second part of the diagram shows the reaction of the function block in automatic
mode (MAN = 0 and HALT= 0) both with a positive ERR system deviation and with a
negative ERR system deviation. For constant positive system deviation, Y ramps
upward until the upper output limit is reached.
Y is then limited to the value ymax. Limiting is signaled by qmax. The system
deviation then jumps to a negative value whose absolute value is greater than the
previous positive value.
30
Introduction
This chapter describes the PID block.
Description
Function description
The function block produces a PID controller.
A system deviation ERR is formed because of the reference variable SP and the
controlled variable PV. This deviation ERR causes the manipulated variable Y to
change.
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:
z real PID controller with independent gain, ti, td setting
z Operating modes Manual, Halt, Automatic
z bumpless changeover between manual and automatic
z Manipulated variable limiting in automatic mode
z Separately enabled P, I and D component
z Anti-Windup-Reset
z Anti-windup measures taken only for an active I component
z definable delay of the D component
z D component connectable to controlled variable PV or system deviation ERR
Transfer function
The transfer function is:
Variable Description
YD D component (only when en_d = 1)
YI I component (only when en_i= 1)
YP P component (only when en_p= 1)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PID_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, MODE:=OperatingModes,
PARA:=Parameter, FEED_FWD:=Disturbance,
YMAN:=ManualManipulatedValue, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y)
Representation in ST
Representation:
PID_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, MODE:=OperatingModes,
PARA:=Parameter, FEED_FWD:=Disturbance,
YMAN:=ManualManipulatedValue, Y:=ManipulatedVariable,
ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y) ;
Error message
An error message is returned if
z an invalid floating point number lies at input YMAN or PV
z ymax < ymin
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Structure diagram
The following is the structure diagram of the PID block:
Parametering
The PID control structure is displayed in Structure diagram, page 289.
Setting function block parameters is initially performed by the pure PID parameters,
i.e. the proportional action coefficient gain, the reset time ti and the rate time td.
The D component is delayed by the time td_lag. The td/td_lag ratio is termed
the differential gain, and is generally selected between 3 and 10. The D component
can either be based upon the system deviation ERR (d_on_pv = "0") or the
controlled variable PV (d_on_pv = "1"). Should the D component be determined by
the controlled variable PV, then the D component will not be able to cause jumps
when reference variable fluctuations (changes in input SP) take place. In principle
the D component only influences disturbances and process changes.
The upper limit ymax for limiting the manipulated variable must be greater than the
lower limit ymin, otherwise the function block reports an error and does not function.
Anti-windup reset
Should limiting of the manipulated variable take place, the anti-windup reset should
ensure that the I component "cannot go berserk". Anti-windup measures are only
taken if the controller I component is not switched off. Anti-windup limits are identical
to those for the manipulated variable. The anti-windup measures disregard D
component values, to avoid being falsely triggered by D component peaks.
The anti-windup measures correct the I component in such a way that:
Operating modes
Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the
manipulated variable Y. However, the manipulated variable is limited by ymax and
ymin. Internal variables will be manipulated in such a manner that the controller
changeover from manual to automatic (with I component enabled) can be bumpless.
The control limits are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.
Halt mode
In halt mode the control output remains unchanged; the function block does not
influence the manipulated variable Y, i.e. Y = Y(old). The internal sizes are tracked
in such a way that the controller (on connecting to the I component) bumplessly
proceeds from its current position. The control limits are also limits for the Anti-
windup reset. The halt operating mode is also useful for setting the control output Y
via an external operator device, whereby the internal components are tracked
correctly in the controller.
In this operating mode the D component is automatically set to 0.
The MOVE function is only performed when the PID controller is in automatic mode
(Mode.man = 0). If only one changeover from automatic to manual takes place it is
bumpless, as the value of YMAN is equal to the value of Y in this cycle. In the manual
mode the value of YMAN can slowly be changed.
Detailed formulas
Variable Meaning
is the time differential between the current cycle and the previous cycle
Manipulated variable
The manipulated variable consists of various terms which are dependent on the
operating mode:
Description
Function description
The function block replicates a PID controller in parallel structure.
A system deviation ERR is formed by the difference between the reference variable
SP and the controlled variable PV. The deviation ERR causes the manipulated
variable Y to change.
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:
z PID controller in pure parallel structure
z Independent gains for P-. I and D component
z Each component P, I and D can be individually enabled
z Limiting control limits in automatic mode
z Anti-windup measure with an active I component only
z Anti-windup reset
z Operating modes Manual, Halt, Automatic
z bumpless changeover between manual and automatic
z D component connectable to input variable PV or system deviation ERR
z D component with variable delay
Transfer function
The transfer function is:
Variable Description
YD D component
YI I component
YP P component
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PID_P_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualValue,
FEED_FWD:=Disturbance, Y:=ManipulatedVariable,
ERR=>OutputSystemDeviation, STATUS=>StatusOfOutput_Y)
Representation in ST
Representation:
PID_P_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, MODE:=OperatingModes,
PARA:=Parameter, YMAN:=ManualValue,
FEED_FWD:=Disturbance, Y:=ManipulatedVariable,
ERR=>OutputSystemDeviation, STATUS=>StatusOfOutput_Y) ;
Runtime error
An error message is returned if
z an invalid floating point number lies at input YMAN or X
z ymax < ymin.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Structure diagram
The following is the structure diagram of the PIDP block:
Parametering
The PID_P control structure is displayed in theStructure diagram, page 305.
Setting parameters for the PID_P controller takes place first of all for the pure PID
parameters, that is to say, the proportional action coefficient kp, the integral action
coefficient ki and rate of differentiation kd.
The P, I and D components can be disabled individually by setting the corresponding
input (kp, ki or kd) to 0.
The D component is delayed by the time constant td_lag. The D component can
either be based upon the system deviation ERR (d_on_pv = "0") or the controlled
variable PV (d_on_pv = "1"). Should the D component be determined by the
controlled variable PV, then the D component will not be able to cause jumps when
reference variable fluctuations (changes in input SP) take place. In principle, the D
component only affects disturbances and process variances.
The upper limit ymax for limiting the manipulated variable must be greater than the
lower limit ymin, otherwise the function block reports an error and does not function.
Anti-windup reset
If manipulated variable limiting takes place, the anti-windup reset should make sure
that the integral component cannot exceed all limits. The anti-windup measure is
only implemented if the I component of the controller is not disabled. Anti-windup
limits are identical to those for the manipulated variable. The D component is not
taken into consideration for anti-windup measures, so that peaks, caused by the D
component, are not capped by the anti-windup measure.
The anti-windup reset measure corrects the I component in the form, which means:
Controller type kp ki kd
P controller >0 =0 =0
PI controller >0 >0 =0
PD controller >0 =0 >0
PID controller >0 >0 >0
I controller =0 >0 =0
Operating modes
Manual mode
In manual mode the manually manipulated value YMAN is passed on directly to the
manipulated variable Y. However, the manipulated variable is limited by ymax and
ymin. Internal variables will be manipulated in such a manner that the controller
changeover from manual to automatic (with I component enabled) can be bumpless.
The control limits are also limits for the Anti-windup reset.
In this operating mode the D component is automatically set to 0.
Halt mode
In halt mode the control output remains unchanged; the function block does not
influence the manipulated variable Y, i.e. Y = Y(old). Internal variables will be
manipulated in such a manner that the controller (with I component enabled) can be
driven smoothly from its current position. The control limits are also limits for the
Anti-windup reset. The halt operating mode is also useful for setting the control
output Y via an external operator device, whereby the internal components are
tracked correctly in the controller.
In this operating mode the D component is automatically set to 0.
Detailed formulas
Variable Meaning
is the time differential between the current cycle and the previous cycle
Manipulated variable
The manipulated variable is composed of various terms:
System deviation
The system deviation will be determined as follows:
ERR = SP - PV, if reverse = 0
ERR = PV - SP, if reverse = 1
32
Introduction
This chapter describes the PIP block.
Description
Function description
The function block displays a cascade-controller, consisting of a PI-master controller
and a P-sub controller.
A system deviation ERR is formed by the difference between the reference variable
SP and the controlled variable PV.
The master controller generates a sub controller setpoint value SP2 through this
system deviation. Due to the difference between SP2 and PV2 the sub controller
generates the manipulated variable Y.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block has the following properties:
z PI as master controller and P as sub controller
z Manipulated variable limiting
z Anti-windup reset (PI controller)
z Operating modes, fixed setpoint control, manual, halt, automatic
Transfer function
The transmission function for the controller says:
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PIP_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, PV2:=AuxiliaryControlVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualValue, SP_FIX:=FixedValue, OFF:=Offset,
Y:=ManipulatedVariable, ERR=>OutputSystemDeviation,
SP2=>SubControllerSetpointValue,
STATUS=>StatusOfOutput_Y)
Representation in ST
Representation:
PIP_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, PV2:=AuxiliaryControlVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualValue, SP_FIX:=FixedValue, OFF:=Offset,
Y:=ManipulatedVariable, ERR=>OutputSystemDeviation,
SP2=>SubControllerSetpointValue,
STATUS=>StatusOfOutput_Y) ;
Runtime error
An error message is returned if
z an invalid floating point number lies at input PV, PV2, YMAN or SP_FIX
z ymax < ymin.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Structure diagram
The following is the structure diagram of the PIP block:
Structure diagram
Structure diagram of the PIP cascade controller
Parametering
The PIP control structure is displayed in theStructure diagram, page 318.
Setting parameters for the function block takes place firstly through the pure PI –
parameter, that is to say the proportional correction value gainl and the reset time
ti.
The I component can be disabled by setting ti = 0.
Subsequently setting parameters for the P controller takes place through the
proportional correction value gain2.
Operating modes
Manual mode
The P controller works in manual mode. The PI controller I component is
manipulated to permit bumpless switching.
In the manual mode the manual manipulated value YMAN is passed on directly to the
control output Y. The control output is, however, limited by ymax and ymin. the
integral component of the master controller is tracked in such a way that the
controller (on connecting to the I-component) can be switched bumplessly from
manual to automatic.
Halt mode
In halt mode the control output remains unchanged; the function block does not
influence the control output Y, i.e. Y = Y(old). Halt mode is also useful in allowing an
external operator device to adjust control output Y. the internal components are so
manipulated that the controller can be driven smoothly from it’s current position. The
control output is, however, limited by ymax and ymin.
Detailed formulas
Variable Meaning
is the time differential between the current cycle and the previous cycle
The integral component Y1 of the master controller for the automatic mode is
determined as follows:
Manual mode
The output signal Y of the cascade controller is:
The integral component Y1 of the master controller for the manual mode is
determined as follows:
Halt mode
The output signal Y of the cascade controller is:
The integral component Y1 of the master controller for the halt mode is determined
as follows:
The integral component Y1 of the master controller for the fixed setpoint control
mode is determined as follows:
33
Introduction
This chapter describes the PPI block.
Description
Function description
The function block displays a cascade-controller, consisting of a P-master controller
and a PI-sub controller.
A system deviation ERR is formed by the difference between the reference variable
SP and the controlled variable PV.
The master controller generates a sub controller setpoint value SP2 through this
system deviation. Due to the difference between SP2 and PV2 the sub controller
generates the manipulated variable Y.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block has the following properties:
z P as master controller and PI as sub controller
z Manipulated variable limiting
z Anti-windup reset (PI controller)
z Operating modes, fixed setpoint control, manual, halt, automatic
Transfer function
The transmission function for the controller says:
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PPI_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, PV2:=AuxiliaryControlVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualValue, SP_FIX:=FixedValue, OFF:=Offset,
Y:=ManipulatedVariable, ERR=>OutputSystemDeviation,
SP2=>SubControllerSetpointValue,
STATUS=>StatusOfOutput_Y)
Representation in ST
Representation:
PPI_Instance (SP:=ReferenceVariable,
PV:=ControlledVariable, PV2:=AuxiliaryControlVariable,
MODE:=OperatingModes, PARA:=Parameter,
YMAN:=ManualValue, SP_FIX:=FixedValue, OFF:=Offset,
Y:=ManipulatedVariable, ERR=>OutputSystemDeviation,
SP2=>SubControllerSetpointValue,
STATUS=>StatusOfOutput_Y) ;
Runtime error
An error message is returned if
z an invalid floating point number lies at input PV, PV2, YMAN or SP_FIX
z ymax < ymin.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Structure diagram
The following is the structure diagram of the PPI block:
Block diagram
Block diagram of the PPI cascade controller
Parametering
The PPI control structure is displayed in theBlock diagram, page 332.
Setting parameters for the function block takes place firstly through the proportional
correction value (gain1) and the offset for the output of the p-controller (OFF).
Subsequently setting parameters for the PI controller takes place through the
proportional correction value gain2 and the reset time ti.
The I component can be disabled by setting ti = 0.
The limits ymax and ymin limit the output within the prescribed range.
The outputs qmax and qmin signal that the output has reached a limit, and thus
been capped.
z qmax = 1, if Y ≥ ymax
z qmin = 1, if Y ≤ymin
Operating modes
Manual mode
In the manual mode the manual manipulated value YMAN is passed on directly to the
control output Y. The control output is, however, limited by ymax and ymin. Internal
variables will be manipulated in such a manner that the controller changeover from
manual to automatic (with I component enabled) can be bumpless.
Halt mode
In halt mode the control output remains unchanged; the function block does not
influence the control output Y, i.e. Y = Y(old). Halt mode is also useful in allowing an
external operator device to adjust control output Y. the internal components are so
manipulated that the controller can be driven smoothly from it’s current position. The
control output is, however, limited by ymax and ymin.
Detailed formulas
Variable Meaning
Present sample time
The integral component Y1 of the sub controller for the automatic mode is
determined as follows:
Manual mode
The output signal Y of the cascade controller is:
The integral component Y1 of the sub controller for the manual mode is determined
as follows:
Halt mode
The output signal Y of the cascade controller is:
The integral component Y1 of the sub controller for the halt mode is determined as
follows:
The integral component Y1 of the sub controller for the fixed setpoint control mode
is determined as follows:
34
Introduction
This chapter describes the PWM block.
Description
Function description
The PWM function block is used to convert analog values into digital output signals
for Unity Pro.
In the pulse width modulation (PWM1) a "1" signal of variable persistence proportional
to the analog value X is output within a fixed cycle period. The adjusted average
energy corresponds to the quotient of the switch on duration T_on and the cycle time
t_period.
In order that the adjusted average energy also corresponds to the analog input
variable IN, the following must apply:
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Y_NEG
Parametering rules
For correct operation the following rules should be observed:
z
z From the parameters up_pos and up_neg only the value is evaluated.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PWM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameters, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput)
Representation in ST
Representation:
PWM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameters, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Time-span dependency
The dependency of the time duration in which the output Y_POS (Y_NEG) carries a
1-signal, on the input variable X is illustrated in the following diagram (again the
figure has put t_pause = t_brake = 0).
Operating modes
In reset mode R = 1, outputs Y_POS and Y_NEG are set to "0" signal. The internal
time meters are also standardized, so that the function block begins the transfer to
R=0 with the output of a new 1 signal on the associated output.
Boundary conditions
If the PWM block is operated together with a PID controller, then the period
t_period should be so selected, that it corresponds to the PID controller’s scan
time. It is then guaranteed that every new actuating signal from the PID controller
within the period time can be fully processed.
The PWM scan time should be in proportion with the period vs. pulse time. Though
this the smallest possible actuating pulse will be specified.
The following ratio is recommended:
Overview
In the example, the signal sequences on the outputs Y_POS and Y_NEG are shown
for various X input signal values. The examples differ with respect to their selected
parameter assignments.
The following examples on the PMW function block are to be found in this section
z Jump response 1
z Jump response 2
Jump response 1
The following parameter specifications apply to the jump response 1 display:
Parameters Specification
t_period 4s
t_min 0.2 s
t_max 3.8 s
t_pause 0.1 s
t_brake 0.2 s
up_pos 10
up_neg 10
X analog signal
It is easily seen that the time span in which output Y_POS carries "1" signal is directly
proportional to input signal X. In addition, it can be seen that a short Y_NEG signal
(output Y_NEG to 1-Signal) follows every Y_POS signal. This can be attributed to the
non-"0" t_brake parameters. With negative X input signals, the signal duration for
Y_NEG is proportional X. A short Y_POS pulse as brake pulse also follows the Y_NEG
pulse here as well.
Jump response 2
The following parameter specifications apply to the jump response 2 display:
Parameters Specification
t_period 4s
t_min 0.5 s
t_max 4s
t_pause 0s
t_brake 0s
up_pos 10
up_neg 10
X analog signal
In contrast to the example "Jump response 1", here the pause and brake pulses are
dropped, as the appropriate parameters were configured to "0". It is noticeable that
pulses are no longer output for very small X input signals. This is directly attributable
to the effect of time t_min. Moreover a continuous pulse is output for large X input
signals (X = up_pos/up_neg). This is related to having selected t_max =
t_period.
Description
Function description
The function block QPWM converts analog values into digital output signals.
In pulse width modulation (QPWM), a 1-signal is emitted, at a constant clock rate, for
a duration that is a function of the analog value. The adjusted average energy
corresponds to the quotient of the switch on duration T_on and the cycle time
t_period.
In order that the adjusted average energy also corresponds to the analog input
variable IN, the following must apply:
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Y_NEG
Parametering rules
For correct operation when setting parameters the following rules should be
observed:
t_min ≤t_period
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL QPWM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameter, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput)
Representation in ST
Representation:
QPWM_Instance (X:=InputVariable, R:=ResetMode,
PARA:=Parameter, Y_POS=>Positive_X_ValueOutput,
Y_NEG=>Negative_X_ValueOutput) ;
Runtime error
For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Time-span dependency
The dependency of the time duration in which the output Y_POS (Y_NEG) carries a
1-signal; the input variable X is illustrated in the following diagram:
Operating modes
In reset mode R = 1, outputs Y_POS and Y_NEG are set to "0" signal. The internal
time meters are also standardized, so that the function block begins the transfer to
R=0 with the output of a new 1 signal on the associated output.
Boundary conditions
If the QPWM block is operated together with a PID controller, then the period
t_period should be so selected, that it corresponds to the PID controller’s scan
time. It is then guaranteed that every new actuating signal from the PID controller
within the period time can be fully processed.
The QPWM scan time should be in proportion with the period vs. pulse time. The
smallest possible actuating pulse is determined this way.
The following ratio is recommended:
Jump response
In the example, the signal sequences on the outputs Y_POS and Y_NEG are shown
for various X input signal values.
The following parameter specifications apply to the jump response display:
Parameters Specification
t_period 4s
t_min 0.5 s
x_max 10
X Analog signal
It is noticeable that pulses are no longer output for very small X input signals. This
is directly attributable to the effect of time t_min. A continuous pulse is output for
large X (X = x_max) signals.
36
Introduction
This chapter describes the SCON3 block.
Description
Function description
The function block replicates a three-point step controller, and exhibits a PD-like
behavior due to a dynamic feedback path.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block SCON3 has the following properties:
z Reset and automatic operating modes
z One internal feedback path (delay 1st Order)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SCON3_Instance (SP:=SetpointInput, PV:=ProcessVariable,
PARA:=Parameters, R:=ResetModeFlag,
Y_POS=>PosManipulated_ERR_EFF,
Y_NEG=>NegManipulated_ERR_EFF,
ERR_EFF=>EffectiveError)
Representation in ST
Representation:
SCON3_Instance (SP:=SetpointInput, PV:=ProcessVariable,
PARA:=Parameters, R:=ResetModeFlag,
Y_POS=>PosManipulated_ERR_EFF,
Y_NEG=>NegManipulated_ERR_EFF,
ERR_EFF=>EffectiveError) ;
Runtime error
If hys > 2 * db, an error message is shown in the diagnostic viewer (Tools →
Diagnostic viewer).
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Warning
In the following cases, a warning is shown in the diagnostic viewer (Tools →
Diagnostic viewer):
z gain ≤0 : The controller operates without feedback response.
z ti = 0: The controller operates without feedback response.
z t_proc = 0: The controller operates with a predetermined value of t_proc = 60
s.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
If... Then...
Y=1 Y_POS = 1
Y_NEG = 0
Y=0 Y_POS = 0
Y_NEG = 0
Y = -1 Y_POS = 0
Y_NEG = 1
Meaning of variable K:
Dead zone
The parameter db sets the connection point for the outputs Y_POS and Y_NEG. If the
effective switching value ERR_EFF = SP - PV - XR is positive and is greater than db,
then the Y_POS output switches from "0" to "1". If the effective switch value ERR_EFF
is negative and is less than db, then the output Y_NEG will switch from "0" to "1". The
parameter db is typically set to 1% of the maximum control range (max. (SP - PV)).
NOTE: The amount is evaluated from the db dead zone!
Hysteresis
The parameter hys indicates the connector-hysteresis, i.e. the value which the
effective switch value ERR_EFF outgoing from control point db must be reduced by,
before the output Y_POS (Y_NEG) is reset to "0". The connection between Y_POS
and Y_NEG depending on the effective switch value ERR_EFF and the parameters
db and hys is illustrated in the image "Principle of the three-point controller,
page 364". The parameter hys is typically set to 0.5 % of the maximum control
range (max. (SP - PV)).
NOTE: The amount is evaluated from the hys hysterisis!
Operating modes
There are two operating modes that can be selected through the R parameter input:
37
Introduction
This chapter describes the VLIM block.
Description
Function description
The function block produces a velocity limiter of the 1st order with limiting of the
manipulated variable.
The output Y follows the input X, but at the maximum gradient rate. Furthermore,
the Y output is limited by ymax and ymin. This allows the function block to adjust
signals to the technologically limited pace and limits from controlling elements.
NOTE: This function block performs an internal initialization in the first program
cycle after a warm start or cold start (e.g. application download or power cycle) of
the PLC program.
Due to this, you have to make sure that the function block is invoked in the first
program cycle. In case of inkoving the function block in a later program cycle, the
internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Properties
The function block has the following properties:
z Operating modes Manual, Halt, Automatic
z Manipulated variable limiting
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL VLIM_Instance (X:=Input, MODE:=OperatingMode,
PARA:=Parameters, YMAN:=ManualManipulatedValue,
Y:=Output, STATUS:=Output_Y_Status)
Representation in ST
Representation:
VLIM_Instance (X:=Input, MODE:=OperatingMode,
PARA:=Parameters, YMAN:=ManualManipulatedValue,
Y:=Output, STATUS:=Output_Y_Status)
Runtime error
An error message is returned if
z an invalid floating point number lies at input YMAN or X,
z ymax < ymin.
NOTE: For a list of all block error codes and values, see CLC_PRO, page 606.
Detailed description
Parametering
The parameter assignments of the function block are defined by the determination
of the maximum gain rate as well as the ymax and ymin thresholds for the Y
output. The maximum velocity rate indicates the maximum by which the output may
change within one second.
The amount will be evaluated by the rate parameter.
Limits
The limits ymax and ymin limit the output within the prescribed range. Therefore
ymin ≤Y ≤ymax.
The outputs qmax and qmin indicate that the output has reached a limit or that the
output signal has been capped.
z qmax = 1 if Y ≥ ymax
z qmin = 1 if Y ≤ymin
Operating modes
There are three operating modes, which are selected via the inputs MAN and HALT:
Example
Illustration of the dynamic behavior of the VLIM function block.
The function block follows the jump to input X with maximum change in speed
(rate). Output Y remains at a standstill in Halt mode, in order to subsequently move
on from the position at which it has stopped. It is also clear to see the limits of output
Y durch ymax and ymin with the relevant messages qmax and qmin.
Extension/Compatibility
IV
Overview
This part describes the elementary functions and elementary function blocks in the
family Extension/Compatibility.
38
Description
Available functions
The available functions are as follows:
z ADD_DT_PL7,
z ADD_TOD_PL7.
Representation in FBD
Representation applied to a time of day:
Representation in LD
Representation applied to a time of day:
Representation in IL
Representation applied to a time of day:
LD Source_Value
ADD_TOD_PL7 Time_to_Add
ST Result_Value
Representation in ST
Representation applied to a time of day:
Result_Value := ADD_TOD_PL7(Source_Value, Time_to_Add);
Description of parameters
The following table describes the input parameters:
Execution errors
When Source_Value is in the DINT format (TOD of PL7), there is a change of day
if Result_Value is greater than 24:00:00. In this case the system bit %S18
(see page 615) is set at 1 and the value of Result_Value is only significant with a
modulo 24:00:00.
When Source_Value is in the ARRAY [0..3] OF INT format (DT of PL7) and if
Result_Value is outside the authorized range of values, the system bit %S18
(see page 615) is set at 1 and the value of Result_Value is also at the maximum
limit.
If one of the input parameters cannot be interpreted and is inconsistent with the
function format then the system bit %S18 (see page 615) is set at 1 and
Result_Value is:
z 00:00:00 for the TOD type.
z 00001-01-01-00:00:00 for the DT type.
39
Description
Function description
The derived function block detects any edge (1 -> 0 and 0 -> 1) on the CLK input.
Output Q is "1" for a cycle if there is a transition from "0" to "1" or a transition from
"1" to "0" on CLK; otherwise it remains "0".
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_FL_Instance (CLK:=ClockInput, Q=>DisplaysAnyEdge)
Representation in ST
Representation:
AKF_FL_Instance (CLK:=ClockInput, Q=>DisplaysAnyEdge) ;
Parameter description
Description of the input parameters:
40
Description
Function description
The derived function block is used as switch off delay.
The delay time comprises a time base ZB and a factor SW. The delay time is
calculated from ZB x SW.
The actual value is displayed at the TIW output and is calculated according to the
following formula: TIW = expired time / ZB
With a 0 -> 1 edge at the IN input, the delay time is transferred to the TSW output
and the Q output is set to "1".
With a 1 -> 0 at the IN input, the internal timer is started and the current state is
displayed at the TIW output. When TIW equals TSW, the Q output is set to "0".
With a 0 -> 1 edge at the R input the internal timer is reset and the Q output is set to
"0".
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_TA_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorDelayTime, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)
Representation in ST
Representation:
AKF_TA_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorDelayTime, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;
Parameter description
Description of input parameters:
Timing diagram
Timing diagram of the TA disconnection delay:
-
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
41
Description
Function description
The derived function block is used as switch on delay.
The delay time comprises a time base ZB and a factor SW. The delay time is
calculated from ZB x SW.
The actual value is displayed at the TIW output and is calculated according to the
following formula: TIW = expired time / ZB
With a 0 -> 1 edge at the IN input the delay time is transferred to the TSW output, the
internal timer is started, and the current state is displayed at the TIW output.
When TIW equals TSW, the Q output is set to "1".
With a 0 -> 1 edge at the R input or a 1 -> 0 edge at the IN input, the internal timer
is reset and the Q output is set to "0".
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_TE_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorDelayTime, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)
Representation in ST
Representation:
AKF_TE_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorDelayTime, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;
Parameter description
Description of input parameters:
Timing diagram
Timing diagram for activation delay TE:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
AKF_TI: Pulse
42
Description
Function description
The derived function block is used to generate a pulse that has a defined maximum
duration.
The maximum pulse duration comprises a time base ZB and a factor SW. The
maximum pulse duration is calculated from ZB x SW.
The actual value is displayed at the TIW output and is calculated according to the
following formula: TIW = expired time / ZB
With a 0 -> 1 edge at the IN input, the maximum pulse duration is transferred to the
TSW output, the internal timer is started and the Q output is set to "1".
If TIW equals TSW, the Q output is set to "0", independent of the IN input.
With a 0 -> 1 edge at the R input the internal timer is reset and the Q output is set to
"0".
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_TI_Instance (IN:=StartingPulse, ZB:=TimeBaseOfPulse,
SW:=FactorOfPulse, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)
Representation in ST
Representation:
AKF_TI_Instance (IN:=StartingPulse, ZB:=TimeBaseOfPulse,
SW:=FactorOfPulse, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;
Parameter description
Description of input parameters:
Timing diagram
Timing diagram for TI pulse:
(1) If IN becomes "1", Q becomes "1", and the internal timer (TIW) is started.
(2) If the internal timer TIW reaches the value of TSW, Q becomes "0".
(3) If IN becomes "0", the internal timer is stopped/reset.
(4) If IN becomes "0", Q becomes "0" and the internal timer is stopped/reset.
(5) If R becomes "1", Q becomes "0" and the internal timer is stopped/reset.
(6) If R becomes "1", the internal timer, is stopped/reset, independent of IN.
(7) If IN becomes "1" and R is "1", Q remains at "0".
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
43
Description
Function description
The derived function block is used as stored switch on delay. Resetting of the output
can only be performed with the R input.
The delay time comprises a time base ZB and a factor SW. The delay time is
calculated from ZB x SW.
The actual value is displayed at the TIW output and is calculated according to the
following formula: TIW = expired time / ZB
With a 0 -> 1 edge at the IN input the delay time is transferred to the TSW output, the
internal timer is started, and the current state is displayed at the TIW output.
When TIW equals TSW, the Q output is set to "1".
With a 0 -> 1 edge at the R input the internal timer is reset and the Q output is set to
"0".
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_TS_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorOfDelay, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)
Representation in ST
Representation:
AKF_TS_Instance (IN:=StartingDelay, ZB:=TimeBase,
SW:=FactorOfDelay, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;
Parameter description
Description of input parameters:
Timing diagram
Timing diagram for storing activation delay TS
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
44
Description
Function description
The derived function block is used to generate an extended pulse.
The pulse duration comprises a time base ZB and a factor SW. The pulse duration is
calculated from ZB x SW.
The actual value is displayed at the TIW output and is calculated according to the
following formula: TIW = expired time / ZB
With a 0 -> 1 edge at the IN input, the pulse duration is transferred to the TSW output,
the internal timer is started and the Q output is set to "1".
The Q output remains at "1", independent of IN, until TIW equals TSW. The Q output
is now set to "0".
With a 0 -> 1 edge at the R input the internal timer is reset and the Q output is set to
"0".
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_TV_Instance (IN:=StartingPulse, ZB:=TimeBaseOfPulse,
SW:=FactorOfPulse, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue)
Representation in ST
Representation:
AKF_TV_Instance (IN:=StartingPulse, ZB:=TimeBaseOfPulse,
SW:=FactorOfPulse, R:=ResetInput, Q=>Output,
TIW=>InternalTime, TSW=>TimerSetpointValue) ;
Parameter description
Description of input parameters:
Timing diagram
Timing diagram for extended pulse TV:
(1) If IN becomes "1", Q becomes "1", and the internal timer (TIW) is started.
(2) If the internal timer (TIW) reaches the value of TSW, Q becomes "0".
(3) If IN becomes "1" again, the internal timer is restarted and Q becomes "1".
(4) If IN becomes "1" again, the internal timer is restarted and Q remains "1".
(5) If R becomes "1", Q becomes "0", independent of IN, and the internal timer is
stopped/reset.
(6) If IN becomes "1" and R is "1", Q remains at "0" and the internal timer is not started.
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
45
Description
Function description
The derived function block is used for downwards counting.
With a "1"signal at the R input, the actual value and the Q output are set to"0".
With a 0 -> 1 edge at the S input, the SW input accepts the setpoint value which is
then displayed at the ZSWO output. The actual value is set to the setpoint value. A
comparison of setpoint value/actual value will not take place until a setpoint value
has been accepted at least once.
The Q output is set to "1" if the actual value is greater than "0" and less than the
setpoint value.
Given a 0 -> 1 edge at the IN input, the actual value (ZIWO) is decreased by 1 (to 0
as a minimum) and compared to the setpoint value (ZSWO).
The ZIW and ZSW inputs can be used to change the setpoint value (ZSW) and the
actual value (ZIW) online.
NOTE: In order for the counter to work correctly, the variable (actual value) which is
established at ZIW must also be established at ZIWO. The variable (setpoint), which
is established at ZSW has also to be established at ZSWO.
EN and ENO can be configured as additional parameters.
Formula
Q = 1, if 0 < ZIWO < ZSWO
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_ZR_Instance (IN:=TriggerInput, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue)
Representation in ST
Representation:
AKF_ZR_Instance (IN:=TriggerInput, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue) ;
Parameter description
Description of input parameters:
Timing diagram
Timing diagram for AKF_ZR backwards counter:
(1) If S becomes "1" and R is "0", the preset setpoint value SW is accepted and displayed at
the ZSWO output.
(2) If IN becomes "1", the actual counter value is decreased by "1" and Q set to "1".
(3) If IN becomes "1", the current counter value is decreased by "1".
(4) If IN becomes "1", the current counter value is decreased by "1". If this causes the counter
value (ZIWO) to become "0", the Q output is set to "0".
(5) If R becomes "1", the current counter value is set to "0".
(6) If S becomes "1" and R is "0", the preset setpoint value SW is accepted and Q is set to "0".
46
Description
Function description
The derived function block is used for incrementing.
With a "1"signal at the R input, the actual value and the Q output are set to"0".
With a 0 -> 1 edge at the S input, the SW input accepts the setpoint value which is
then displayed at the ZSWO output. The actual value is set to "0". A comparison of
setpoint value/actual value will not take place until a setpoint value has been
accepted at least once.
The Q output is set to "1" if the actual value is greater than "0" and less than the
setpoint value.
In the case of -> 1 edge at the IN input, the actual value (ZIWO) is increased by 1
and compared to the setpoint value (ZSWO).
The ZIW and ZSW inputs can be used to change the setpoint value (ZSW) and the
actual value (ZIW) online.
NOTE: In order for the counter to work correctly, the variable (actual value) which is
established at ZIW must also be established at ZIWO. The variable (setpoint), which
is established at ZSW has also to be established at ZSWO.
EN and ENO can be configured as additional parameters.
Formula
Q = 1, if 0 < ZIWO < ZSWO
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_ZV_Instance (IN:=TriggerInput, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue)
Representation in ST
Representation:
AKF_ZV_Instance (IN:=TriggerInput, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue) ;
Parameter description
Description of input parameters:
Timing diagram
Timing diagram for Incremental counter AKF_ZVR:
(1) If IN becomes "1" and R is "0", the actual value is increased by "1" and Q is set to "1".
(2) If R becomes "1", the actual value and Q are set to "0".
(3) If S becomes "1", the preset setpoint value is accepted.
(4) If IN becomes "1", the actual value is increased by "1". If this causes the actual value to
reach the setpoint value, Q is set to "0".
(5) If IN becomes "1", the actual value is increased by "1".
(6) If S becomes "1", the preset setpoint value is accepted and the actual value is set to "0".
(7) If S becomes "1", the preset setpoint value is accepted, and the actual value and Q are set
to "0".
AKF_ZVR:
Incremental/decremental counter
47
Description
Function description
The derived function block is used for incrementing/decrementing.
With a "1"-signal at the R input, the actual value and the Q output are set to"0".
With a 0 -> 1 edge at the S input, the SW input accepts the setpoint value which is
then displayed at the ZSWO output. The actual value does not change. A comparison
of setpoint value/actual value will not take place until a setpoint value has been
accepted at least once.
The Q output is set to "1" if the actual value is greater than or equal to the setpoint.
In the case of -> 1 edge at the IN_F input, the actual value (ZIWO) is increased by
1 and compared to the setpoint value (ZSWO).
In the case of -> 1 edge at the IN_B input, the actual value (ZIWO) is decreased by
1 and compared to the setpoint value (ZSWO).
The ZIW and ZSW inputs can be used to change the setpoint value (ZSW) and the
actual value (ZIW) online.
NOTE: In order for the counter to work correctly, the variable (actual value) which is
established at ZIW must also be established at ZIWO. The variable (setpoint), which
is established at ZSW has also to be established at ZSWO.
EN and ENO can be configured as additional parameters.
Formula
Q = 1, if ZIWO ≥ ZSWO
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AKF_ZVR_Instance (IN_F:=TriggerInputIncrementing,
IN_B:=TriggerInputDecrementing, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue)
Representation in ST
Representation:
AKF_ZVR_Instance (IN_F:=TriggerInputIncrementing,
IN_B:=TriggerInputDecrementing, S:=SetInput,
SW:=PresetSetpointValue, R:=ResetInput,
ZIW:=InternalCurrentValueControl,
ZSW:=InternalSetpointValueControl, Q=>Output,
ZIWO=>DisplayCurrentValue, ZSWO=>DisplaySetpointValue) ;
Parameter description
Description of the input parameters:
Timing diagram
Timing diagram for Incremental counter AKF_ZVR
(1) If IN_F becomes "1" and R is "0", the current value is increased by "1".
(2) If IN_B becomes "1" and R is "0", the actual value is decreased by "1".
(3) If S becomes "1", the preset setpoint value is accepted.
(4) If IN_F becomes "1" and R is "0", the current value is increased by "1". If this causes the
actual value to reach the setpoint value, Q is set to "1".
(5) If R becomes "1", the actual value and Q are set to "0".
(6) If IN_B becomes "1" and R is "0", the actual value is decreased by "1". If this causes the
actual value to fall below the setpoint value, Q is set to "0".
(7) If IN_B becomes "1" and R is "0", the actual value is decreased by "1". If this causes the
actual value to reach the setpoint value, Q is set to "1".
Function description
The function COMPARE performs a comparison between two integers.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Valid
COMPARE Value1, Value2, Greater_Than, Equal_Values, Less_Than,
Different_Values
Representation in ST
Representation:
COMPARE(Valid, Value1, Value2, Greater_Than, Equal_Values,
Less_Than, Different_Values);
DATE_DINT_TO_STRING:
Conversion of a date (DATE PL7)
into a character string 49
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Date1
DATE_DINT_TO_STRING
ST Result_Str
Representation in ST
Representation:
Result_Str:= DATE_DINT_TO_STRING(Date1);
Description of parameters
The following table describes the input parameters:
Example: ’2000-12-27’
Runtime errors
If the string Result_Str is too short to contain the date (length = less than 10
characters), the date is truncated and the bit %S15 (see page 615) is set to 1.
If Date1 cannot be interpreted and is not consistent in DATE format, the system bit
%S18 (see page 615) is set to 1 and Result_Str =’YYYY-MM-DD’.
50
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
DAY_OF_WEEK
ST Out_Day_Of_Week
Representation in ST
Representation:
Out_Day_Of_Week := DAY_OF_WEEK();
Description of parameters
The following table describes the output parameters:
Runtime errors
If the function cannot update the result following a real-time clock access error, the
result sent back is 0 and the system bit %S18 (see page 615) is set to 1.
Available functions
The available functions are as follows:
z DELTA_D,
z DELTA_DT,
z DELTA_TOD.
Representation in FBD
Representation applied to a time of day:
Representation in LD
Representation applied to a time of day:
Representation in IL
Representation applied to a time of day:
LD Input_IN1
DELTA_TOD Input_IN2
ST Delay1
Representation in ST
Representation applied to a time of day:
Delay1:= DELTA_TOD(Input_IN1, Input_IN2);
Description of parameters
The following table describes the input parameters:
Runtime errors
If Delay1 exceeds the maximum value allowed for a DINT format, an overflow
occurs, in which case Delay1 = 0 and the system bit %S18 (see page 615) is set
to 1.
If one of the input parameters cannot be interpreted and is inconsistent with the
function format, then Delay1 = 0 and the system bit %S18 (see page 615) is set to
1.
DT_ARINT_TO_STRING:
Converting a PL7 date into a
character string 52
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Date1
DT_ARINT_TO_STRING
ST Result_Str
Representation in ST
Representation:
Result_Str:= DT_ARINT_TO_STRING(Date1);
Description of parameters
The following table describes the input parameters:
Example: ’2000-12-27-23:15:50’
Runtime errors
If the string Result_Str is too short to contain the date (length = less than 19
characters), the date is truncated and the bit %S15 (see page 615) is set to 1.
If Date1 cannot be interpreted and is not consistent, the system bit %S18
(see page 615) is set to 1 and Result_Str =’YYYY-MM-DD-HH:MM:SS’.
Function description
The END function in an application program is used to define the end of the execution
of a program cycle.
By default (normal mode), when the end of program is activated, outputs are
updated and the program switches to the next cycle.
If polling is periodic, outputs are updated and the program waits until the end of the
period then switches to the next cycle.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL END
Representation in ST
Representation:
END ();
Description
Function description
This function block is a ‘first in – first out’ stack register.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL FIFO_Instance (R:=ClearedStackRegister, SET:=WriteValue,
GET:=ReadValue, X:=StackRegisterInput,
N_MAX:=MaxNumberInStack, FULL=>StackRegisterFull,
EMPTY=>StackRegisterEmpty, Y=>StackRegisterOutput)
Representation in ST
Representation:
FIFO_Instance (R:=ClearedStackRegister, SET:=WriteValue,
GET:=ReadValue, X:=StackRegisterInput,
N_MAX:=MaxNumberInStack, FULL=>StackRegisterFull,
EMPTY=>StackRegisterEmpty, Y=>StackRegisterOutput) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
Detailed description
The N_MAX parameter provides the maximum number of elements in the stack
register.
In a full stack register (number of elements in the stack register = N_MAX <= 2000 /
(size of (X)), FULL is set to 1 and no more elements can be placed in the stack
register. If the stack register is empty (number of elements in the stack register = 0),
then EMPTY is set to 1. The function has an X input and a Y input for various
elementary data types.
X and Y are type ANY, which implies a predefined length. Due to the limited size of
the internal stack register, only input and output types with an element size equal to
or smaller than 200 bytes are accepted. Otherwise a runtime error occurs and an
error message is generated that sets ENO to 0.
FPULSOR: Generation of
rectangular signals
55
Subject of this Chapter
This Chapter describes the function FPulsor.
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Enable
FPULSOR Rise_Time, Fall_Back_Time, Mem_Double_W, OUT_Pulsor,
Current_Value
Representation in ST
Representation:
FPULSOR(Enable, Rise_Time, Fall_Back_Time, Mem_Double_W,
OUT_Pulsor, Current_Value);
Description of parameters
The following table describes the input parameters:
Timing diagram
Timing diagram.
Operation
The following table describes the operation of the FPULSOR function:
FSTEP_PL7_DRUM : Forcing a
drum to a step
56
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Step_value
FSTEP_PL7_DRUM Drum_instance
Representation in ST
Representation:
FSTEP_PL7_DRUM (Step_value, Drum_instance);
Description of parameters
The following table describes the input parameters:
Execution errors
If the number of the step transmitted does not exist (number higher than or equal to
the step number of the drum), the %S18 (see page 615) bit is set at 1.
57
Subject of this Chapter
This Chapter describes the function FTOF.
Description
Function description
The function FTOF is a deactivation timer.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Enable
FTOF Presel_Value, Mem_Word, OUT_Ftof, Current_Value
Representation in ST
Representation:
FTOF(Enable, Presel_Value, Mem_Word, OUT_Ftof,
Current_Value);
Timing diagram
Timing diagram.
Operation
The following table describes the operation of the FTOF function:
58
Subject of this Chapter
This Chapter describes the function FTON.
Description
Function description
The function FTON is an activation timer.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Enable
FTON Presel_Value, Mem_Word, OUT_Fton, Current_Value
Representation in ST
Representation:
FTON(Enable, Presel_Value, Mem_Word, OUT_Fton,
Current_Value);
Timing diagram
Timing diagram.
Operation
The following table describes the operation of the FTON function:
59
Subject of this Chapter
This Chapter describes the function FTP.
Description
Function description
The function FTP is a timer which enables a pulse of a precise and programmable
duration to be obtained.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Enable
FTP Presel_Value, Mem_Word, OUT_FTP, Current_Value
Representation in ST
Representation:
FTP(Enable, Presel_Value, Mem_Word, OUT_FTP, Current_Value);
Timing diagram
Timing diagram.
Operation
The following table describes the operation of the FTP function:
Function description
This function writes values from the %IW register area (3x) of the state RAM to the
variable that is connected to the output pin.
Offset is an offset in the %IW register memory (3x).
The function copies as many bytes as the size of the output data type which is
connected to the output pin.
EN and ENO can be configured as additional parameters.
Example
The output of this function reads the 16-bit value of register %IW120 (register
300120), if Offset = 120 and the output is of data type INT.
The value in Offset may be modified at runtime.
If Offset lies outside the configured number of %IW (3x), an error message is
generated and ENO is set to 0.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Offset
GET_3X
ST Output
Representation in ST
Representation:
Output := GET_3X (Offset);
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
Function description
This function copies values from the %MW register area (4x register area for
Quantum CPUs) to the variable connected to the output pin VAL.
OFF is the word offset in the %MW register area.
The function copies as many bytes as the size of the output data type connected to
the output pin VAL.
The value in OFF may be modified at runtime. If OFF is outside the configured %MW
register area, an error message is generated and ENO is set to 0.
The function copies in any case only until the end of the configured %MW area, even
if the connected data type could take more data. The remaining part of the
connected data type remains untouched by the block in such cases.
EN and ENO can be configured as additional parameters.
Example
This function reads the 16-bit value of register %MW120 (register 400120), if OFF =
120 and the output is of data type INT.
This function reads only 1 word, if OFF addresses the last configured %MW, even if
the connected data type is of a larger size than a word.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Offset
GET_4X
ST Output
Representation in ST
Representation:
Output := GET_4X (Offset);
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
62
Description
Function description
This function reads the bit selected with BitNumber for input InputRegister and
writes the current state to output CurrentState.
The output is the current state of the selected input data bit.
The BitNumber parameter shows which input data bit to select.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD InputRegister
GET_BIT BitNumber
ST CurrentState
Representation in ST
Representation:
CurrentState := GET_BIT(InputRegister, BitNumber);
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Double_Int
HIGH_INT
ST High_Int
Representation in ST
Representation:
High_Int := HIGH_INT(Double_Int);
Description of parameters
The following table describes the input parameters:
64
Introduction
This chapter describes the IEC_BMDI block.
Description
Function description
This procedure copies the number of elements listed in NumberOfElements
wordwise, from position OffsetInSourceTable in the source table
(SourceTable) to position OffsetInDestinationTable in the destination table
(DestinationTable).
WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to
possible forced values in the reference data editor. This can produce serious
process conditions.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD SourceTable
IEC_BMDI OffsetInSourceTable, NumberOfElements,
DestinationTable, OffsetInDestinationTable
Representation in ST
Representation:
IEC_BMDI (SourceTable, OffsetInSourceTable,
NumberOfElements, DestinationTable,
OffsetInDestinationTable);
Parameter description
Description of input parameters:
Runtime error
The following standard user error messages are used:
If there are no errors, the procedure copies the values from the indicated source to
the destination address and sets the ENO output to 1.
The user errors 1 through 12 will block the copy operation and are setting the ENO
output to 0.
If user error 13 occurs, the copy operation continues and the ENO output remains at
1 because this error is treated as a warning.
NOTE: For a list of all block error codes, see Extension/Compatibility, page 609.
Detailed description
Function description
WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to
possible forced values in the reference data editor. This can produce serious
process conditions.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Example 1
In the example, 64 %MX source bits from start address %MX129 are copied into the
%MW destination register (starting at address %MW112). The input range is
%MX129 to %MX192 and the output range is %MW112 to %MW115.
Example 2
In the example, 11 %MW source bits from start address %MW250 are copied into
the %MX destination register (starting at address %MX257). The input range is
%MW250 to %MW260 and the output range is %MX257 to %MX432.
Example 3
In the example, 128 %MX source bits from start address %MX001 are copied into
the %MX destination register (starting at address %MX257). The input range is
%MX001 to %MX127 and the output range is %MX257 to %MX384.
Example 4
In the example, 15 %MW source bits from start address %MW250 are copied into
the %MW destination register (starting at address 4:01030). The input range is
%MW250 to %MW264, and the output range is 4:01030 to 4:01044.
Description
Function description
This function block is a ‘last in – first out’ stack register.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL LIFO_Instance (R:=ClearedStackRegister, SET:=WriteValue,
GET:=ReadValue, X:=StackRegisterInput,
N_MAX:=MaxNumberInStack, FULL=>StackRegisterFull,
EMPTY=>StackRegisterEmpty, Y=>StackRegisterOutput)
Representation in ST
Representation:
LIFO_Instance (R:=ClearedStackRegister, SET:=WriteValue,
GET:=ReadValue, X:=StackRegisterInput,
N_MAX:=MaxNumberInStack, FULL=>StackRegisterFull,
EMPTY=>StackRegisterEmpty, Y=>StackRegisterOutput) ;
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
Detailed description
Function description
LIFO is a 'last in-first out' stack register.
The index and stack registers are invisible to the user. The stack register is part of
the internal state and can accept up to 2000 bytes (i.e. 1000 INT or 500 REAL or 500
TIME elements).
The function block has two Boolean inputs, GET and SET, that are used to either
read a value from or write a value to the stack register. If GET and SET are set
simultaneously, SET (write) will be executed before GET (read).
The stack register will be cleared if R(eset) = 1.
The input parameters checking the stack must be set in a meaningful order to allow
the function block to work properly.
A meaningful order is, for example:
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Double_Int
LOW_INT
ST Low_Int
Representation in ST
Representation:
Low_Int := LOW_INT(Double_Int);
Description of parameters
The following table describes the input parameters:
MUX_DINTARR_125: Multiplexer
for arrays of the data type
DIntArr125 67
Description
Function description
Use this function to address and select a single element in an array. When
addressing arrays, only constant indexes can be entered in the programming
languages FBD and LD.
With the help of this function, variables for indexing can also be used.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD DIntArray
MUX_DINTARR_125 PositionInArray
ST SelectedElement
Representation in ST
Representation:
SelectedElement := MUX_DINTARR_125 (DIntArray,
PositionInArray) ;
Runtime error
There will be an error message when the authorized value range for the parameter
NO is violated. The error number is entered in this case instead of the selected
element on the output of the function (SelectedElement).
NOTE: For a list of all block error codes and values, see Extension/Compatibility,
page 609.
PL7_COUNTER :
Counter/downcounter
68
Object of this chapter
This chapter describes the PL7_COUNTERfunction.
Description
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
CAL Counter_1(R := Raz, P := Preselect, CU := Count_Up, CD :=
Count_Down, E => Empty, D => Done, F => Full)
ST representation
Representation:
IF Raz THEN
RESET_PL7_COUNTER (Counter_1) ;
END_IF ;
IF Preselect THEN
PRESET_PL7_COUNTER (Counter_1) ;
END_IF ;
IF Count_Up THEN
UP_PL7_COUNTER (Counter_1) ;
END_IF ;
IF Count_Down THEN
DOWN_PL7_COUNTER (Counter_1) ;
END_IF ;
Empty := Counter_1.E ;
Done := Counter_1.D ;
Full := Counter_1.F ;
Description of parameters
The following table describes the input parameters:
Description of variables
The following table describes the public variables:
Description
The following table describes the specific modes of operation of the PL7_COUNTER
function:
Effect... Description
of a cold restart (%S0=1) the current value is reset to zero, the outputs are set to
zero and the preset value is initialized at the value defined in
configuration.
of a warm restart, a (%S1=1) has no effect on the current value of the counter.
change to stop,
deactivation of a task
or execution of a
breakpoint
of modifying the A modification to the preset value by instruction or adjustment is
preset taken into account during management of the block by the
application.
NOTE: it is recommended to test the output bits only once in the program.
PL7_DRUM : Drum
69
Object of this chapter
This chapter describes the PL7_DRUMfunction.
Description
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
CAL PL7_Drum_1(R := Raz, U := Up, F => Full, W => %MW0)
ST representation
Representation:
IF Raz THEN
RESET_PL7_DRUM(PL7_Drum_1);
END_IF ;
IF RE (Up) THEN
UP_PL7_DRUM(PL7_Drum_1);
END_IF ;
Full := PL7_Drum_1.F ;
%MW0 := PL7_Drum_1.W ;
Description of parameters
The following table describes the input parameters:
Description of variables
The following table describes the public variables:
CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected
behavior of the application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.
Chart
Chart of the operation of the PL7_DRUM function block:
The number of the current step is incremented for each rising edge on the input
PL7_Drum_1.U (or activation of the instruction UP_PL7_DRUM(PL7_Drum_1)).
This number can be changed by the program.
Description
The following table describes the specific modes of operation of the PL7_DRUM
function:
Effect... Description
of a cold restart (%S0=1) causes the reinitialization of the programmer to step 0
(with updating of the order bits).
of a warm restart (%S1=1) causes the updating of the order bits according to the
current step.
a program jump, The fact of not scanning the drum does not cause a reset to 0 of the
deactivation of a task order bits.
or execution of a
breakpoint
NOTE: updating of the order bits only takes place when there is a change of step or
when there is a warm or cold start.
NOTE: on resetting to 0:
z In LD and FBD, the history of the input PL7_Drum_1.U is updated with the
cabled values.
z In IL, the history of the input PL7_Drum_1.U is not updated; it retains the value
it had before the call.
z In ST, the history of the input PL7_Drum_1.U is updated with 0.
PL7_MONOSTABLE : Monostable
70
Object of this chapter
This chapter describes the PL7_MONOSTABLEfunction.
Description
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
CAL Mn_1(S := Mn_Start, R => Mn_State)
ST representation
Representation:
IF RE(Mn_Start) THEN
START_PL7_MONOSTABLE (Mn_1) ;
END_IF ;
Mn_State := Mn_1.R ;
Description of parameters
The following table describes the input parameters:
NOTE: the monostable can be reset on the rising edge of Ma_1.S, on the other
hand, the length of the monostable starting pulse does not change the pulse
generated as the monostable is started on the rising edge.
Description of variables
The following table describes the public variables:
CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected
behavior of the application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.
Chart
Chart showing operation of the monostable
Operation
Description of monostable operation
Phase Description
1 Once a rising edge appears on input Mn_1.S of the monostable, the current value
Mn_1.ET takes the preselection value Mn_1.PT.
2 The current value Mn_1.ET decreases to 0 at a rate of one unit for each pulse of
the time base Mn_1.TB
3 The output bit Mn_1.R (Running) switches to 1 once the current value Mn_1.ET
is different to 0.
4 When the current value Mn_1.ET = 0, the output bit Mn_1.R switches back to 0.
Description
The following table describes the specific modes of operation of the
PL7_MONOSTABLE function:
Effect... Description
of a cold restart (%S0=1), causes a reset to zero of the current value, the preset
value is reinitialized to the value defined in the configuration and the
current value is set at the preset value.
of a warm restart (%S1=1) has no effect on the current value of the monostable or on
the preset value. The current value does not change during a power
outage.
a change to stop, Does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the monostable
block is programmed does not freeze the current value that
continues to decrease towards zero.
Similarly the output bit retains it normal function and can thus be
tested by another instruction. On the other hand the output, directly
cabled to the output, is not activated as it is not scanned by the PLC
Output bit test the output bit can change state in mid-cycle.
NOTE: it is recommended to test the output bit of the monostable only once in the
program.
PL7_REGISTER_32 : 32 word
memory register
71
Description
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
CAL R_1 (R := Raz, I := In_Pulse, O := Out_Pulse, E => Empty,
F => Full)
ST representation
Representation:
IF Raz THEN
RESET_PL7_REGISTER_32 (R_1) ;
END_IF ;
IF RE(In_Pulse) THEN
GET_PL7_REGISTER_32 (R_1) ;
END_IF ;
IF RE(Out_Pulse) THEN
PUT_PL7_REGISTER_32 (R_1) ;
END_IF ;
Empty := R_1.E ;
Full := R_1.F ;
Description of parameters
The following table describes the input parameters:
NOTE: when both inputs (store and destock) are activated simultaneously, storing
is carried out before destocking.
Description of variables
The following table describes the public variables:
Operating modes
The following table describes the specific modes of operation of the
PL7_REGISTER_32 function:
Effect... Description
of a cold restart (%S0=1), causes the initialization of the contents of the register. The
output bit indicating that the register is empty is set at 1.
of a warm restart (%S1=1) has no effect on the content of the register or on the state
of the output bits.
of a reset to zero The effect of the reset to zero differs according to the language
used :
z in LD and FBD, the input histories are updated with the cabled
values,
z in IL, the input histories are not updated and each input retains
the value it had prior to the call.
z in ST, the input histories are set to zero.
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
CAL R_1 (R := Raz, I := In_Pulse, O := Out_Pulse, E => Empty,
F => Full)
ST representation
Representation:
IF Raz THEN
RESET_PL7_REGISTER_255 (R_1) ;
END_IF ;
IF RE(In_Pulse) THEN
GET_PL7_REGISTER_255 (R_1) ;
END_IF ;
IF RE(Out_Pulse) THEN
PUT_PL7_REGISTER_255 (R_1) ;
END_IF ;
Empty := R_1.E ;
Full := R_1.F ;
Description of parameters
The following table describes the input parameters:
NOTE: when both inputs (store and destock) are activated simultaneously, storing
is carried out before destocking.
Description of variables
The following table describes the public variables:
Operating modes
The following table describes the specific modes of operation of the
PL7_REGISTER_255 function:
Effect... Description
of a cold restart (%S0=1), causes the initialization of the contents of the register. The
empty register output bit is set at 1.
of a warm restart (%S1=1) has no effect on the content of the register or on the state
of the output bits.
of a reset to zero The effect of the reset to zero differs according to the language
used :
z in LD and FBD, the input histories are updated with the cabled
values,
z in IL, the input histories are not updated and each input retains
the value it had prior to the call.
z in ST, the input histories are set to zero.
73
Differences between PL7 and Unity Pro: Timers
Introduction
This part explains the differences between the PL7 timers and IEC timers available
in Unity Pro. Those differences are useful especially when migrating from PL7
software to Unity Pro.
The PL7 timers include:
z PL7_TON
z PL7_TOF
z PL7_TP
The IEC timers include:
z TON
z TOF
z TP
74
Object of this chapter
This chapter describes the PL7_TOFfunction.
Description
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
CAL TOF_Timer_1(S := Timer_Start, Q => Timer_State)
ST representation
Representation:
IF RE(Timer_start) THEN
START_PL7_TOF (TOF_Timer_1) ;
END_IF ;
IF FE(Timer_Start) THEN
DOWN_PL7_TOF (TOF_Timer_1) ;
END_IF ;
Timer_State := TOF_Timer_1.Q ;
Description of parameters
The following table describes the input parameters:
Description of variables
The following table describes the public variables:
CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected
behavior of the application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.
Chart
Chart.
Operation
The following table describes the operation of the PL7_TOF timer function:
Phase Description
1 The current value TOF_Timer_1.ET takes the value 0, on a rising edge of the
TOF_Timer_1.S input (even if the timer is running at the time).
2 The output bit TOF_Timer_1.Q changes to 1.
3 When there is a falling edge on the TOF_Timer_1.S, input the timer is started.
4 The current value increases towards TOF_Timer_1.PT by one unit for each
pulse of the time base TB.
5 The output bit TOF_Timer_1.Q falls to 0 again as soon as the current value
reaches TOF_Timer_1.PT.
Description
The following table describes the specific modes of operation of the PL7_TOF timer
function:
Effect... Description
of a cold restart (%S0=1), causes a reset to zero of the current value, a reset to 0 of
the Q output and the preset value is reset to the value defined in the
configuration.
of a warm restart (%S1=1) has no effect on the current value of the timer or on the
preset value. The current value does not change during a power
outage.
a change to stop, Does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the timer block is
programmed does not freeze the current value ET which continues
to increase towards PT.
Similarly bit Q retains it normal function and can thus be tested by
another instruction. On the other hand the output, directly cabled to
the output Q, is not activated as it is not scanned by the PLC
of modifying the preset A modification to the preset value by instruction or adjustment is
only taken into account the next time the timer function is activated.
A modification of the preset value in the variables editor is only taken
into account after a cold restart (%S0=1).
75
Object of this chapter
This chapter describes the PL7_TONfunction.
Description
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
LD Timer_Start
CAL TON_Timer_1(S := TON_Timer_1, Q => Timer_State)
ST representation
Representation:
IF RE(Timer_start) THEN
START_PL7_TON (TON_Timer_1) ;
END_IF ;
IF FE(Timer_Start) THEN
DOWN_PL7_TON (TON_Timer_1) ;
END_IF ;
Timer_State := TON_Timer_1.Q ;
Description of parameters
The following table describes the input parameters:
Description of variables
The following table describes the public variables:
CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected
behavior of the application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.
Chart
Chart.
Operation
The following table describes the operation of the PL7_TON timer function:
Phase Description
1 When there is a rising edge on the TON_Timer_1.S, input the timer is started.
2 The current value TON_Timer_1.ET of the timer increases from 0 towards
TON_Timer_1.PT at a rate of one unit for each pulse of the time base TB.
3 The output bit TON_Timer_1.Q changes to 1 as soon as the current value
reaches TON_Timer_1.PT.
4 The TON_Timer_1.Q output bit remains at 1 while the TON_Timer_1.S input
is at 1.
5 When the TON_Timer_1.S input is at 0, the timer is stopped, even if it was
running at the time: TON_Timer_1.ET takes the value 0.
Description
The following table describes the specific modes of operation of the PL7_TON timer
function:
Effect... Description
of a cold restart (%S0=1), causes a reset to zero of the current value, a reset to 0 of
the Q output and the preset value is reset to the value defined in the
configuration.
of a warm restart (%S1=1) has no effect on the current value of the timer or on the
preset value. The current value does not change during a power
outage.
a change to stop, Does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the timer block is
programmed does not freeze the current value ET which continues
to increase towards PT.
Similarly bit Q retains it normal function and can thus be tested by
another instruction. On the other hand the output, directly cabled to
the output Q, is not activated as it is not scanned by the PLC.
of modifying the preset A modification to the preset value by instruction or adjustment is
only taken into account the next time the timer function is activated.
A modification of the preset value in the variables editor is only taken
into account after a cold restart (%S0=1).
76
Object of this chapter
This chapter describes the PL7_TP function.
Description
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
CAL TP_Timer_1(S := Timer_Start, Q => Timer_State)
ST representation
Representation:
IF RE(Timer_start) THEN
START_PL7_TP (TP_Timer_1) ;
END_IF ;
IF FE(Timer_Start) THEN
DOWN_PL7_TP (TP_Timer_1) ;
END_IF ;
Timer_State := TP_Timer_1.Q ;
Description of parameters
The following table describes the input parameters:
Description of variables
The following table describes the public variables:
CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected
behavior of the application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.
Chart
Chart.
Operation
The following table describes the operation of the PL7_TP timer function:
Phase Description
1 When there is a rising edge on the TP_Timer_1.S, input the timer is started
2 The output bit TP_Timer_1.Q changes to 1.
3 The current value TP_Timer_1.ET of the timer increases from 0 towards
TP_Timer_1.PT at a rate of one unit for each pulse of the time base TB
4 The output bit TP_Timer_1.Q falls to 0 again as soon as the current value
reaches TP_Timer_1.PT
5 When the TP_Timer_1.IN input and the TP_Timer_1.Q output are at 0,
TP_Timer_1.ET takes the value 0.
6 This monostable cannot be reset.
Description
The following table describes the specific modes of operation of the PL7_TP timer
function:
Effect... Description
of a cold restart (%S0=1), causes a reset to zero of the current value, a reset to 0 of
the Q output and the preset value is reset to the value defined in the
configuration.
of a warm restart (%S1=1) has no effect on the current value of the timer or on the
preset value. The current value does not change during a power
outage.
a change to stop, does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the timer block is
programmed does not freeze the current value ET which continues
to increase towards PT.
Similarly bit Q retains it normal function and can thus be tested by
another instruction. On the other hand the output, directly cabled to
the output Q, is not activated as it is not scanned by the PLC
of modifying the preset A modification to the preset value by instruction or adjustment is
only taken into account the next time the timer function is activated.
A modification of the preset value in the variables editor is only
taken into account after a cold restart (%S0=1).
Description
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
CAL PL7_3_Timer_1(E := Timer_Enable, C := Timer_Control, D =>
Timer_Done, R => Timer_Run)
ST representation
Representation:
IF Timer_Enable THEN
IF Timer_Control THEN
START_PL7_3_TIMER (PL7_3_Timer_1) ;
ELSE
STOP_PL7_3_TIMER (PL7_3_Timer_1) ;
END_IF
ELSE
PRESET_PL7_3_TIMER (PL7_3_Timer_1) ;
END_IF ;
Timer_Done := PL7_3_Timer_1.D ;
Timer_Run := PL7_3_Timer_1.R ;
Description of parameters
The following table describes the input parameters:
Description of variables
The following table describes the public variables:
CAUTION
UNEXPECTED BEHAVIOR AFTER WARM RESTART
Do no modify the time base (TB) in online mode, this would cause an unexpected
behavior of the application on warm restart.
Failure to follow these instructions can result in injury or equipment damage.
Chart
Chart.
E 0 0 1 1
C 0 1 0 1
PT ET = PT ET = PT ET frozen ET decreases by PT to 0
ET
D 0 1 0 1 if timer elapsed
R 0 1 0 1 if timer running
Operation
The following table describes the operation of the PL7_3_TIMER timer function:
Phase Description
1 The current value PL7_3_Timer_1.ET decreases from the preset
PL7_3_Timer_1.PT towards 0, by one unit per base time pulse.
2 The output bit PL7_3_Timer_1.R (Timer running) is then at state 1, the output
bit PL7_3_Timer_1.D (Timer elapsed) is at state 0.
3 When the current value PL7_3_Timer_1.ET = 0, PL7_3_Timer_1.D
changes to state 1 and PL7_3_Timer_1.R resets to state 0.
Description
The following table describes the specific modes of operation of the PL7_3_TIMER
function:
Effect... Description
of a cold restart (%S0=1), causes the writing of the preset value (defined in
configuration) in the current value and the resetting to zero of the
"Done" output, with any preset value modified during adjustment
(terminal) being lost.
of a warm restart (%S1=1) has no effect on the current value of the timer or on the
preset value.
a change to stop, Does not freeze the current value.
deactivation of a task
or execution of a
breakpoint
of a program jump The fact of not scanning the instructions where the timer block is
programmed does not freeze the current value ET which continues
to decrease towards 0.
Similarly the two output bits retain their normal operation and can
thus be tested by another instruction. On the other hand, the coils
directly cabled to the outputs are not activated since they are not
scanned by the PLC.
NOTE: it is recommended to test the output bits only one in the program as they may
change state in mid-cycle.
78
Description
Function description
This function copies values from input variable IN to the %MW register area (4x
register area for Quantum CPUs). OFF is the word offset in the %MW register area.
The function copies as many bytes as the size of the data type connected to the
input pin IN.
The value in OFF may be modified at runtime. If OFF is outside the configured %MW
register area, an error message is generated and ENO is set to 0.
The function writes in any case only until the end of the configured %MW area, even
if the connected data type could have more data. The remaining part of the
connected data type remains unread by the block in such cases.
EN and ENO can be configured as additional parameters.
Example
This function writes the 16-bit value of register %MW120 (register 400120), if OFF =
120 and the input is of data type INT.
This function writes only 1 word, if OFF addresses the last configured %MW, even if
the size of the connected IN variable is of larger size than a word.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD OffsetIn4XRegisterMemory
PUT_4X Input
Representation in ST
Representation:
PUT_4X (OffsetIn4XRegisterMemory, Input);
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
Description
Function description
This function converts an input value with data type REAL to data type INT and then
data type WORD.
As opposed to the REAL_TO_WORD conversion module (standard library), the
R_INT_WORD module performs a conversion to an INT value prior to output of the
WORD value. The result is, for example, that the input value -1.0 is output as output
value FFFF. (Not as with the REAL_TO_WORD module, for which in this case the
output value 0 is set).
As additional parameters, EN and ENO are projected.
Representation in FBD
Representation:
Representation in LD
Appearance:
Representation in IL
Appearance:
LD RealValue
R_INT_WORD
ST WordValue
Representation in ST
Appearance:
WordValue := R_INT_WORD (RealValue);
Parameter description
Description of input parameters:
Runtime error
The system bit %S18 (see page 615) and system words %SW17 (see page 621)
(error status) and %SW125 (see page 636) (16#DE87: Caldulation errors in a
floating point value calculation) are set when
z an unauthorized floating point number is set at the input,
z the value range of the data type INT is exceeded,
Description
Function description
This function converts an input value with data type REAL to data type UINT and
then data type WORD.
As opposed to the conversion module REAL_TO_WORD (standard library) the
R_UINT_WORD module performs a conversion to a UINT value before output of a
WORD value (value range 0 - 65535). This results in that the input value -1.0 causes
an error message, the outputENO is set, and the output value remains unchanged.
(Not as with the REAL_TO_WORD module, for which the output value 0 is set without
error message in this case).
As additional parameters, EN and ENO are projected.
Representation in FBD
Representation:
Representation in LD
Appearance:
Representation in IL
Appearance:
LD RealValue
R_UINT_WORD
ST WordValue
Representation in ST
Appearance:
WordValue := R_UINT_WORD (RealValue);
Parameter description
Description of input parameters:
Runtime error
The system bit %S18 (see page 615) and system words %SW17 (see page 621)
(error status) and %SW125 (see page 636) (16#DE87: Caldulation errors in a
floating point value calculation) are set when
z an unauthorized floating point number is set at the input,
z the value range of the data type UINT is exceeded,
z a negative input value is to be converted.
81
Introduction
This chapter describes the R2T_*** block.
Description
Function description
This function block copies the value entered at SRC to the DEST parameter which is
interpreted as a table.
EN and ENO can be configured as additional parameters.
Available functions
The following blocks are available:
z R2T_INT
z R2T_DINT
z R2T_UINT
z R2T_UDINT
z R2T_REAL
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL R2T_Instance (NOINC:=FreezesPointerValue,
R:=ResetPointerValue, SRC:=SourceData,
OFF:=PositionInTable, END=>PointerStatus,
DEST=>DestinationTable)
Representation in ST
Representation:
R2T_Instance (NOINC:=FreezesPointerValue,
R:=ResetPointerValue, SRC:=SourceData,
OFF:=PositionInTable, END=>PointerStatus,
DEST=>DestinationTable) ;
Parameter description
Description of input parameters:
Detailed description
Mode of Operation
R2T_*** copies the value entered at SRC to the DEST parameter which is
interpreted as a table.
The OFF parameter, an offset, points to the position in the destination field (array)
where the source value is to be saved.
In each cycle, the function copies the value from SRC to DEST[OFF] and increments
the offset value by the size of the data type in the table, i.e. OFF+1.
The offset value is automatically raised in each cycle as long as the NOINC
parameter does not have the value 1. OFF is of the read/write type, equivalent to the
VAR_IN_OUT IEC parameters
Association between OFF, NOINC and R:
DEST is type ANY which implicates a pre-defined length. The same type is accepted
as the data type for this array as for SRC irrespective of the type entered for the run
time (it could be a structure of various types).
OFF undergoes a boundary check in each cycle. If OFF exceeds the length of the
table (internal parameter size), END is set to 1 and OFF is no longer increased (the
function no longer copies until OFF accepts a value within the table’s boundaries
again.
Description
Function description
The READ_PCMCIA function transfers data from the user memory card archiving
zone to the PLC RAM memory. The function READ_U_PCMCIA enables to address
the PLC zone's beginning to be copied to the PCMCIA card up to 65 535 (instead of
32 767 for READ_PCMCIA function) and is therefore recommended to be used
instead of READ_PCMCIA function.
The additional parameters EN and ENO can be configured.
An example using the functions READ_PCMCIA and WRITE_PCMCIA is available,
READ_PCMCIA and WRITE_PCMCIA example (see page 540).
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Slot_Number
READ_PCMCIA Source_Address, Words_Number, Dest_Address,
Read_State
Representation in ST
Representation:
READ_PCMCIA(Slot_Number, Source_Address, Words_Number,
Dest_Address, Read_State);
Source_Address DINT First address where the data is read from the memory
card (0...).
Words_Number INT Number of words to be read.
Dest_Address INT First address where the data is written in the PLC
(%MW). The upper limit of the address is: 32 767.
Objectives
This example shows how to use the READ_PCMCIA and WRITE_PCMCIA function
blocks by:
z Writing values from words (%MW100 to %MW109) to a memory card.
z Reading values from the memory card to words (%MW110 to %MW119).
NOTE: In this example, to use those function blocks, a memory card must be
connected into the PLC.
Function Description
The ROR1_ARB function is used to perform a rotation shift to the right of a byte in a
PL7 byte table. Using Unity Pro, the PL7 byte tables have become character strings.
This is therefore the rotation shift of a byte to the right in a character string.
The additional parameters EN and ENO can be configured.
FBD representation
Representation:
LD representation
Representation:
IL representation
Representation:
LD String1
ROR1_ARB
ST representation
Representation:
ROR1_ARB(String1);
Parameter Description
The following table describes the input/output parameters:
84
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
RRTC
ST Result_Date
Representation in ST
Representation:
RRTC(Result_Date);
Description of parameters
The following table describes the output parameters:
Function description
The SCOUNT function carries out up/down counting with overshoot signaling.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Valid
SCOUNT Presel_Value, Count_Up, Count_Down, Minimum, Maximum,
Mem_Word, Output_Qmin, Output_Qmax, Count_Value
Representation in ST
Representation:
SCOUNT(Valid, Presel_Value, Count_Up, Count_Down, Minimum,
Maximum, Mem_Word, Output_Qmin, Output_Qmax, Count_Value);
Description of parameters
The following table describes the input parameters:
NOTE:
z If (en) = 0 then the function is no longer enabled and on each call, we have:
Output_Qmin = Output_Qmax = 0
Mem_Word:X0 = Mem_Word:X1 = 0, Count_Value = Presel_Value
z If Maximum > Minimum then:
Count_Value ≥ Maximum entails: Output_Qmax = 1 and Output_Qmin = 0
Minimum < Count_Value < Maximum entails: Output_Qmax = Output_Qmin
= 0
Count_Value ≤Minimum entails: Output_Qmax = 0 and Output_Qmin = 1
z If Maximum < Minimum then:
Maximum ≤Count_Value ≤Minimum entails: Output_Qmax = 1 and
Output_Qmin = 0
Count_Value < Maximum entails: Output_Qmax = 0 and Output_Qmin = 1
Count_Value > Maximum entails: Output_Qmax = 1 and Output_Qmin = 0
z If Maximum = Minimum then:
Count_Value < Maximum and Minimum entails: Output_Qmax = 0 and
Output_Qmin = 1
Count_Value ≥ Maximum and Minimum entails: Output_Qmax = 1 and
Output_Qmin = 0
z A modification of the Presel_Value parameter with Enable set to 1 has no
impact on operation.
z A negative value for the Presel_Value and Minimum parameters is interpreted
as a nil value.
z A value of less than 1 for the Maximum parameter is interpreted as equal to 1.
Timing diagram
Functional timing diagram:
86
Description
Function description
This function sets the bit of the OutputRegister output word selected with
BitNumber to the value of InputData.
The BitNumber parameter provides the bit number in the output data.
WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to
possible forced values in the reference data editor. This can produce serious
process conditions.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD InputData
SET_BIT BitNumber
ST OutputRegister
Representation in ST
Representation:
OutputRegister := SET_BIT (InputData, BitNumber);
Parameter description
Description of input parameters:
Runtime error
For a list of all block error codes and values, see Extension/Compatibility, page 609.
Function description
The SET_PCMCIA function enables all or part of the user memory card's archiving
zone to be initialized at the desired value.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Slot_Number
SET_PCMCIA Address, Words_Number, Init_Value, Init_State
Representation in ST
Representation:
SET_PCMCIA(Slot_Number, Address, Words_Number, Init_Value,
Init_State);
Function description
The function SHL_RBIT_*** performs a shift to the left for an integer or a double
integer, with recovery of the moved bits.
The additional parameters EN and ENO can be configured.
Available functions
List of available functions:
z SHL_RBIT_INT,
z SHL_RBIT_DINT.
Representation in FBD
Representation applied to an integer:
Representation in LD
Representation applied to an integer:
Representation in IL
Representation applied to an integer:
LD Input_Var
SHL_RBIT_INT Shift_Num, Shifted_Var, Shifted_Bits
Representation in ST
Representation applied to an integer:
SHL_RBIT_INT(Input_Var, Shift_Num, Shifted_Var,
Shifted_Bits);
Example: Shift_Num = 4.
Function description
The SHR_RBIT_*** function performs a shift to the right on an integer or a double
integer with sign extension and recovery of the shifted bits.
The additional parameters EN and ENO can be configured.
Available functions
List of available functions:
z SHR_RBIT_INT,
z SHR_RBIT_DINT.
Representation in FBD
Representation applied to a double integer:
Representation in LD
Representation applied to a double integer:
Representation in IL
Representation applied to a double integer:
LD Input_Var
SHR_RBIT_DINT Shift_Num, Shifted_Var, Shifted_Bits
Representation in ST
Representation applied to a double integer:
SHR_RBIT_DINT(Input_Var, Shift_Num, Shifted_Var,
Shifted_Bits);
Example: Input_Var =
2#10000000111100010000000011001111.
Shift_Num INT Value of the shift to be performed.
Example: Shift_Num = 6.
Function description
The function SHRZ_*** performs a shift to the right on an integer or a double integer
and fills the shift register with zeros.
The additional parameters EN and ENO can be configured.
Available functions
List of available functions:
z SHRZ_INT,
z SHRZ_DINT.
Representation in FBD
Representation applied to an integer:
Representation in LD
Representation applied to an integer:
Representation in IL
Representation applied to an integer:
LD Input_Var
SHRZ_INT Shift_Num
ST Shifted_Var
Representation in ST
Representation applied to an integer:
Shifted_Var := SHRZ_INT(Input_Var, Shift_Num);
Example: Shift_Num = 4.
Function description
The function SHRZ_RBIT_*** performs a shift to the right on an integer or a double
integer, fills the shift register with zeros and recovers the shifted bits.
The additional parameters EN and ENO can be configured.
Available functions
List of available functions:
z SHRZ_RBIT_INT,
z SHRZ_RBIT_DINT.
Representation in FBD
Representation applied to an integer:
Representation in LD
Representation applied to an integer:
Representation in IL
Representation applied to an integer:
LD Input_Var
SHRZ_RBIT_INT Shift_Num, Shifted_Var, Shifted_Bits
Representation in ST
Representation applied to an integer:
SHRZ_RBIT_INT(Input_Var, Shift_Num, Shifted_Var,
Shifted_Bits);
Example: Shift_Num = 4.
SRCH: Search
92
Introduction
This chapter describes the SRCH block.
Description
Function description
This function block searches a source table for an entered bit pattern. It increments
the directory in the source table in each released cycle and checks whether the
displayed Array element matches the defined pattern or not.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Appearance:
Representation in IL
Representation:
CAL SRCH_Instance (TRIG:=StartsSearch, CONT:=ContinueSearch,
SRC:=SourceTable, PATTERN:=BitPatternForSearch,
INDEX:=FindingPlace, FOUND=>FoundPattern)
Representation in ST
Representation:
SRCH_Instance (TRIG:=StartsSearch, CONT:=ContinueSearch,
SRC:=SourceTable, PATTERN:=BitPatternForSearch,
INDEX:=FindingPlace, FOUND=>FoundPattern) ;
Parameter description
Description of input parameters:
Detailed description
Function description
The SRCH function block searches a source table for an entered bit pattern. It
increments the directory in the source table in each released cycle marked TRIG
and checks whether the Array element displayed with INDEX matches the defined
pattern or not. The result is displayed at the FOUND output.
SRC (source) is type ANY which implicates a pre-defined length. This field (array) is
interpreted as an ARRAY with the same data type (INT, DINT, UINT, UDINT, REAL)
as the data type used at the PATTERN input. To enable correct work methods, make
sure that the data type of PATTERN is identical to that of the array to be searched
for. A binary comparison is performed in each cycle between PATTERN and an Array
element. The length of the comparison is always derived from the length of
PATTERN; the length of the Array element is not considered.
TRIG detects the rising edge and starts the search for one cycle. The search will
stop after this cycle until the next rising edge is detected at TRIG.
PATTERN is the bit pattern to be searched for.
The CONT parameter defines whether to continue the search or to resume it at the
beginning of the table after a pattern has been found.
Once the pattern is found, FOUND is set to "1" and the INDEX parameter shows
where in the table the pattern has been found.
Function description
The STR_ROUND function provides the approximate value of a floating point number
expressed in the form of a character string.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Real_Str
STR_ROUND Pos, Rounded_Str
Representation in ST
Representation:
STR_ROUND(Real_Str, Pos, Rounded_Str);
Example: ’-1.1354942e-30’
Pos INT Position from which the rounding off is performed. The
position is calculated from the decimal separator, and
the calculation is inclusive of the separator.
Example: 2
Runtime errors
The length of the original and resulting character strings must be between 15 and
255. Otherwise , the system bit %S15 (see page 615) is set to 1.
The parameter Pos must be between 0 and 8. Otherwise, the bit %S20
(see page 615) is set to 1. Special case for Pos = 0 and Pos = 8, the rounding off is
not performed, Real_Str = Rounded_Str.
When the last character different to zero is greater than 5, the preceding character
is incremented.
94
Description
Available functions
The available functions are as follows:
z SUB_DT_PL7,
z SUB_TOD_PL7.
Representation in FBD
Representation applied to a time of day:
Representation in LD
Representation applied to a time of day:
Representation in IL
Representation applied to a time of day:
LD Source_Value
SUB_TOD_PL7 Time_to_Sub
ST Result_Value
Representation in ST
Representation applied to a time of day:
Result_Value := SUB_TOD_PL7(Source_Value, Time_to_Add);
Description of parameters
The following table describes the input parameters:
Execution errors
If Source_Value is in the DINT format (TOD of PL7), there is a change of day if
Result_Value is outside of the range of authorized values. In this case the system
bit %S18 (see page 615) is set at 1 and the value of Result_Value is only
significant with a modulo 24:00:00.
If Source_Value is in the ARRAY [0..3] OF INT format (DT of PL7), if
Result_Value is outside the authorized range of values, the system bit %S18
(see page 615) is set at 1 and the value of Result_Value is also at the minimum
limit.
If one of the input parameters cannot be interpreted and is inconsistent with the
function format then the system bit %S18 (see page 615) is set at 1 and
Result_Value applies:
z 00:00:00 for the TOD type of PL7.
z 00001-01-01-00:00:00 for the DT type of PL7.
95
Description
Function description
This function block displays the status of the PLC.
SYSSTATE is task-specific and can be used in MAST, FAST and AUX tasks.
SYSSTATE cannot be used in EVT tasks.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL SYSSTATE_Instance (COLD=>ColdStartCycle,
WARM=>WarmStartCycle, ERROR=>ErrorInBuffer)
Representation in ST
Representation:
SYSSTATE_Instance (COLD=>ColdStartCycle,
WARM=>WarmStartCycle, ERROR=>ErrorInBuffer) ;
Parameter description
Description of output parameters:
NOTE: In cold start cycle both outputs COLD and WARM are set to "1".
96
Introduction
This chapter describes the T2T block.
Description
Function description
This function block copies the value from the SRC parameter to the DEST parameter.
Both tables have to be of the same data type.
When setting OFF to 0 the copy operation is blocked. In this case the function block
sets END to 1 and doesn't perform any data copying.
If the sum of OFF and SIZE is outside of the DEST table END is also set to 1.
Independent from the data type of SRC and DEST the function block copies on a word
base (16 bits). This results in the following behavior:
z In case of arrays defined of data types smaller than 16 bits (e.g. BOOL, EBOOL,
BYTE) the function block copies two values at once. Due to this, the number of
elements in the source and destination table has to be even.
z In case of arrays defined of 32 bits data types (e.g. DINT, UDINT, REAL) the
function block has to copy 2 words per array element. Due to this, the parameters
OFF and SIZE has to be increased by 2 per array element to copy.
In general the copy operation will only be performed for END=0.
If NOINC is set to 0, the value of OFF increases by SIZE after each copy operation.
EN can be configured as additional parameter.
NOTE: ENO is not supported by this function block (value is always 1).
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL T2T_Instance (NOINC:=FreezesPointerValue,
R:=Reset, SRC:=SourceData,
SIZE:=NumberOfWordsToCopy, OFF:=Offset,
END=>PointerValue, DEST=>DestinationTable)
Representation in ST
Representation:
T2T_Instance (NOINC:=FreezesPointerValue,
R:=Reset, SRC:=SourceData,
SIZE:=NumberOfWordsToCopy, OFF:=Offset,
END=>PointerValue, DEST=>DestinationTable) ;
Parameter description
Description of input parameters:
Detailed Description
Mode of Operation
This function copies the value from the SRC parameter, which is interpreted as a
table, to the DEST parameter, which is also interpreted as a table.
The parameter OFF points into both tables. It is an index for the source array and the
destination array where the source value should be copied from and to.
In each cycle the function copies the value of SRC[OFF] to DEST[OFF].
The offset will be incremented in each cycle by the number of 16 bit words, which
are copied, unless the parameter NOINC is 1. OFF is of the read/write type,
equivalent to the VAR_IN_OUT IEC parameters
A parameter SIZE tells the EFB how many words have to be copied every cycle.
OFF is reset if the parameter R has the value 1 before copying.
SRC and DEST are type ANY, which implies a predefined length. These variables will
be interpreted as an ARRAY of bytes regardless of the type definition for these
parameters (they may be a structure of different types).
OFF undergoes a boundary check each cycle. If OFF exceeds the length of one of
the tables, then END is set to 1 and OFF is not incremented. The function will not copy
any more data until OFF returns within its boundaries.
TIME_DINT_TO_STRING:
Conversion of a variable to DINT
format 97
Description
Function description
The function TIME_DINT_TO_STRING is used to convert a variable in DINT format
(TIME using PL7) into a character string.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Time1
TIME_DINT_TO_STRING
ST Result_Str
Representation in ST
Representation:
Result_Str := TIME_DINT_TO_STRING(Time1);
Description of parameters
The following table describes the input parameters:
Example: ’119304:38:49.5’
Runtime errors
If the string Result_Str is too short to contain the date (length = less than 15
characters), the date is truncated and the bit %S15 (see page 615) is set to 1.
TOD_DINT_TO_STRING:
Conversion of a variable to TOD
format 98
Description
Function description
The function TOD_DINT_TO_STRING is used to convert a TOD format PL7 variable,
or DINT double integer, into a character string.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Time1
TOD_DINT_TO_STRING
ST Result_Str
Representation in ST
Representation:
Result_Str := TOD_DINT_TO_STRING(Time1);
Description of parameters
The following table describes the input parameters:
Runtime errors
If the string Result_Str is too short to contain the converted value (length = less
than 8 characters), it is truncated and the bit %S15 (see page 615) is set to 1.
TRANS_TIME: Conversion of a
duration into DINT format
99
Description
Function description
The function TRANS_TIME is used to convert a duration in DINT format (TIME using
PL7) into a number.
z of hours (HHHH),
z of minutes (MM),
z of seconds (SS).
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Time1
TRANS_TIME
ST Result_DINT
Representation in ST
Representation:
Result_DINT := TRANS_TIME(Time1);
Runtime errors
The maximum possible value is therefore 9999 hours, 59 minutes and 59 seconds,
or 359,999,990 tenths of a second.
If Time1 is ≥ 360,000,000, there is an overflow, the bit %S15 (see page 615)
switches to 1 and Result_DINT = 16#00000000
Description
Function description
This function converts an input value with data type WORD to data type INT and then
data type REAL.
As opposed to the WORD_TO_REAL conversion module (standard library), the
W_INT_REAL module performs a conversion to an INT value prior to output of the
REAL value. The result is, for example, that the input value FFFF is output as output
value -1.0. (Not as with the WORD_TO_REAL module, for which the output value
9.183409e-41 is set).
As additional parameters, EN and ENO are projected.
Representation in FBD
Representation:
Representation in LD
Appearance:
Representation in IL
Appearance:
LD WordValue
W_INT_REAL
ST RealValue
Representation in ST
Appearance:
RealValue := W_INT_REAL (WordValue);
Parameter description
Description of input parameters:
Description
Function description
This function converts an input value with data type WORD to data type UINT and
then data type REAL.
As opposed to the WORD_TO_REAL conversion module (standard library), the
W_UINT_REAL module performs a conversion to a UINT value prior to output of the
REAL value. The result is, for example, that the input value FFFF is output as output
value 65535.0. (Not as with the WORD_TO_REAL module, for which the output value
9.183409e-41 is set).
As additional parameters, EN and ENO are projected.
Representation in FBD
Representation:
Representation in LD
Appearance:
Representation in IL
Appearance:
LD WordValue
W_UINT_REAL
ST RealValue
Representation in ST
Appearance:
RealValue := W_UINT_REAL (WordValue);
Parameter description
Description of input parameters:
Function description
The WRITE_PCMCIA function transfers data from the PLC's RAM memory to the
user memory card archiving zone. The function WRITE_U_PCMCIA enables to
address the PLC zone's beginning to be copied to the PCMCIA card up to 65 535
(instead of 32 767 for WRITE_PCMCIA function) and is therefore recommended to
be used instead of WRITE_PCMCIA function.
The additional parameters EN and ENO can be configured.
An example using the functions READ_PCMCIA and WRITE_PCMCIA is available,
READ_PCMCIA and WRITE_PCMCIA example (see page 540).
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Slot_Number
WRITE_PCMCIA Dest_Address, Words_Number, Source_Address,
Write_State
Representation in ST
Representation:
WRITE_PCMCIA(Slot_Number, Dest_Address, Words_Number,
Source_Address, Write_State);
103
Description
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Date1
WRTC
Representation in ST
Representation:
WRTC(Date1);
Description of parameters
The following table describes the input parameters:
Appendices
Overview
This section contains the appendicies.
A
Introduction
The following tables show the error codes and error values created for the EFBs of
the Obsolete Library.
Introduction
The following tables show the error codes and error values created for the EFBs of
the Obsolete Library.
CLC
Table of error codes and errors values created for EFBs of the CLC family.
CLC_PRO
Table of error codes and errors values created for EFBs of the CLC_PRO family.
Extension/Compatibility
Table of error codes and errors values created for EFBs of the
Extension/Compatibility family.
Introduction
The following table shows the commen error codes and error values created for
floating point errors.
System Objects
B
Subject of this Chapter
This chapter describes the system bits and words of Unity Pro language.
Note: The symbols, associated with each bit object or system word, mentioned in
the descriptive tables of these objects, are not implemented as standard in the
software, but can be entered using the data editor.
They are proposed in order to ensure the homogeneity of their names in the different
applications.
General
The Modicon M340, Premium, Atrium and Quantum PLCs use %Si system bits
which indicate the state of the PLC, or they can be used to control how it operates.
These bits can be tested in the user program to detect any functional development
requiring a set processing procedure.
Some of these bits must be reset to their initial or normal state by the program.
However, the system bits that are reset to their initial or normal state by the system
must not be reset by the program or by the terminal.
Detailed Description
Description of system bits %S15 to %S21:
CAUTION
UNEXPECTED APPLICATION BEHAVIOR - SPECIFIC VARIABLE BEHAVIOR
On Quantum, network communication errors with remote devices detected by
communication modules (NOM, NOE, NWM, CRA, CRP) and motion modules
(MMS) are not reported on bits %S10, %S16 and %S119.
Failure to follow these instructions can result in injury or equipment damage.
Detailed Description
Description of system words %SW0 to %SW11.
CAUTION
UNEXPECTED APPLICATION BEHAVIOR
Before setting the %SW9 value to 1, ensure that the output behavior will remain
appropriate:
On Premium/Atrium:
Module outputs located on the X Bus automatically switch to the configured
mode(fallback or maintain). On the Fipio bus, certain devices do not manage
fallback mode, then only maintain mode is possible.
On Quantum:
All outputs, as well as the local or remote rack (RIO) are maintained in the state
that preceded the switch to 1 of the %SW9 bit corresponding to the task.
The Distributed Inputs/Outputs (DIO) are not assigned by the system word %SW9.
Failure to follow these instructions can result in injury or equipment damage.
Detailed Description
Description of system words %SW12 to %SW29:
Detailed Description
Description of system words %SW70 to %SW100.
Detailed Description
Description of system words %SW123 to %SW127.
Glossary
0-9
%I
According to the CEI standard, %I indicates a language object of type discrete IN.
%IW
According to the CEI standard, %IW indicates a language object of type analog IN.
%KW
According to the CEI standard, %KW indicates a language object of type constant
word.
%M
According to the CEI standard, %M indicates a language object of type memory bit.
%MW
According to the CEI standard, %MW indicates a language object of type memory
word.
%Q
According to the CEI standard, %Q indicates a language object of type discrete OUT.
%QW
According to the CEI standard, %QW indicates a language object of type analog OUT.
ADDM_TYPE
This predefined type is used as an output for the ADDM function. This is an
ARRAY[0..8] OF Int. You can find it in the library, in the same family as the EFs that
use it.
ADDR_TYPE
This predefined type is used as an output for the ADDR function. This is an
ARRAY[0..5] OF Int. You can find it in the library, in the same family as the EFs that
use it.
ANL_IN
ANL_IN is the abbreviation of the analog input data type. It is used when processing
analog values. %IW addresses in the configured analog input module, which are
specified in the list of I/O components, are automatically assigned to data types, and
therefore must be occupied by unassigned variables only.
ANL_OUT
ANL_OUT is the abbreviation of the analog output data type. It is used when
processing analog values. %MW addresses in the configured analog input module,
which are specified in the list of I/O components, are automatically assigned to data
types, and therefore must be occupied by unassigned variables only.
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:
ARRAY
An ARRAY is a table containing elements of a single type.
The syntax is as follows: ARRAY [<limits>] OF <Type>
Example:
ARRAY [1..2] OF BOOL is a one-dimensional table with two elements of type
BOOL.
ARRAY [1..10, 1..20] OF INT is a two-dimensional table with 10x20
elements of type INT.
Assigned variables
A variable whose position in the PLC memory can be known. For example, the
Water_pressure variable is associated with %MW102. Water_pressure is said
to be assigned.
BCD
BCD is the abbreviation of the Binary Coded Decimal format.
BCD can be used to represent decimal numbers between 0 and 9 using a set of four
bits (nybble).
In this format, the four bits used to encode decimal numbers have an unused range
of combinations.
Example of BCD encoding:
z The number 2,450
z is encoded: 0010 0100 0101 0000
BOOL
BOOL is the abbreviation for the Boolean type. This is the basic data type in
computing. A BOOL variable can have either of the following two values: 0 (FALSE)
or 1 (TRUE).
A bit extracted from a word is of type BOOL, for example: %MW10.4.
BYTE
When 8 bits are grouped together, they are called a BYTE. You can enter a BYTE
either in binary mode or in base 8.
The BYTE type is encoded in an 8 bit format which, in hexadecimal format, ranges
from 16#00 to 16#FF.
DATE
The DATE type, encoded in BCD in a 32 bit format, contains the following
information:
z the year encoded in a 16 bit field;
z the month encoded in an 8 bit field;
z the day encoded in an 8 bit field.
The DATE type must be entered as follows: D# <Year> - <Month> - <Day>
This table shows the upper/lower limits of each field:
DATE_AND_TIME
See DT.
DBCD
Representation of a double integer in double BCD format.
BCD format can be used to represent decimal numbers between 0 and 9 using a set
of four bits.
In this format, the four bits used to encode decimal numbers have an unused range
of combinations.
Example of DBCD encoding:
z The number 78,993,016
z is encoded: 0111 1000 1001 1001 0011 0000 0001 0110
DDT
DDT is the abbreviation of Derived Data Type.
A derived data type is a set of elements with the same type (ARRAY) or with different
types (structure).
DFB
DFB is the abbreviation of Derived Function Block.
DFB types are function blocks that can be defined by the user in ST, IL, LD or FBD
language.
Using these DFB types in an application makes it possible to:
z simplify the design and entry of the program;
z make the program easier to read;
z make it easier to debug;
z reduce the amount of code generated.
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.
DT
DT is the abbreviation of Date and Time.
The DT type, encoded in BCD in a 64 bit format, contains the following information:
z the year encoded in a 16 bit field;
z the month encoded in an 8 bit field;
z the day encoded in an 8 bit field;
z the time encoded in an 8 bit field;
z the minutes encoded in an 8 bit field;
z the seconds encoded in an 8 bit field.
NOTE: The 8 least significant bits are not used.
The DT type must be entered as follows:
DT# <Year> - <Month> - <Day> - <Hour> : <Minutes> : <Seconds>
DWORD
DWORD is the abbreviation of Double Word.
The DWORD type is encoded in a 32 bit format.
This table shows the upper/lower limits of each of the bases that can be used:
Examples of representation:
EBOOL
EBOOL is the abbreviation of Extended BOOLean. An EBOOL type has a value (0
(FALSE) or 1 (TRUE), but also rising or falling edges and forcing functions.
An EBOOL variable occupies one byte in memory.
The byte contains the following information:
z one bit for the value;
z one bit for the history (whenever the object changes state, the value is copied to
the history bit);
z one bit for forcing (equal to 0 if the object is not forced, or 1 if the bit is forced).
The default value of each bit is 0 (FALSE).
EF
EF is the abbreviation of Elementary Function.
This is a block used in a program which performs a predefined logical function.
A function does not have any information on the internal state. Several calls to the
same function using the same input parameters will return the same output values.
You will find information on the graphic form of the function call in the "[functional
block (instance)]". Unlike a call to a function block, function calls include only an
output which is not named and whose name is identical to that of the function. In
FBD, each call is indicated by a unique [number ] via the graphic block. This number
is managed automatically and cannot be modified.
You position and configure these functions in your program in order to execute your
application.
You can also develop other functions using the SDKC development kit.
EFB
EFB is the abbreviation of Elementary Function Block.
This is a block used in a program which performs a predefined logical function.
EFBs have states and internal parameters. Even if the inputs are identical, the
output values may differ. For example, a counter has an output indicating that the
preselection value has been reached. This output is set to 1 when the current value
is equal to the preselection value.
Elementary function
See EF.
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):
z the status of the function block outputs remains the same as it was during the
previous scanning cycle that executed correctly;
z the output(s) of the function, as well as the procedures, are set to "0".
FBD
FBD is the abbreviation of Function Block Diagram.
FBD is a graphical programming language that works like a flowchart. By adding
simple logical blocks (AND, OR, etc.), each function or function block in the program
is represented in this graphical format. For each block, the inputs are on the left and
the outputs on the right. Block outputs can be linked to inputs of other blocks in order
to create complex expressions.
FFB
Collective term for EF (elementary function), EFB (elementary function block) and
DFB (derived function block).
FTP
File Transfer Protocol.
Function
See EF.
Global Data
Global Data provides the automatic exchange of data variables for the coordination
of PLC applications.
GRAY
The Gray code, or "reflected binary", is used to encode a numerical value developed
in a string of binary configurations that may be differentiated by changing the status
of a single bit.
For example, this code can be used to avoid the following random event: in pure
binary, changing the value 0111 to 1000 may produce a range numbers between 0
and 1,000, given that the bits do not all change value at the same time.
Equivalence between decimal, BCD and Gray:
HTTP
Hypertext Transfer Protocol
I/O scanning
An I/O scan continuously polls I/O modules to collect data bits and status, error, and
diagnostics information. This process monitors inputs and control outputs.
IEC 61131-3
International standard: programmable logic controllers
Part 3: programming languages
IL
IL is the abbreviation of Instruction List.
This language is a series of basic instructions.
It is very close to assembly language used to program processors.
Each instruction is made up of an instruction code and an operand.
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.
IODDT
IODDT is the abbreviation of Input/Output Derived Data Type.
The term IODDT indicates a structured data type representing a module or a
channel of a PLC module. Each expert module has its own IODDTs.
Keyword
A keyword is a unique combination of characters used as a syntax element in a
programming language (see the definition provided in appendix B of the IEC 61131-
3 standard. All the keywords used in Unity Pro and included in the IEC 61131-3
standard appear in appendix C of that standard. Keywords cannot be used as
identifiers [names of variables, sections, DFB types, etc.] in your program).
LD
LD is the abbreviation of Ladder Diagram.
LD is a programming language that represents instructions to be executed as
graphical diagrams very similar to electrical diagrams (contacts, coils, etc.).
Multitoken
Operating mode of an SFC. In multitoken mode, the SFC can have several steps
that are active simultaneously.
NAN
Used to indicate that the result of an operation is not a number (NAN = Not A
Number).
Example: calculating the square root of a negative number.
NOTE: The CEI 559 standard defines two classes of NAN: the silent NAN (QNAN)
and the signaling NAN (SNAN). A QNAN is a NAN with a most significant fraction
bit while an SNAN is a NAN without a most significant fraction bit (bit number 22).
QNANs can be propagated via most arithmetic operations without throwing an
exception. As for SNANs, they generally indicate an invalid operation when they are
used as operands in arithmetic operations (see %SW17 and %S18).
Network
There are two meanings of the work "network".
z In LD:
a network is a set of interconnected graphic elements. The scope of a network
is local, concerning the organizational unit (section) of the program containing the
network.
z With expert communication modules:
a network is a set of stations that intercommunicate. The term "network" is also
used to define a group interconnected graphic elements. This group then makes
up part of a program that may comprise a group of networks.
Peer cop
Peer Cop service is a mechanism for automatic exchange between stations
connected on the same Modbus Plus segment.
Procedure
Procedures are technically functional views. The only difference with elementary
functions is the fact that procedures can include more than one output and that they
handle the VAR_IN_OUT data type. In appearance, procedures are no different from
elementary functions.
Procedures are an extension to the IEC 61131-3 standard.
REAL
The REAL type is encoded in a 32 bit format.
The possible value ranges are shown in the figure below:
SFC
SFC is the abbreviation of Sequential Function Chart.
An SFC can be used to graphically represent in a structured manner the operation
of a sequential PLC. This graphical description of the PLC's sequential behavior and
of the various resulting situations is created using simple graphic symbols.
SIL
Safety Integrity Level
Safety functions are executed to achieve and maintain the safe state of a system.
The IEC 61508 specifies 4 levels of safety performance for a safety function. These
are called safety integrity levels (SIL), ranging from 1 (the lowest) to 4 (the highest).
The Quantum Safety PLC is certified for use in SIL2 applications in which the de-
energized state is the safe state, for example in an Emergency Shutdown (ESD)
system.
You can use the Schneider safety products for creating a Hot Standby (HSBY)
solution if you require high availability for a safety system.
Single token
Operating mode for an SFC diagram in which only one step can be active at a given
time.
SNMP
Simple Network Management Protocol.
ST
ST is the abbreviation of Structured Text.
The structured literal language is a developed language similar to computer
programming languages. It can be used to organize a series of instructions.
STRING
A STRING variable is a series of ASCII characters. The maximum length of a string
is 65,534 characters.
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
TIME_OF_DAY
See TOD.
TOD
TOD is the abbreviation of Time Of Day.
The TOD type, encoded in BCD in a 32 bit format, contains the following information:
z the hour encoded in an 8 bit field;
z the minutes encoded in an 8 bit field;
z the seconds encoded in an 8 bit field.
NOTE: The 8 least significant bits are not used.
The TOD type must be entered as follows: TOD# <Hour> : <Minutes> :
<Seconds>
This table shows the upper/lower limits of each field:
Example: TOD#23:59:45.
Token
Active step in an SFC.
TOPO_ADDR_TYPE
This predefined type is used as an output for the READ_TOPO_ADDR function.
This is an ARRAY[0..4] OF Int. You can find it in the library, in the same family as
the EFs that use it.
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.
UDP
user datagram protocol. UDP is a connectionless Internet communications protocol
defined by IETF RFC 768. This protocol facilitates the direct transmission of
datagrams on IP networks. UDP/IP messages do not expect a response, and are
therefore ideal for applications in which dropped packets do not require
retransmission (such as streaming video and networks that demand real-time
performance).
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.
Unassigned variables
A variable whose position in the PLC memory cannot be known. A variable that is
not linked to an address is called unassigned variable.
Variable
Memory entity of type BOOL, WORD, DWORD, etc., whose contents can be modified by
the program currently running.
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
B
AC
A conditioning - instructions
ALIM, 143
ADD_***_PL7, 377
DEADTIME, 173
AKF_FL, 381
DELAY, 41
AKF_TA, 383
DERIV, 181
AKF_TE, 387
FGEN, 189
AKF_TI, 391
INTEG, 207
AKF_TS, 395
INTEGRATOR1, 47
AKF_TV, 399
LAG, 215
AKF_ZR, 403
LAG1, 53
AKF_ZV, 407
LAG2, 221
AKF_ZVR, 411
LEAD_LAG, 229
ALIM, 143
LEAD_LAG1, 59
array - instructions
LIMV, 67
R2T_***, 533
SMOOTH_RATE, 111
T2T, 579
VLIM, 367
availability of the instructions, 29
C
COMP_PID, 149
COMPARE, 415
comparison - instructions
COMPARE, 415
SRCH, 565
I P
IEC_BMDI, 459 PCMCIA card - instructions
instructions READ_PCMCIA, 537
availability, 29 SET_PCMCIA, 555
INTEG, 207 WRITE_PCMCIA, 595
INTEGRATOR1, 47 PCON2, 237
PCON3, 243
PD_OR_PI, 251
L PDM, 263
LAG, 215 PI, 273
LAG1, 53 PI1, 73
LAG2, 221 PID, 283
LEAD_LAG, 229 PID_P, 299
LEAD_LAG1, 59 PID1, 83
LIFO, 467 PIDP1, 99
LIMV, 67 PIP, 311
logical - instructions PL7_3_TIMER, 521
HIGH_INT, 457 PL7_COUNTER, 475
LOW_INT, 471 PL7_DRUM, 481
AKF_FL, 381 PL7_MONOSTABLE, 487
PL7_MONOSTABLE, 487 PL7_REGISTER_255, 497
SET_BIT, 553 PL7_REGISTER_32, 493
START_PL7_MONOSTABLE, 487 PL7_TOF, 503
LOW_INT, 471 PL7_TON, 509
PL7_TP, 515
PPI, 325
M PRESET_PL7_3_TIMER, 521
mathematical - instructions PRESET_PL7_COUNTER, 475
ADD_***_PL7, 377 PUT_4X, 527
DELTA_***, 421 PUT_PL7_REGISTER_255, 497
IEC_BMDI, 459 PUT_PL7_REGISTER_32, 493
MUX_DINTARR_125, 473 PWM, 339
STR_ROUND, 571
SUB_***_PL7, 573
T2T, 579 Q
MUX_DINTARR_125, 473 QPWM, 351
O
output processing - instructions
PWM, 339
QPWM, 351
R START_PL7_MONOSTABLE, 487
START_PL7_TOF, 503
R_INT_WORD, 529
START_PL7_TON, 509
R_UINT_WORD, 531
START_PL7_TP, 515
R2T_***, 533
STOP_PL7_3_TIMER, 521
READ_PCMCIA, 537
STR_ROUND, 571
register management - instructions
string management - instructions
FIFO, 429
DATE_DINT_TO_STRING, 417
GET_3X, 451
DT_ARINT_TO_STRING, 423
GET_4X, 453
END, 427
GET_BIT, 455
TIME_DINT_TO_STRING, 585
GET_PL7_REGISTER_255, 497
TOD_DINT_TO_STRING, 587
GET_PL7_REGISTER_32, 493
STR_ROUND, 571
LIFO, 467
SUB_***_PL7, 573
PL7_REGISTER_255, 497
SYSSTATE, 577
PL7_REGISTER_32, 493
system specials - instructions
PUT_4X, 527
SYSSTATE, 577
PUT_PL7_REGISTER_255, 497
system time and date - instructions
PUT_PL7_REGISTER_32, 493
DAY_OF_WEEK, 419
RESET_PL7_REGISTER_255, 497
RRTC, 545
RESET_PL7_REGISTER_32, 493
WRTC, 599
ROR1_ARB, 543
SHL_RBIT_***, 557
SHR_RBIT_***, 559
SHRZ_***, 561
SHRZ_RBIT_***, 563
RESET_PL7_COUNTER, 475
RESET_PL7_DRUM, 481
RESET_PL7_REGISTER_255, 497
RESET_PL7_REGISTER_32, 493
ROR1_ARB, 543
RRTC, 545
S
SCON3, 359
SCOUNT, 547
SET_BIT, 553
SET_PCMCIA, 555
SHL_RBIT_***, 557
SHR_RBIT_***, 559
SHRZ_***, 561
SHRZ_RBIT_***, 563
SMOOTH_RATE, 111
SRCH, 565
START_PL7_3_TIMER, 521
T W_UINT_REAL, 593
WRITE_PCMCIA, 595
T2T, 579
WRTC, 599
THREE_STEP_CON1, 117
THREEPOINT_CON1, 125
TIME_DINT_TO_STRING, 585
timer - instructions
DOWN_PL7_TON, 509
FPULSOR, 433
FTOF, 439
FTON, 443
FTP, 447
PL7_TON, 509
START_PL7_TON, 509
AKF_TA, 383
AKF_TE, 387
AKF_TI, 391
AKF_TS, 395
AKF_TV, 399
DOWN_PL7_TOF, 503
DOWN_PL7_TP, 515
PL7_3_TIMER, 521
PL7_TOF, 503
PL7_TP, 515
PRESET_PL7_3_TIMER, 521
START_PL7_3_TIMER, 521
START_PL7_TOF, 503
START_PL7_TP, 515
STOP_PL7_3_TIMER, 521
TOD_DINT_TO_STRING, 587
TRANS_TIME, 589
TWOPOINT_CON1, 133
U
UP_PL7_COUNTER, 475
UP_PL7_DRUM, 481
V
VLIM, 367
W
W_INT_REAL, 591