Anda di halaman 1dari 262

3

3
0
0
3
8
7
3
.
0
5
www.schneider-electric.com
Unity Pro
33003873 07/2012
Unity Pro
Safety
Block Library
07/2012
2 33003873 07/2012

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 that is
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.
2012 Schneider Electric. All rights reserved.
33003873 07/2012 3
Table of Contents
Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
About the Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Part I General information . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 1 Block Types and Their Applications. . . . . . . . . . . . . . . . 17
Block Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
FFB Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
EN and ENO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Chapter 2 Availability of the Blocks on Different Hardware
Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Availability of the Block on the Various Hardware Platforms. . . . . . . . . . . 23
Part II Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 3 S_EQ_***: Equal To. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Chapter 4 S_GE_***: Greater Than or Equal To. . . . . . . . . . . . . . . . 33
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Chapter 5 S_GT_***: Greater Than . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Chapter 6 S_LE_***: Less Than or Equal To . . . . . . . . . . . . . . . . . . 37
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Chapter 7 S_LT_***: Less Than. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Chapter 8 S_NE_***: Not Equal To . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Part III High Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Chapter 9 S_DISIL2: High Availiability for Safety Digital Inputs . . 45
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Hardware Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Software Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4 33003873 07/2012
Chapter 10 S_AISIL2: High Availiability for Safety Analog Inputs . . 65
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Hardware Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Software Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Part IV Hot Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Chapter 11 S_HSBY_SWAP: Hot Standby Swapping Function . . . . 77
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Part V Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter 12 S_AND_***: AND Function . . . . . . . . . . . . . . . . . . . . . . . . 85
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Chapter 13 S_F_TRIG: Falling Edge Detection. . . . . . . . . . . . . . . . . . 87
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Chapter 14 S_NOT_***: Negation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Chapter 15 S_OR_***: OR Function . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Chapter 16 S_R_TRIG: Rising Edge Detection. . . . . . . . . . . . . . . . . . 93
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Chapter 17 S_ROL_***: Rotate Left . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Chapter 18 S_ROR_***: Rotate Right. . . . . . . . . . . . . . . . . . . . . . . . . . 97
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Chapter 19 S_RS: Bistable Function Block, Reset Dominant . . . . . . 99
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Chapter 20 S_SHL_***: Shift Left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Chapter 21 S_SHR_***: Shift Right . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Chapter 22 S_SR: Bistable Function Block, Set Dominant . . . . . . . . 105
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Chapter 23 S_XOR_***: Exclusive OR Function . . . . . . . . . . . . . . . . . 107
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Part VI Mathematics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Chapter 24 S_ABS_***: Absolute Value Computation . . . . . . . . . . . . 111
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Chapter 25 S_ADD_***: Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Chapter 26 S_DIV_***: Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Chapter 27 S_MUL_***: Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . 117
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
33003873 07/2012 5
Chapter 28 S_MOVE: Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Chapter 29 S_SMOVE_BIT: Assignment . . . . . . . . . . . . . . . . . . . . . . 121
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Chapter 30 S_SMOVE_WORD: Assignment . . . . . . . . . . . . . . . . . . . 127
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Chapter 31 S_NEG_***: Negation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Chapter 32 S_SQRT_REAL: Safety Square Root . . . . . . . . . . . . . . . 137
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Chapter 33 S_SIGN_***: Sign Evaluation . . . . . . . . . . . . . . . . . . . . . . 139
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Chapter 34 S_SUB_***: Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Part VII Statistical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Chapter 35 S_LIMIT_***: Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Chapter 36 S_MAX_***: Maximum Value Function . . . . . . . . . . . . . . 147
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Chapter 37 S_MIN_***: Minimum Value Function . . . . . . . . . . . . . . . 149
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Chapter 38 S_MUX_***: Multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Chapter 39 S_SEL: Binary Selection . . . . . . . . . . . . . . . . . . . . . . . . . 155
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Part VIII Timer & Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Chapter 40 S_CTD_***: Down Counter . . . . . . . . . . . . . . . . . . . . . . . . 159
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Chapter 41 S_CTU_***: Up Counter . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Chapter 42 S_CTUD_***: Up/Down Counter. . . . . . . . . . . . . . . . . . . . 163
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Chapter 43 S_TOF: Off Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Chapter 44 S_TON: On Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Chapter 45 S_TP: Pulse. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Part IX Type to Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Chapter 46 S_BIT_TO_BYTE: Type Conversion . . . . . . . . . . . . . . . . 175
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
6 33003873 07/2012
Chapter 47 S_BIT_TO_WORD: Type Conversion. . . . . . . . . . . . . . . . 179
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Chapter 48 S_BOOL_TO_***: Type Conversion . . . . . . . . . . . . . . . . . 181
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Chapter 49 S_BYTE_TO_BIT: Type Conversion. . . . . . . . . . . . . . . . . 183
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Chapter 50 S_BYTE_TO_***: Type Conversion . . . . . . . . . . . . . . . . . 185
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Chapter 51 S_DWORD_TO_***: Type Conversion . . . . . . . . . . . . . . . 187
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Chapter 52 S_INT_TO_***: Type Conversion . . . . . . . . . . . . . . . . . . . 189
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Chapter 53 S_DINT_TO_***: Type Conversion . . . . . . . . . . . . . . . . . . 191
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Chapter 54 S_REAL_TO_***: Type Conversion . . . . . . . . . . . . . . . . . 193
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Chapter 55 S_TIME_TO_UDINT: Type Conversion. . . . . . . . . . . . . . . 195
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Chapter 56 S_UDINT_TO_***: Type Conversion. . . . . . . . . . . . . . . . . 197
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Chapter 57 S_UINT_TO_***: Type Conversion . . . . . . . . . . . . . . . . . . 199
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Chapter 58 S_WORD_TO_BIT: Type Conversion. . . . . . . . . . . . . . . . 201
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Chapter 59 S_WORD_TO_***: Type Conversion. . . . . . . . . . . . . . . . . 203
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Part X Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Chapter 60 S_WR_ETH: Safe Ethernet PLC-PLC Communication
Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Chapter 61 S_RD_ETH: Safe Ethernet PLC-PLC Communication
Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Appendix A System Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
A.1 System Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
System Bit Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Description of the System Bits %S0 to %S13 . . . . . . . . . . . . . . . . . . . . . 220
Description of the System Bits %S15 to %S21 . . . . . . . . . . . . . . . . . . . . 222
Description of the System Bits %S30 to %S51 . . . . . . . . . . . . . . . . . . . . 224
Description of the System Bits %S59 to %S122 . . . . . . . . . . . . . . . . . . . 225
33003873 07/2012 7
A.2 System Words. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Description of the System Words %SW0 to %SW21 . . . . . . . . . . . . . . . . 228
Description of the System Words %SW30 to %SW59 . . . . . . . . . . . . . . . 231
Description of the System Words %SW60 to %SW127 . . . . . . . . . . . . . . 235
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
8 33003873 07/2012
33003873 07/2012 9

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.
10 33003873 07/2012
PLEASE NOTE
Electrical equipment should be installed, operated, serviced, and maintained only by
qualified personnel. No responsibility is assumed by Schneider Electric for any
consequences arising out of the use of this material.
A qualified person is one who has skills and knowledge related to the construction
and operation of electrical equipment and its installation, and has received safety
training to recognize and avoid the hazards involved.
33003873 07/2012 11
About the Book
At a Glance
Document Scope
This document describes the functions and function blocks of the Safety library.
Validity Note
This document is valid from Unity Pro 7.0.
This document is only valid for Unity Pro XLS.
Related Documents
You can download these technical publications and other technical information from
our website at www.schneider-electric.com.
Title of Documentation Reference Number
Modicon Quantum Safety Reference Manual 33003879
Unity Pro XLS Specifics 33003885
Unity Pro Operating Modes Manual 33003101
Unity Pro - Languages and Program Structure Reference Manual 35006144
IEC 61131-2 Programmable controllers Part 2: Equipment
requirements and tests, Second edition 2003-02

IEC 61508 Functional safety of electrical/electronic/programmable


electronic safety-related systems, edition 2.0

IEC 61511 Functional safety - safety instrumented systems for the


process industry sector, First edition

