Unity Pro Safety Block Library
Unity Pro Safety Block Library
33003873 02/2015
Unity Pro
Safety
Block Library
02/2015
33003873.06
www.schneider-electric.com
The information provided in this documentation contains general descriptions and/or technical
characteristics of the performance of the products contained herein. This documentation is not
intended as a substitute for and is not to be used for determining suitability or reliability of these
products for specific user applications. It is the duty of any such user or integrator to perform the
appropriate and complete risk analysis, evaluation and testing of the products with respect to the
relevant specific application or use thereof. Neither Schneider Electric nor any of its affiliates or
subsidiaries shall be responsible or liable for misuse of the information contained herein. If you
have any suggestions for improvements or amendments or have found errors in this publication,
please notify us.
No part of this document may be reproduced in any form or by any means, electronic or
mechanical, including photocopying, without express written permission of Schneider Electric.
All pertinent state, regional, and local safety regulations must be observed when installing and
using this product. For reasons of safety and to help ensure compliance with documented system
data, only the manufacturer should perform repairs to components.
When devices are used for applications with technical safety requirements, the relevant
instructions must be followed.
Failure to use Schneider Electric software or approved software with our hardware products may
result in injury, harm, or improper operating results.
Failure to observe this information can result in injury or equipment damage.
© 2015 Schneider Electric. All rights reserved.
2 33003873 02/2015
Table of Contents
Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
About the Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Part I General information . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 1 Block Types and Their Applications. . . . . . . . . . . . . . . 15
Block Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
FFB Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
EN and ENO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 2 Availability of the Blocks on Different Hardware
Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Availability of the Block on the Various Hardware Platforms . . . . . . . . 21
Part II Comparison. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Chapter 3 S_EQ_***: Equal To . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 4 S_GE_***: Greater Than or Equal To . . . . . . . . . . . . . . 31
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Chapter 5 S_GT_***: Greater Than . . . . . . . . . . . . . . . . . . . . . . . . . 33
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Chapter 6 S_LE_***: Less Than or Equal To . . . . . . . . . . . . . . . . . 35
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Chapter 7 S_LT_***: Less Than. . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Chapter 8 S_NE_***: Not Equal To . . . . . . . . . . . . . . . . . . . . . . . . . 39
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Part III High Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Chapter 9 S_DISIL2: High Availiability for Safety Digital Inputs . 43
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Hardware Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Software Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Chapter 10 S_AISIL2: High Availiability for Safety Analog Inputs 63
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Hardware Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Software Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
33003873 02/2015 3
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
4 33003873 02/2015
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 Quantum_IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Chapter 35 NI_DROP: Configuring a Remote I/O Station Rack . . . 145
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Chapter 36 NI_QUANTUM: Configuring a Main Rack . . . . . . . . . . . 149
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Chapter 37 NI_ERT_854_20: Data Transfer EFB . . . . . . . . . . . . . . . 153
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Function Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
EFB Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Part VIII Statistical. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Chapter 38 S_LIMIT_***: Limit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Chapter 39 S_MAX_***: Maximum Value Function . . . . . . . . . . . . . 169
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Chapter 40 S_MIN_***: Minimum Value Function . . . . . . . . . . . . . . 171
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Chapter 41 S_MUX_***: Multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . 173
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Chapter 42 S_SEL: Binary Selection . . . . . . . . . . . . . . . . . . . . . . . . 175
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Part IX Timers & Counters . . . . . . . . . . . . . . . . . . . . . . . . . 177
Chapter 43 S_CTD_***: Down Counter. . . . . . . . . . . . . . . . . . . . . . . 179
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
33003873 02/2015 5
Chapter 44 S_CTU_***: Up Counter . . . . . . . . . . . . . . . . . . . . . . . . . 181
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Chapter 45 S_CTUD_***: Up/Down Counter . . . . . . . . . . . . . . . . . . 183
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Chapter 46 S_TOF: Off Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Chapter 47 S_TON: On Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Chapter 48 S_TP: Pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Part X Type to Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Chapter 49 S_BIT_TO_BYTE: Type Conversion . . . . . . . . . . . . . . . 193
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Chapter 50 S_BIT_TO_WORD: Type Conversion . . . . . . . . . . . . . . 195
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Chapter 51 S_BOOL_TO_***: Type Conversion . . . . . . . . . . . . . . . 197
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Chapter 52 S_BYTE_TO_BIT: Type Conversion . . . . . . . . . . . . . . . 199
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Chapter 53 S_BYTE_TO_***: Type Conversion. . . . . . . . . . . . . . . . 201
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Chapter 54 S_DWORD_TO_***: Type Conversion . . . . . . . . . . . . . 203
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Chapter 55 S_INT_TO_***: Type Conversion . . . . . . . . . . . . . . . . . 205
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Chapter 56 S_DINT_TO_***: Type Conversion . . . . . . . . . . . . . . . . 207
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Chapter 57 S_REAL_TO_***: Type Conversion . . . . . . . . . . . . . . . 209
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Chapter 58 S_TIME_TO_UDINT: Type Conversion . . . . . . . . . . . . . 211
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Chapter 59 S_UDINT_TO_***: Type Conversion . . . . . . . . . . . . . . . 213
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Chapter 60 S_UINT_TO_***: Type Conversion . . . . . . . . . . . . . . . . 215
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Chapter 61 S_WORD_TO_BIT: Type Conversion . . . . . . . . . . . . . . 217
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
6 33003873 02/2015
Chapter 62 S_WORD_TO_***: Type Conversion . . . . . . . . . . . . . . . 219
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Part XI Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Chapter 63 S_WR_ETH: Safe Ethernet PLC-PLC Communication
Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Chapter 64 S_RD_ETH: Safe Ethernet PLC-PLC Communication
Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Appendices ......................................... 231
Appendix A System Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
A.1 System Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
System Bit Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Description of the System Bits %S0 to %S13 . . . . . . . . . . . . . . . . . . . 236
Description of the System Bits %S15 to %S21 . . . . . . . . . . . . . . . . . . 238
Description of the System Bits %S30 to %S51 . . . . . . . . . . . . . . . . . . 240
Description of the System Bits %S59 to %S122 . . . . . . . . . . . . . . . . . 241
A.2 System Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Description of the System Words %SW0 to %SW21 . . . . . . . . . . . . . 244
Description of the System Words %SW30 to %SW59 . . . . . . . . . . . . 246
Description of the System Words %SW60 to %SW127 . . . . . . . . . . . 250
Glossary ......................................... 257
Index ......................................... 269
33003873 02/2015 7
8 33003873 02/2015
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.
33003873 02/2015 9
PLEASE NOTE
Electrical equipment should be installed, operated, serviced, and maintained only by qualified
personnel. No responsibility is assumed by Schneider Electric for any consequences arising out of
the use of this material.
A qualified person is one who has skills and knowledge related to the construction and operation
of electrical equipment and its installation, and has received safety training to recognize and avoid
the hazards involved.
10 33003873 02/2015
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.
WARNING
UNINTENDED EQUIPMENT OPERATION
Use only Schneider Electric approved software.
Failure to follow these instructions can result in death, serious injury, or equipment
damage.
33003873 02/2015 11
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.
12 33003873 02/2015
Unity Pro
General information
33003873 02/2015
Part I
General information
General information
Overview
This section contains general information about the Safety library.
33003873 02/2015 13
General information
14 33003873 02/2015
Unity Pro
Block Types and Their Applications
33003873 02/2015
Chapter 1
Block Types and Their Applications
Overview
This chapter describes the different block types and their applications.
33003873 02/2015 15
Block Types and Their Applications
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.
16 33003873 02/2015
Block Types and Their Applications
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.
33003873 02/2015 17
Block Types and Their Applications
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.
18 33003873 02/2015
Block Types and Their Applications
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
Example Description
EN/ENO handling with function blocks that have 1 link as an output If EN from FunctionBlock_1 is set to 0, the
parameter: 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 If EN from FunctionBlock_1 is set to 0
output parameters: 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.
Functions/Procedures
As defined in IEC61131-3, the outputs from deactivated functions (EN-input set to 0) is undefined.
The same applies to procedures.
33003873 02/2015 19
Block Types and Their Applications
Example Description
EN/ENO handling with function/procedure blocks that (only) have 1 link If EN from Function/Procedure_1 is set
as an output parameter: 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 If EN from Function/Procedure_1 is set
and 1 link as output parameters: 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.
The output behavior of the FFBs does not depend on whether the FFBs are called up without
EN/ENO or with EN=1.
20 33003873 02/2015
Unity Pro
Availability of the Block
33003873 02/2015
Chapter 2
Availability of the Blocks on Different 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
Legend:
+ Yes
- No
High Availability
Availability of the blocks
Legend:
+ Yes
- No
33003873 02/2015 21
Availability of the Block
Hot Standby
Availability of the blocks
Legend:
+ Yes
- No
Logic
Availability of the blocks
Legend:
+ Yes
- No
22 33003873 02/2015
Availability of the Block
Mathematics
Availability of the blocks
Legend:
+ Yes
- No
Quantum_IO
Availability of the blocks
Legend:
+ Yes
- No
33003873 02/2015 23
Availability of the Block
Statistical
Availability of the blocks
Legend:
+ Yes
- No
Legend:
+ Yes
- No
24 33003873 02/2015
Availability of the Block
Type to Type
Availability of the blocks
Legend:
+ Yes
- No
Communication
Availability of the blocks
Legend:
+ Yes
- No
33003873 02/2015 25
Availability of the Block
26 33003873 02/2015
Unity Pro
Comparison
33003873 02/2015
Part II
Comparison
Comparison
Introduction
This section describes the elementary functions and elementary function blocks of the
Comparison family.
33003873 02/2015 27
Comparison
28 33003873 02/2015
Unity Pro
S_EQ_***
33003873 02/2015
Chapter 3
S_EQ_***: Equal To
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) = INn)
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
Representation in FBD
Representation
33003873 02/2015 29
S_EQ_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
30 33003873 02/2015
Unity Pro
S_GE_***
33003873 02/2015
Chapter 4
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) ≥ INn)
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
Representation in FBD
Representation
33003873 02/2015 31
S_GE_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
32 33003873 02/2015
Unity Pro
S_GT_***
33003873 02/2015
Chapter 5
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) > INn)
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
Representation in FBD
Representation
33003873 02/2015 33
S_GT_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
34 33003873 02/2015
Unity Pro
S_LE_***
33003873 02/2015
Chapter 6
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) ≤INn)
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
Representation in FBD
Representation
33003873 02/2015 35
S_LE_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
36 33003873 02/2015
Unity Pro
S_LT_***
33003873 02/2015
Chapter 7
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) < INn)
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
Representation in FBD
Representation
33003873 02/2015 37
S_LT_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
38 33003873 02/2015
Unity Pro
S_NE_***
33003873 02/2015
Chapter 8
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
33003873 02/2015 39
S_NE_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
40 33003873 02/2015
Unity Pro
High Availability
33003873 02/2015
Part III
High Availability
High Availability
Introduction
This section describes the elementary functions and elementary function blocks of the High
Availability family.
33003873 02/2015 41
High Availability
42 33003873 02/2015
Unity Pro
S_DISIL2
33003873 02/2015
Chapter 9
S_DISIL2: High Availiability for Safety Digital Inputs
Introduction
This chapter describes the S_DISIL2 block.
33003873 02/2015 43
S_DISIL2
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.
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.
44 33003873 02/2015
S_DISIL2
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
33003873 02/2015 45
S_DISIL2
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
46 33003873 02/2015
S_DISIL2
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
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.
33003873 02/2015 47
S_DISIL2
48 33003873 02/2015
S_DISIL2
Output Parameters
Output parameter OUT
33003873 02/2015 49
S_DISIL2
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.
50 33003873 02/2015
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:
33003873 02/2015 51
S_DISIL2
Fault Bits
The following table describes the meaning of each significant fault bit:
52 33003873 02/2015
S_DISIL2
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
33003873 02/2015 53
S_DISIL2
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.
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.
54 33003873 02/2015
S_DISIL2
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.
33003873 02/2015 55
S_DISIL2
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:
56 33003873 02/2015
S_DISIL2
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:
33003873 02/2015 57
S_DISIL2
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.
58 33003873 02/2015
S_DISIL2
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.
33003873 02/2015 59
S_DISIL2
60 33003873 02/2015
S_DISIL2
33003873 02/2015 61
S_DISIL2
Example 3:
62 33003873 02/2015
Unity Pro
S_AISIL2
33003873 02/2015
Chapter 10
S_AISIL2: High Availiability for Safety Analog Inputs
Introduction
This chapter describes the S_AISIL2 block.
33003873 02/2015 63
S_AISIL2
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.
64 33003873 02/2015
S_AISIL2
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
33003873 02/2015 65
S_AISIL2
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
66 33003873 02/2015
S_AISIL2
Output Parameters
Output parameter OUT
33003873 02/2015 67
S_AISIL2
State Table
68 33003873 02/2015
S_AISIL2
Fault Bits
The following table describes the meaning of the 2 fault bits:
33003873 02/2015 69
S_AISIL2
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
70 33003873 02/2015
S_AISIL2
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.
33003873 02/2015 71
S_AISIL2
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.
72 33003873 02/2015
S_AISIL2
Example 2:
33003873 02/2015 73
S_AISIL2
74 33003873 02/2015
Unity Pro
Hot Standby
33003873 02/2015
Part IV
Hot Standby
Hot Standby
33003873 02/2015 75
Hot Standby
76 33003873 02/2015
Unity Pro
S_HSBY_SWAP
33003873 02/2015
Chapter 11
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) .
33003873 02/2015 77
S_HSBY_SWAP
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.
78 33003873 02/2015
S_HSBY_SWAP
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameter
33003873 02/2015 79
S_HSBY_SWAP
NOTE: The system words %SW60 and %SW61 reflect the status of the primary and the secondary
PLC.
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.
80 33003873 02/2015
S_HSBY_SWAP
Step Action
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.
33003873 02/2015 81
S_HSBY_SWAP
82 33003873 02/2015
Unity Pro
Logic
33003873 02/2015
Part V
Logic
Logic
Introduction
This section describes the elementary functions and elementary function blocks of the Logic
family.
33003873 02/2015 83
Logic
84 33003873 02/2015
Unity Pro
S_AND_***
33003873 02/2015
Chapter 12
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
33003873 02/2015 85
S_AND_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
86 33003873 02/2015
Unity Pro
S_F_TRIG
33003873 02/2015
Chapter 13
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
33003873 02/2015 87
S_F_TRIG
Parameter Description
Description of the input parameters
88 33003873 02/2015
Unity Pro
S_NOT_***
33003873 02/2015
Chapter 14
S_NOT_***: Negation
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
Representation in LD
Representation
33003873 02/2015 89
S_NOT_***
Parameter Description
Description of the input parameters
90 33003873 02/2015
Unity Pro
S_OR_***
33003873 02/2015
Chapter 15
S_OR_***: OR Function
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
OR’ed 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
33003873 02/2015 91
S_OR_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
92 33003873 02/2015
Unity Pro
S_R_TRIG
33003873 02/2015
Chapter 16
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
33003873 02/2015 93
S_R_TRIG
Parameter Description
Description of the input parameters
94 33003873 02/2015
Unity Pro
S_ROL_***
33003873 02/2015
Chapter 17
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
33003873 02/2015 95
S_ROL_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
96 33003873 02/2015
Unity Pro
S_ROR_***
33003873 02/2015
Chapter 18
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
33003873 02/2015 97
S_ROR_***
Representation in LD
Representation
Parameter Description
Description of the input parameters
98 33003873 02/2015
Unity Pro
S_RS
33003873 02/2015
Chapter 19
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
Representation in LD
Representation
33003873 02/2015 99
S_RS
Parameter Description
Description of the input parameters
Chapter 20
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 21
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 22
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 23
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Part VI
Mathematics
Mathematics
Introduction
This section describes the elementary functions and elementary function blocks of the
Mathematics family.
Chapter 24
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
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Runtime Error
The system bit %S18 (see page 238) is set to 1, if a value is below a limit value (data types INT
and DINT).
Chapter 25
S_ADD_***: Addition
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Runtime Error
The system bit %S18 (see page 238) is set to 1, if the value range on the output is exceeded (all
available data types).
NOTE: The system word %SW17 gives the detected error status on S_ADD_REAL.
Chapter 26
S_DIV_***: Division
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.
Formula
Available Functions
List of available functions
S_DIV_INT
S_DIV_DINT
S_DIV_UINT
S_DIV_UDINT
S_DIV_REAL
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Runtime Error
The system bit %S18 (see page 238) is set to 1, if an invalid division by 0 is executed (all available
data types).
NOTE: The system word %SW17 gives the detected error status on S_DIV_REAL.
Chapter 27
S_MUL_***: Multiplication
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 INn
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Runtime Error
The system bit %S18 (see page 238) is set to 1, if the value range at the output has been exceeded
(all available data types).
NOTE: The system word %SW17 gives the detected error status on S_MUL_REAL.
Chapter 28
S_MOVE: Assignment
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
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
Chapter 29
S_SMOVE_BIT: Assignment
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 PLC’s 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.
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.
Representation in FDB
Representation
Representation in LD
Representation
Parameter Description
Description of the input 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
If... Then...
CHANGE mode bit = 0 the value of the input bit will be written to the
and output bit in the safety memory.
DEMAND mode bit = 0
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...
there is a rising edge detected at the TRIG the value of the input bit will be written to the
input output bit in the safety memory.
Change Mode
In this mode only CHANGE is set to 1 (DEMAND is 0 and TRIG has no influence).
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 the newly connected variable will not change
OUT by another variable its current value until the input IN changes.
you replace a variable connected to the output the value of a link which is also connected to
OUT by another variable the output will become equal to the current
value of the newly connected variable.
you replace a variable connected to the output the value of the link will be 0 until the input IN
OUT by a link changes.
State Table
Pin states and the respective mode
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
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
Chapter 30
S_SMOVE_WORD: Assignment
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 PLC’s 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.
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.
Representation in FDB
Representation
Representation in LD
Representation
Parameter Description
Description of the input 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.
Transparent Mode
If... Then...
CHANGE mode bit = 0 the value of the input word will be written to
and the output word in the safety memory.
DEMAND mode bit = 0
and
the input value IN is within the valid range
(MIN...MAX)
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...
there is a rising edge detected at the TRIG the value of the input word will be written to
input the output word in the safety memory.
and
the input value IN is within the valid range
(MIN...MAX)
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.
Change Mode
In this mode only CHANGE is set to 1 (DEMAND is 0 and TRIG has no influence).
If... Then...
the input value IN is within the valid range the value of the input word will be written to
(MIN...MAX) the output word in the safety memory.
and
the input value IN is changing
If... Then...
you replace a variable connected to the output the newly connected variable will not change
OUT by another variable its current value until the input IN changes.
you replace a variable connected to the output the value of a link which is also connected to
OUT by another variable the output will become equal to the current
value of the newly connected variable.
you replace a variable connected to the output the value of the link will be 0 until the input IN
OUT by a link changes.
State Table
Pin states and the respective mode
Chapter 31
S_NEG_***: Negation
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
Representation in LD
Representation
Parameter Description
Description of input 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.
Chapter 32
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:
Description of parameters
The following table describes the input parameters:
Runtime errors
When Value1 is of REAL type and negative, the result of the function contains NAN and bit %S18
(see page 238) = 1.
In case of %%S18 (see page 238) = 1 the system word %%SW17 indicates the type of fault.
Chapter 33
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
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of input 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.
Chapter 34
S_SUB_***: Subtraction
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Runtime Error
The system word %SW17 gives the detected error status on S_SUB_REAL.
Part VII
Quantum_IO
Quantum_IO
Introduction
This section describes the non-interfering elementary function blocks of the Quantum_IO family.
Chapter 35
NI_DROP: Configuring a Remote I/O Station Rack
Description
Function Description
The function block is used to edit the configuration data of a remote I/O station (in safety
configuration) for subsequent processing by module configuration EFBs.
To configure an I/O station rack, the NI_DROP function block in the configuration section (see Unity
Pro, I/O Management, Block Library) is connected to the corresponding SLOT output of the
NI_QUANTUM (see page 149) function block. The number of the I/O station defined in the I/O map
has to be entered at the NUMBER input of the NI_DROP function block. The function blocks for
140 ERT 854 20 module of the I/O stations are connected to the SLOT outputs.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL NI_DROP_Instance (SLOT:=SlotForRIO,
NUMBER:=NumberOfRIO, SLOT1=>Slot1,
SLOT2=>Slot2, SLOT3=>Slot3, SLOT4=>Slot4, SLOT5=>Slot5,
SLOT6=>Slot6, SLOT7=>Slot7, SLOT8=>Slot8, SLOT9=>Slot9,
SLOT10=>Slot10, SLOT11=>Slot11, SLOT12=>Slot12,
SLOT13=>Slot13, SLOT14=>Slot14, SLOT15=>Slot15,
SLOT16=>Slot16)
Representation in ST
Representation:
NI_DROP_Instance (SLOT:=SlotForRIO,
NUMBER:=NumberOfRIO, SLOT1=>Slot1,
SLOT2=>Slot2, SLOT3=>Slot3, SLOT4=>Slot4, SLOT5=>Slot5,
SLOT6=>Slot6, SLOT7=>Slot7, SLOT8=>Slot8, SLOT9=>Slot9,
SLOT10=>Slot10, SLOT11=>Slot11, SLOT12=>Slot12,
SLOT13=>Slot13, SLOT14=>Slot14, SLOT15=>Slot15,
SLOT16=>Slot16) ;
Parameter Description
Description of input parameters:
Chapter 36
NI_QUANTUM: Configuring a Main Rack
Description
Function Description
The function block is used to edit the configuration data of a Quantum main rack (in safety
configuration) for subsequent use by the scaling EFBs.
To configure a Quantum main rack, the NI_QUANTUM function block is inserted into the
configuration section (see Unity Pro, I/O Management, Block Library). The function block NI_ERT_
584_20 (see page 154) for the configuration of 140 ERT 854 20 module or the NI_DROP
(see page 145) function block for the remote I/O station are connected at its SLOT outputs.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL NI_QUANTUM_Instance (SLOT1=>Slot1, SLOT2=>Slot2,
SLOT3=>Slot3, SLOT4=>Slot4, SLOT5=>Slot5, SLOT6=>Slot6,
SLOT7=>Slot7, SLOT8=>Slot8, SLOT9=>Slot9,
SLOT10=>Slot10, SLOT11=>Slot11, SLOT12=>Slot12,
SLOT13=>Slot13, SLOT14=>Slot14, SLOT15=>Slot15,
SLOT16=>Slot16)
Representation in ST
Representation:
NI_QUANTUM_Instance (SLOT1=>Slot1, SLOT2=>Slot2,
SLOT3=>Slot3, SLOT4=>Slot4, SLOT5=>Slot5, SLOT6=>Slot6,
SLOT7=>Slot7, SLOT8=>Slot8, SLOT9=>Slot9,
SLOT10=>Slot10, SLOT11=>Slot11, SLOT12=>Slot12,
SLOT13=>Slot13, SLOT14=>Slot14, SLOT15=>Slot15,
SLOT16=>Slot16) ;
Parameter Description
Description of output parameters:
Chapter 37
NI_ERT_854_20: Data Transfer EFB
Introduction
This chapter describes the NI_ERT_854_20 block.
Description
Function Description
The NI_ERT_854_20 EFB provides a software interface to the 140 ERT 854 20 module (in a
safety configuration) which gives you simple access of the functions such as time stamp and
status.
NOTE:
When using the 140 ERT 854 20 in a safety configuration:
Time synchronization of the 140 ERT 854 20 module with CPU using DPM_Time structure is
not possible and
Counting feature is not available.
The NI_ERT_854_20 EFB coordinates the flow of multiplex data from the ERT module to the PLC
using the input and output registers. A marker "New data" is always set for every data type if the
input data type in the corresponding EFB output structure was copied.
As additional parameters, EN and ENO can be configured.
Appearance in FBD
Representation:
Appearance in LD
Representation:
Appearance in IL
Appearance:
CAL NI_ERT_854_20_Instance (SLOT:=SlotIndex,
ACK:=EventAcknowledgment, CL_TT:=ClearEventBufferFlag,
INPUT=>OutputBoolArray, ND_TT=>NewTimeTagFlag,
TT_DATA=>TimeTagDataOutput, ND_STAT=>NewStatusDataFlag,
STATUS=>EFB_ERTStatus)
Appearance in ST
Appearance:
NI_ERT_854_20_Instance (SLOT:=SlotIndex,
ACK:=EventAcknowledgment, CL_TT:=ClearEventBufferFlag,
INPUT=>OutputBoolArray, ND_TT=>NewTimeTagFlag,
TT_DATA=>TimeTagDataOutput, ND_STAT=>NewStatusDataFlag,
STATUS=>EFB_ERTStatus) ;
Parameter Description
Description of the input parameters:
CAUTION
UNEXPECTED APPLICATION BEHAVIOR
Do not use the NI_ERT_584_20 EFB inside a DFB.
Do not modify the values of the output parameters TT_DATA and INPUT in the application after
the execution of the EFB NI_ERT_854_20 in the cycle.
Failure to follow these instructions can result in injury or equipment damage.
To modify the values of output parameters TT_DATA and INPUT in the application after the
execution of the EFB, first make a copy of these values in other PLC variables. Then make the
modifications.
D7 D6 Type of event message D5...D0 Number of the first input of the event group
01 1-pin message 1...32 Input pin number
10 2-pin message 1, 3, 5...31 First input of the group
11 8-pin message 1, 9, 17, 25 First input of the group
Function Mode
Contents Function
Digital inputs 1...16 Digitally processed input data which is cyclically updated (the
input address of the module corresponds to that of the digital
Digital inputs 17...32
standard input module that is inputs 1...16 correspond to bits
15...0)
Transfer status IN transfer status (TS_IN)
MUX 1 Multiplex data block for block transfer, such as:
1 event with 5 byte time marker or
MUX 2
2 counter values of maximal configuration 32 or
MUX 3 1 status word
MUX 4
RESERVED Reserved for internal use
Simplified structure of the NI_ERT_854_20 output register block with 5 %MW output words for the
transfer from the PLC to the ERT.
Contents Function
Transfer status OUT transfer status (TS_OUT)
MUX 1 Time data block for the ERT for the clock synchronization
MUX 2
MUX 3
MUX 4
NOTE: User interfaces are normally the inputs and outputs of the NI_ERT_854_20 EFB, not the
%IW, and %MW input/output words.
EFB Configuration
EFB Connection
The EFB connection to the input and output references (%IW and %QW) is accomplished through
a graphic connection to the ERT slot number. The currently available NI_QUANTUM and NI_DROP
EFBs from the safety library are used as follows:
NI_QUANTUM for local
NI_DROP for remote racks
These EFBs transfer an integer index to every specified slot, which points to an internal data
structure with the configured values. The module parameters and the ID are stored there, in
addition to the addresses and lengths of the assigned input and output references (%IW and
%MW).
A significant improvement in the runtime can be achieved by deactivating the NI_QUANTUM or the
NI_DROP EFB after the first execution.
Function of CL_TT
Setting the input marker CL_TT causes the FIFO buffer event of the ERT to be cleared. Setting the
markers for one cycle is sufficient.
Block Diagram
Principle structure:
Data Flow
Digital Inputs
No marker for new data is provided for this input type. The digital inputs in the first two input register
words are updated directly by the ERT in every PLC cycle. The NI_ERT_854_20 EFB makes the
processed values available as BOOL in the array of the output parameter INPUT.
Event Inputs
You need to confirm your readiness to receive new events. Therefore the administration of markers
becomes more complex (a handshake mechanism is required). Event data remains in the event
message output array TT_DATA and the marker for new data ND_TT stays set until the ACK input
is set and a new event thus requested. The EFB responds to this by resetting ND_TT for at least
one cycle. After the new event has been sent to the event message output array TT_DATA, ND_TT
is reset by the EFB. Reset the ACK input after the EFB has reset the ND_TT marker so that new
event data does not get overwritten. This state can then remain stable to allow the user program
enough time for event processing. Each subsequent event tracked with the ERT is temporarily
stored within the event FIFO buffer.
New events are sent directly from the internal buffer of the EFB in intervals of at least two cycles
for as long as the ACK input is set (for the special continuous operating mode); the effect is,
however, that the ND_TT only stays set for one cycle. In this special mode, the user program’s task
is still to terminate event processing before ND_TT signals the transfer of other new events to the
event message output TT_DATA as handshake protection by ACK is not available in this case.
Status Inputs
The marker for new status data ND_STAT is set for one cycle. The status inputs can be overwritten
after two inquiry cycles.
The status word contains EFB and ERT error bits.
When configuring the parameter screen some of these errors can be assigned to grouped error
messages with the "F" light as well as the module’s error byte within the status table. All other
errors are then defined as warnings.
D11...D9 reserved.
Part VIII
Statistical
Statistical
Introduction
This section describes the elementary functions and elementary function blocks of the
Statistical group.
Chapter 38
S_LIMIT_***: Limit
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
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 39
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
Representation in LD
Representation
Parameter Description
Description of input parameters
Chapter 40
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
Representation in LD
Representation
Parameter Description
Description of input parameters
Chapter 41
S_MUX_***: Multiplexer
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
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of input parameters
Chapter 42
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Part IX
Timers & Counters
Introduction
This section describes the elementary functions and elementary function blocks of the Timers &
Counters family.
Chapter 43
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 44
S_CTU_***: Up Counter
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
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 45
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
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 46
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
Parameter Description
Description of the input parameters
Timing Diagram
Representation of the OFF delay S_TOF
Chapter 47
S_TON: On Delay
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
Parameter Description
Description of the input parameters
Timing Diagram
Representation of the ON delay S_TON
Chapter 48
S_TP: Pulse
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
Parameter Description
Description of the input parameters
Timing Diagram
Representation of the S_TP pulse
Part X
Type to Type
Type to Type
Introduction
This section describes the elementary functions and elementary function blocks of the Type to
Type family.
Chapter 49
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.
Formula
Block formula
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 50
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.
Formula
Block formula
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 51
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
Representation in LD
Representation of an Integer application
Parameter Description
Description of the input parameters
Chapter 52
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.
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 53
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
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Chapter 54
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
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Runtime Error
The system bit %S18 (see page 238) and system word %SW17 (see page 246) are not used.
Chapter 55
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
Representation in FBD
Representation of a double integer application
Representation in LD
Representation of a double integer application
Parameter Description
Description of input parameters
Runtime Error
The system bit %S18 (see page 238) 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 238) and system word %SW17 (see page 246) are not used
when data types are converted:
BOOL
BYTE
WORD
DWORD
Chapter 56
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
Representation in FBD
Representation of an Integer application
Representation in LD
Representation of an Integer application
Parameter Description
Description of the input parameters
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.
Chapter 57
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
Representation in FBD
Representation of a double integer application:
Representation in LD
Representation of a double integer application:
Parameter description
Description of input parameters:
Runtime error
The system bit %S18 (see page 238) 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.
Chapter 58
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
Parameter Description
Description of the input parameters
Chapter 59
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
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Runtime Error
The system bit %S18 (see page 238) 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 238) and system word %SW17 (see page 246) are not used
when data types are converted:
BOOL
BYTE
WORD
DWORD
REAL
Chapter 60
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
Representation in FBD
Representation of an Integer application
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Runtime Error
The system bit %S18 (see page 238) is set to 1, if
the value range on the output is exceeded (numeric data types)
The system bit %S18 (see page 238) and system word %SW17 (see page 246) are not used
when data types are converted:
BOOL
BYTE
WORD
DWORD
Chapter 61
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.
Representation in FBD
Representation
Representation in LD
Representation
Parameter Description
Description of the input parameters
Chapter 62
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
Representation in LD
Representation of an Integer application
Parameter Description
Description of input parameters
Part XI
Communication
Communication
Introduction
This section describes the derived function blocks of the Communication family.
Chapter 63
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 246)).
Insert the calculated CRC and time stamp at the end of the data to be sent array (Reserved
Data zone (see page 225)).
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
Representation in LD
Representation
Parameter Description
Description of the input/output parameter:
Chapter 64
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 246)).
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.
Representation in FBD
Representation:
Representation in LD
Representation:
Parameter Description
Description of the input parameters:
33003873 02/2015
Appendices
Appendix A
System Objects
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).
Section A.1
System Bits
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.
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.
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:
%S4 time base see chapter "System Bits" in the Unity Pro Program - no no
TB10MS 10 ms Languages and Structure Reference Manual
%S5 time base see chapter "System Bits" in the Unity Pro Program - no no
TB100MS 100 ms Languages and Structure Reference Manual
%S6 time base see chapter "System Bits" in the Unity Pro Program - no no
TB1SEC 1s Languages and Structure Reference Manual
%S7 time base see chapter "System Bits" in the Unity Pro Program - no no
TB1MIN 1 min Languages and Structure Reference Manual
%S10 input/output Normally at 1, this is set to 0 when an I/O fault on an in- 1 no yes
IOERR fault 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.
%S11 watchdog Normally at 0, this is set to 1 by the system as soon as 0 no yes
WDG overflow the task execution time becomes greater than the
maximum execution time (i.e. the watchdog) declared in
the task properties.
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.
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:
%S16 task Normally set to 1, this bit is set to 0 by the system when 1 yes yes
IOERRTSK input/output a fault occurs on an in-rack I/O module or a Fipio device
fault configured in the task.
This bit must be reset to 1 by the user.
%S17 rotate or normally at 0 0 no yes
CARRY shift output During a rotate or shift operation, this bit takes the state
of the outgoing bit.
%S18 overflow or Normally set to 0, this bit is set to 1 in the event of a 0 yes yes
OVERFLOW arithmetic capacity overflow if there is
error 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.
%S19 task period Normally set to 0, this bit is set to 1 by the system in the 0 yes yes
OVERRUN overrun event of a time period overrun (i.e. task execution time
(periodical is greater than the period defined by the user in the
scanning) 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.
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.
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:
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:
%S68 state of the This bit is used to check the operating state of the – no yes
PLCBAT processor backup battery for saving data and the program in RAM:
battery set to 0: battery present and operational,
set to 1: battery missing or non-operational.
%S75 state of the This bit is used to monitor the status of the main battery – no no
PCMCIABAT1 data when the memory card is in the lower PCMCIA slot, see
storage chapter "System Bits" in the Unity Pro Program
memory Languages and Structure Reference Manual.
card battery Note: Data stored on a memory card in slot B are not
processed in SIL3 projects.
Section A.2
System Words
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.
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:
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:
%SW31 maximum This word indicates the longest master task - no yes
MASTMAXTIME master task execution time since the last cold start (in ms).
execution time
%SW32 minimum This word indicates the shortest master task - no yes
MASTMINTIME master task execution time since the last cold start (in ms).
execution time
%SW33 to fast task see chapter "System Objects" in the Unity Pro - no no
%SW35 execution Program Languages and Structure Reference
times Manual
%SW36 NTP number of This word indicates the number of seconds 0 no yes
seconds (LSB) 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.
%SW37 NTP number of This word indicates the number of seconds 0 no yes
seconds passed since January 1st, 1980 at 00:00 (MSB
(MSB) part). It reflects the NTP time coming from the
140 NOE 771 11 module. This word is refreshed
internally between two NTP synchronizations.
%SW38 NTP number of This word indicates the number of milliseconds 0 no yes
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.
%SW40 to auxiliary tasks see chapter "System Objects" in the Unity Pro - no no
%SW47 execution Program Languages and Structure Reference
times Manual
Detailed Description
Not all of the system words can be used in the Quantum Safety PLC. In the following table the
unusable system words are marked no in the Quant. Safety column.
This table gives a description of the system words %SW60 to %SW127:
%SW60.2
= 0 sets PLC B to OFFLINE mode.
= 1 sets PLC B to RUN mode.
%SW60.3
= 0 If an application mismatch is detected,
standby PLC is forced to OFFLINE mode.
= 1 Standby PLC operates normally even if
a mismatch occurs.
%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 is switched on Modbus port 1
during a primary swap.
= 1 address is not switched on in Modbus
port 1 during a primary swap.
%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
%SW71 position of the This word provides the image of the positions of 0 no yes
KEY_SWITCH switches on the the switches on the front panel of the Quantum
Quantum front processor. This word is updated automatically by
panel 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
For the description of the system words %SW128 to %SW339 and %SW535 to %SW640, see the
chapter "Quantum Specific System Words" in the Unity Pro Program Languages and Structure
Reference Manual. The system words %SW340 to %SW534 are not used in Quantum Safety PLCs.
Glossary
!
%
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.
%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)
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
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
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 state’s object changes, the value is copied inside the
history bit),
1 bit for the forcing bit (equals to 0, if the object isn’t 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.
elementary function
see EF
EN
EN means ENable, this is an optional block input.
When EN is activated, an ENO output is automatically drafted.
If... then...
If EN = 0, the block is not activated,
its internal program is not executed,
and ENO is set to 0.
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)
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
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:
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.
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.
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 A network is a group of stations which communicate among one
expert modules 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.
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:
S
SAI module
safety analog input module
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.
UMA
UMA is the abbreviation of unrestricted memory area. The UMA is a part of the Safety PLC’s
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
Index
%SW54, 248 B
%SW55, 248
binary selection
%SW56, 248
S_SEL, 175
%SW57, 248
bistable function block, reset dominant
%SW58, 248
S_RS, 99
%SW59, 249
bistable function block, set dominant
%SW60, 250
S_SR, 105
%SW61, 251
BLKERRTYPE, 255
%SW62, 252
block types, 16
%SW63, 252
%SW70, 252
%SW71, 252
%SW75, 252
C
%SW76, 252 CARRY, 238
%SW77, 252 COLDSTART, 236
%SW78, 252 Communication
%SW8, 244 S_RD_ETH, 227
%SW80, 253 S_WR_ETH, 223
%SW81, 253 Comparison
%SW87, 253 S_EQ_***, 29
%SW9, 244 S_GE_***, 31
%SW90, 253 S_GT_***, 33
S_LE_***, 35
S_LT_***, 37
0-9 S_NE_***, 39
conditional FFB call, 20
100MSCOUNTER, 245
configuring a remote I/O station rack
1RSTSCANRUN, 237
NI_DROP, 145
1RSTTASKRUN, 239
CPUERR, 254
A D
absolute value computation
DAYOFWEEK, 248
S_ABS_***, 111
detection of falling edges
ACTIVEVT, 240
S_F_TRIG, 87
addition
detection of rising edges
S_ADD_***, 113
S_R_TRIG, 93
ADJDATETIME, 249
DIAGBUFFCONF, 242
AND function
DIAGBUFFFULL, 242
S_AND_***, 85
division
APMODE, 244
S_DIV_***, 115
assignment
DLASTDEREG, 252
S_MOVE, 119
DLASTREG, 252
S_SMOVE_BIT, 121
DNBERRBUF, 252
S_SMOVE_WORD, 127
down counter
S_CTD_***, 179
IOERR, 236
E IOERRTSK, 238
elementary function, 16 IOEVTNB, 248
elementary function block, 16
EN, 19
ENO, 19 K
equal to
KEY_SWITCH, 252
S_EQ_***, 29
ERRADDRi, 256
EVTOVR, 240 L
exclusive OR function
less than
S_XOR_***, 107
S_LT_***, 37
less than or equal to
F S_LE_***, 35
limit
FASTACT, 240
S_LIMIT_***, 167
FASTPERIOD, 244
LOCIOERR, 242
FLOATSTAT, 245
Logic
FORCEDIOIM, 253
S_AND_***, 85
S_F_TRIG, 87
S_NOT_***, 89
G S_OR_***, 91
greater than S_R_TRIG, 93
S_GT_***, 33 S_ROL_***, 95
greater than or equal to S_ROR_***, 97
S_GE_***, 31 S_RS, 99
S_SHL_***, 101
S_SHR_***, 103
H S_SR, 105
HALTIFERROR, 242 S_XOR_***, 107
high availability
S_AISIL2, 63
high availiability M
S_DISIL2, 43 MASTACT, 240
Hot Standby MASTCURRTIME, 246
S_HSBY_SWAP, 77 MASTMAXTIME, 246
HOURMIN, 248 MASTMINTIME, 246
HSB_CMD, 250 MASTPERIOD, 244
HSB_STS, 251
HSBY_REVERSEi, 252
I
INDEXOVF, 239
INTELMODE, 245
Mathematics OR function
S_ABS_***, 111 S_OR_***, 91
S_ADD_***, 113 OSCOMMPATCH, 245
S_DIV_***, 115 OSCOMMVERS, 245
S_MOVE, 119 OSINTVERS, 245
S_MUL_***, 117 OVERFLOW, 238
S_NEG_***, 135 OVERRUN, 238
S_SIGN_***, 139
S_SMOVE_BIT, 121
S_SMOVE_WORD, 127 P
S_SQRT_REAL, 137 PCMCIABAT0, 241
S_SUB_***, 141 PCMCIABAT1, 241
maximum value function PLCBAT, 241
S_MAX_***, 169 PLCRUNNING, 237
MAXREQNB, 253 pulse
minimum value function S_TP, 189
S_MIN_***, 171
MONTHDAY, 248
MSGCNT0, 253 Q
MSGCNT1, 253 Quantum_IO
MSTSERVCNT, 253 NI_ERT_854_20, 153
multiplexer NI_QUANTUM, 149
S_MUX_***, 173
multiplication
S_MUL_***, 117 R
REMIOERR, 242
rotate left
N S_ROL_***, 95
negation rotate right
S_NEG_***, 135 S_ROR_***, 97
S_NOT_***, 89 RSTMSGCNT, 242
NI_DROP RTCERR, 240
configuring a remote I/O station rack, 145 RTCTUNING, 241
NI_ERT_854_20, 153 RTCWRITE, 240
NI_QUANTUM, 149
not equal to
S_NE_***, 39 S
S_ABS_***, 111
S_ADD_***, 113
O S_AISIL2, 63
off delay S_AND_***, 85
S_TOF, 185 S_BIT_TO_BYTE, 193
on delay S_BIT_TO_WORD, 195
S_TON, 187 S_BOOL_TO_***, 197
S_BYTE_TO_***, 201
U
unconditional FFB call, 20
up counter
S_CTU_***, 181
up/down counter
S_CTUD_***, 183
W
WARMSTART, 236
WDG, 236
WDGVALUE, 244