12 33003873 07/2012
Product Related Information
Terms used in this document:
certified
failure (except as used in Special Message Statement of Consequence)
fault
non-interfering
Quantum Safety PLC
Quantum Safety CPU
Safety analog inputs
Safety analog module(s)
Safety CPU
Safety digital inputs
Safety digital modules
Safety digital outputs
Safety FFB
Safety firmware
Safety I/O (module(s))
Safety library
Safety logic
Safety memory area
WARNING
UNINTENDED EQUIPMENT OPERATION
Use only Schneider Electric approved software.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
WARNING
UNINTENDED EQUIPMENT OPERATION
Refer to IEC 61508, "Functional safety of electrical/electronic/programmable
electronic safety-related systems".
Completely understand the applications and environment defined by Safety
Integrity Level (SIL) 3 within IEC 61508 Parts 1-7, edition 2.0.
SIL requirements are based on the standards current at the time of certification.
Do Not exceed SIL3 ratings in the application of this product.
The terms identified in the list below as used in this document are applied only
within the SIL3 rating.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
33003873 07/2012 13
Safety modules
Safety mode
Safety outputs
Safety PLC
Safety power supply
Safety programming
Safety Quantum
Safety-Related application(s)
Safety remote I/O
Safety variable
User Comments
We welcome your comments about this document. You can reach us by e-mail at
techcomm@schneider-electric.com.
14 33003873 07/2012
33003873 07/2012 15
I
Unity Pro
General information
33003873 07/2012
General information
Overview
This section contains general information about the Safety library.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
1 Block Types and Their Applications 17
2 Availability of the Blocks on Different Hardware Platforms 23
General information
16 33003873 07/2012
33003873 07/2012 17
1
Unity Pro
Block Types and Their Applications
33003873 07/2012
Block Types and Their
Applications
Overview
This chapter describes the different block types and their applications.
What Is in This Chapter?
This chapter contains the following topics:
Topic Page
Block Types 18
FFB Structure 19
EN and ENO 21
Block Types and Their Applications
18 33003873 07/2012
Block Types
Block Types
Different block types are used in Unity Pro. The general term for all block types is
FFB.
There are the following types of block:
Elementary Function (EF)
Elementary Function Block (EFB)
Elementary Function
Elementary functions (EF) have no internal status. If the input values are the same,
the value at the output is the same for all 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 always represented on the
left and the outputs always 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.
Elementary Function Block
Elementary function blocks (EFB) have an internal status. If the inputs have the
same values, the value on the output can have another value during the individual
executions. For example, with a counter, the value on the output is incremented.
An elementary function block is represented in the graphical languages (FBD and
LD) as a block frame with inputs and outputs. The inputs are always represented on
the left and the outputs always on the right of the frame. The name of the function
block, i.e. the function block type, is shown in the center of the frame. The instance
name is displayed above the frame.
Block Types and Their Applications
33003873 07/2012 19
FFB Structure
Structure
Each FFB is made up of an operation (name of the FFB), the operands 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:
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.
Block Types and Their Applications
20 33003873 07/2012
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 all actual parameters consist of
literals, a suitable data type is selected for the function block.
Block Types and Their Applications
33003873 07/2012 21
EN and ENO
Description
An EN input and an ENO output can be configured for all FFBs.
Examples
The following tables describe examples if ENO is set to 0 (caused by EN=0 or an error
during execution).
Function blocks
If the value of EN is ... then ...
0 when the FFB is called up, the algorithms defined by the FFB are not executed and
ENO is set to 0.
1 when the FFB is called up, the algorithms defined by the FFB are executed. After the
algorithms have been executed successfully, the value of
ENO is set to 1.
Note: If an error occurs when executing these algorithms,
ENO is set to 0.
Example Description
EN/ENO handling with function blocks that have 1 link as an output
parameter:
If EN from FunctionBlock_1 is set to 0, the
output connection OUT from
FunctionBlock_1 retains the status it had
in the last correctly executed cycle.
EN/ENO handling with function blocks that have 1 variable and 1 link as
output parameters:
If EN from FunctionBlock_1 is set to 0
the output connection OUT from
FunctionBlock_1 retains the status it
had in the last correctly executed cycle;
the variable OUT1 on the same pin, either
retains its previous status or can be
changed externally without influencing
the connection;
the variable and the link are saved
independently of each other.
Block Types and Their Applications
22 33003873 07/2012
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 statuses in this case:
The output behavior of the FFBs does not depend on whether the FFBs are called
up without EN/ENO or with EN=1.
Conditional/Unconditional FFB Call
Unconditional or conditional calls are possible with each FFB. The condition
is realized by pre-linking the input EN.
When EN is connected, then the FFB will be processed when EN = 1.
When EN is shown or hidden and marked TRUE, or shown and not occupied, then
the FFB is processed.
Example Description
EN/ENO handling with function/procedure blocks that (only) have 1 link
as an output parameter:
If EN from Function/Procedure_1 is set
to 0, the output connection OUT from
Function/Procedure_1 is also set to 0.
EN/ENO handling with function/procedure blocks that have 1 variable
and 1 link as output parameters:
If EN from Function/Procedure_1 is set
to 0
the output connection OUT from
Function/Procedure_1 is also set to
0;
the variable OUT1 on the same pin retains
its previous value.
Note: In this way it is possible for the variable
and the link to have different values.
33003873 07/2012 23
2
Unity Pro
Availability of the Block
33003873 07/2012
Availability of the Blocks on
Different Hardware Platforms
Availability of the Block on the Various Hardware Platforms
Introduction
Not all blocks are available on all hardware platforms. The blocks available on your
hardware platform can be found in the following tables.
Comparison
Availability of the blocks
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_EQ_*** EF + - - +
S_GE_*** EF + - - +
S_GT_*** EF + - - +
S_LE_*** EF + - - +
S_LT_*** EF + - - +
S_NE_*** EF + - - +
Legend:
+ Yes
- No
Availability of the Block
24 33003873 07/2012
High Availability
Availability of the blocks
Hot Standby
Availability of the blocks
Logic
Availability of the blocks
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_DISIL2 EF - - - +
S_AISIL2 EF - - - +
Legend:
+ Yes
- No
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_HSBY_SWAP EF - - - +
Legend:
+ Yes
- No
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_AND_*** EF + - - +
S_F_TRIG EFB + - - +
S_NOT EF + - - +
S_OR_*** EF + - - +
S_R_TRIG EFB + - - +
S_ROL_*** EF + - - +
S_ROR_*** EF + - - +
S_RS EFB + - - +
S_SHL_*** EF + - - +
S_SHR_*** EF + - - +
Availability of the Block
33003873 07/2012 25
Mathematics
Availability of the blocks
S_SR EFB + - - +
S_XOR_*** EF + - - +
Legend:
+ Yes
- No
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_ABS_*** EF + - - +
S_ADD_*** EF + - - +
S_DIV_*** EF + - - +
S_MOVE_*** EF + - - +
S_SMOVE_BIT EF - - - +
S_SMOVE_WORD EF - - - +
S_MUL_*** EF + - - +
S_NEG_*** EF + - - +
S_SIGN_*** EF + - - +
S_SQRT_REAL EF + - - +
S_SUB_*** EF + - - +
Legend:
+ Yes
- No
Availability of the Block
26 33003873 07/2012
Statistical
Availability of the blocks
Timers and Counter
Availability of the blocks
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_LIMIT_*** EF + - - +
S_MAX_*** EF + - - +
S_MIN_*** EF + - - +
S_MUX_*** EF + - - +
S_SEL EF + - - +
Legend:
+ Yes
- No
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_CTD_*** EFB + - - +
S_CTU_*** EFB + - - +
S_CTUD_*** EFB + - - +
S_TOF EFB + - - +
S_TON EFB + - - +
S_TP EFB + - - +
Legend:
+ Yes
- No
Availability of the Block
33003873 07/2012 27
Type to Type
Availability of the blocks
Communication
Availability of the blocks
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_BIT_TO_BYTE EF + - - +
S_BIT_TO_WORD EF + - - +
S_BOOL_TO_*** EF + - - +
S_BYTE_TO_BIT EF + - - +
S_BYTE_TO_*** EF + - - +
S_DINT_TO_*** EF + - - +
S_DWORD_TO_*** EF + - - +
S_INT_TO_*** EF + - - +
S_TIME_TO_UDINT EF + - - +
S_REAL_TO_*** EF + - - +
S_UDINT_TO_*** EF + - - +
S_UINT_TO_*** EF + - - +
S_WORD_TO_BIT EF + - - +
S_WORD_TO_*** EF + - - +
Legend:
+ Yes
- No
Block Name Block Type Defined in
IEC 61131-3
Premium/
M340
Quantum Safety
Quantum
S_WR_ETH DFB - - - +
S_RD_ETH DFB - - - +
Legend:
+ Yes
- No
Availability of the Block
28 33003873 07/2012
33003873 07/2012 29
II
Unity Pro
Comparison
33003873 07/2012
Comparison
Introduction
This section describes the elementary functions and elementary function blocks of
the Comparison family.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
3 S_EQ_***: Equal To 31
4 S_GE_***: Greater Than or Equal To 33
5 S_GT_***: Greater Than 35
6 S_LE_***: Less Than or Equal To 37
7 S_LT_***: Less Than 39
8 S_NE_***: Not Equal To 41
Comparison
30 33003873 07/2012
33003873 07/2012 31
3
Unity Pro
S_EQ_***
33003873 07/2012
S_EQ_***: Equal To
Description
Function Description
The function checks the inputs for equality, i.e. the output becomes 1 if there is
equality at all inputs; otherwise, the output remains at 0.
The data types of all input values must be identical.
The number of inputs can be increased to a maximum of 32.
When comparing variables of the BOOL, BYTE, WORD, DWORD, INT, DINT, UINT,
UDINT and REAL data types, the values are compared with each other.
EN and ENO can be configured as additional parameters.
Formula
OUT = 1, if (IN1 = IN2) & (IN2 = IN3) & .. & (IN
(n-1)
= IN
n
)
Available Functions
List of available functions
S_EQ_BOOL
S_EQ_BYTE
S_EQ_WORD
S_EQ_DWORD
S_EQ_INT
S_EQ_DINT
S_EQ_UINT
S_EQ_UDINT
S_EQ_REAL
S_EQ_***
32 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
1. input
Value2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
2. input
Valuen BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
n. input
n = max 32
Parameter Data Type Meaning
Result BOOL output
33003873 07/2012 33
4
Unity Pro
S_GE_***
33003873 07/2012
S_GE_***: Greater Than or Equal
To
Description
Function Description
The function checks the values of successive inputs for a decreasing sequence or
equality.
The data types of all input values must be identical.
The number of inputs can be increased to a maximum of 32.
When comparing variables of the BOOL, BYTE, WORD, DWORD, INT, DINT, UINT,
UDINT and REAL data types, the values are compared with each other.
EN and ENO can be configured as additional parameters.
Formula
OUT = 1, if (IN1 IN2) & (IN2 IN3) & .. & (IN
(n-1)
IN
n
)
Available Functions
List of available functions
S_GE_BOOL
S_GE_BYTE
S_GE_WORD
S_GE_DWORD
S_GE_INT
S_GE_DINT
S_GE_UINT
S_GE_UDINT
S_GE_REAL
S_GE_***
34 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
1. input
Value2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
2. input
Valuen BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
n. input
n = max 32
Parameter Data Type Meaning
Result BOOL output
33003873 07/2012 35
5
Unity Pro
S_GT_***
33003873 07/2012
S_GT_***: Greater Than
Description
Function Description
The function checks the values of successive inputs for a decreasing sequence.
The data types of all input values must be identical.
The number of inputs can be increased to a maximum of 32.
When comparing variables of the BOOL, BYTE, WORD, DWORD, INT, DINT, UINT,
UDINT and REAL data types, the values are compared with each other.
EN and ENO can be configured as additional parameters.
Formula
OUT = 1, if (IN1 > IN2) & (IN2 > IN3) & .. (IN
(n-1)
> IN
n
)
Available Functions
List of available functions
S_GT_BOOL
S_GT_BYTE
S_GT_WORD
S_GT_DWORD
S_GT_INT
S_GT_DINT
S_GT_UINT
S_GT_UDINT
S_GT_REAL
S_GT_***
36 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
1. input
Value2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
2. input
Valuen BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
n. input
n = max 32
Parameter Data Type Meaning
Result BOOL output
33003873 07/2012 37
6
Unity Pro
S_LE_***
33003873 07/2012
S_LE_***: Less Than or Equal To
Description
Function Description
The function checks the values of successive inputs for an increasing sequence or
equality.
The data types of all input values must be identical.
The number of inputs can be increased to a maximum of 32.
When comparing variables of the BOOL, BYTE, WORD, DWORD, INT, DINT, UINT,
UDINT and REAL data types, the values are compared with each other.
EN and ENO can be configured as additional parameters.
Formula
OUT = 1, if (IN1 IN2) & (IN2 IN3) & .. & (IN
(n-1)
IN
n
)
Available Functions
List of available functions
S_LE_BOOL
S_LE_BYTE
S_LE_WORD
S_LE_DWORD
S_LE_INT
S_LE_DINT
S_LE_UINT
S_LE_UDINT
S_LE_REAL
S_LE_***
38 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
1. input
Value2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
2. input
Valuen BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
n. input
n = max 32
Parameter Data Type Meaning
Result BOOL output
33003873 07/2012 39
7
Unity Pro
S_LT_***
33003873 07/2012
S_LT_***: Less Than
Description
Function Description
The function checks the values of successive inputs for an increasing sequence.
The data types of all input values must be identical.
The number of inputs can be increased to a maximum of 32.
When comparing variables of the BOOL, BYTE, WORD, DWORD, INT, DINT, UINT,
UDINT and REAL data types, the values are compared with each other.
EN and ENO can be configured as additional parameters.
Formula
OUT = 1, if (IN1 < IN2) & (IN2 < IN3) & .. & (IN
(n-1)
< IN
n
)
Available Functions
List of available functions
S_LT_BOOL
S_LT_BYTE
S_LT_WORD
S_LT_DWORD
S_LT_INT
S_LT_DINT
S_LT_UINT
S_LT_UDINT
S_LT_REAL
S_LT_***
40 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
1. input value
Value2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
2. input value
Valuen BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
n. input value
n = max 32
Parameter Data Type Meaning
Result BOOL output value
33003873 07/2012 41
8
Unity Pro
S_NE_***
33003873 07/2012
S_NE_***: Not Equal To
Description
Function Description
The function checks the input values for inequality.
The data types of the input values must be identical.
EN and ENO can be configured as additional parameters.
Formula
OUT = 1, if IN1 < > IN2
Available Functions
List of available functions
S_NE_BOOL
S_NE_BYTE
S_NE_WORD
S_NE_DWORD
S_NE_INT
S_NE_DINT
S_NE_UINT
S_NE_UDINT
S_NE_REAL
Representation in FBD
Representation
S_NE_***
42 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
1. input
Value2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT, REAL
2. input
Parameter Data Type Meaning
Result BOOL output
33003873 07/2012 43
III
Unity Pro
High Availability
33003873 07/2012
High Availability
Introduction
This section describes the elementary functions and elementary function blocks of
the High Availability family.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
9 S_DISIL2: High Availiability for Safety Digital Inputs 45
10 S_AISIL2: High Availiability for Safety Analog Inputs 65
High Availability
44 33003873 07/2012
33003873 07/2012 45
9
Unity Pro
S_DISIL2
33003873 07/2012
S_DISIL2: High Availiability for
Safety Digital Inputs
Introduction
This chapter describes the S_DISIL2 block.
What Is in This Chapter?
This chapter contains the following topics:
Topic Page
Description 46
Hardware Configuration 55
Software Configuration 58
S_DISIL2
46 33003873 07/2012
Description
Function Description
This function block is used in high-availability architecture with redundant safety
digital input (140 SDI 953 00S) modules. It continuously compares the integrity of
both SDI modules and selects the data to be retrieved based on that comparison.
By default, the data of module 1 are used as long as they are healthy.
To improve availability by using the S_DISIL2 safety function blocks, it is
recommended to respect the following rules:
Use 2 SDI modules 140 SDI 953 00S. (For details on this module see the
Quantum with Unity Pro Discrete and Analog I/O Reference Manual
(see Quantum with Unity Pro, Discrete and Analog I/O, Reference Manual).)
Use 2 remote drops, each containing one of the SDI modules.
Use 1 or 2 sensors.
Examples of High-Availability Architectures
The following drawings represent examples of high-availability architectures with 1
or 2 sensors.
Architecture A: 2 sensors, 2 safety input modules, 2 remote drops
1 local rack
2 remote drops
In architecture A one SDI module processes the signal from sensor S1 whereas the
other SDI module processes the signal from sensor S2.
S_DISIL2
33003873 07/2012 47
Architecture B: 1 sensor, 2 safety input modules, 2 remote drops
1 local rack
2 remote drops
In architecture B both SDI modules process the same signal from sensor S.
Should one of the SDI modules fail, the other will feed the signal from the sensor to
the CPU.
Representation in FBD
Representation
S_DISIL2
48 33003873 07/2012
Representation in LD
Representation
Parameter Description
The S_DISIL2 function block consists of the following input and output parameters.
Input parameters:
DATA
HEALTH
Output parameters:
OUT
VALID
ERR
S_DISIL2
33003873 07/2012 49
Input Parameters
The function block retrieves the data and the health information out of each SDI
module.
General description of the DATA and HEALTH parameters
Retrieving DATA and HEALTH Information from the SDI Modules
The DATA1, DATA2 and HEALTH1, HEALTH2 parameters can be retrieved from the
first and seventh word of the respective SDI module.
NOTE: There is a difference in the HEALTH parameter between S_DISIL2 and
S_AISIL2 function blocks: Since S_AISIL2 works with only 1 channel of the SAI
module, the HEALTH parameter consists of only 1 bit that represents the health
status of 1 analog channel.
Parameter Data Type Meaning
DATA WORD Each bit represents one of the 16 channels of the SDI module.
HEALTH WORD Each bit represents the health of one channel of the SDI
module.
1:
channel is healthy or valid
0:
channel is unhealthy or invalid
The health information is a combination of:
open circuit
safety state
process power supply failures
Parameter
X
th
Word of
SDI Module
Meaning
DATA1 first This word contains all 16 channel data of SDI module 1.
HEALTH1 seventh This word contains all 16 channel health data of the SDI
module 1.
DATA2 first This word contains all 16 channel data of SDI module 2.
HEALTH2 seventh This word contains all 16 channel health data of the SDI
module 2.
S_DISIL2
50 33003873 07/2012
Graphical Representations of DATA and HEALTH Addressing
The S_DISIL2 safety function block parameters DATA and HEALTH are associated
to respectively word 1 and word 2 on 1 SDI module and represent the 16 data bits
and 16 health bits of the 16 channels of the module.
SDI module: addressing word 1 (DATA)
SDI module: addressing word 2 (HEALTH)
Bit=1 channel is healthy
Bit=0 channel is unhealthy (broken wire, invalid channel, process supply failed, CRC failed,
incorrect exchange number
NOTE: Channel 1 is mapped to bit 15.
S_DISIL2
33003873 07/2012 51
Output Parameters
Output parameter OUT
Example: OUT parameter for channel 1
Output parameters VALID and ERR
NOTE: The ERR word does not indicate which channel on the unhealthy module is
faulty or in which channel there is a discrepancy. To discover that, just check the
binary value of the corresponding DATA and HEALTH word.
Parameter Data Type Meaning
OUT WORD The parameter OUT contains the evaluation of all 16 channels
from the 2 SDI modules.
By default, the function block first of all evaluates the channels
of module 1. If these are healthy their data values will be used
for OUT.
If any of the channels of module 1 is not healthy, the respective
channel on module 2 is checked. If this channel on module 2 is
healthy, its data value will be used for OUT.
Result: The OUT value may be a mixture of values from
modules 1 and 2 if some channels of module 1 are not healthy.
If a channel is neither healthy in module 1 nor in module 2, the
bit of this channel in OUT will be set to 0 (safe state).
If the complete module 1 is defect, the data of all channels will
be taken from module 2 (if module 2 is healthy).
Module 1, Channel 1 Module 2, Channel 1 OUT Data Value
healthy not evaluated value of module 1, channel 1
not healthy healthy value of module 2, channel 1
not healthy not healthy = 0 (safe state)
Parameter Data Type Meaning
VALID WORD The parameter VALID shows the validity of the 16 channels
individually in the 16 bits of the word VALID.
A bit VALID is 1 if at least 1 of the 2 module channels is healthy.
ERR WORD This word will return a value between 0 and 7 depending on the
health of the 2 modules and if there is a discrepancy between
data of the 2 modules.
S_DISIL2
52 33003873 07/2012
Block Behavior Description
Summary: For each bit of the parameters DATA1/2 and HEALTH1/2 the following
rules apply:
Conclusion: Module1, when healthy, is dominant.
If the bit in the health word HEALTH1 of SDI module 1 is valid, then the
corresponding bit in DATA1 will be copied to the output word OUT of S_DISIL2.
State Table
This table shows the states for only 1 channel. Each channel is treated individually.
Only the error code ERR indicates the global state of the modules, see below:
If... Then ...
HEALTH1 is valid DATA1 will be used for OUT.
HEALTH1 is not valid HEALTH2 is checked and if valid, DATA2 will
be used for OUT.
HEALTH1 and HEALTH2 are not valid OUT is set to 0 (safe state).
HEALTH1 and HEALTH2 are valid The bit of DATA1 will be used for OUT,
regardless whether it is different from DATA2
or not. The error word ERR informs on the
discrepancy between DATA1 and DATA2.
DATA1
Data1.
Channel X
HEALTH1
Health1.
Channel X
DATA2
Data2.
Channel X
HEALTH2
Health2.
Channel X
OUT
OUT.Cha
nnel X
VALID
VALID.
Channel X
ERR Remark
0 0 0 0 0 0 Mod1, Mod2
defective
safe state
0 0 0 1 0 1 Mod1 defective use Mod2 value
0 0 1 0 0 0 Mod1, Mod2
defective
safe state
0 0 1 1 1 1 Mod1 defective use Mod2 value
0 1 0 0 0 1 Mod2 defective use Mod1 value
0 1 0 1 0 1 OK consistent values
0 1 1 0 0 1 Mod2 defective use Mod1 value
0 1 1 1 0 1 discrepancy use Mod1 value
1 0 0 0 0 0 Mod1, Mod2
defective
safe state
1 0 0 1 0 1 Mod1 defective use Mod2 value
1 0 1 0 0 0 Mod1, Mod2
defective
safe state
1 0 1 1 1 1 Mod1 defective use Mod2 value
S_DISIL2
33003873 07/2012 53
Mod1 Digital input module 1
Mod2 Digital input module 2
Error Code Table
The following table explains the error codes:
1 1 0 0 1 1 Mod2 defective use Mod1 value
1 1 0 1 1 1 discrepancy use Mod1 value
1 1 1 0 1 1 Mod2 defective use Mod1 value
1 1 1 1 1 1 OK consistent values
DATA1
Data1.
Channel X
HEALTH1
Health1.
Channel X
DATA2
Data2.
Channel X
HEALTH2
Health2.
Channel X
OUT
OUT.Cha
nnel X
VALID
VALID.
Channel X
ERR Remark
Error Code Meaning
0 OK
All health bits of module 1 are valid and all health bits of module 2 are valid.
All data bits of module 1 and module 2 are equal.
1 At least 1 health bit of module 1 is invalid and all health bits of module 2 are valid.
All data bits of module 1 and module 2 are equal.
2 All health bits of module 1 are valid and at least 1 health bit of module 2 is invalid.
All data bits of module 1 and module 2 are equal.
3 At least 1 health bit of module 1 is invalid and at least 1 health bit of module 2 is invalid.
All data bits of module 1 and module 2 are equal.
4 There is a discrepancy between the input data.
All health bits of module 1 are valid and all health bits of module 2 are valid.
At least 1 data bit of module 1 is different to the data bit of module 2.
5 Discrepancy and 1 or more health bits in module 1 are invalid.
At least 1 health bit of module 1 is invalid and all health bits of module 2 are valid.
At least 1 data bit of module 1 is different to the data bit of module 2 (not necessarily the data bit of
the unhealthy channel.
6 Discrepancy and 1 or more health bits in module 2 are invalid.
All health bits of module 1 are valid and at least 1 health bit of module 2 is invalid.
At least 1 data bit of module 1 is different to the data bit of module 2 (not necessarily the data bit of
the unhealthy channel.
7 Discrepancy and 1 or more invalid health bits in module 1 and module 2.
At least 1 health bit of module 1 is invalid and at least 1 health bit of module 2 is invalid.
At least 1 data bit of module 1 is different to the data bit of module 2 (not necessarily the data bit of
the unhealthy channel).
S_DISIL2
54 33003873 07/2012
Fault Bits
The following table describes the meaning of each significant fault bit:
Fault Bit Meaning
bit0 at least 1 channel of module 1 is invalid
bit1 at least 1 channel of module 2 is invalid
bit2 discrepancy between DATA1 and DATA2
S_DISIL2
33003873 07/2012 55
Hardware Configuration
Overview
This section provides hardware configuration examples.
Application Example
As an example, the following application can be created and built upon.
Configuration example
1 SDI module 1
2 SDI module 2
S_DISIL2
56 33003873 07/2012
Hardware Configuration Example using 2 Sensors
The drawing below shows an application example with 2 sensors:
1 local rack
2 remote drops
In applications that use 2 sensors to measure the process value, these 2 sensors
have to be consistently wired to the same channel on both modules.
Example: Wire sensor 1 to channel X on module 1 AND sensor 2 to channel X on
module 2.
Hardware Configuration Example using 1 Sensor
The drawing below shows an application example with 1 sensor:
1 local rack
2 remote drops
In applications that use 1 sensor to measure the process value, this sensor has to
be consistently wired to the same channel on both modules.
S_DISIL2
33003873 07/2012 57
Retrieving Physical Addresses via Unity XLS Pro
Both SDI modules are mapped to integer values (%IW). You can display the physical
addresses for each SDI module in the configuration window of Unity XLS Pro.
Physical addresses for SDI module 1: %IW1...%IW7
Physical addresses for SDI module 2: %IW8...%IW14
In the hardware example presented in this document, the data needed from each
module is as follows:
After you have created the hardware configuration proceed with creating the
necessary variables in the Unity Pro XLS Data Editor as described in the following
section.
SDI Module DATA HEALTH
SDI module 1 DATA1:
%IW1
HEALTH1:
%IW7
SDI module 2 DATA2:
%IW8
HEALTH2:
%IW14
S_DISIL2
58 33003873 07/2012
Software Configuration
Overview
This section provides software configuration examples.
Creating Variables
After you have created the hardware configuration as described in the previous
section, open the Unity Pro XLS Data Editor to create the necessary variables.
To be able to use the individual bits in the logic and to be able to force them, if
necessary, the 16 data bits of each SDI module must be declared as EBOOL data
types.
Creating variables for SDI module 1:
S_DISIL2
33003873 07/2012 59
Creating variables for SDI module 2:
NOTE: %IW is interpreted as INT and therefore cannot be connected to the
S_DISIL2 function block. You must therefore declare a variable of type WORD at the
correct address. Use flat addressing to be able to set WORD type. The WORD type is
forbidden on topological addressing.
Example:
Test : WORD : %IW\2.2\1.3.1.2 is not accepted
Test : WORD : %IW8 is accepted
%IW1 being interpreted as data type INT:
S_DISIL2
60 33003873 07/2012
Example of Forcing Bits
If the individual bits are available you can force each bit of the input words in order
to simulate the behavior of the block.
The example below illustrates how to force the bits of word input DATA1:
Use the function block S_WORD_TO_BIT followed by S_BIT_TO_WORD to create a
word DATA_1 of which you can force bits.
The example below illustrates how to force the bits of word input DATA2:
Use the function block S_WORD_TO_BIT followed by S_BIT_TO_WORD to create a
word DATA_2 of which you can force bits.
S_DISIL2
33003873 07/2012 61
Animation Table Result
The complete program that will be used with the animation table is as follows:
S_DISIL2
62 33003873 07/2012
Examples of S_DISIL2 Input and Output Values
Example 1:
The above example indicates the following information:
Both SDI modules are healthy (all bits of HEALTH1 and HEALTH2 are 1).
Bit 14 of DATA1 is 1 while bit 14 of DATA2 is 0.
The resulting error code is 4 which indicates that both modules are healthy but
that there is a discrepancy between the 2 data words.
The output value is set to DATA1.
Example 2:
The above example indicates the following information:
Bit 15 of HEALTH1 is 0 and bit 15 of HEALTH2 is 0.
Bit 14 of DATA1 is 1 while bit 14 of DATA2 is 0.
The resulting error code is 7 which indicates that there is a discrepancy on data
bits between both modules (in this example: bit 14) in addition to the presence of
at least 1 unhealthy bit in module 1 and in module 2.
Output bits 0 to 14 are equal to DATA1, only unhealthy bit 15 is set to the safe
state 0.
S_DISIL2
33003873 07/2012 63
Example 3:
The above example indicates the following information:
Bit 15 of HEALTH1 is 0 and bit 15 of HEALTH2 is 0 which means that channel 1
on both SDI modules is unhealthy.
DATA1 and DATA2 are equal, so there is no discrepancy.
The error code is 3 which indicates that at least 1 health bit of module 1 is invalid
and at least 1 bit of module 1 is invalid and that all data bits of module 1 and
module 2 are equal.
Output bit 15 is 0 (safe state) because bit 15 on both modules is unhealthy.
S_DISIL2
64 33003873 07/2012
33003873 07/2012 65
10
Unity Pro
S_AISIL2
33003873 07/2012
S_AISIL2: High Availiability for
Safety Analog Inputs
Introduction
This chapter describes the S_AISIL2 block.
What Is in This Chapter?
This chapter contains the following topics:
Topic Page
Description 66
Hardware Configuration 71
Software Configuration 73
S_AISIL2
66 33003873 07/2012
Description
Function Description
This function block is used in high-availability architectures with redundant safety
analog input (140 SAI 940 00S) modules. It continuously compares the integrity of
the 2 channels stemming from both SAI modules and selects the data to be retrieved
based on that comparison.
To improve availability by using the S_AISIL2 safety function blocks, it is
recommended to respect the following rules:
Use 2 SAI modules 140 SAI 940 00S. (For details on this module see the
Quantum with Unity Pro Discrete and Analog I/O Reference Manual
(see Quantum with Unity Pro, Discrete and Analog I/O, Reference Manual).)
Use 2 remote drops, each containing one of the SAI modules.
Use 2 sensors.
High-Availability Architecture
Example of a high-availability architecture with 2 sensors, 2 SAI modules, 2 remote
drops
In this architecture 1 SAI module processes the signal from sensor S1 whereas the
other SAI module processes the signal from sensor S2.
S_AISIL2
33003873 07/2012 67
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
The S_AISIL2 function block consists of the following input and output parameters.
Input parameters:
DATA
HEALTH
Output parameters:
OUT
VALID
ERR
S_AISIL2
68 33003873 07/2012
Input Parameters
The function block retrieves the data and the health information out of each SAI
module.
General description of the DATA and HEALTH parameters
Retrieving DATA and HEALTH Information from the SAI Modules
The DATA1 and DATA2 variables are mapped to one of the first 8 words of
SAI module 1 and SAI module 2.
The HEALTH1 and HEALTH2 variables are each one bit located in the thirteenth word
of SAI module 1 respectively SAI module 2.
NOTE: The S_AISIL2 safety function block DATA is associated to 1 of the words 1
to 8 whereas the parameter HEALTH is associated to a bit in word 13 of the
SAI module.
Graphical Representations of DATA and HEALTH Addressing
SAI module: addressing words 1 to 8 (DATA)
Parameter Data Type Meaning
DATA WORD Each bit represents one of the 8 channels of the SAI module.
HEALTH BIT It represents the health of 1 channel of the SAI module.
1:
channel is healthy or valid
0:
channel is unhealthy or invalid
The health information is a combination of:
open circuit
safety state
process power supply failures
S_AISIL2
33003873 07/2012 69
SAI module: addressing word 13 (HEALTH)
Bit 8 to 15: unused
Bit 0 to 7: used
Bit=1 channel is healthy
Bit=0 Channel is unhealthy (invalid channel, out of range, CRC failed, incorrect exchange
number)
NOTE: Channel 1 is mapped to bit 7.
Output Parameters
Output parameter OUT
Example: OUT parameter for channel of module 1
Output parameters VALID and ERR
Parameter Data Type Meaning
OUT WORD =DATA1: The OUT word will always contain the value of DATA1
as long as the channel of SAI module 1 is healthy (HEALTH1 is
valid).
=DATA2: The OUT word will only contain the value of DATA2 if
the channel of SAI module 1 is defective (HEALTH1 is invalid).
=0: The value of the OUT word is set to 0 (safe state) when the
channels of both SAI modules are defective (HEALTH1 and
HEALTH2 are invalid).
Channel of Module 1 Channel of Module 2 OUT Data Value
healthy not evaluated value of channel of module 1
not healthy healthy value of channel of module 2
not healthy not healthy = 0 (safe state)
Parameter Data Type Meaning
VALID WORD When at least 1 of the HEALTH bits is valid, VALID will be 1.
ERR WORD This word will return a value between 0 and 3 depending on the
states of the 2 modules.
S_AISIL2
70 33003873 07/2012
Block Behavior Description
Summary: The following rules apply for the parameters DATA1/2 and HEALTH1/2 :
Conclusion: Module1, when healthy, is dominant.
If the health bit HEALTH1 of the channel of the SAI module 1 is 1, then DATA1 will
be copied to the output word OUT of S_AISIL2.
State Table
Error Code Table
The following table explains the error codes:
Fault Bits
The following table describes the meaning of the 2 fault bits:
If... Then ...
HEALTH1 is valid DATA1 will be used for OUT.
HEALTH1 is not valid HEALTH2 is checked and if valid, DATA2 will be used for OUT.
HEALTH1 and HEALTH2 are not valid OUT is set to 0 (safe state).
HEALTH1 and HEALTH2 are valid DATA1 will be used for OUT, regardless whether it is different from DATA2 or
not. The error word ERR informs on the discrepancy between DATA1 and
DATA2.
Health1 Health2 Output Valid Error Remark
0 0 0 0 channel in module 1 defective
channel in module 2 defective
safe state
0 1 Data2 1 channel in module 1 defective use value of channel in module 2
1 0 Data1 1 channel in module 2 defective use value of channel in module 1
1 1 Data1 1 Both channels on both modules are OK use value of channel in module 1
Error Code Fault Description
0 valid
1 Module 1 is defective.
2 Module 2 is defective.
3 Module 1 and module 2 are defective.
Fault Bit Meaning
bit0 channel of module 1 is invalid
bit1 channel of module 2 is invalid
S_AISIL2
33003873 07/2012 71
Hardware Configuration
Overview
This section provides hardware configuration examples.
Application Example
As an example, the following application can be created and built upon.
Configuration example
1 SAI module 1: sensor 1 connected to channel 1
2 SAI module 2: sensor 2 connected to channel 1
S_AISIL2
72 33003873 07/2012
Retrieving Physical Addresses via Unity XLS Pro
Both SAI modules are mapped to integer values (%IW). You can display the physical
addresses for each SAI module in the configuration window of Unity XLS Pro.
Physical addresses for SAI module 1: %IW15...%IW27
Physical addresses for SAI module 2: %IW28...%IW40
In the hardware example presented in this document, the data needed from each
module is the data from channel 1 of each SAI module:
After you have created the hardware configuration proceed with creating the
necessary variables in the Unity Pro XLS Data Editor as described in the following
section.
SAI Module DATA HEALTH
SAI module 1 DATA1:
%IW15
HEALTH1:
%IW27.7
SAI module 2 DATA2:
%IW28
HEALTH2:
%IW40.7
S_AISIL2
33003873 07/2012 73
Software Configuration
Overview
This section provides software configuration examples.
Creating Variables
After you have created the hardware configuration as described in the previous
section, open the Unity Pro XLS Data Editor to create the necessary variables.
These variables are needed to feed the pins of the S_AISIL2 safety function block.
Animation Table Result
The following paragraphs show values forced in the Unity Pro XLS Animation table
and their results.
Examples of S_AISIL2 Input and Output Values
Example 1:
The above example indicates the following information:
Both SAI modules are defective (HEALTH1 and HEALTH2 are set to 0).
The resulting error code is 3.
The output value is set to 0. (Remember: In case both modules are defective,
OUT switches to the safe state.)
S_AISIL2
74 33003873 07/2012
Example 2:
The above example indicates the following information:
SAI module 2 is defective (bit 0 of HEALTH2 is set to 0).
The resulting error code is 2.
The output value OUT is set to the value of DATA1 (16#0001).
Example 3:
The above example indicates the following information:
Both SAI modules are healthy (HEALTH1 is 1 and HEALTH2 is 1).
The resulting error code is 0.
The output value OUT is set to the value of DATA1 (16#0001).
33003873 07/2012 75
IV
Unity Pro
Hot Standby
33003873 07/2012
Hot Standby
Hot Standby
76 33003873 07/2012
33003873 07/2012 77
11
Unity Pro
S_HSBY_SWAP
33003873 07/2012
S_HSBY_SWAP: Hot Standby
Swapping Function
Description
Function Description
The S_HSBY_SWAP function block is used to initiate the swapping between primary
and standby CPU.
EN and ENO can be configured as additional parameters.
This function block is convenient to be used to activate a swap by program logic.
This swap between primary and standby CPU can be performed in the Hot Standby
Safety mode only.
Please refer to the Modicon Quantum Hot Standby with Unity - User Manual
(see Modicon Quantum, Hot Standby System, User Manual) for information
regarding safety hot standby CPUs.
This means that when the HSBY is running, the standby PLC becomes the primary
PLC, and the old primary PLC becomes the standby PLC activated by the program
logic.
NOTE: It is not mandatory to use this function for performing a hot standby swap in
safety mode. Indeed, you may rely on register %SW60 and follow the procedure
described in the Modicon Quantum Hot Standby with Unity - User Manual
(see Modicon Quantum, Hot Standby System, User Manual) .
Advantages of the Swapping Function
The advantages of swapping could be the following:
The health of the standby PLC is monitored. It is checked that the standby PLC
can take over.
The switch over could be tested at regular intervals.
S_HSBY_SWAP
78 33003873 07/2012
Example of a Hot Standby Safety Application
The illustration below shows an example of a hot standby safety application:
Steps for Changing Status
A Hot Standby swapping function is processed as follows:
Step Action
1 Status: PLC-A is the primary controller, PLC-B is the standby controller.
PLC-A sets itself to offline.
Result:
PLC-B becomes the primary controller.
2 Status: PLC-A is offline, PLC-B is the primary controller.
PLC-B sets PLC-A to run-mode
Result:
PLC-A is the standby controller.
3 Status: PLC-A is the standby controller, PLC-B is the primary controller.
EFB outputs will be set.
Result:
Hot Standby swapping function is completed.
S_HSBY_SWAP
33003873 07/2012 79
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameter
Parameter Data Type Meaning
START BOOL START = 1 starts the S_HSBY_SWAP operation.
The value of 1 must be applied until the operation has finished
or until an error has occurred.
S_HSBY_SWAP
80 33003873 07/2012
Description of output parameters
Error Status Table
The following table explains the error codes:
NOTE: The system words %SW60 and %SW61 reflect the status of the primary and
the secondary PLC.
Switchover Using Command Register System Bit %SW60.1 or %SW60.2
Another way of forcing a switchover is setting the bits in the Command Register. To
achieve this, do the following:
Parameter Data Type Meaning
ACTIVE BOOL ACTIVE = 1 indicates that an S_HSBY_SWAP operation is in
progress.
DONE BOOL DONE = 1 indicates that the S_HSBY_SWAP operation has been
completed successfully.
ERROR BOOL ERROR = 1 indicates that an error has occurred, or that the
current S_HSBY_SWAP operation has been aborted.
STATUS INT An error code (STATUS) is generated by the S_HSBY_SWAP
block. A complete list is shown in the error code table.
Error Codes Fault Description
0 OK
1 The function S_HSBY_SWAP has been aborted.
2 Hot Standby not activated (%SW61.15=0).
3 Standby does not exist.
4 Primary controller is not in Safety mode.
5 The swap was unsuccessful.
Step Action
1 Open file 1.
2 Connect to the primary,
3 Ensure the controller order of the primary is A or B.
4 Access
Command Register system bit %SW60.1
If the connected controller order is A.
Command Register system bit %SW60.2
If the connected controller order is B.
5 Set bit to 0.
Note: Ensure that the standby switched to primary.
S_HSBY_SWAP
33003873 07/2012 81
6 Open file 2.
7 Connect to the new primary controller.
8 Access the Command Register system bit used in step 4.
9 Set bit to 1.
Note: Ensure that the standby controller is now online.
10 Ensure both primary and standby controllers are in Run Primary and in Run
Standby mode.
Step Action
S_HSBY_SWAP
82 33003873 07/2012
33003873 07/2012 83
V
Unity Pro
Logic
33003873 07/2012
Logic
Introduction
This section describes the elementary functions and elementary function blocks of
the Logic family.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
12 S_AND_***: AND Function 85
13 S_F_TRIG: Falling Edge Detection 87
14 S_NOT_***: Negation 89
15 S_OR_***: OR Function 91
16 S_R_TRIG: Rising Edge Detection 93
17 S_ROL_***: Rotate Left 95
18 S_ROR_***: Rotate Right 97
19 S_RS: Bistable Function Block, Reset Dominant 99
20 S_SHL_***: Shift Left 101
21 S_SHR_***: Shift Right 103
22 S_SR: Bistable Function Block, Set Dominant 105
23 S_XOR_***: Exclusive OR Function 107
Logic
84 33003873 07/2012
33003873 07/2012 85
12
Unity Pro
S_AND_***
33003873 07/2012
S_AND_***: AND Function
Description
Function Description
The function for a bit-by-bit AND link of the bit sequences at the inputs and assigns
the result to the output.
The data types of all input values and output values must be identical.
The number of inputs can be increased to a maximum of 32.
EN and ENO can be configured as additional parameters.
Formula
OUT = IN1 & IN2 & ... & INn
Available Functions
List of available functions
S_AND_BOOL
S_AND_BYTE
S_AND_WORD
S_AND_DWORD
Representation in FBD
Representation
S_AND_***
86 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value_1 BOOL, BYTE, WORD,
DWORD
input bit sequence
Value_2 BOOL, BYTE, WORD,
DWORD
input bit sequence
Value_n BOOL, BYTE, WORD,
DWORD
input bit sequence (n = max. 32)
Parameter Data Type Meaning
Result BOOL, BYTE, WORD,
DWORD
output bit sequence
33003873 07/2012 87
13
Unity Pro
S_F_TRIG
33003873 07/2012
S_F_TRIG: Falling Edge Detection
Description
Function Description
This function block is used for the detection of falling edges 1 -> 0.
Output Q becomes 1 if there is a transition from 1 to 0 at the CLK input. The output
will remain at 1 from one function block execution to the next; the output
subsequently returns to 0.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
Representation in LD
Representation
S_F_TRIG
88 33003873 07/2012
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
CLK BOOL clock input
Parameter Data Type Meaning
Q BOOL output
33003873 07/2012 89
14
Unity Pro
S_NOT_***
33003873 07/2012
S_NOT_***: Negation
Description
Function Description
The function negates the input bit sequence bit-by-bit and assigns the result to the
output.
The data types of the input and output values must be identical.
EN and ENO can be configured as additional parameters.
Formula
OUT = NOT IN
Available Functions
List of available functions
S_NOT_BOOL
S_NOT_BYTE
S_NOT_WORD
S_NOT_DWORD
Representation in FBD
Representation
S_NOT_***
90 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value BOOL, BYTE, WORD,
DWORD
input bit sequence
Parameter Data Type Meaning
NegValue BOOL, BYTE, WORD,
DWORD
negated bit sequence
33003873 07/2012 91
15
Unity Pro
S_OR_***
33003873 07/2012
S_OR_***: OR Function
Description
Function Description
The function logically ORs each input with the next input until the total number of
inputs have been ORed together.
The data types of all input values and output values must be identical.
The number of inputs can be increased to a maximum of 32.
EN and ENO can be configured as additional parameters.
Formula
OUT = IN1 OR IN2 OR ... OR INn
Available Functions
List of available functions
S_OR_BOOL
S_OR_BYTE
S_OR_WORD
S_OR_DWORD
Representation in FBD
Representation
S_OR_***
92 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value_1 BOOL, BYTE, WORD,
DWORD
input bit sequence
Value_2 BOOL, BYTE, WORD,
DWORD
input bit sequence
Value_n BOOL, BYTE, WORD,
DWORD
input bit sequence
n = max. 32
Parameter Data Type Meaning
Result BOOL, BYTE, WORD,
DWORD
output bit sequence
33003873 07/2012 93
16
Unity Pro
S_R_TRIG
33003873 07/2012
S_R_TRIG: Rising Edge Detection
Description
Function Description
This function block is used for the detection of rising edges 0 -> 1.
Output Q becomes 1 if there is a transition from 0 to 1 at the CLK input. The output
remains at 1 from one function block execution to the next (one cycle); the output
subsequently returns to 0.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
Representation in LD
Representation
S_R_TRIG
94 33003873 07/2012
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
CLK BOOL clock input
Parameter Data Type Meaning
Q BOOL output
33003873 07/2012 95
17
Unity Pro
S_ROL_***
33003873 07/2012
S_ROL_***: Rotate Left
Description
Function Description
This function rotates the bit pattern at the IN input circularly to the left by n bits (value
at input Number).
System bit %S17 is used as CARRY bit, i.e. the status of the bit that is shifted out is
stored there.
The data types of the IN input and OUT output must be identical.
NOTE: Because of IEC 61131-3 conformity, this function also works with the BOOL
data type. This is not significant here.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_ROL_BOOL
S_ROL_BYTE
S_ROL_WORD
S_ROL_DWORD
Representation in FBD
Representation
S_ROL_***
96 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
InputPattern BOOL, BYTE, WORD,
DWORD
This is the bit pattern to be rotated.
For example:
InputPattern=2#0100000011110001
Number UINT This is the number of spaces to be
rotated.
Example:
number = 4
Parameter Data Type Meaning
OutputPattern BOOL, BYTE, WORD,
DWORD
This is the rotated bit pattern.
For example:
With the data from the previous table, the
result is:
RotatedPattern=2#0000111100010100
33003873 07/2012 97
18
Unity Pro
S_ROR_***
33003873 07/2012
S_ROR_***: Rotate Right
Description
Function Description
This function rotates the bit pattern at the In input circularly to the right by n bits
(value at input Number).
System bit %S17 is used as CARRY bit, i.e. the status of the bit that is shifted out is
stored there.
The data types of the IN input and OUT output must be identical.
NOTE: Because of IEC 61131-3 conformity, this function also works with the BOOL
data type. This is not significant here.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_ROR_BOOL
S_ROR_BYTE
S_ROR_WORD
S_ROR_DWORD
Representation in FBD
Representation
S_ROR_***
98 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
InputPattern BOOL, BYTE, WORD,
DWORD
This is the bit pattern to be rotated.
For example:
InputPattern=2#0100000011110001
Number UINT This is the number of spaces to be
rotated.
Example:
number = 4
Parameter Data Type Meaning
OutputPattern BOOL, BYTE, WORD,
DWORD
This is the rotated bit pattern.
For example:
With the data from the previous table, the
result is
RotatedPattern=2#0001010000001111
33003873 07/2012 99
19
Unity Pro
S_RS
33003873 07/2012
S_RS: Bistable Function Block,
Reset Dominant
Description
Function Description
The function block is used as RS memory with the property "Reset dominant".
Output Q1 becomes 1 when the S input becomes 1. This state remains even if input
S reverts back to 0. Output Q1 changes back to 0 when input R1 becomes 1. If the
inputs S and R1 are 1 simultaneously, the dominating input R1 will set the output Q1
to 0.
When the function block is called for the first time, the initial state of Q1 is 0.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
S_RS
100 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
S BOOL set
R1 BOOL reset (dominant)
Parameter Data Type Meaning
Q1 BOOL output
33003873 07/2012 101
20
Unity Pro
S_SHL_***
33003873 07/2012
S_SHL_***: Shift Left
Description
Function Description
This function shifts the bit pattern at the IN input to the left by n bits (value at input N).
System bit %S17 is used as CARRY bit, i.e. the status of the bit that is shifted out is
stored there.
Zeros are filled in from the right.
The data types of the IN input and OUT output must be identical.
NOTE: Because of IEC 61131-3 conformity, this function also works with the BOOL
data type. This is not significant here.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_SHL_BOOL
S_SHL_BYTE
S_SHL_WORD
S_SHL_DWORD
Representation in FBD
Representation
S_SHL_***
102 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
IntputPattern BOOL, BYTE, WORD,
DWORD
This is the bit pattern to be shifted.
For example
IntputPattern =
2#0100000011110001.
Number UINT This is the number of spaces to be
shifted.
For example
Number = 4.
Parameter Data Type Meaning
ShiftedPattern BOOL, BYTE, WORD,
DWORD
This is the bit pattern to be shifted.
For example
With the data from the previous table, the
result is
ShiftedPattern = 2#0000111100010000
33003873 07/2012 103
21
Unity Pro
S_SHR_***
33003873 07/2012
S_SHR_***: Shift Right
Description
Function Description
This function shifts the bit pattern at the IN input to the right by n bits (value at input
N).
System bit %S17 is used as CARRY bit, i.e. the status of the bit that is shifted out is
stored there.
Zeros are filled in from the left.
The data types of the In input and OUT output must be identical.
NOTE: Because of IEC 61131-3 conformity, this function also works with the BOOL
data type. This is not significant here.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_SHR_BOOL
S_SHR_BYTE
S_SHR_WORD
S_SHR_DWORD
Representation in FBD
Representation
S_SHR_***
104 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
IntputPattern BOOL, BYTE, WORD,
DWORD
This is the bit pattern to be shifted.
For example
IntputPattern =
2#0100000011110001.
Number UINT This is the number of spaces to be
shifted.
Example:
number = 4.
Parameter Data Type Meaning
ShiftedPattern BOOL, BYTE, WORD,
DWORD
This is the bit pattern to be shifted.
For example
With the data from the previous table, the
result is
ShiftedPattern = 2#0000010000001111
33003873 07/2012 105
22
Unity Pro
S_SR
33003873 07/2012
S_SR: Bistable Function Block,
Set Dominant
Description
Function Description
The function block is used as SR memory with the property "Set dominant".
Output Q1 becomes 1 when the S1 input becomes 1. This state remains even if input
S1 reverts back to 0. Output Q1 changes back to 0 when input R becomes 1. If the
inputs S1 and R are both 1 simultaneously, the dominating input S1 will set the
output Q1 to 1.
When the function block is called for the first time, the initial state of Q1 is 0.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
S_SR
106 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
S1 BOOL set (dominant)
R BOOL reset
Parameter Data Type Meaning
Q1 BOOL output
33003873 07/2012 107
23
Unity Pro
S_XOR_***
33003873 07/2012
S_XOR_***: Exclusive OR
Function
Description
Function Description
The function for a bit XOR is to sequence the bits at the inputs and return the result
at the output.
The data types of all input values and output values must be identical.
The number of inputs can be increased to a maximum of 32.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_XOR_BOOL
S_XOR_BYTE
S_XOR_WORD
S_XOR_DWORD
Formula
OUT = IN1 XOR IN2 XOR ... XOR INn
Representation in FBD
Representation
S_XOR_***
108 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Value_1 BOOL, BYTE, WORD,
DWORD
input bit sequence
Value_2 BOOL, BYTE, WORD,
DWORD
input bit sequence
Value_n BOOL, BYTE, WORD,
DWORD
input bit sequence
n = max 32
Parameter Data Type Meaning
Result BOOL, BYTE, WORD,
DWORD
output bit sequence
33003873 07/2012 109
VI
Unity Pro
Mathematics
33003873 07/2012
Mathematics
Introduction
This section describes the elementary functions and elementary function blocks of
the Mathematics family.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
24 S_ABS_***: Absolute Value Computation 111
25 S_ADD_***: Addition 113
26 S_DIV_***: Division 115
27 S_MUL_***: Multiplication 117
28 S_MOVE: Assignment 119
29 S_SMOVE_BIT: Assignment 121
30 S_SMOVE_WORD: Assignment 127
31 S_NEG_***: Negation 135
32 S_SQRT_REAL: Safety Square Root 137
33 S_SIGN_***: Sign Evaluation 139
34 S_SUB_***: Subtraction 141
Mathematics
110 33003873 07/2012
33003873 07/2012 111
24
Unity Pro
S_ABS_***
33003873 07/2012
S_ABS_***: Absolute Value
Computation
Description
Function Description
The function computes the absolute value of the input value and assigns the result
to the output.
The data types of the input and output values must be identical.
NOTE: Because of IEC 61131-3 conformity, this function also works with the UINT
and UDINT data types. This is not significant here.
EN and ENO can be configured as additional parameters.
Formula
Available Functions
List of available functions
S_ABS_INT
S_ABS_DINT
S_ABS_UINT
S_ABS_UDINT
S_ABS_REAL
S_ABS_***
112 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Runtime Error
The system bit %S18 (see page 222) is set to 1, if a value is below a limit value (data
types INT and DINT).
Parameter Data Type Meaning
Value INT, DINT, UINT,
UDINT, REAL
input value
Parameter Data Type Meaning
Result INT, DINT, UINT,
UDINT, REAL
output value
33003873 07/2012 113
25
Unity Pro
S_ADD_***
33003873 07/2012
S_ADD_***: Addition
Description
Function Description
The function adds the input values and assigns the result to the output.
The data types of all input values and output values must be identical.
The number of inputs can be increased to a maximum of 32 for all functions.
EN and ENO can be configured as additional parameters.
Formula
INT, DINT, UINT, UDINT, REAL:
OUT = IN1 + IN2 + ... + INn
Available Functions
List of available functions
S_ADD_INT
S_ADD_DINT
S_ADD_UINT
S_ADD_UDINT
S_ADD_REAL
Representation in FBD
Representation
S_ADD_***
114 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Runtime Error
The system bit %S18 (see page 222) is set to 1, if the value range on the output is
exceeded (all available data types).
NOTE: The system word %SW17 (see Unity Pro, Program Languages and
Structure, Reference Manual ) gives the detected error status on S_ADD_REAL.
Parameter Data Type Meaning
Value1 INT, DINT, UINT,
UDINT, REAL
summand
Value2 INT, DINT, UINT,
UDINT, REAL
summand
Valuen INT, DINT, UINT,
UDINT, REAL
summand
n = max 32
Parameter Data Type Meaning
Sum INT, DINT, UINT,
UDINT, REAL
sum
33003873 07/2012 115
26
Unity Pro
S_DIV_***
33003873 07/2012
S_DIV_***: Division
Description
Function Description
The function divides the value at the Dividend with the value at the Divisor input
and assigns the result to the output.
The data types of the input values and the output values must be identical.
When dividingINT, DINT, UINT and UDINT data types, any decimal places in the
result are omitted, however, when dividing REAL data type any decimal places in the
result appear.
EN and ENO can be configured as additional parameters.
Formula
Available Functions
List of available functions
S_DIV_INT
S_DIV_DINT
S_DIV_UINT
S_DIV_UDINT
S_DIV_REAL
S_DIV_***
116 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Runtime Error
The system bit %S18 (see page 222) is set to 1, if an invalid division by 0 is executed
(all available data types).
NOTE: The system word %SW17 (see Unity Pro, Program Languages and
Structure, Reference Manual ) gives the detected error status on S_DIV_REAL.
Parameter Data Type Meaning
Dividend INT, DINT, UINT,
UDINT, REAL
dividend
Divisor INT, DINT, UINT,
UDINT, REAL
divisor
Parameter Data Type Meaning
Quotient INT, DINT, UINT,
UDINT, REAL
quotient
33003873 07/2012 117
27
Unity Pro
S_MUL_***
33003873 07/2012
S_MUL_***: Multiplication
Description
Function Description
The function multiplies the input values and assigns the result to the output.
The data types of all input values and output values must be identical.
The number of inputs can be increased to a maximum of 32.
EN and ENO can be configured as additional parameters.
Formula
OUT = IN1 x IN2 x ... x IN
n
Available Functions
List of available functions
S_MUL_INT
S_MUL_DINT
S_MUL_UINT
S_MUL_UDINT
S_MUL_REAL
Representation in FBD
Representation
S_MUL_***
118 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Runtime Error
The system bit %S18 (see page 222) is set to 1, if the value range at the output has
been exceeded (all available data types).
NOTE: The system word %SW17 (see Unity Pro, Program Languages and
Structure, Reference Manual ) gives the detected error status on S_MUL_REAL.
Parameter Data Type Meaning
Factor1 INT, DINT, UINT,
UDINT, REAL
multiplicand (factor)
Factor2 INT, DINT, UINT,
UDINT, REAL
multiplier (factor)
Factorn INT, DINT, UINT,
UDINT, REAL
multiplier (factor)
n = max 32
Parameter Data Type Meaning
Product INT, DINT, UINT,
UDINT, REAL
product
33003873 07/2012 119
28
Unity Pro
S_MOVE
33003873 07/2012
S_MOVE: Assignment
Description
Function Description
The function assigns the input value to the output.
This is a generic function, i.e. the data type to be processed will be determined by
the variable that was first assigned to the function.
If a direct address of a variable is to be assigned or vice versa, always assign the
variable to the function first. A direct address at input and output of the function is
not authorized since this does not allow a clear definition of the data type.
The data types of the input and output values must be identical.
EN and ENO can be configured as additional parameters.
NOTE: S_MOVE cannot access the unrestricted memory area. For access to the
unrestricted area, the S_SMOVE_* FBs have to be used.
NOTE: It is not possible to copy an array of EBOOL elements using the S_MOVE
function, since the S_MOVE function does not update the assignment history of the
array elements.
Formula
OUT = IN
Representation in FBD
Representation
S_MOVE
120 33003873 07/2012
Representation in LD
This function can not be used in the LD (Ladder Diagram) programming language
with the BOOL data type, since the same functionality can be achieved there with
contacts and coils.
Representation
Parameter Description
Description of the input parameter
Description of the output parameter
Parameter Data Type Meaning
Input ANY input value
Parameter Data Type Meaning
Output ANY output value
33003873 07/2012 121
29
Unity Pro
S_SMOVE_BIT
33003873 07/2012
S_SMOVE_BIT: Assignment
Description
Function Description
In general, the memory of the Safety PLC is write protected, i.e. write requests are
not executed.
To allow exceptions from this rule (which are fully in the responsibility of the
customer), e.g. to change set points from an HMI, the UMA (unrestricted memory
area) for %M and %MW values has been introduced.
Definition of UMA
The UMA is characterized as follows:
The UMA is a part of the Safety PLCs memory for %M and %MW values that is not
write protected.
Its addresses can be written from other PLCs or HMIs.
Its configuration is performed in the CPU property dialog of Unity Pro XLS.
S_SMOVE_BIT
122 33003873 07/2012
Configuring the memory of the Safety PLC (safety memory and UMA):
NOTE: %M and %MW in the UMA are located at the beginning of the memory range.
You should thus make sure to reserve UMA space of the memory at the very
beginning of the project.
Purpose of S_SMOVE_BIT
You cannot use variables of type BOOL from the UMA range of %MW use the
S_SMOVE_BIT function block in the safety logic.
S_SMOVE_BIT
33003873 07/2012 123
Representation in FDB
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Parameter Data Type Meaning
IN BOOL A variable or direct address from the unrestricted bit range.
CHANGE BOOL If the input data has changed, the input data is transferred to the
output.
Otherwise the output value remains unchanged.
A literal can be connected or if a variable is used it must be
mapped to a bit in the safety memory range.
S_SMOVE_BIT
124 33003873 07/2012
Description of output parameters
Block Behavior
The S_SMOVE_BIT function block may work according to the following 3 modes:
transparent mode
demand mode
change mode
These modes will be described in the following paragraphs.
Transparent Mode
NOTE: If no signals are connected to DEMAND, CHANGE and TRIG the function block
is in transparent mode because non-connected inputs are treated as connected with
0.
Demand Mode
DEMAND BOOL If a rising edge at the TRIG input is detected, the input data is
transferred to the output.
Otherwise the output value remains unchanged.
A literal can be connected or if a variable is used it must be
mapped to a bit in the safety memory range.
TRIG BOOL Only used in Demand Mode: A rising edge at this input triggers
the transfer of the input value to OUT.
A literal can be connected or if a variable is used it must be
mapped to a bit in the safety memory range.
Parameter Data Type Meaning
OUT BOOL This is the controlled bit to be used in safety logic. It is mapped
to a bit in the safety memory range.
Parameter Data Type Meaning
If... Then...
CHANGE mode bit = 0
and
DEMAND mode bit = 0
the value of the input bit will be written to the
output bit in the safety memory.
If... Then...
there is a rising edge detected at the TRIG
input
the value of the input bit will be written to the
output bit in the safety memory.
S_SMOVE_BIT
33003873 07/2012 125
Change Mode
In this mode only CHANGE is set to 1 (DEMAND is 0 and TRIG has no influence).
Notable Differences between Change and Transparent Mode
In change mode the function block only changes the value of the variable connected
to the OUT if the input IN is changed. In transparent mode the value of the input IN
will always be written to the output OUT. When doing modifications in online mode
consider the following:
Note for Change and Demand Mode
NOTE: Both DEMAND and CHANGE bits are set to 1. In this case the input will be
written to the output when the input changes or when there is a rising edge on the
trigger input.
State Table
Pin states and the respective mode
If... Then...
the input value IN is changing the value of the input bit will be written to the
output bit in the safety memory.
If... Then...
you replace a variable connected to the output
OUT by another variable
the newly connected variable will not change
its current value until the input IN changes.
you replace a variable connected to the output
OUT by another variable
the value of a link which is also connected to
the output will become equal to the current
value of the newly connected variable.
you replace a variable connected to the output
OUT by a link
the value of the link will be 0 until the input IN
changes.
CHANGE Pin DEMAND Pin TRIG Pin IN Pin OUT Pin Mode
0 0 - - = IN transparent
0 1 0->1 - = IN demand
0 1 Not 0->1 - old IN value demand
1 0 - has changed = IN change
1 0 - no change OUT
unchanged
change
1 1 0->1 no change = IN demand +
change
S_SMOVE_BIT
126 33003873 07/2012
1 1 Not 0->1 no change OUT
unchanged
demand +
change
1 1 0->1 has changed = IN demand +
change
1 1 Not 0->1 has changed = IN demand +
change
CHANGE Pin DEMAND Pin TRIG Pin IN Pin OUT Pin Mode
33003873 07/2012 127
30
Unity Pro
S_SMOVE_WORD
33003873 07/2012
S_SMOVE_WORD: Assignment
Description
Function Description
In general, the memory of the Safety PLC is write protected, i.e. write requests are
not executed.
To allow exceptions from this rule (which are fully in the responsibility of the
customer), e.g. to change set points from an HMI, the UMA (unrestricted memory
area) for %M and %MW values has been introduced.
Definition of UMA
The UMA is characterized as follows:
The UMA is a part of the Safety PLCs memory for %M and %MW values that is not
write protected.
Its addresses can be written from other PLCs or HMIs.
Its configuration is performed in the CPU property dialog of Unity Pro XLS.
S_SMOVE_WORD
128 33003873 07/2012
Configuring the memory of the Safety PLC (safety memory and UMA):
NOTE: %M and %MW in the UMA are located at the beginning of the memory range.
You should thus make sure to reserve UMA space of the memory at the very
beginning of the project.
Purpose of S_SMOVE_WORD
You cannot use variables of type WORD from the UMA ranges directly in the safety
logic. To use these variables, the safety function block S_SMOVE_WORD is required.
For variables of type BOOL from the UMA range of %MW use the S_SMOVE_BIT
function block in the safety logic.
S_SMOVE_WORD
33003873 07/2012 129
Representation in FDB
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Parameter Data Type Meaning
IN WORD A variable of the unrestricted word range.
MAX WORD The maximum value permitted for IN.
A literal can be connected or if a variable is used it must be
mapped to a word in the safety memory range.
S_SMOVE_WORD
130 33003873 07/2012
Description of output parameters
Block Behavior
The S_SMOVE_WORD function block may work according to the following 3 modes:
transparent mode
demand mode
change mode
These modes will be described in the following paragraphs.
MIN WORD The minimum value permitted for IN.
A literal can be connected or if a variable is used it must be
mapped to a word in the safety memory range.
CHANGE BOOL =1: The input data is transferred to the output if the input data
has changed (as long as IN is in the valid range (MIN...MAX)).
=0 or no data change: The output value is not written.
=0 and DEMAND=0: called transparent mode, for more
information see below.
A literal can be connected or if a variable is used it must be
mapped to a word in the safety memory range.
DEMAND BOOL =1 and rising edge at the TRIG input detected: The input data is
transferred to the output value OUT (as long as IN is in the valid
range (MIN...MAX)).
Otherwise the output value remains unchanged.
A literal can be connected or if a variable is used it must be
mapped to a Boolean in the safety memory range.
TRIG BOOL Only used in demand mode.
A rising edge at this input triggers the transfer of the input value
to OUT (as long as IN is in the valid range (MIN...MAX)).
A literal can be connected or if a variable is used it must be
mapped to a Boolean in the safety memory range.
Parameter Data Type Meaning
OUT WORD This is the controlled word to be used in the safety logic. It is
mapped to a word in the safety memory range.
ERR WORD If the actual value at the input is not within the range, the value
of output OUT will not be changed and the output ERR will
indicate an out of range (8A19h) error. It is mapped to a
word in the safety memory range.
Parameter Data Type Meaning
S_SMOVE_WORD
33003873 07/2012 131
Transparent Mode
NOTE: If no signals are connected to DEMAND, CHANGE and TRIG the function block
is in transparent mode because non-connected inputs are treated as connected with
0.
Demand Mode
If... Then...
CHANGE mode bit = 0
and
DEMAND mode bit = 0
and
the input value IN is within the valid range
(MIN...MAX)
the value of the input word will be written to
the output word in the safety memory.
If... Then...
there is a rising edge detected at the TRIG
input
and
the input value IN is within the valid range
(MIN...MAX)
the value of the input word will be written to
the output word in the safety memory.
S_SMOVE_WORD
132 33003873 07/2012
Example of demand mode with IN being within the defined range:
If... Then...
the input value IN is out of range the output is unchanged and error code
16#8A19 is shown in the error status word.
S_SMOVE_WORD
33003873 07/2012 133
Example of demand mode with IN being out of the defined range:
Change Mode
In this mode only CHANGE is set to 1 (DEMAND is 0 and TRIG has no influence).
Notable Differences between Change and Transparent Mode
In change mode the function block only changes the value of the variable connected
to the OUT if the input IN is changed. In transparent mode the value of the input IN
will always be written to the output OUT. When doing modifications in online mode
consider the following:
If... Then...
the input value IN is within the valid range
(MIN...MAX)
and
the input value IN is changing
the value of the input word will be written to
the output word in the safety memory.
If... Then...
you replace a variable connected to the output
OUT by another variable
the newly connected variable will not change
its current value until the input IN changes.
you replace a variable connected to the output
OUT by another variable
the value of a link which is also connected to
the output will become equal to the current
value of the newly connected variable.
you replace a variable connected to the output
OUT by a link
the value of the link will be 0 until the input IN
changes.
S_SMOVE_WORD
134 33003873 07/2012
Note for Change and Demand Mode
NOTE: Both DEMAND and CHANGE bits are set to 1. In this case the input will be
written to the output when the input changes or when there is a rising edge on the
trigger input, unless the input value is out of range.
State Table
Pin states and the respective mode
CHANGE DEMAND TRIG IN OUT ERR Mode
- - - out of range
(min, max)
old OUT value E_Input_Valu_Out_Of_Range
(16#8A19)
-
0 0 - valid range = IN 0 transparent
0 1 0->1 valid range = IN 0 demand
0 1 not 0->1 valid range old IN value 0 demand
1 0 - valid range,
changed
= IN 0 change
1 0 - valid range, no
change
OUT unchanged 0 change
1 1 0->1 valid range, no
change
= IN 0 demand +
change
1 1 not 0->1 valid range, no
change
OUT unchanged 0 demand +
change
1 1 0->1 valid range,
changed
= IN 0 demand +
change
1 1 not 0->1 valid range,
changed
= IN 0 demand +
change
33003873 07/2012 135
31
Unity Pro
S_NEG_***
33003873 07/2012
S_NEG_***: Negation
Description
Function Description
The function negates the input value and delivers the result at the OUT output.
The negation causes a sign reversal, e.g.
6 -> -6
-4 -> 4
The data types of the input and output values must be identical.
EN and ENO can be configured as additional parameters.
NOTE: When the INT and DINT data types are processed, it is not possible to
convert very long negative values into positive ones. However, the ENO output is not
set to 0 when this error occurs.
NOTE: When the UINT and UDINT data types are processed, an error message is
returned.
Available Functions
List of available functions
S_NEG_INT
S_NEG_DINT
S_NEG_UINT
S_NEG_UDINT
S_NEG_REAL
Representation in FBD
Representation
S_NEG_***
136 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of input parameters
Description of output parameters
Runtime Error
The system bit %S18 is set to 1 if
a violation of the value range at the input occurs during the execution of the
function (data types INT and DINT)
or
an input value of the data type UINT or UDINT is to be converted.
Parameter Data Type Meaning
Input INT, DINT, UINT,
UDINT, REAL
input value (Input)
Parameter Data Type Meaning
Negated
Output
INT, DINT, UINT,
UDINT, REAL
negated output value (NegatedOutput)
33003873 07/2012 137
32
Unity Pro
S_SQRT_REAL
33003873 07/2012
S_SQRT_REAL: Safety Square
Root
Description
Function description
The S_SQRT_REAL function extracts the square root from a variable. This function
can be called using its generic name.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation applied to a real:
Representation in LD
Representation applied to a real:
S_SQRT_REAL
138 33003873 07/2012
Description of parameters
The following table describes the input parameters:
The following table describes the output parameters:
Runtime errors
When Value1 is of REAL type and negative, the result of the function contains NAN
and bit %S18 (see page 222) = 1.
In case of %%S18 (see page 222) = 1 the system word %%SW17 (see Unity Pro,
Program Languages and Structure, Reference Manual ) indicates the type of fault.
Parameter Type Comment
Value1 REAL. Variable whose square root you want to extract.
0 Value1
Parameter Type Comment
S_Sqrt_Value1 REAL. S_Sqrt_Value1 contains the square root of Value1.
S_Sqrt_Value1 is of the same type as Value1.
33003873 07/2012 139
33
Unity Pro
S_SIGN_***
33003873 07/2012
S_SIGN_***: Sign Evaluation
Description
Function Description
The function is used for the detection of negative signs.
With a value 0 at the input, the output becomes 0. With a value < 0 at the input,
the output becomes 1.
NOTE: Because of IEC 61131-3 conformity, this function also works with the UINT
and UDINT data types. This is not significant since these functions return a 0 result.
EN and ENO can be configured as additional parameters.
Formula
Block formula
OUT = 1, if IN < 0
OUT = 0, if IN 0
NOTE: Be aware of the following behavior results for signed 0 (+/-0):
-0 -> SIGN_INT/DINT -> 0
+0 -> SIGN_INT/DINT -> 0
Available Functions
List of available functions
S_SIGN_INT
S_SIGN_DINT
S_SIGN_UINT
S_SIGN_UDINT
S_SIGN_REAL
S_SIGN_***
140 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of input parameters
Description of output parameters
Runtime Error
The system bit %S18 is set to 1 and ENO to 0 if an input value of the data type UINT
or UDINT is given.
Parameter Data Type Meaning
Value INT, DINT, UINT,
UDINT, REAL
signed input
Parameter Data Type Meaning
Negative BOOL sign evaluation
33003873 07/2012 141
34
Unity Pro
S_SUB_***
33003873 07/2012
S_SUB_***: Subtraction
Description
Function Description
The function subtracts the value at the Value2 input from the value at the Value1
input and assigns the result to the output.
The data types of the input values and the output values must be identical.
EN and ENO can be configured as additional parameters.
Formula
Difference = Value1 - Value2
Available Functions
List of available functions
S_SUB_INT
S_SUB_DINT
S_SUB_UINT
S_SUB_UDINT
S_SUB_REAL
Representation in FBD
Representation
S_SUB_***
142 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Runtime Error
The system word %SW17 (see Unity Pro, Program Languages and Structure,
Reference Manual ) gives the detected error status on S_SUB_REAL.
Parameter Data Type Meaning
Value1 INT, DINT, UINT,
UDINT, REAL
minuend
Value2 INT, DINT, UINT,
UDINT, REAL
subtrahend
Parameter Data Type Meaning
Difference INT, DINT, UINT,
UDINT, REAL
difference
33003873 07/2012 143
VII
Unity Pro
Statistical
33003873 07/2012
Statistical
Introduction
This section describes the elementary functions and elementary function blocks of
the Statistical group.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
35 S_LIMIT_***: Limit 145
36 S_MAX_***: Maximum Value Function 147
37 S_MIN_***: Minimum Value Function 149
38 S_MUX_***: Multiplexer 151
39 S_SEL: Binary Selection 155
Statistical
144 33003873 07/2012
33003873 07/2012 145
35
Unity Pro
S_LIMIT_***
33003873 07/2012
S_LIMIT_***: Limit
Description
Function Description
This function transfers the unchanged input value (Input) to the output if the input
value is not less than the minimum value (LowerLimit) and does not exceed the
maximum value (UpperLimit). If the input value (Input) is less than the minimum
value (LowerLimit), the minimum value will be transferred to the output. If the
input value (Input) exceeds the maximum value (UpperLimit), the maximum
value will be transferred to the output.
The data types of all input values and output values must be identical.
EN and ENO can be configured as additional parameters.
Formula
OUT = IN, if (IN MN) & (IN MX)
OUT = MN, if (IN < MN)
OUT = MX, if (IN > MX)
Available Functions
List of available functions
S_LIMIT_BOOL
S_LIMIT_BYTE
S_LIMIT_WORD
S_LIMIT_DWORD
S_LIMIT_INT
S_LIMIT_DINT
S_LIMIT_UINT
S_LIMIT_UDINT
S_LIMIT_***
146 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
LowerLimit BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
lower limit
Input BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
input
UpperLimit BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
upper limit
Parameter Data Type Meaning
Output BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
output
33003873 07/2012 147
36
Unity Pro
S_MAX_***
33003873 07/2012
S_MAX_***: Maximum Value
Function
Description
Function Description
The function assigns the largest input value to the output.
The data types of all input values and output values must be identical.
The number of inputs can be increased to maximum 32.
EN and ENO can be configured as additional parameters.
Formula
OUT = MAX {IN1, IN2, ..., INn}
Available Functions
List of available functions
S_MAX_BOOL
S_MAX_BYTE
S_MAX_WORD
S_MAX_DWORD
S_MAX_INT
S_MAX_DINT
S_MAX_UINT
S_MAX_UDINT
Representation in FBD
Representation
S_MAX_***
148 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of input parameters
Description of output parameters
Parameter Data Type Meaning
Value1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
1. input value
Value2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
2. input value
Valuen BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
n. input value
n = max 32
Parameter Data Type Meaning
Maximum BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
maximum value
33003873 07/2012 149
37
Unity Pro
S_MIN_***
33003873 07/2012
S_MIN_***: Minimum Value
Function
Description
Function Description
The function assigns the smallest input value to the output.
The data types of all input values and output values must be identical.
The number of inputs can be increased to maximum 32.
EN and ENO can be configured as additional parameters.
Formula
OUT = MIN {IN1, IN2, ..., INn}
Available Functions
List of available functions
S_MIN_BOOL
S_MIN_BYTE
S_MIN_WORD
S_MIN_DWORD
S_MIN_INT
S_MIN_DINT
S_MIN_UINT
S_MIN_UDINT
Representation in FBD
Representation
S_MIN_***
150 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of input parameters
Description of output parameters
Parameter Data Type Meaning
Value1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
1. input value
Value2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
2. input value
Valuen BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
n. input value
n = max 32
Parameter Data Type Meaning
Minimum BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
minimum value
33003873 07/2012 151
38
Unity Pro
S_MUX_***
33003873 07/2012
S_MUX_***: Multiplexer
Description
Function Description
This function transfers the respective input to the output depending on the value at
the K input.
The number of inputs can be increased to maximum 31.
EN and ENO can be configured as additional parameters.
Example
K = 0: Input IN0 is transferred to the output
K = 1: Input IN1 is transferred to the output
K = 5: Input IN5 is transferred to the output
K= n: Input INn is transferred to the output
Data Types
The data types at the inputs Input0 to Inputn and at the output must be identical.
Available Functions
List of available functions
S_MUX_INT
S_MUX_DINT
S_MUX_UINT
S_MUX_UDINT
S_MUX_***
152 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
S_MUX_***
33003873 07/2012 153
Parameter Description
Description of input parameters
Description of output parameters
Parameter Data Type Meaning
K INT, DINT, UINT,
UDINT
selection input
K = 0...30
IN0 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
1. input
IN1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
2. input
IN2 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
3. input
INn BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
n+1. input, n = max. 30
Parameter Data Type Meaning
OUT BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
output
S_MUX_***
154 33003873 07/2012
33003873 07/2012 155
39
Unity Pro
S_SEL
33003873 07/2012
S_SEL: Binary Selection
Description
Function Description
The function is used for binary selection between 2 input values.
Depending on the state of the Selection input, either the Input0 input or Input1
input is transferred to the Output output.
Selection = 0 -> Output = Input0
Selection = 1 -> Output = Input1
The data types of the Input0 and Input1 input values and the Output output
values must be identical.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
S_SEL
156 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
Selection BOOL selection input
Input0 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
input 0
Input1 BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
input 1
Parameter Data Type Meaning
Output BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, UDINT
output
33003873 07/2012 157
VIII
Unity Pro
Timer & Counter
33003873 07/2012
Timer & Counter
Introduction
This section describes the elementary functions and elementary function blocks of
the Timer & Counter family.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
40 S_CTD_***: Down Counter 159
41 S_CTU_***: Up Counter 161
42 S_CTUD_***: Up/Down Counter 163
43 S_TOF: Off Delay 167
44 S_TON: On Delay 169
45 S_TP: Pulse 171
Timer & Counter
158 33003873 07/2012
33003873 07/2012 159
40
Unity Pro
S_CTD_***
33003873 07/2012
S_CTD_***: Down Counter
Description
Function Description
The function block is used for downwards counting.
A 1 signal at the LD input causes the value of the PV input to be allocated to the CV
output. With each transition from 0 to 1 at the CD input, the value of CV is reduced
by 1.
When CV 0, the Q output becomes 1.
NOTE: The counter only works to the minimum values of the data type being used.
No overflow occurs.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_CTD_INT
S_CTD_DINT
S_CTD_UINT
S_CTD_UDINT
Representation in FBD
Representation
S_CTD_***
160 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
CD BOOL trigger input
LD BOOL load data
PV INT, DINT, UINT,
UDINT
preset value
Parameter Data Type Meaning
Q BOOL output
CV INT, DINT, UINT,
UDINT
count value (actual value)
33003873 07/2012 161
41
Unity Pro
S_CTU_***
33003873 07/2012
S_CTU_***: Up Counter
Description
Function Description
The function block is used for upwards counting.
A 1 signal at the R input causes the value 0 to be assigned to the CV output. With
each transition from 0 to 1 at the CU input, the value of CV is incremented by 1. When
CV PV, the Q output is set to 1.
NOTE: The counter only works to the maximum values of the data type being used.
No overflow occurs.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_CTU_INT
S_CTU_DINT
S_CTU_UINT
S_CTU_UDINT
Representation in FBD
Representation
S_CTU_***
162 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
CU BOOL trigger input
R BOOL reset
PV INT, DINT, UINT,
UDINT
preset value
Parameter Data Type Meaning
Q BOOL output
CV INT, DINT, UINT,
UDINT
count value (actual value)
33003873 07/2012 163
42
Unity Pro
S_CTUD_***
33003873 07/2012
S_CTUD_***: Up/Down Counter
Description
Function Description
The function block is used for upwards and downwards counting.
A 1 signal at the R input causes the value 0 to be assigned to the CV output. A 1
signal at the LD input causes the value of the PV input to be allocated to the CV
output. With each transition from 0 to 1 at the CU input, the value of CV is
incremented by 1. With each transition from 0 to 1 at the CD input, the value of CV is
reduced by 1.
If there is a simultaneous 1 signal at inputs R and LD, input R has precedence.
When CV PV, output QU becomes 1.
When CV 0, the QD output becomes 1.
NOTE: The down counter only works to the minimum values of the data type being
used, and the up counter only to the maximum values of the data type being used.
No overflow occurs.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_CTUD_INT
S_CTUD_DINT
S_CTUD_UINT
S_CTUD_UDINT
S_CTUD_***
164 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Parameter Data Type Meaning
CU BOOL up counter trigger input
CD BOOL down counter trigger input
R BOOL reset
LD BOOL load data
PV INT, DINT, UINT,
UDINT
preset value
S_CTUD_***
33003873 07/2012 165
Description of the output parameter
Parameter Data Type Meaning
QU BOOL up display
QD BOOL down display
CV INT, DINT, UINT,
UDINT
count value (actual value)
S_CTUD_***
166 33003873 07/2012
33003873 07/2012 167
43
Unity Pro
S_TOF
33003873 07/2012
S_TOF: Off Delay
Description
Function Description
The function block is used as the Off delay.
When the function block is called for the first time, the initial state of ET is 0.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
Representation in LD
Representation
S_TOF
168 33003873 07/2012
Parameter Description
Description of the input parameters
Description of the output parameter
Timing Diagram
Representation of the OFF delay S_TOF
(1) If IN becomes 1, Q becomes 1.
(2) If IN becomes 0, the internal time (ET) is started.
(3) If the internal time reaches the value of PT, Q becomes 0.
(4) If IN becomes 1, Q becomes 1, and the internal time is stopped/reset.
(5) If IN becomes 1 before the internal time has reached the value of PT, the internal time is
stopped/reset without Q being set back to 0.
Parameter Data Type Meaning
IN BOOL start delay
PT TIME preset delay time
Parameter Data Type Meaning
Q BOOL output
ET TIME internal time
33003873 07/2012 169
44
Unity Pro
S_TON
33003873 07/2012
S_TON: On Delay
Description
Function Description
The function block is used as the On delay.
When the function block is called for the first time, the initial state of ET is 0.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
Representation in LD
Representation
S_TON
170 33003873 07/2012
Parameter Description
Description of the input parameters
Description of the output parameter
Timing Diagram
Representation of the ON delay S_TON
(1) If IN becomes 1, the internal time (ET) starts.
(2) If the internal time reaches the value of PT, Q becomes 1.
(3) If IN becomes 0, Q becomes 0 and the internal time is stopped/reset.
(4) If IN becomes 0 before the internal time has reached the value of PT, the internal time
stops/resets without Q going to 1.
Parameter Data Type Meaning
IN BOOL start delay
PT TIME preset delay time
Parameter Data Type Meaning
Q BOOL output
ET TIME internal time
33003873 07/2012 171
45
Unity Pro
S_TP
33003873 07/2012
S_TP: Pulse
Description
Function Description
The function block is used for the generation of a pulse with defined duration.
When the function block is called for the first time, the initial state of ET is 0.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
Representation in LD
Representation
S_TP
172 33003873 07/2012
Parameter Description
Description of the input parameters
Description of the output paramete:
Timing Diagram
Representation of the S_TP pulse
(1) If IN becomes 1, Q becomes 1 and the internal time (ET) starts.
(2) If the internal time reaches the value of PT, Q becomes 0 (independent of IN).
(3) The internal time stops/is reset if IN becomes 0.
(4) If the internal time has not reached the value of PT yet, the internal time is not affected by
a clock at IN.
(5) If the internal time has reached the value of PT and IN is 0, the internal time stops/is reset
and Q becomes 0.
Parameter Data Type Meaning
IN BOOL trigger pulse
PT TIME preset pulse duration
Parameter Data Type Meaning
Q BOOL output
ET TIME internal time
33003873 07/2012 173
IX
Unity Pro
Type to Type
33003873 07/2012
Type to Type
Introduction
This section describes the elementary functions and elementary function blocks of
the Type to Type family.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
46 S_BIT_TO_BYTE: Type Conversion 175
47 S_BIT_TO_WORD: Type Conversion 179
48 S_BOOL_TO_***: Type Conversion 181
49 S_BYTE_TO_BIT: Type Conversion 183
50 S_BYTE_TO_***: Type Conversion 185
51 S_DWORD_TO_***: Type Conversion 187
52 S_INT_TO_***: Type Conversion 189
53 S_DINT_TO_***: Type Conversion 191
54 S_REAL_TO_***: Type Conversion 193
55 S_TIME_TO_UDINT: Type Conversion 195
56 S_UDINT_TO_***: Type Conversion 197
57 S_UINT_TO_***: Type Conversion 199
58 S_WORD_TO_BIT: Type Conversion 201
59 S_WORD_TO_***: Type Conversion 203
Type to Type
174 33003873 07/2012
33003873 07/2012 175
46
Unity Pro
S_BIT_TO_BYTE:
33003873 07/2012
S_BIT_TO_BYTE: Type
Conversion
Description
Function Description
The function converts 8 input values of the data type BOOL to an output of the BYTE
data type.
The input values are assigned to the individual bits of the byte at the output
according to the input names.
EN and ENO can be configured as additional parameters.
Formula
Block formula
S_BIT_TO_BYTE:
176 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
S_BIT_TO_BYTE:
33003873 07/2012 177
Parameter Description
Description of the input parameters
Description of the output parameter:
Parameter Data Type Meaning
InputBit0 BOOL input bit 0
InputBit1 BOOL input bit 1
: : :
InputBit7 BOOL input bit 7
Parameter Data Type Meaning
OutputByte BYTE output value
S_BIT_TO_BYTE:
178 33003873 07/2012
33003873 07/2012 179
47
Unity Pro
S_BIT_TO_WORD
33003873 07/2012
S_BIT_TO_WORD: Type
Conversion
Description
Function Description
The function converts 16 input values of the BOOL data type to an output value of
the WORD data type.
The input values are assigned to the individual bits of the word at the output
according to the input names.
EN and ENO can be configured as additional parameters.
Formula
Block formula
S_BIT_TO_WORD
180 33003873 07/2012
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
InputBit0 BOOL input bit 0
: : :
InputBit15 BOOL input bit 15
Parameter Data Type Meaning
WORD_Output WORD output value
33003873 07/2012 181
48
Unity Pro
S_BOOL_TO_***
33003873 07/2012
S_BOOL_TO_***: Type
Conversion
Description
Function Description
The function converts an input value of the BOOL data type to a BYTE, WORD, DWORD,
INT, DINT, UINT or UDINT data type.
The input value is written in the lowest bit of the output. All other output bits are set
to zero.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_BOOL_TO_BYTE
S_BOOL_TO_WORD
S_BOOL_TO_DWORD
S_BOOL_TO_INT
S_BOOL_TO_DINT
S_BOOL_TO_UINT
S_BOOL_TO_UDINT
Representation in FBD
Representation of an Integer application
S_BOOL_TO_***
182 33003873 07/2012
Representation in LD
Representation of an Integer application
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
BOOL_variable BOOL input value
Parameter Data Type Meaning
ConvertedVariable BYTE, WORD, DWORD,
INT, DINT, UINT,
UDINT
output value
33003873 07/2012 183
49
Unity Pro
S_BYTE_TO_BIT
33003873 07/2012
S_BYTE_TO_BIT: Type
Conversion
Description
Function Description
The procedure converts an input value of the BYTE data type to 8 output values of
the BOOL data type.
The individual bits of the byte at the input are assigned to the outputs according to
the output names.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
S_BYTE_TO_BIT
184 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
BYTE_variable BYTE input
Parameter Data Type Meaning
BOOL_variable1 BOOL output bit 0
BOOL_variable2 BOOL output bit 1
: : :
BOOL_variable8 BOOL output bit 7
33003873 07/2012 185
50
Unity Pro
S_BYTE_TO_***
33003873 07/2012
S_BYTE_TO_***: Type Conversion
Description
Function Description
The function converts an input value of the BYTE data type to a BOOL, WORD, DWORD,
INT, DINT, UINT or UDINT data type.
When converting the data type BYTE to the data type WORD, DWORD, INT, DINT,
UINT or UDINT, the bit pattern of the input is transferred to the least significant bits
of the output. The most significant bits of the output are set to zero.
When converting the data type BYTE into the data type BOOL, the least significant
bit of the input value is transferred to the output.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_BYTE_TO_BOOL
S_BYTE_TO_WORD
S_BYTE_TO_DWORD
S_BYTE_TO_INT
S_BYTE_TO_DINT
S_BYTE_TO_UINT
S_BYTE_TO_UDINT
Representation in FBD
Representation of an Integer application
S_BYTE_TO_***
186 33003873 07/2012
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Description of output parameters
Parameter Data Type Meaning
BYTE_variable BYTE input value
Parameter Data Type Meaning
ConvertedVariable BOOL, WORD, DWORD,
INT, DINT, UINT,
UDINT
output value
33003873 07/2012 187
51
Unity Pro
S_DWORD_TO_***
33003873 07/2012
S_DWORD_TO_***: Type
Conversion
Description
Function Description
The function converts an input value of the DWORD data type to a BOOL, BYTE, WORD,
INT, DINT, UINT or UDINT data type.
NOTE: The function converts strictly in accordance with IEC rules. Since this
function has been realized as a generic function, there will also be a few illogical
conversions, e.g. DWORD_TO_BOOL.
When converting the data type DWORD to the BOOL, BYTE, WORD, INT or UINT data
type, the least significant bits of the input value are transferred to the output.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_DWORD_TO_BOOL
S_DWORD_TO_BYTE
S_DWORD_TO_WORD
S_DWORD_TO_INT
S_DWORD_TO_DINT
S_DWORD_TO_UINT
S_DWORD_TO_UDINT
Representation in FBD
Representation of an Integer application
S_DWORD_TO_***
188 33003873 07/2012
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Description of output parameters
Runtime Error
The system bit %S18 (see page 222) and system word %SW17 (see page 231) are
not used.
Parameter Data Type Meaning
DWORD_variable DWORD input value
Parameter Data Type Meaning
ConvertedVariable BOOL, BYTE, WORD,
INT, DINT, UINT,
UDINT
output value
33003873 07/2012 189
52
Unity Pro
S_INT_TO_***
33003873 07/2012
S_INT_TO_***: Type Conversion
Description
Function Description
The function converts an input value of the INT data type to a BOOL, BYTE, WORD,
DWORD, DINT, UINT or UDINT output value.
NOTE: The function converts strictly in accordance with IEC rules. Since this
function has been realized as a generic function, there will also be a few illogical
conversions, e.g. INT_TO_BOOL.
Negative input values cannot be converted into data types UINT or UDINT.
When converting an input value from the data type INT into data type WORD, the bit
pattern from the input is transferred to the output without being modified.
When converting an input value of data type INT into the data types BOOL or BYTE,
the least significant bits of the input are transferred to the output.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_INT_TO_BOOL
S_INT_TO_BYTE
S_INT_TO_WORD
S_INT_TO_DWORD
S_INT_TO_DINT
S_INT_TO_UINT
S_INT_TO_UDINT
S_INT_TO_***
190 33003873 07/2012
Representation in FBD
Representation of a double integer application
Representation in LD
Representation of a double integer application
Parameter Description
Description of input parameters
Description of output parameters
Runtime Error
The system bit %S18 (see page 222) is set to 1, if
the value range on the output is exceeded (numeric data types)
a negative input value is to be converted into an UDINT- or UINT output value.
The system bit %S18 (see page 222) and system word %SW17 (see page 231) are
not used when data types are converted:
BOOL
BYTE
WORD
DWORD
Parameter Data Type Meaning
INT_variable INT input value
Parameter Data Type Meaning
ConvertedVariable BOOL, BYTE, DWORD,
WORD, DINT, UINT,
UDINT
output value
33003873 07/2012 191
53
Unity Pro
S_DINT_TO_***
33003873 07/2012
S_DINT_TO_***: Type Conversion
Description
Function Description
The function converts an input value of the DINT data type to a BOOL, BYTE, WORD,
DWORD, INT, UINT, UDINT or REAL output value.
NOTE: The function converts strictly in accordance with IEC rules. Since this
function has been realized as a generic function, there will also be a few illogical
conversions, e.g. DINT_TO_BOOL.
When converting the data type DINT to the BOOL, BYTE, WORD, INT or UINT data
type, the least significant bits of the input value are transferred to the output.
Negative input values cannot be converted into data types UINT or UDINT.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_DINT_TO_BOOL
S_DINT_TO_BYTE
S_DINT_TO_WORD
S_DINT_TO_DWORD
S_DINT_TO_INT
S_DINT_TO_UINT
S_DINT_TO_UDINT
S_DINT_TO_REAL
S_DINT_TO_***
192 33003873 07/2012
Representation in FBD
Representation of an Integer application
Representation in LD
Representation of an Integer application
Parameter Description
Description of the input parameters
Description of the output parameter
Runtime Error
The system bit %S18 is set to 1, if
the value range of the output is exceeded (numeric data type except REAL )
a negative input value is to be converted into an UDINT- or UINT output value.
The system bit %S18 is not used when data types BOOL, BYTE, WORD and DWORD
are converted.
Parameter Data Type Meaning
DINT_variable DINT input value
Parameter Data Type Meaning
ConvertedVariable BOOL, BYTE, WORD,
DWORD, INT, UINT,
UDINT, REAL
output value
33003873 07/2012 193
54
Unity Pro
S_REAL_TO_***
33003873 07/2012
S_REAL_TO_***: Type
Conversion
Description
Function description
The function converts an input value of the REAL data type to a DINT, UDINT data
type.
NOTE: The function converts strictly in accordance with IEC rules. Since this
function has been realized as a generic function, there will also be a few illogical
conversions.
When converting to DINT and UDINT , the IEC 559 rules for rounding are applied.
EN and ENO can be configured as additional parameters.
Available functions
List of available functions:
S_REAL_TO_DINT
S_REAL_TO_UDINT
Example
The following example shows how the IEC 559 rounding is applied.
1,4 -> 1
1,5 -> 2
2,5 -> 2
3,5 -> 4
4,5 -> 4
4,6 -> 5
Negative input values
Negative input values cannot be converted into data type , UDINT.
S_REAL_TO_***
194 33003873 07/2012
Representation in FBD
Representation of a double integer application:
Representation in LD
Representation of a double integer application:
Parameter description
Description of input parameters:
Description of output parameters:
Runtime error
The system bit %S18 (see page 222) is set to 1, if
an unauthorized floating point number is set at the input
the value range on the output is exceeded (numeric data types)
a negative input value is to be converted into an UDINT.
an unauthorized floating point number is created during the conversion into the
REAL data type. In this case, the status is also placed in %SW17 (see Unity Pro,
Program Languages and Structure, Reference Manual ).
Parameter Data type Meaning
REAL_variable REAL Input value
Parameter Data type Meaning
ConvertedVariable DINT, UDINT Output value
33003873 07/2012 195
55
Unity Pro
S_TIME_TO_UDINT
33003873 07/2012
S_TIME_TO_UDINT: Type
Conversion
Description
Function Description
The function converts an input value of the TIME data type to UDINT data type.
EN and ENO can be configured as additional parameters.
Available Function
List of available function
S_TIME_TO_UDINT
Representation in FBD
Representation of an Unsigned Double Integer application
Representation in LD
Representation of an Unsigned Double Integer application
S_TIME_TO_UDINT
196 33003873 07/2012
Parameter Description
Description of the input parameters
Description of the output parameter:
Parameter Data Type Meaning
TIME_variable TIME input value
Parameter Data Type Meaning
ConvertedVariable UDINT output value
33003873 07/2012 197
56
Unity Pro
S_UDINT_TO_***
33003873 07/2012
S_UDINT_TO_***: Type
Conversion
Description
Function Description
The function converts an input value of the UDINT data type to an output value of
the BOOL, BYTE, WORD, DWORD, INT, DINT, UINT,REAL or TIME data type.
NOTE: The function converts strictly in accordance with IEC rules. Since this
function has been realized as a generic function, there will also be a few illogical
conversions, e.g. UDINT_TO_BOOL.
When converting the data type UDINT to the BOOL, BYTE, WORD, INT or UINT data
type, the least significant bits of the input value are transferred to the output.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_UDINT_TO_BOOL
S_UDINT_TO_BYTE
S_UDINT_TO_WORD
S_UDINT_TO_DWORD
S_UDINT_TO_INT
S_UDINT_TO_DINT
S_UDINT_TO_UINT
S_UDINT_TO_TIME
S_UDINT_TO_REAL
Representation in FBD
Representation of an Integer application
S_UDINT_TO_***
198 33003873 07/2012
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Description of output parameters
Runtime Error
The system bit %S18 (see page 222) is set to 1, if
the value range on the output is exceeded (numeric data types).
a negative input value is to be converted into an UDINT,UINTorTIME output
value.
The system bit %S18 (see page 222) and system word %SW17 (see page 231) are
not used when data types are converted:
BOOL
BYTE
WORD
DWORD
REAL
Parameter Data Type Meaning
UDINT_variable UDINT input value
Parameter Data Type Meaning
ConvertedVariable BOOL, BYTE, WORD,
DWORD, INT, DINT,
UINT, REAL, TIME
output value
33003873 07/2012 199
57
Unity Pro
S_UINT_TO_***
33003873 07/2012
S_UINT_TO_***: Type Conversion
Description
Function Description
The function converts an input value of the UINT data type to an output value of the
BOOL, BYTE, WORD, DWORD, INT, DINT or UDINT .data type.
NOTE: The function converts strictly in accordance with IEC rules. Since this
function has been realized as a generic function, there will also be a few illogical
conversions, e.g. UINT_TO_BOOL.
When converting an input value from the data type UINT into data type WORD, the
bit pattern from the input is transferred to the output without being modified.
When converting an input value of data type UINT into the data types BOOL or BYTE,
the least significant bits of the input are transferred to the output.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_UINT_TO_BOOL
S_UINT_TO_BYTE
S_UINT_TO_WORD
S_UINT_TO_DWORD
S_UINT_TO_INT
S_UINT_TO_DINT
S_UINT_TO_UDINT
S_UINT_TO_***
200 33003873 07/2012
Representation in FBD
Representation of an Integer application
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Description of output parameters
Runtime Error
The system bit %S18 (see page 222) is set to 1, if
the value range on the output is exceeded (numeric data types)
The system bit %S18 (see page 222) and system word %SW17 (see page 231) are
not used when data types are converted:
BOOL
BYTE
WORD
DWORD
Parameter Data Type Meaning
UINT_variable UINT input value
Parameter Data Type Meaning
ConvertedVariable BOOL, BYTE, WORD,
DWORD, INT, DINT,
UDINT
output value
33003873 07/2012 201
58
Unity Pro
S_WORD_TO_BIT
33003873 07/2012
S_WORD_TO_BIT: Type
Conversion
Description
Function Description
The procedure converts an input value of the WORD data type to 16 output values of
the BOOL data type.
The individual bits of the word at the input are assigned to the outputs according to
the output names.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation
S_WORD_TO_BIT
202 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input parameters
Description of the output parameter
Parameter Data Type Meaning
WORD_variable WORD input
Parameter Data Type Meaning
BOOL_variable1 BOOL output BIT0
: : :
BOOL_variable16 BOOL output BIT15
33003873 07/2012 203
59
Unity Pro
S_WORD_TO_***
33003873 07/2012
S_WORD_TO_***: Type
Conversion
Description
Function Description
The function converts an input value of the WORD data type to a BOOL, BYTE, DWORD,
INT, DINT, UINT or UDINT data type.
When converting the WORD data type to the DWORD, DINT or UDINT data type, the
bit pattern of the input is transferred to the least significant bits of the output. The
most significant bits of the output are set to zero.
When converting the data type WORD to the data type BOOL or BYTE, the least
significant bits of the input value are transferred to the output.
EN and ENO can be configured as additional parameters.
Available Functions
List of available functions
S_WORD_TO_BOOL
S_WORD_TO_BYTE
S_WORD_TO_DWORD
S_WORD_TO_INT
S_WORD_TO_DINT
S_WORD_TO_UINT
S_WORD_TO_UDINT
Representation in FBD
Representation of an Integer application
S_WORD_TO_***
204 33003873 07/2012
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Description of output parameters
Parameter Data Type Meaning
WORD_variable WORD input value
Parameter Data Type Meaning
ConvertedVariable BOOL, BYTE, DWORD,
INT, DINT, UINT,
UDINT
output value
33003873 07/2012 205
X
Unity Pro
Communication
33003873 07/2012
Communication
Introduction
This section describes the derived function blocks of the Communication family.
What Is in This Part?
This part contains the following chapters:
Chapter Chapter Name Page
60 S_WR_ETH: Safe Ethernet PLC-PLC Communication
Function
207
61 S_RD_ETH: Safe Ethernet PLC-PLC Communication
Function
211
Communication
206 33003873 07/2012
33003873 07/2012 207
60
Unity Pro
S_WR_ETH
33003873 07/2012
S_WR_ETH: Safe Ethernet PLC-
PLC Communication Function
Description
Function Description
The S_WR_ETH function block is used on a sender PLC when configuring a safe
peer-to-peer communication between 2 PLCs. Its purpose is to calculate the CRC
and time stamp of safety data to be sent and to insert them in the DATA_SAFE array.
NOTE: To make a safe peer-to-peer communication please refer to Modicon
Quantum Safety Reference Manual.
EN and ENO can be configured as additional parameters.
S_WR_ETH function block tasks:
Calculate the CRC of the safety data to be sent.
Calculate the time stamp to be sent with the data. The time stamp is based on a
time base reference which is periodically updated with the time received from an
NTP server (%SW36 to %SW39 system words (see page 231)).
Insert the calculated CRC and time stamp at the end of the data to be sent array
(Reserved Data zone (see page 208)).
The S_WR_ETH DFB function block has to be called at each cycle in the sender PLC.
Within the cycle, it has to be executed in the logic after all required modifications
have been performed on the data to be sent. This means that the data to be sent
must not be modified by the user within the cycle after the execution of the DFB,
otherwise the CRC information used in the reserved data area will not be correct and
the safe peer-to-peer communication fails.
Representation in FBD
Representation
S_WR_ETH
208 33003873 07/2012
Representation in LD
Representation
Parameter Description
Description of the input/output parameter:
Description of the input parameter:
Description of output parameter:
DATA_SAFE Array Description
The DATA_SAFE array must be allocated inside the safety logic. If it is not the case,
Unity Pro XLS creates an error message and does not generate the user application
code.
The DATA_SAFE array must be located in the Safety memory area. If it is not the
case, Unity Pro XLS creates an error message and does not generate the user
application code.
Parameter Data Type Meaning
DATA_SAFE ARRAY[0..
99] of INT
Array of safety data to be sent using the IO
scanning service.
Parameter Data Type Meaning
ID INT Communication identifier. The ID value is used to
calculate the CRC and it must be unique and have
the same value as the value used by the receiver.
Parameter Data Type Meaning
SYNCHRO_NTP BOOL Set to 1 to indicate that NTP time synchronization
is healthy. SYNCHRO_NTP is a logical AND of bits
%SW39.0, %SW39.1 and %SW39.2.
S_WR_ETH
33003873 07/2012 209
DATA_SAFE array is composed of 2 zones:
The User Safety Data zone contains the user data.
This zone starts at index 0 and finishes at index 90.
The Reserved Data zone that is reserved for safety. The data in this zone contain
the CRC and time-stamp variables. They are used to check if the data contained
in the User Safety Data zone are safe or not.
The user must not write in this data zone.
This zone starts at index 91 and finishes at index 99.
DATA_SAFE array (array[0..99] of INT) structure representation:
S_WR_ETH
210 33003873 07/2012
33003873 07/2012 211
61
Unity Pro
S_RD_ETH
33003873 07/2012
S_RD_ETH: Safe Ethernet PLC-
PLC Communication Function
Description
Function Description
The S_RD_ETH function block is used on a receiver PLC when configuring a safe
peer-to-peer communication between 2 PLCs. Its purpose is to copy the data
received in the unrestricted memory area to the Safety memory area and guarantee
the validity of the received data.
NOTE: To make a safe peer-to-peer communication please refer to Modicon
Quantum Safety Reference Manual.
EN and ENO can be configured as additional parameters.
S_RD_ETH function block tasks:
Make a copy of the data received in the unrestricted memory area to the Safety
memory area if the following conditions are respected:
The CRC of the last data received in the unrestricted memory area using the
IO scanning service is correct. If the CRC is not correct, the data are
considered as unsafe and they are not written in the Safety memory area.
The last data received in the unrestricted memory area are more recent than
the data written in the Safety memory area (time stamp checks). If the last data
received in the unrestricted memory area are not more recent, they are not
copied in the Safety memory area.
Check the age of the data in the Safety memory area. If the age is higher than a
maximum value set by the user in the SAFETY_CONTROL_TIMEOUT input
register, the data are declared unsafe and the HEALTH bit is set to 0.
NOTE: The data age is the time difference between the time when the data are
computed in the sender PLC and the time when the data are checked in the receiver
PLC. The time base reference is periodically updated with the time received from an
NTP server (%SW36 to %SW39 system words (see page 231)).
If the HEALTH bit is set to 0, the data available in the OUTPUT_DATA_SAFE array
must be considered as unsafe and you must react accordingly.
S_RD_ETH
212 33003873 07/2012
Representation in FBD
Representation:
Representation in LD
Representation:
S_RD_ETH
33003873 07/2012 213
Parameter Description
Description of the input parameters:
Description of the output parameters:
Parameter Data Type Meaning
INPUT_DATA ARRAY[0..99]
of INT
Array of data received in the unrestricted
memory area using the IO scanning
service.
ID INT Communication identifier. The ID value
is used to calculate the CRC and it must
be unique and have the same value as
the value used by the sender.
SAFETY_CONTROL_TIMEOUT INT Time out value (in ms). Used to check
the age of the data in the Safety memory
area and to determine if those data are
considered as safe.
Parameter Data Type Meaning
OUTPUT_DATA_SAFE ARRAY[0..99]
of INT
Array of safety data located in the Safety
memory area.
SYNCHRO_NTP BOOL Set to 1 to indicate that NTP time
synchronization is healthy. SYNCHRO_NTP is
a logical AND of bits %SW39.0, %SW39.1 and
%SW39.2.
NEW BOOL Set to 1 to indicate that new safe data have
been refreshed during the current cycle.
HEALTH BOOL =1, the data in the Safety memory area
are safe
=0, the data in the Safety memory area
are not safe
TIME_DIFF INT Returns the age of the data received and
written in the Safety memory area (in ms).
Set to 0 if the internal NTP time (%SW36 to
%SW38) is not initialized or if no correct data
have been received yet.
S_RD_ETH
214 33003873 07/2012
INPUT_DATA and OUTPUT_DATA_SAFE Arrays Description
The INPUT_DATA and OUTPUT_DATA_SAFE arrays must be allocated inside the
safety logic. If it is not the case, Unity Pro XLS creates an error message and does
not generate the user application code.
The INPUT_DATA array must be located in the unrestricted memory area. If it is not
the case, Unity Pro XLS creates an error message and does not generate the user
application code.
The OUTPUT_DATA_SAFE array must be located in the Safety memory area. If it is
not the case, Unity Pro XLS creates an error message and does not generate the
user application code.
INPUT_DATA and OUTPUT_DATA_SAFE arrays are composed of 2 zones:
The User Safety Data zone contains the user data.
This zone starts at index 0 and finishes at index 90.
The Reserved Data zone that is reserved for safety. The data in this zone contain
the CRC and time-stamp variables. They are used to check if the data contained
in the User Safety Data zone are safe or not.
The user must not write in this data zone.
This zone starts at index 91 and finishes at index 99.
INPUT_DATA and OUTPUT_DATA_SAFE arrays (array[0..99] of INT) structure
representation:
33003873 07/2012 215
Unity Pro
33003873 07/2012
Appendices
216 33003873 07/2012
33003873 07/2012 217
A
Unity Pro
System Objects
33003873 07/2012
System Objects
Introduction
This chapter describes the system bits and words of the Quantum Safety PLC.
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.
It is suggested that the symbol names associated with the system bits and system
words that appear on the following pages be implemented to provide continuity and
ease of understanding. Example: %S0 COLDSTART (the user can select another
word to replace COLDSTART).
What Is in This Chapter?
This chapter contains the following sections:
Section Topic Page
A.1 System Bits 218
A.2 System Words 227
System Objects
218 33003873 07/2012
A.1 System Bits
Introduction
This section describes the system bits of the Quantum Safety PLC.
For your convenience, all system bits of standard Quantum PLCs are listed but only
explained further if used in the Quantum Safety PLC.
What Is in This Section?
This section contains the following topics:
Topic Page
System Bit Introduction 219
Description of the System Bits %S0 to %S13 220
Description of the System Bits %S15 to %S21 222
Description of the System Bits %S30 to %S51 224
Description of the System Bits %S59 to %S122 225
System Objects
33003873 07/2012 219
System Bit Introduction
General
The 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.
Some of these bits must be reset to their initial or normal state by either the program
or the user. Other bits are automatically reset by the system. Finally, there are bits
which only display the status of the PLC.
System Objects
220 33003873 07/2012
Description of the System Bits %S0 to %S13
Detailed Description
NOTE: Not all of the system bits can be used in the Quantum Safety PLC. The
unusable system bits are marked in the Quant. Safety column with no.
The following table gives a description of the system bits %S0 to %S13:
Bit
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
%S0
COLDSTART
cold start Normally at 0, this bit is set to 1 by:
power restoration with loss of data (battery related),
the user program,
the terminal,
a change of cartridge,
This bit is set to 1 during the first complete restored
cycle of the PLC either in RUN or in STOP mode. It is
reset to 0 by the system before the following cycle.
%S0 is not always set in the first scan of the PLC. If a
signal set for every start of the PLC is needed, %S21
should be used instead.
1
(1
cycle)
no yes
%S1
WARMSTART
warm
restart
see chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual
0 no no
%S4
TB10MS
time base
10 ms
see chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual
- no no
%S5
TB100MS
time base
100 ms
see chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual
- no no
%S6
TB1SEC
time base
1 s
see chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual
- no no
%S7
TB1MIN
time base
1 min
see chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual
- no no
System Objects
33003873 07/2012 221
%S10
IOERR
input/output
fault
Normally at 1, this is set to 0 when an I/O fault on an in-
rack module or device on Fipio is detected (e.g. non-
compliant configuration, exchange fault, hardware
fault, etc.). The %S10 bit is reset to 1 by the system as
soon as the fault disappears.
1 no yes
%S11
WDG
watchdog
overflow
Normally at 0, this is set to 1 by the system as soon as
the task execution time becomes greater than the
maximum execution time (i.e. the watchdog) declared
in the task properties.
0 no yes
%S12
PLCRUNNING
PLC in
RUN
This bit is set to 1 by the system when the PLC is in
RUN.
It is set to 0 by the system as soon as the PLC is no
longer in RUN (STOP, INIT, etc.).
0 no yes
%S13
1RSTSCANRUN
first cycle
after
switching to
RUN
Normally set to 0, this is set to 1 by the system during
the first cycle of the master task after the PLC is set to
RUN.
- no yes
Bit
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
WARNING
UNINTENDED EQUIPMENT OPERATION
On Quantum Safety PLCs, communication interruptions from NOE, CRA or CRP
modules are not reported on bit %S10.
Make certain that these system bits are used correctly.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
System Objects
222 33003873 07/2012
Description of the System Bits %S15 to %S21
Detailed Description
NOTE: Not all of the system bits can be used in the Quantum Safety PLC. The
unusable system bits are marked in the Quant. Safety column with no.
The following table gives a description of the system bits %S15 to %S21:
Bit
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
%S15
STRINGERROR
character
string fault
see chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual
0 yes no
%S16
IOERRTSK
task
input/output
fault
Normally set to 1, this bit is set to 0 by the system when
a fault occurs on an in-rack I/O module or a Fipio device
configured in the task.
This bit must be reset to 1 by the user.
1 yes yes
%S17
CARRY
rotate or
shift output
normally at 0
During a rotate or shift operation, this bit takes the state
of the outgoing bit.
0 no yes
%S18
OVERFLOW
overflow or
arithmetic
error
Normally set to 0, this bit is set to 1 in the event of a
capacity overflow if there is
a result greater than + 32 767 or less than - 32 768,
in single length,
result greater than + 65 535, in unsigned integer,
a result greater than + 2 147 483 647 or less than -
2 147 483 648, in double length,
result greater than +4 294 967 296, in double length
or unsigned integer,
real values outside limits,
division by 0,
the root of a negative number,
forcing to a non-existent step on a drum,
stacking up of an already full register, emptying of
an already empty register.
It must be tested by the user program after each
operation where there is a risk of overflow, and then
reset to 0 by the user if there is indeed an overflow.
When the %S18 bit switches to 1, the application stops
in error state if the %S78 bit has been set to 1.
0 yes yes
System Objects
33003873 07/2012 223
%S19
OVERRUN
task period
overrun
(periodical
scanning)
Normally set to 0, this bit is set to 1 by the system in the
event of a time period overrun (i.e. task execution time
is greater than the period defined by the user in the
configuration or programmed into the %SW word
associated with the task). The user must reset this bit to
0. Each task manages its own %S19 bit.
0 yes yes
%S20
INDEXOVF
Index
overflow
Normally set to 0, this bit is set to 1 when the address
of the indexed object becomes less than 0 or exceeds
the number of objects declared in the configuration.
In this case, it is as if the index were equal to 0.
It must be tested by the user program after each
operation where there is a risk of overflow, and then
reset to 0 if there is indeed an overflow.
When the %S20 bit switches to 1, the application stops
in error state if the %S78 bit has been set to 1.
0 yes no
%S21
1RSTTASKRUN
first task
cycle
Tested in a task (Mast, Fast, Aux0, Aux1, Aux2 Aux3),
the bit %S21 indicates the first cycle of this task. %S21
is set to 1 at the start of the cycle and reset to zero at
the end of the cycle.
Notes: The bit %S21 does not have the same meaning
in PL7 as in Unity Pro.
0 no yes
Bit
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
WARNING
UNINTENDED EQUIPMENT OPERATION
On Quantum Safety PLCs, communication interruptions from NOE, CRA or CRP
modules are not reported on bit %S16.
Make certain that these system bits are used correctly.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
System Objects
224 33003873 07/2012
Description of the System Bits %S30 to %S51
Detailed Description
NOTE: Not all of the system bits can be used in the Quantum Safety PLC. The
unusable system bits are marked in the Quant. Safety column with no.
The following table gives a description of the system bits %S30 to %S51:
Bit
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
%S30
MASTACT
activation/deac-
tivation of the
master task
see chapter "System Bits" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
1 yes no
%S31
FASTACT
activation/deac-
tivation of the
fast task
see chapter "System Bits" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%S32
%S33
%S34
%S35
activation/deac-
tivation of the
auxiliary tasks 0-
3
see chapter "System Bits" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%S38
ACTIVEVT
enabling/inhibi-
tion of events
see chapter "System Bits" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
1 yes no
%S39
EVTOVR
saturation in
event process-
ing
see chapter "System Bits" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%S50
RTCWRITE
updating of time
and date via
words %SW50
to %SW53
Normally set to 0, this bit is set to 1 by the program
or the terminal:
set to 0: update of system words %SW50 to
%SW53 by the date and time supplied by the
PLC real-time clock,
set to 1: system words %SW50 to %SW53 are
no longer updated, therefore making it possible
to modify them.
The switch from 1 to 0 updates the real-time
clock with the values entered in words %SW50
to %SW53.
0 yes yes
%S51
RTCERR
time loss in real-
time clock
This system-managed bit set to 1 indicates that
the real-time clock is missing or that its system
words (%SW50 to %SW53) are meaningless. If
set to 1, the clock must be reset to the correct time.
- no yes
System Objects
33003873 07/2012 225
Description of the System Bits %S59 to %S122
Detailed Description
NOTE: Not all of the system bits can be used in the Quantum Safety PLC. The
unusable system bits are marked in the Quant. Safety column with no.
The following table gives a description of the system bits %S59 to %S122:
Bit
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
%S59
RTCTUNING
incremental
update of
the time
and date
via word
%SW59
Normally set to 0, this bit can be set to 1 or 0 by the
program or the terminal:
set to 0: the system does not manage the system
word %SW59,
set to 1: the system manages edges on word
%SW59 to adjust the date and current time (by
increment).
0 yes yes
%S67
PCMCIABAT0
state of the
application
memory
card battery
This bit is used to monitor the status of the main battery
when the memory card is in the upper PCMCIA slot (all
the Atriums, Premiums, and on the Quantums):
set to 1: main voltage battery is low (application is
preserved but you must replace the battery following
the so-called predictive maintenance procedure),
set to 0: main battery voltage is sufficient
(application is preserved).
Bit %S67 is managed:
on the PV06 small and medium capacity RAM
memory cards (product version written on the card
label), i.e. offering memory size under Unity
=#768K: TSX MRP P 128K, TSX MRP P 224K TSX
MCP C 224K, MCP C 512K, TSX MRP P 384K, TSX
MRP C 448K, TSX MRP C 768K,
under Unity whose version is 2.02.
- no yes
%S68
PLCBAT
state of the
processor
battery
This bit is used to check the operating state of the
backup battery for saving data and the program in
RAM:
set to 0: battery present and operational,
set to 1: battery missing or non-operational.
no yes
%S75
PCMCIABAT1
state of the
data
storage
memory
card battery
This bit is used to monitor the status of the main battery
when the memory card is in the lower PCMCIA slot, see
chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual.
Note: Data stored on a memory card in slot B are not
processed in SIL3 projects.
no no
System Objects
226 33003873 07/2012
%S76
DIAGBUFFCONF
configured
diagnostics
buffer
This bit is set to 1 by the system when the diagnostics
option has been configured. Then, a diagnostics buffer
for storage of errors found by diagnostics DFBs is
reserved.
This bit is read-only.
0 no yes
%S77
DIAGBUFFFULL
full
diagnostics
buffer
This bit is set to 1 by the system when the buffer that
receives errors from the diagnostics function blocks is
full.
This bit is read-only.
0 no yes
%S78
HALTIFERROR
stop in the
event of
error
Normally at 0, this bit can be set to 1 by the user, to
program a PLC stop on application fault: %S15, %S18,
%20.
0 yes yes
%S80
RSTMSGCNT
reset
message
counters
Normally set to 0, this bit can be set to 1 by the user to
reset the message counters %SW80 to %SW86.
0 yes yes
%S94
SAVECURRVAL
saving
adjustment
values
see chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual
0 yes no
%S118
REMIOERR
General
Remote I/O
fault
Normally set to 1, this bit is set to 0 by the system when
a fault occurs on a device connected to the RIO (Fipio
for Premium or Drop S908 for Quantum) remote
input/output bus.
This bit is reset to 1 by the system when the fault
disappears.
This bit is not updated if an error occurs on the other
buses (DIO, ProfiBus, ASI).
no yes
%S119
LOCIOERR
General
inrack I/O
fault
Normally set to 1, this bit is set to 0 by the system when
a fault occurs on an I/O module placed in 1 of the racks.
This bit is reset to 1 by the system when the fault
disappears.
no yes
%S120
%S121
%S122
DIO bus
faults
see chapter "System Bits" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the
Unity Pro Program Languages and Structure
Reference Manual
no no
Bit
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
33003873 07/2012 227
A.2 System Words
Introduction
This section describes the system words of the Quantum Safety PLC.
For your convenience, all system words of standard Quantum PLCs are listed but
only explained further if used in the Quantum Safety PLC.
What Is in This Section?
This section contains the following topics:
Topic Page
Description of the System Words %SW0 to %SW21 228
Description of the System Words %SW30 to %SW59 231
Description of the System Words %SW60 to %SW127 235
System Objects
228 33003873 07/2012
Description of the System Words %SW0 to %SW21
Detailed Description
NOTE: Not all of the system words can be used in the Quantum Safety PLC. The
unusable system words are marked in the Quant. Safety column with no.
The following table gives a description of the system words %SW0 to %SW21:
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
%SW0
MASTPERIOD
master task
scanning
period
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%SW1
FASTPERIOD
fast task
scanning
period
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%SW2, %SW3,
%SW4, %SW5
auxiliary task
scanning
period
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%SW8
TSKINHIBIN
acquisition of
task input
monitoring
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%SW9
TSKINHIBOUT
monitoring of
task output
update
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%SW10
TSKINIT
first cycle
after cold
start
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 no no
%SW11
WDGVALUE
watchdog
duration
Reads the duration of the watchdog. The duration
is expressed in milliseconds (20...990 ms).
This word cannot be modified.
- no yes
System Objects
33003873 07/2012 229
%SW12
APMODE
mode of
application
processor
This word indicates the operating mode of the
application processor. Possible values are:
16#A501: application processor is in
Maintenance Mode.
16#5AFE: application processor is in Safety
Mode.
Any other value is interpreted as an error.
This system word is not available for the standard
Quantum CPU.
16#A501 no yes
%SW13
INTELMODE
mode of Intel
processor
This word indicates the operating mode of the Intel
Pentium processor. Possible values are:
16#501A: application processor is in
Maintenance Mode.
16#5AFE: application processor is in Safety
Mode.
Any other value is interpreted as an error.
This system word is not available for the standard
Quantum CPU.
16#501A no yes
%SW14
OSCOMMVERS
commercial
version of
PLC
processor
This word contains the commercial version of the
PLC processor.
Example: 16#0135
version: 01; issue number: 35
- no yes
%SW15
OSCOMMPATCH
PLC
processor
patch version
This word contains the commercial version of the
PLC processor patch.
It is coded onto the least significant byte of the
word.
coding: 0 = no patch, 1 = A, 2 = B...
Example: 16#0003 corresponds to patch C.
- no yes
%SW16
OSINTVERS
firmware
version
number
This word contains the Firmware version number
in hexadecimal of the PLC processor firmware.
Example: 16#0017
version: 2.1; VN: 17
- no yes
%SW17
FLOATSTAT
error status
on floating
operation
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
%SW17.1: Flag not managed by Quantum Safety.
0 yes yes
%SW18
%SW19
100MSCOUNTER
absolute time
counter
%SW18 is the low and %SW19 the high word for
calculating durations. Both are incremented every
1/10th of a second by the system (even when the
PLC is in STOP, they are no longer incremented if
it is powered down). They can be read and written
by the user program or by the terminal.
0 yes yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
230 33003873 07/2012
%SW20
%SW21
MSCOUNTER
absolute time
counter
The low word %SW20 and the high word %SW21
are incremented every 1/1000th of a second by
the system (even when the PLC is in STOP, they
are no longer incremented if it is powered down).
They can be read by the user program or by the
terminal. %SW20 and %SW21 are reset on a cold
start, but not on a warm start.
0 no yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
33003873 07/2012 231
Description of the System Words %SW30 to %SW59
Detailed Description
NOTE: Not all of the system words can be used in the Quantum Safety PLC. The
unusable system words are marked in the Quant. Safety column with no.
The following table gives a description of the system words %SW30 to %SW59:
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
%SW30
MASTCURRTIME
master task
execution time
This word indicates the execution time of the last
master task cycle (in ms).
- no no
%SW31
MASTMAXTIME
maximum
master task
execution time
This word indicates the longest master task
execution time since the last cold start (in ms).
- no yes
%SW32
MASTMINTIME
minimum
master task
execution time
This word indicates the shortest master task
execution time since the last cold start (in ms).
- no yes
%SW33 to
%SW35
fast task
execution
times
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
- no no
%SW36 NTP number of
seconds (LSB)
This word indicates the number of seconds
passed since January 1st, 1980 at 00:00 (LSB
part). It reflects the NTP time coming from the
140 NOE 771 11 module. This word is refreshed
internally between two NTP synchronizations.
0 no yes
%SW37 NTP number of
seconds
(MSB)
This word indicates the number of seconds
passed since January 1st, 1980 at 00:00 (MSB
part). It reflects the NTP time coming from the
140 NOE 771 11 module. This word is refreshed
internally between two NTP synchronizations.
0 no yes
%SW38 NTP number of
milliseconds
This word indicates the number of milliseconds
added to the NTP number of seconds (%SW36
and %SW37). It reflects the NTP time coming
from the 140 NOE 771 11 module. This word is
refreshed internally between two NTP
synchronizations.
0 no yes
System Objects
232 33003873 07/2012
%SW39 status of the
NTP
timestamps in
ms
Meaning of the different bits of %SW39 word:
%SW39.0 (managed by the controller):
=0, the time value is not available or the
time has not been updated within last 2
minutes
=1, the time value is available or the time
has been updated within last 2 minutes
%SW39.1 (managed by the 140 NOE 771 11
status):
=0, the NTP server time value is not
available
=1, the updated time value is received from
the NTP server and has been sent to the
module (at least once)
%SW39.2 (managed by the CPU):
=0, the time value in %SW36 to %SW38
words differs from the last NTP server time
received by more than 2 seconds. The last
NTP server time received has been
ignored.
=1, the time value in %SW36 to %SW38
words are consistent with the last NTP
server time received (less than 2 seconds
difference). The time value in %SW36 to
%SW38 words is filtered with a slope of
1ms/s to reach the last NTP server time
received.
%SW39.3 to %SW39.7: not used
%SW39.8 (control that can be set by the
application):
=0, no action
=1. When set to 1, the CPU will accept the
next NTP server time received without
filtering (1 ms/s) and without consistency
check (difference between time value in
%SW36 to %SW38 words and NTP server
time). After the next NTP server time is
received, the %SW39.8 bit is automatically
reset to 0 by the controller.
%SW39.9 to %SW39.15: not used
0 yes yes
%SW40 to
%SW47
auxiliary tasks
execution
times
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
- no no
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
33003873 07/2012 233
%SW48
IOEVTNB
number of
events
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages and
Structure Reference Manual
0 yes no
%SW49
DAYOFWEEK
%SW50
SEC
%SW51
HOURMIN
%SW52
MONTHDAY
%SW53
YEAR
real-time clock
function
System words containing date and current time (in
BCD):
%SW49: day of the week:
1 = Monday,
2 = Tuesday,
3 = Wednesday,
4 = Thursday,
5 = Friday,
6 = Saturday,
7 = Sunday,
%SW50: Seconds (16#SS00),
%SW51: Hours and Minutes (16#HHMM),
%SW52: Month and Day (16#MMDD),
%SW53: Year (16#YYYY).
These words are managed by the system when
the bit %S50 is set to 0.
These words can be written by the user program
or by the terminal when the bit %S50 is set to 1.
- yes yes
%SW54
STOPSEC
%SW55
STOPHM
%SW56
STOPMD
%SW57
STOPYEAR
%SW58
STOPDAY
real-time clock
function on last
stop
System words containing date and time of the last
power outage or PLC stop (in Binary Coded
Decimal):
%SW54: Seconds (00SS),
%SW55: Hours and Minutes (HHMM),
%SW56: Month and Day (MMDD),
%SW57: Year (YYYY),
%SW58: the most significant byte contains the
day of the week (1 for Monday through to 7 for
Sunday), and the least significant byte
contains the code for the last stop:
1 = change from RUN to STOP by the
terminal or the dedicated input,
2 = stop by watchdog (PLC task or SFC
overrun),
4 = power outage or memory card lock
operation,
5 = stop on hardware fault,
6 = stop on software fault. Details on the
type of software fault are stored in
%SW125.
- no yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
234 33003873 07/2012
%SW59
ADJDATETIME
adjustment of
current date
Contains 2 8-bit series to adjust the current date.
The action is performed on the rising edge of the
bit.
This word is enabled by bit %S59=1.
In the following illustration, bits in the left column
increment the value, and bits in the right column
decrement the value:
0 yes yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
33003873 07/2012 235
Description of the System Words %SW60 to %SW127
Detailed Description
NOTE: Not all of the system words can be used in the Quantum Safety PLC. The
unusable system words are marked no in the Quant. Safety column.
The following table gives a description of the system words %SW60 to %SW127:
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
%SW60
HSB_CMD
Quantum Hot
Standby
command
register
Meaning of the different bits of the word %SW60:
%SW60.0=1 invalidates the commands
entered in the display (keypad).
%SW60.1
=0 sets PLC A to OFFLINE mode.
=1 sets PLC A to RUN mode.
%SW60.2
=0 sets PLC B to OFFLINE mode.
=1 sets PLC B to RUN mode.
%SW60.3=0 forces Standby PLC to OFFLINE
mode if the applications are different.
%SW60.4
=0 authorizes an update of the firmware
only after the application has stopped.
=1 authorizes an update of the firmware
without the application stopping.
%SW60.5=1 application transfer request from
the Standby to the primary.
%SW60.8
=0 address switch on Modbus port 1 during
a primary swap.
=1 no address switch on Modbus port 1
during a primary swap.
0 yes no
System Objects
236 33003873 07/2012
%SW61
HSB_STS
Quantum status
register
Meaning of the different bits of the word %SW61:
%SW61.0 und %SW61.1 PLC operating mode
bits:
%SW61.1=0, %SW61.0=1: OFFLINE
mode.
%SW61.1=1, %SW61.0=0: primary mode.
%SW61.1=1, %SW61.0=1: secondary
mode (Standby).
%SW61.2 and %SW61.3 operating mode bits
from the other PLC
%SW61.3=0, %SW61.2=1: OFFLINE
mode.
%SW61.3=1, %SW61.2=0: primary mode.
%SW61.3=1, %SW61.2=1: secondary
mode (Standby).
%SW61.3=0, %SW61.2=0: the remote PLC
is not accessible (switched off, no
communication).
%SW61.4=0 the applications are identical on
both PLCs.
%SW61.5
=0 the PLC is used as unit A.
=1 the PLC is used as unit B.
%SW61.7
=0 same PLC OS version.
=1 different PLC OS version.
%SW61.8
=0 same Copro OS version.
=1 different Copro OS version.
%SW61.12
=0 information given by bit 13 is not
relevant.
=1 information given by bit 13 is valid.
%SW61.13
=0 NOE address set to IP.
=1 NOE address set to IP + 1.
%SW61.15
=0 Hot Standby not activated.
=1 Hot Standby activated.
0 no yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
33003873 07/2012 237
%SW62
HSBY_REVERSE0
%SW63
HSBY_REVERSE1
transfer word These 2 words may be written by the user in the
first section of the master task. They are then
transferred automatically from the Standby
processor to update the primary PLC.
They may be read on the primary PLC and be
used as primary application parameters.
0 yes yes
%SW70
WEEKOFYEAR
real-time clock
function
System word containing the number of the week
in the year: 1 to 52.
yes
%SW71
KEY_SWITCH
position of the
switches on the
Quantum front
panel
This word provides the image of the positions of
the switches on the front panel of the Quantum
processor. This word is updated automatically by
the system.
%SW71.0 = 1 switch in the "Memory
protected" position,
%SW71.1 = 1 switch in the "STOP" position,
%SW71.2 = 1 switch in the "START" position,
%SW71.8 = 1 switch in the "MEM" position,
%SW71.9 = 1 switch in the "ASCII" position,
%SW71.10 = 1 switch in the "RTU" position,
%SW71.3 to 7 and 11 to 15 are not used.
0 no yes
%SW75
TIMEREVTNB
timer-type
event counter
see chapter "System Objects" (see Unity Pro,
Program Languages and Structure, Reference
Manual ) in the Unity Pro Program Languages
and Structure Reference Manual
0 no
%SW76
DLASTREG
diagnostics
function:
recording
Result of the last registration:
= 0 if the recording was successful,
= 1 if the diagnostics buffer has not been
configured,
= 2 if the diagnostics buffer is full.
0 yes
%SW77
DLASTDEREG
diagnostics
function: non-
recording
Result of the last deregistration:
= 0 if the non-recording was successful,
= 1 if the diagnostics buffer has not been
configured,
= 21 if the error identifier is invalid,
= 22 if the error has not been recorded.
0 yes
%SW78
DNBERRBUF
diagnostics
function:
number of
errors
Number of errors currently in the diagnostics
buffer.
0 yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
238 33003873 07/2012
%SW80
MSGCNT0
%SW81
MSCNT1
message
management
These words are updated by the system, and can
also be reset using %S80.
%SW80: Number of Modbus messages sent by
the system as client on all communication
ports except USB and Ethernet copro.
NOTE: Modbus messages sent by the system as
Master are not counted in this word.
%SW81: Number of Modbus messages
received by the system as client on all
communication ports except USB and
Ethernet copro.
NOTE: Modbus messages received as response
to the requests sent by the system, as Master, are
not counted in this word.
0 yes yes
%SW87
MSTSERVCNT
communication
flow
management
Number of requests processed by synchronous
server per master (MAST) task cycle.
0 yes
%SW90
MAXREQNB
maximum
number of
requests
processed per
master task
cycle
This word is used to set a maximum number of
requests which can be processed by the PLC per
master task cycle.
When the CPU is the server: This number of
requests must be between 2 (minimum) and N+4
(maximum).
N: number differs depending on the model.
When the CPU is the client:
N: number differs depending on the model.
The value 0 does not work. If a value that is
outside of the range is entered, it is the value N
that is taken into account.
See also chapter "System Objects" (see Unity
Pro, Program Languages and Structure,
Reference Manual ) in the Unity Pro Program
Languages and Structure Reference Manual.
0 yes yes
%SW108
FORCEDIOIM
number of
forced I/O
module bits
This system word counts the number of forced I/O
module bits. This word is incremented for every
forcing, and decremented for every unforcing.
0 no yes
%SW110 number of
unrestricted
memory area
for %M
This system word gives information on the size of
the unrestricted memory area for %M.
This system word is not available for the standard
Quantum CPU.
no yes
%SW111 number of
unrestricted
memory area
for %MW
This system word gives information on the size of
the unrestricted memory area for %MW.
This system word is not available for the standard
Quantum CPU.
no yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
33003873 07/2012 239
%SW124
CPUERR
type of system
fault
This system word is updated if the PLC is set to
error state.
The possible values are as follows:
0x0065: execution of HALT instruction
impossible
0x0080: system watchdog
If the PLC is set to Safety error state, the content
of %SW125 is updated and can be read after the
next restart of the PLC (see below).
no yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
240 33003873 07/2012
%SW125
BLKERRTYPE
last fault
detected
The code of the last fault detected is given in this
word. The following error codes cause the PLC to
stop if %S78 is set to 1. %S15, %S18 and %S20 are
activated independently of %S78:
16#0002: PCMCIA signature not verified
16#2258: execution of HALT instruction
16#2302: call to a not supported system
function in a user function block
16#9690: error of application CRC detected in
background
16#DE87: calculation error on floating-point
numbers (%S18, these errors are listed in the
word %SW17)
16#DEB0: watchdog overflow (%S11)
16#DEF1: character string transfer error
(%S15)
16#DEF2: arithmetic or division by 0 error
(%S18)
16#DEF3: index overflow (%S20)
Note: The codes 16#8xxx and 16#7xxx do not
stop the application and indicate an error on
function blocks.
In case of a SIL3 related error, the PLC stops.
After power off and restart of the PLC, %SW 125
contains the code of the cause of the error:
0x5AF1: sequence check error (unpredictable
execution in CPU)
0x5AF2: error in memory (corrupt address)
0x5AF3: comparison error (execution results
of Intel and application processor differ)
0x5AF4: real-time clock error
0x5AF5: error initializing double code
execution
0x5AF6: watchdog activation error
0x5AF7: error during memory check (takes
more than 8 hours)
0x5AF8: error in memory check (corrupt RAM)
Note: %SW125 is only reset after init or
complete download or restart (it always contains
the last fault detected).
no yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
33003873 07/2012 241
For the description of the system words %SW128 to %SW339 and %SW535 to %SW640,
see the chapter "Quantum Specific System Words" (see Unity Pro, Program
Languages and Structure, Reference Manual ) in the Unity Pro Program Languages
and Structure Reference Manual. The system words %SW340 to %SW534 are not
used in Quantum Safety PLCs.
%SW126
ERRADDR0
%SW127
ERRADDR1
blocking fault
instruction
address
Address of the instruction that generated the
application blocking fault.
For 16 bit processors:
%SW126 contains the offset for this address,
%SW127 contains the segment number for this
address.
For 32 bit processors:
%SW126 contains the least significant word for
this address,
%SW127 contains the most significant word for
this address.
The content of %SW126 and %SW127 is for
Schneider Electric use only.
0 no yes
Word
Symbol
Function Description Initial
State
Write
Access
Quant.
Safety
System Objects
242 33003873 07/2012
33003873 07/2012 243
Unity Pro
Glossary
33003873 07/2012
Glossary
0-9
%
Prefix that identifies internal memory addresses in the controller that are used to
store the value of program variables, constants, I/O, etc.
%I
According to the IEC standard, %I indicates a discrete input-type language object.
%IW
According to the IEC standard, %IW indicates an analog input -type language object.
%KW
According to the IEC standard, %KW indicates a constant word-type language object.
%M
According to the IEC standard, %M indicates a memory bit-type language object.
%MW
According to the IEC standard, %MW indicates a memory word-type language object.
%Q
According to the IEC standard, %Q indicates a discrete output-type language object.
Glossary
244 33003873 07/2012
%QW
According to the IEC standard, %QW indicates an analog output-type language
object.
A
ARRAY
An ARRAY is a table of elements of the same type.
The syntax is as follows: ARRAY [<terminals>] OF <Type>
Example:
ARRAY [1..2] OF BOOL is a one-dimensional table made up of 2 BOOL-type
elements.
NOTE: Only one-dimensional ARRAYs are allowed for safety applications.
B
base 10 literals
A literal value in base 10 is used to represent a decimal integer value. This value can
be preceded by the signs + and -. If the character _ is employed in this literal value,
it is not significant.
Example:
-12, 0, 123_456, +986
base 16 literals
A literal value in base 16 is used to represent an integer in hexadecimal. The base
is determined by the number 16 and the # symbol. The signs + and - are not allowed.
For greater clarity when reading, you can use the _ symbol between bits.
Example:
16#F_F or 16#FF (in decimal 255)
16#E_0 or 16#E0 (in decimal 224)
Glossary
33003873 07/2012 245
base 2 literals
A literal value in base 2 is used to represent a binary integer. The base is determined
by the number 2 and the # symbol. The signs + and - are not allowed. For greater
clarity when reading, you can use the _ symbol between bits.
Example:
2#1111_1111 or 2#11111111 (in decimal 255)
2#1110_0000 or 2#11100000 (in decimal 224)
base 8 literals
A literal value in base 8 is used to represent an octal integer. The base is determined
by the number 8 and the # symbol. The signs + and - are not allowed. For greater
clarity when reading, you can use the _ symbol between bits.
Example:
8#3_77 or 8#377 (in decimal 255)
8#34_0 or 8#340 (in decimal 224)
BCD
binary coded decimal format
BCD is used to represent decimal numbers between 0 and 9 using a group of 4 bits
(half-byte).
In this format, the 4 bits used to code the decimal numbers have a range of unused
combinations.
Example of BCD coding:
the number 2450
is coded: 0010 0100 0101 0000
BOOL
BOOL is the abbreviation of boolean type. This is the elementary data item in
computing. A BOOL type variable has a value of either: 0 (FALSE) or 1 (TRUE).
A BOOL type word extract bit, for example: %MW10.4.
BYTE
When 8 bits are put together, this is called a BYTE. A BYTE is either entered in
binary, or in base 8.
The BYTE type is coded in an 8 bit format, which, in hexadecimal, ranges from
16#00 to 16#FF
Glossary
246 33003873 07/2012
D
DBCD
representation of a double BCD-format double integer
The binary coded decimal (BCD) format is used to represent decimal numbers
between 0 and 9 using a group of 4 bits.
In this format, the 4 bits used to code the decimal numbers have a range of unused
combinations.
Example of DBCD coding
number 78993016
is coded: 0111 1000 1001 1001 0011 0000 0001 0110
DINT
double integer format (coded on 32 bits).
The lower and upper limits are as follows: -(2 to the power of 31) to (2 to the power
of 31) - 1.
Example:
-2147483648, 2147483647, 16#FFFFFFFF.
DWORD
double word
The DWORD type is coded in 32 bit format.
This table shows the lower/upper limits of the bases which can be used:
Representation examples
Base Lower Limit Upper Limit
Hexadecimal 16#0 16#FFFFFFFF
Octal 8#0 8#37777777777
Binary 2#0 2#11111111111111111111111111111111
Data Content Representation in One of the Bases
00000000000010101101110011011110 16#ADCDE
00000000000000010000000000000000 8#200000
00000000000010101011110011011110 2#10101011110011011110
Glossary
33003873 07/2012 247
E
EBOOL
extended boolean type
A EBOOL type variable brings a value 0 (FALSE) or 1 (TRUE) but also rising or falling
edges and forcing capabilities.
An EBOOL type variable takes up 1 byte of memory.
The byte split up into
1 bit for the value,
1 bit for the history bit (each time the states object changes, the value is copied
inside the history bit),
1 bit for the forcing bit (equals to 0, if the object isnt forced, equal to 1 if the bit is
forced.
The default type value of each bit is 0 (FALSE).
EF
elementary function
This is a block which is used in a program, and which performs a predefined
software function.
A function has no internal status information. Multiple invocations of the same
function using the same input parameters will supply the same output values. Details
of the graphic form of the function invocation can be found in the "[Functional block
(instance)] ". In contrast to the invocation of the function blocks, function invocations
only have a single unnamed output, whose name is the same as the function. In FBD
each invocation is denoted by a unique number via the graphic block, this number
is automatically generated and can not be altered.
You position and set up these functions in your program in order to carry out your
application.
You can also develop other functions using the SDKC development kit.
EFB
elementary function block
This is a block which is used in a program, and which performs a predefined
software function.
EFBs have internal statuses and parameters. Even where the inputs are identical,
the output values may be different. For example, a counter has an output which
indicates that the preselection value has been reached. This output is set to 1 when
the current value is equal to the preselection value.
Glossary
248 33003873 07/2012
elementary function
see EF
EN
EN means ENable, this is an optional block input.
When EN is activated, an ENO output is automatically drafted.
ENO
ENO means Error NOtification, this is the output associated to the optional input EN.
If ENO is set to 0 (caused by EN=0 or in case of an execution error),
the outputs of function blocks remain in the status they were in for the last correct
executed scanning cycle, and
the output(s) of functions and procedures are set to 0.
F
FBD
function block diagram
FBD is a graphic programming language that operates as a logic diagram. In
addition to the simple logic blocks (AND, OR, etc.), each function or function block of
the program is represented using this graphic form. For each block, the inputs are
located to the left and the outputs to the right. The outputs of the blocks can be linked
to the inputs of other blocks to form complex expressions.
FFB
FFB is the abbreviation of Functions and Function Block which is a collective term
for EF (elementary function), EFB (elementary function block) and DFB (derived
function block)
If... then...
If EN = 0, the block is not activated,
its internal program is not executed,
and ENO is set to 0.
If EN = 1, the internal program of the block is executed,
and ENO is set to 1 by the system.
Note: If an error occurs, ENO is set to 0.
If EN is not connected, it is automatically set to 1.
Glossary
33003873 07/2012 249
function
see EF
function block diagram
see FBD
G
GRAY
Gray or "reflected binary" code is used to code a numerical value being developed
into a chain of binary configurations that can be differentiated by the change in
status of one and only one bit.
This code can be used, for example, to avoid the following random event: in pure
binary, the change of the value 0111 to 1000 can produce random numbers between
0 and 1000, as the bits do not change value altogether simultaneously.
Equivalence between decimal, BCD and Gray
I
IEC 61131-3
international standard: programmable logic controls
Part 3: Programming Languages
Glossary
250 33003873 07/2012
INF
Used to indicate that a number overruns the allowed limits.
For a number of Integers, the value ranges (shown in gray) are as follows:
When a calculation result is
less than -3.402824e+38, the symbol -INF (for -infinite) is displayed,
greater than +3.402824e+38, the symbol INF (for +infinite) is displayed.
INT
single integer format (coded on 16 bits)
The lower and upper 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.
integer literals
Integer literal are used to enter integer values in the decimal system. The values can
have a preceding sign (+/-). Individual underlines (_ ) between numbers are not
significant.
Example
-12, 0, 123_456, +986
IODDT
input/output derived data type
The term IODDT designates a structured data type representing a module or a
channel of a PLC module. Each application expert module possesses its own
IODDTs.
Glossary
33003873 07/2012 251
K
keyword
A keyword is a unique combination of characters used as a syntactical programming
language element. (See annex B definition of the IEC standard 61131-3. All the
keywords used in Unity Pro and of this standard are listed in annex C of the IEC
standard 61131-3. These keywords cannot be used as identifiers in your program
(names of variables, sections, DFB types, etc.))
L
LD
ladder diagram
LD is a programming language, representing the instructions to be carried out in the
form of graphic diagrams very close to a schematic electrical diagram (contacts,
coils, etc.).
located variables
A located variable is a variable for which it is possible to know its position in the PLC
memory. For example, the variable Water_pressure, is associated with%MW102.
Water_pressure is said to be localized.
NOTE: All variables used in safety applications must be located.
Glossary
252 33003873 07/2012
N
naming conventions (identifier)
An identifier is a sequence of letters, numbers and underlines beginning with a letter
or underline (e.g. name of a function block type, an instance, a variable or a section).
Letters from national character sets (e.g: ,, , ) can be used except in project and
DFB names. Underlines are significant in identifiers; e.g. A_BCD and AB_CD are
interpreted as different identifiers. Multiple leading underlines and consecutive
underlines are invalid.
Identifiers cannot contain spaces. Not case sensitive; e.g. ABCD and abcd are
interpreted as the same identifier.
According to IEC 61131-3 leading digits are not allowed in identifiers. Nevertheless,
you can use them if you activate in dialog Tools Project settings in tab
Language extensions the check box Leading digits.
Identifiers cannot be keywords.
NAN
Used to indicate that a result of an operation is not a number (NAN = Not A Number).
Example: calculating the square root of a negative number.
NOTE: The IEC 559 standard defines two classes of NAN: quiet NAN (QNAN) and
signaling NaN (SNaN) QNAN is a NAN with the most significant fraction bit set and a
SNAN is a NAN with the most significant fraction bit clear (Bit number 22). QNANs are
allowed to propagate through most arithmetic operations without signaling an
exception. SNAN generally signal an invalid-operation exception whenever they
appear as operands in arithmetic operations (See %SW17 and %S18).
network
There are 2 meanings for network.
Used... Meaning
in LD A network is a set of interconnected graphic elements. The scope
of a network is local to the program organization unit (section) in
which the network is located.
with communication
expert modules
A network is a group of stations which communicate among one
another. The term network is also used to define a group of
interconnected graphic elements. This group forms then a part of a
program which may be composed of a group of networks.
Glossary
33003873 07/2012 253
P
procedure
Procedures are functions view technically.
The only difference to elementary functions is that procedures can take up more
than 1 output and they support data type VAR_IN_OUT. To the eye, procedures are
no different than elementary functions.
Procedures are a supplement to IEC 61131-3.
R
REAL
The REAL type is encoded in a 32 bit format.
The possible value ranges are shown in the figure below:
When a result is:
between -1,175494e-38 and 1,175494e-38, it is considered to be a DEN;
less than -3.402824e+38, the symbol -INF (for - infinity) is displayed;
greater than +3.402824e+38, the symbol INF (for + infinity) is displayed;
undefined (square root of a negative number), the symbolNAN is displayed.
NOTE: The IEC 559 standard defines two classes of NAN: the silent NAN (QNAN)
and the signaling NAN (SNAN). A QNAN is a NAN with a most significant fraction
bit while an SNAN is a NAN without a most significant fraction bit (bit number 22).
QNANs can be propagated via most arithmetic operations without throwing an
exception. As for SNANs, they generally indicate n invalid operation when they are
used as operands in arithmetic operations (see %SW17 and %S18).
NOTE: When a DEN (non-standardized number) is used as an operand, the result is
not significant.
S
SAI module
safety analog input module
Glossary
254 33003873 07/2012
SDI module
safety digital input module
T
TIME
The type TIME expresses a duration in milliseconds. Coded in 32 bits, this type
makes it possible to obtain periods from 0 to 2
32
-1 milliseconds.
The units of type TIME are the following: the days (d), the hours (h), the minutes (m),
the seconds (s) and the milliseconds (ms). A literal value of the type TIME is
represented by a combination of previous types preceded by T#, t#, TIME# or
time#.
Examples: T#25h15m, t#14.7S, TIME#5d10h23m45s3ms
time literals
The units of type TIME are the following: the days (d), the hours (h), the minutes (m),
the seconds (s) and the milliseconds (ms). A literal value of the type TIME is
represented by a combination of previous types preceded by T#, t#, TIME# or
time#.
Examples: T#25h15m, t#14.7S, TIME#5d10h23m45s3ms
U
UDINT
UDINT is the abbreviation of Unsigned Double Integer format (coded on 32 bits)
unsigned. The lower and upper limits are as follows: 0 to (2 to the power of 32) - 1.
Example
0, 4294967295, 2#11111111111111111111111111111111, 8#37777777777,
16#FFFFFFFF.
UINT
unsigned integer format (coded on 16 bits)
The lower and upper limits are as follows: 0 to (2 to the power of 16) - 1.
Example
0, 65535, 2#1111111111111111, 8#177777, 16#FFFF.
Glossary
33003873 07/2012 255
UMA
UMA is the abbreviation of unrestricted memory area. The UMA is a part of the
Safety PLCs memory for %M and %MW that is not write protected. Its addresses can
be written from other PLCs or HMIs. Its configuration is performed in the CPU
property dialog of Unity Pro XLS.
unlocated variable
An unlocated variable is a variable for which it is impossible to know its position in
the PLC memory. A variable which has no address assigned is said to be unlocated.
NOTE: It is not allowed to use unlocated variables in safety applications.
V
variable
Memory entity of the type BOOL, WORD, DWORD, etc., whose contents can be modified
by the program during execution.
W
WORD
The WORD type is coded in 16 bit format and is used to carry out processing on bit
strings.
This table shows the lower/upper limits of the bases which can be used:
Representation examples
Base Lower Limit Upper Limit
Hexadecimal 16#0 16#FFFF
Octal 8#0 8#177777
Binary 2#0 2#1111111111111111
Data Content Representation in One of the Bases
0000000011010011 16#D3
1010101010101010 8#125252
0000000011010011 2#11010011
Glossary
256 33003873 07/2012
33003873 07/2012 257
C
B
A
Unity Pro
Index
33003873 07/2012
Index
Symbols
%S0, 220
%S1, 220
%S10, 221
%S11, 221
%S118, 226
%S119, 226
%S12, 221
%S120, 226
%S121, 226
%S122, 226
%S13, 221
%S15, 222
%S16, 222
%S17, 222
%S18, 222
%S19, 223
%S20, 223
%S21, 223
%S30, 224
%S31, 224
%S32, 224
%S33, 224
%S34, 224
%S35, 224
%S38, 224
%S39, 224
%S4, 220
%S5, 220
%S50, 224
%S51, 224
%S59, 225
%S6, 220
%S67, 225
%S68, 225
%S7, 220
%S75, 225
%S76, 226
%S77, 226
%S78, 226
%S80, 226
%S94, 226
%SW0, 228
%SW1, 228
%SW10, 228
%SW11, 228
%SW12, 229
%SW13, 229
%SW14, 229
%SW15, 229
%SW16, 229
%SW17, 229
%SW18, 229
%SW19, 229
%SW2, 228
%SW20, 230
%SW21, 230
%SW3, 228
%SW30, 231
%SW31, 231
%SW32, 231
%SW33 to %SW35, 231
%SW36, 231
%SW37, 231
Index
258 33003873 07/2012
%SW38, 231
%SW39, 232
%SW4, 228
%SW40 to %SW47, 232
%SW48, 233
%SW49, 233
%SW5, 228
%SW50, 233
%SW51, 233
%SW52, 233
%SW53, 233
%SW54, 233
%SW55, 233
%SW56, 233
%SW57, 233
%SW58, 233
%SW59, 234
%SW8, 228
%SW81, 238
%SW9, 228
0-9
100MSCOUNTER, 229
1RSTSCANRUN, 221
1RSTTASKRUN, 223
A
absolute value computation
S_ABS_***, 111
ACTIVEVT, 224
addition
S_ADD_***, 113
ADJDATETIME, 234
AND function
S_AND_***, 85
APMODE, 229
assignment
S_MOVE, 119
S_SMOVE_BIT, 121
S_SMOVE_WORD, 127
B
binary selection
S_SEL, 155
bistable function block, reset dominant
S_RS, 99
bistable function block, set dominant
S_SR, 105
BLKERRTYPE, 240
block types, 18
C
CARRY, 222
COLDSTART, 220
Communication
S_RD_ETH, 211
S_WR_ETH, 207
Comparison
S_EQ_***, 31
S_GE_***, 33
S_GT_***, 35
S_LE_***, 37
S_LT_***, 39
S_NE_***, 41
conditional FFB call, 22
CPUERR, 239
D
DAYOFWEEK, 233
detection of falling edges
S_F_TRIG, 87
detection of rising edges
S_R_TRIG, 93
DIAGBUFFCONF, 226
DIAGBUFFFULL, 226
division
S_DIV_***, 115
DLASTDEREG, 237
DLASTREG, 237
DNBERRBUF, 237
down counter
S_CTD_***, 159
Index
33003873 07/2012 259
E
elementary function, 18
elementary function block, 18
EN, 21
ENO, 21
equal to
S_EQ_***, 31
ERRADDRi, 241
EVTOVR, 224
exclusive OR function
S_XOR_***, 107
F
FASTACT, 224
FASTPERIOD, 228
FLOATSTAT, 229
FORCEDIOIM, 238
G
greater than
S_GT_***, 35
greater than or equal to
S_GE_***, 33
H
HALTIFERROR, 226
high availability
S_AISIL2, 65
high availiability
S_DISIL2, 45
Hot Standby
S_HSBY_SWAP, 77
HOURMIN, 233
HSB_CMD, 235
HSB_STS, 236
HSBY_REVERSEi, 237
I
INDEXOVF, 223
INTELMODE, 229
IOERR, 221
IOERRTSK, 222
IOEVTNB, 233
K
KEY_SWITCH, 237
L
less than
S_LT_***, 39
less than or equal to
S_LE_***, 37
limit
S_LIMIT_***, 145
LOCIOERR, 226
Logic
S_AND_***, 85
S_F_TRIG, 87
S_NOT_***, 89
S_OR_***, 91
S_R_TRIG, 93
S_ROL_***, 95
S_ROR_***, 97
S_RS, 99
S_SHL_***, 101
S_SHR_***, 103
S_SR, 105
S_XOR_***, 107
M
MASTACT, 224
MASTCURRTIME, 231
MASTMAXTIME, 231
MASTMINTIME, 231
MASTPERIOD, 228
Index
260 33003873 07/2012
Mathematics
S_ABS_***, 111
S_ADD_***, 113
S_DIV_***, 115
S_MOVE, 119
S_MUL_***, 117
S_NEG_***, 135
S_SIGN_***, 139
S_SMOVE_BIT, 121
S_SMOVE_WORD, 127
S_SQRT_REAL, 137
S_SUB_***, 141
maximum value function
S_MAX_***, 147
MAXREQNB, 238
minimum value function
S_MIN_***, 149
MONTHDAY, 233
MSGCNT0, 238
MSGCNT1, 238
MSTSERVCNT, 238
multiplexer
S_MUX_***, 151
multiplication
S_MUL_***, 117
N
negation
S_NEG_***, 135
S_NOT_***, 89
not equal to
S_NE_***, 41
O
off delay
S_TOF, 167
on delay
S_TON, 169
OR function
S_OR_***, 91
OSCOMMPATCH, 229
OSCOMMVERS, 229
OSINTVERS, 229
OVERFLOW, 222
OVERRUN, 223
P
PCMCIABAT0, 225
PCMCIABAT1, 225
PLCBAT, 225
PLCRUNNING, 221
pulse
S_TP, 171
R
REMIOERR, 226
rotate left
S_ROL_***, 95
rotate right
S_ROR_***, 97
RSTMSGCNT, 226
RTCERR, 224
RTCTUNING, 225
RTCWRITE, 224
S
S_ABS_***, 111
S_ADD_***, 113
S_AISIL2, 65
S_AND_***, 85
S_BIT_TO_BYTE, 175
S_BIT_TO_WORD, 179
S_BOOL_TO_***, 181
S_BYTE_TO_***, 185
S_BYTE_TO_BIT, 183
S_CTD_***, 159
S_CTU_***, 161
S_CTUD_***, 163
S_DINT_TO_***, 191
S_DISIL2, 45
S_DIV_***, 115
S_DWORD_TO_***, 187
S_EQ_***, 31
S_F_TRIG, 87
S_GE_***, 33
Index
33003873 07/2012 261
S_GT_***, 35
S_HSBY_SWAP, 77
S_INT_TO_***, 189
S_LE_***, 37
S_LIMIT_***, 145
S_LT_***, 39
S_MAX_***, 147
S_MIN_***, 149
S_MOVE, 119
S_MUL_***, 117
S_MUX_***, 151
S_NE_***, 41
S_NEG_***, 135
S_NOT_***, 89
S_OR_***, 91
S_R_TRIG, 93
S_RD_ETH, 211
S_REAL_TO_***, 193
S_ROL_***, 95
S_ROR_***, 97
S_RS, 99
S_SEL, 155
S_SHL_***, 101
S_SHR_***, 103
S_SIGN_***, 139
S_SMOVE_BIT, 121
S_SMOVE_WORD, 127
S_SQRT_REAL, 137
S_SR, 105
S_SUB_***, 141
S_TIME_TO_UDINT, 195
S_TOF, 167
S_TON, 169
S_TP, 171
S_UDINT_TO_***, 197
S_UINT_TO_***, 199
S_WORD_TO_***, 203
S_WORD_TO_BIT, 201
S_WR_ETH, 207
S_XOR_***, 107
SAVECURRVAL, 226
SEC, 233
shift left
S_SHL_***, 101
shift right
S_SHR_***, 103
sign evaluation
S_SIGN_***, 139
Statistics
S_LIMIT_***, 145
S_MAX_***, 147
S_MIN_***, 149
S_MUX_***, 151
S_SEL, 155
STOPDAY, 233
STOPHM, 233
STOPMD, 233
STOPSEC, 233
STOPYEAR, 233
STRINGERROR, 222
subtraction
S_SUB_***, 141
T
TB100MS, 220
TB10MS, 220
TB1MIN, 220
TB1SEC, 220
Timer & Counter
S_CTD_***, 159
S_CTU_***, 161
S_CTUD_***, 163
S_TOF, 167
S_TON, 169
S_TP, 171
TIMEREVTNB, 237
TSKINHIBIN, 228
TSKINHIBOUT, 228
TSKINIT, 228
Index
262 33003873 07/2012
type conversion
S_BIT_TO_BYTE, 175
S_BIT_TO_WORD, 179
S_BOOL_TO_***, 181
S_BYTE_TO_***, 185
S_BYTE_TO_BIT, 183
S_DINT_TO_***, 191
S_DWORD_TO_***, 187
S_INT_TO_***, 189
S_REAL_TO_***, 193
S_TIME_TO_UDINT, 195
S_UDINT_TO_***, 197
S_UINT_TO_***, 199
S_WORD_TO_***, 203
S_WORD_TO_BIT, 201
Type to type
S_BIT_TO_BYTE, 175
S_BIT_TO_WORD, 179
S_BOOL_TO_***, 181
S_BYTE_TO_***, 185
S_BYTE_TO_BIT, 183
S_DINT_TO_***, 191
S_DWORD_TO_***, 187
S_INT_TO_***, 189
S_REAL_TO_***, 193
S_TIME_TO_UDINT, 195
S_UDINT_TO_***, 197
S_UINT_TO_***, 199
S_WORD_TO_***, 203
S_WORD_TO_BIT, 201
U
unconditional FFB call, 22
up counter
S_CTU_***, 161
up/down counter
S_CTUD_***, 163
W
WARMSTART, 220
WDG, 221
WDGVALUE, 228
WEEKOFYEAR, 237
Y
YEAR, 233

Anda mungkin juga menyukai