0% found this document useful (0 votes)
57 views217 pages

Twinsafe Logic FB - en

The document provides comprehensive documentation for TwinCAT Function Blocks related to TwinSAFE Logic components, including safety instructions, system descriptions, and detailed configurations for various function blocks. It emphasizes the importance of safety, support, and service while outlining the functionality and configuration of each function block within the TwinCAT System Manager. The document is intended for users to understand and implement TwinSAFE Logic effectively in their systems.

Uploaded by

Aidinmah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views217 pages

Twinsafe Logic FB - en

The document provides comprehensive documentation for TwinCAT Function Blocks related to TwinSAFE Logic components, including safety instructions, system descriptions, and detailed configurations for various function blocks. It emphasizes the importance of safety, support, and service while outlining the functionality and configuration of each function block within the TwinCAT System Manager. The document is intended for users to understand and implement TwinSAFE Logic effectively in their systems.

Uploaded by

Aidinmah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 217

Documentation | EN

TwinSAFE Logic FB
TwinCAT Function Blocks for TwinSAFE Logic Components

2024-09-10 | Version: 4.1.0


Table of contents

Table of contents
1 Notes on the documentation.................................................................................................................... 9
1.1 Disclaimer.......................................................................................................................................... 9
1.1.1 Trademarks ........................................................................................................................ 9
1.1.2 Patents ............................................................................................................................... 9
1.1.3 Limitation of liability .......................................................................................................... 10
1.1.4 Copyright.......................................................................................................................... 10
1.2 Documentation issue status ............................................................................................................ 11
1.3 References ...................................................................................................................................... 12
1.4 Staff qualification ............................................................................................................................. 13
1.5 Safety and instruction...................................................................................................................... 14
1.6 Beckhoff Support and Service......................................................................................................... 15
1.7 Notes on information security.......................................................................................................... 16

2 For your safety ........................................................................................................................................ 17


2.1 Duty of care ..................................................................................................................................... 17

3 System description ................................................................................................................................. 18


3.1 TwinSAFE Logic Terminals ............................................................................................................. 18
3.1.1 TwinSAFE group .............................................................................................................. 18
3.1.2 TwinSAFE connection...................................................................................................... 21
3.2 System diagnosis ............................................................................................................................ 21
3.2.1 Diagram showing EL6900/KL6904 diagnostics under TwinCAT 2................................... 22
3.2.2 Diagram showing EL69x0 diagnostics under TwinCAT 3 ................................................ 26
3.2.3 Info data connection......................................................................................................... 27
3.2.4 Function blocks info data ................................................................................................. 28
3.2.5 Groups info data .............................................................................................................. 29

4 Function blocks....................................................................................................................................... 31
4.1 The function block AND .................................................................................................................. 31
4.1.1 Functional description ...................................................................................................... 31
4.1.2 Signal description............................................................................................................. 31
4.1.3 FB AND configuration in the TwinCAT System Manager................................................. 33
4.1.4 Display in TwinCAT 3....................................................................................................... 34
4.2 The function block OR..................................................................................................................... 34
4.2.1 Functional description ...................................................................................................... 34
4.2.2 Signal description............................................................................................................. 35
4.2.3 FB OR configuration in the TwinCAT System Manager................................................... 37
4.2.4 Display in TwinCAT 3....................................................................................................... 37
4.3 The function block OPMODE .......................................................................................................... 38
4.3.1 Functional description ...................................................................................................... 38
4.3.2 Signal description............................................................................................................. 39
4.3.3 Configuration of the FB OPMODE in the TwinCAT System Manager ............................. 42
4.3.4 Restart behavior............................................................................................................... 42
4.3.5 Display in TwinCAT 3....................................................................................................... 44
4.4 The function block ESTOP .............................................................................................................. 45
4.4.1 Functional description ...................................................................................................... 45

TwinSAFE Logic FB Version: 4.1.0 3


Table of contents

4.4.2 Signal description............................................................................................................. 46


4.4.3 FB ESTOP configuration in the TwinCAT System Manager ............................................ 50
4.4.4 Restart behavior............................................................................................................... 50
4.4.5 ESTOP extension............................................................................................................. 53
4.4.6 Display in TwinCAT 3....................................................................................................... 54
4.5 The function block MON.................................................................................................................. 55
4.5.1 Functional description ...................................................................................................... 55
4.5.2 Signal description............................................................................................................. 56
4.5.3 FB MON configuration in the TwinCAT System Manager................................................ 59
4.5.4 Restart behavior............................................................................................................... 60
4.5.5 MON extension ................................................................................................................ 62
4.5.6 Display in TwinCAT 3....................................................................................................... 63
4.6 The function block DECOUPLE ...................................................................................................... 64
4.6.1 Functional description ...................................................................................................... 64
4.6.2 Signal description............................................................................................................. 64
4.6.3 FB DECOUPLE configuration in the TwinCAT System Manager .................................... 67
4.6.4 Display in TwinCAT 3....................................................................................................... 67
4.7 The function block TWOHAND ....................................................................................................... 68
4.7.1 Functional description ...................................................................................................... 68
4.7.2 Signal description............................................................................................................. 69
4.7.3 FB TWOHAND configuration in the TwinCAT System Manager...................................... 72
4.7.4 Display in TwinCAT 3....................................................................................................... 72
4.8 The function block MUTING ............................................................................................................ 73
4.8.1 Functional description ...................................................................................................... 73
4.8.2 Signal description............................................................................................................. 74
4.8.3 FB MUTING configuration in the TwinCAT System Manager .......................................... 77
4.8.4 Extensions FB Muting EL/EJ6910.................................................................................... 81
4.8.5 Display in TwinCAT 3....................................................................................................... 82
4.9 The function block EDM .................................................................................................................. 83
4.9.1 Functional description ...................................................................................................... 83
4.9.2 Signal description............................................................................................................. 84
4.9.3 FB EDM configuration in the TwinCAT System Manager ................................................ 86
4.9.4 Display in TwinCAT 3....................................................................................................... 86
4.10 The function block RS ..................................................................................................................... 87
4.10.1 Functional description ...................................................................................................... 87
4.10.2 Signal description............................................................................................................. 88
4.10.3 FB RS configuration in the TwinCAT System Manager ................................................... 90
4.10.4 Display in TwinCAT 3....................................................................................................... 90
4.11 The function block SR ..................................................................................................................... 91
4.11.1 Functional description ...................................................................................................... 91
4.11.2 Signal description............................................................................................................. 92
4.11.3 FB SR configuration in the TwinCAT System Manager ................................................... 93
4.11.4 Display in TwinCAT 3....................................................................................................... 93
4.12 The function block TON .................................................................................................................. 94
4.12.1 Functional description ...................................................................................................... 94
4.12.2 Signal description............................................................................................................. 95

4 Version: 4.1.0 TwinSAFE Logic FB


Table of contents

4.12.3 FB TON configuration in the TwinCAT System Manager................................................. 97


4.12.4 TON extension ................................................................................................................. 97
4.12.5 Display in TwinCAT 3....................................................................................................... 98
4.13 The function block TON2 ................................................................................................................ 98
4.13.1 Functional description ...................................................................................................... 98
4.13.2 Signal description........................................................................................................... 100
4.14 The function block TOF ................................................................................................................. 101
4.14.1 Functional description .................................................................................................... 101
4.14.2 Signal description........................................................................................................... 102
4.14.3 FB TOF configuration in the TwinCAT System Manager ............................................... 104
4.14.4 TOF extension................................................................................................................ 104
4.14.5 Display in TwinCAT 3..................................................................................................... 104
4.15 The function block CONNECTION SHUTDOWN.......................................................................... 105
4.15.1 Functional description .................................................................................................... 105
4.15.2 Signal description........................................................................................................... 107
4.15.3 FB ConnectionShutdown configuration in the TwinCAT System Manager .................... 109
4.15.4 Display in TwinCAT 3..................................................................................................... 109
4.16 The function block ADD ................................................................................................................ 110
4.16.1 Functional description .................................................................................................... 110
4.16.2 Signal description........................................................................................................... 111
4.16.3 FB ADD configuration in TwinCAT 3.............................................................................. 113
4.17 The function block SUB................................................................................................................. 114
4.17.1 Functional description .................................................................................................... 114
4.17.2 Signal description........................................................................................................... 114
4.17.3 FB SUB configuration in TwinCAT 3 .............................................................................. 116
4.18 The function block MUL ................................................................................................................ 117
4.18.1 Functional description .................................................................................................... 117
4.18.2 Signal description........................................................................................................... 118
4.18.3 FB MUL configuration in TwinCAT 3.............................................................................. 119
4.19 The function block DIV .................................................................................................................. 120
4.19.1 Functional description .................................................................................................... 120
4.19.2 Signal description........................................................................................................... 121
4.19.3 FB DIV configuration in TwinCAT 3 ............................................................................... 123
4.20 The function block COMPARE ...................................................................................................... 124
4.20.1 Functional description .................................................................................................... 124
4.20.2 Signal description........................................................................................................... 125
4.20.3 FB COMPARE configuration in TwinCAT 3 ................................................................... 127
4.21 The function block LIMIT ............................................................................................................... 128
4.21.1 Functional description .................................................................................................... 128
4.21.2 Signal description........................................................................................................... 129
4.21.3 FB LIMIT configuration in TwinCAT 3 ............................................................................ 131
4.22 The function block COUNTER ...................................................................................................... 132
4.22.1 Functional description .................................................................................................... 132
4.22.2 Signal description........................................................................................................... 133
4.22.3 FB Counter configuration in TwinCAT 3......................................................................... 135
4.23 The function block SCALE ............................................................................................................ 136

TwinSAFE Logic FB Version: 4.1.0 5


Table of contents

4.23.1 Functional description .................................................................................................... 136


4.23.2 Signal description........................................................................................................... 137
4.23.3 FB SCALE configuration in TwinCAT 3.......................................................................... 139
4.24 The function block SPEED ............................................................................................................ 140
4.24.1 Functional description .................................................................................................... 140
4.24.2 Signal description........................................................................................................... 141
4.24.3 FB Speed configuration in TwinCAT 3 ........................................................................... 143
4.25 The function block LOADSENSING .............................................................................................. 144
4.25.1 Functional description .................................................................................................... 144
4.25.2 Signal description........................................................................................................... 145
4.25.3 FB LOADSENSING configuration in TwinCAT 3 ........................................................... 147
4.26 The function block CAMMONITOR ............................................................................................... 149
4.26.1 Functional description .................................................................................................... 149
4.26.2 General properties of the FB CAMMONITOR................................................................ 150
4.26.3 Use case excentric mode............................................................................................... 152
4.26.4 Use case: pendulum mode ............................................................................................ 156
4.26.5 Use case: hardware cams.............................................................................................. 160
4.26.6 Description of the process.............................................................................................. 164
4.26.7 Diagnostics messages excentric mode.......................................................................... 164
4.26.8 Diagnostic messages pendulum mode .......................................................................... 167
4.26.9 Status information .......................................................................................................... 169
4.27 The function block SLI................................................................................................................... 170
4.27.1 Functional description .................................................................................................... 170
4.27.2 Signal description........................................................................................................... 171
4.27.3 FB SLI configuration in TwinCAT 3 ................................................................................ 173
4.28 The function block SLI2................................................................................................................. 174
4.28.1 Functional description .................................................................................................... 174
4.28.2 Description of the signals ............................................................................................... 175
4.28.3 FB SLI2 configuration in TwinCAT 3 .............................................................................. 177
4.29 The function block SLP ................................................................................................................. 179
4.29.1 Functional description .................................................................................................... 179
4.29.2 Description of the signals ............................................................................................... 180
4.29.3 FB SLP configuration in TwinCAT 3............................................................................... 184
4.30 The function block SBT ................................................................................................................. 186
4.30.1 Functional description .................................................................................................... 186
4.30.2 Description of the signals ............................................................................................... 187
4.30.3 FB SLT configuration in TwinCAT 3............................................................................... 190
4.31 The function block ADVPOSMON................................................................................................. 192
4.31.1 Functional description .................................................................................................... 192
4.31.2 Description of the signals ............................................................................................... 192
4.31.3 Configuration of FB ADVPOSMON in TwinCAT 3 ......................................................... 195
4.32 The function block Envelope ......................................................................................................... 197
4.32.1 Functional description .................................................................................................... 197
4.32.2 Signal description........................................................................................................... 198
4.32.3 FB Envelope configuration in TwinCAT 3 ...................................................................... 200
4.33 The function block ViolationCounter ............................................................................................. 201

6 Version: 4.1.0 TwinSAFE Logic FB


Table of contents

4.33.1 Functional description .................................................................................................... 201


4.33.2 Signal description........................................................................................................... 202
4.33.3 FB ViolationCnt configuration in TwinCAT 3 .................................................................. 204
4.34 The function block XOR ................................................................................................................ 205
4.34.1 Functional description .................................................................................................... 205
4.34.2 Signal description........................................................................................................... 206
4.34.3 Configuration of the FB XOR in TwinCAT 3................................................................... 209

5 Appendix ................................................................................................................................................ 211


5.1 Support and Service...................................................................................................................... 211

TwinSAFE Logic FB Version: 4.1.0 7


Table of contents

8 Version: 4.1.0 TwinSAFE Logic FB


Notes on the documentation

1 Notes on the documentation

1.1 Disclaimer
Beckhoff products are subject to continuous further development. We reserve the right to revise the
operating instructions at any time and without prior announcement. No claims for the modification of products
that have already been supplied may be made on the basis of the data, diagrams and descriptions in these
operating instructions.

In these operating instructions we define all permissible use cases whose properties and operating
conditions we can guarantee. The use cases we define are fully tested and certified. Use cases beyond this,
which are not described in these operating instructions, require the approval of Beckhoff Automation GmbH
& Co KG.

1.1.1 Trademarks
Beckhoff®, TwinCAT®, EtherCAT®, EtherCAT G®, EtherCAT G10®, EtherCAT P®, Safety over EtherCAT®,
TwinSAFE®, XFC®, XTS® and XPlanar® are registered and licensed trademarks of Beckhoff Automation
GmbH.
The use of other brand names or designations by third parties may lead to an infringement of the rights of
the owners of the corresponding designations.

1.1.2 Patents
The EtherCAT technology is protected by patent rights through the following registrations and patents with
corresponding applications and registrations in various other countries:
• EP1590927
• EP1789857
• EP1456722
• EP2137893
• DE102015105702

EtherCAT® is a registered trademark and patented technology,


licensed by Beckhoff Automation GmbH.

Safety over EtherCAT® is a registered trademark and patented


technology, licensed by Beckhoff Automation GmbH.

TwinSAFE Logic FB Version: 4.1.0 9


Notes on the documentation

1.1.3 Limitation of liability


All components in this product as described in the operating instructions are delivered in a specific
configuration of hardware and software, depending on the application regulations. Modifications and
changes to the hardware and/or software configuration that go beyond the documented options are
prohibited and nullify the liability of Beckhoff Automation GmbH & Co. KG.

The following is excluded from the liability:


• Failure to observe these operating instructions
• Improper use
• Use of untrained personnel
• Use of unauthorized spare parts

1.1.4 Copyright
© Beckhoff Automation GmbH & Co. KG, Germany.
The distribution and reproduction of this document as well as the use and communication of its contents
without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a
patent, utility model or design.

10 Version: 4.1.0 TwinSAFE Logic FB


Notes on the documentation

1.2 Documentation issue status


Version Comment
4.1.0 • Function blocks added:
◦ SLI2
◦ SLP
◦ SBT
◦ ADVPOSMON
• Chapter "References" added
• Chapter "Function block COUNTER" revised
• Editorially revised
• Offset values added
4.0.0 • Migration
3.3.0 • FB TON / FB TON2 – extension of the time base
3.2.0 • Texts rendered more precisely
• Restart behavior for ESTOP, OPMODE and MON described in detail
• FB XOR added
• FB TON2 added (saving of timer value)
• Document title changed
• Note texts updated according to IEC 82079-1
• FB status descriptions amended
• Note on FB versions (BLG) added
• FB SLI input types changed and PositionDiff data types corrected
3.1.0 • Function block Connection Shutdown extended with RUN state
• Table 2-6 extended with status 106
3.0.0 • Extension with function blocks of EL6910 / EJ6910 / EK1960
• FBs modified: EStop, Mon, Muting, TON and TOF
• FBs added: Add, Sub, Mul, Div, Compare, Limit, Counter, Scale, Speed, LoadSensing,
CamMonitor, SLI, Envelope and ViolationCounter
• Description of info data added under TC3
• Representation in TwinCAT 3 added for all FBs
• TwinSAFE group description extended
2.4.1 • Markings removed
2.4.0 • Company address changed
2.3.0 • Document origin and versions added
• EDM extended with standard In
• MUTING status+information extended
• TwoHand diagnostic information extended
2.2.0 • TwinSAFE Connection info data extended
• FB ESTOP info data extended
2.1.0 • FB OPMODE description extended
• Service/support information modified
2.0.0 • EL6900 function blocks added
1.1.1 • Corrections during the translation into English
1.1.0 • Adaptations in the application examples
1.0.0 • First released version

TwinSAFE Logic FB Version: 4.1.0 11


Notes on the documentation

Currentness

Please check whether you are using the current and valid version of this document. The current version can
be downloaded from the Beckhoff homepage at http://www.beckhoff.de/twinsafe. In case of doubt, please
contact Technical Support (see Beckhoff Support and Service [} 15]).

Origin of the document

This original documentation is written in German. All other languages are derived from the German original.

Product features

The valid product properties are always those specified in the current manual. Further information given on
the product pages of the Beckhoff homepage, in emails or in other publications is not authoritative.

1.3 References
In addition to these operating instructions, the following documents form part of the overall documentation,
with the exception of the machinery directive:

No. Issue Title / description


[1] / Not used.
[2] / Not used.
[3] 1.4.1 or newer Operating instructions for EL6910 TwinSAFE Logic module
The document contains a description of the Logic functions of the EL6910,
and thus also of the AMI8911, and their programming
[4] 3.1.0 or newer Documentation for TwinSAFE Logic FB
The document describes the safety function blocks that are available in the
EL6910, and thus also in the AMI8911 option card, and form the safety
application.
[5] 3.3.0 or newer TwinSAFE Application Guide
The Application Guide provides the user with examples for the calculation
of safety parameters for safety functions according to the standards DIN EN
ISO 13849-1 and EN 62061 or EN 61508:2010, such as are typically used
on machines.
[6] 2006/42/EC Directive 2006/42/EC of the European Parliament and of the Council of
17. May 2006 on machinery and amending Directive 95/16-7/EC
(revised) of 29 June 2006
This directive, also known as the Machinery Directive, defines requirements
for the placing on the market of machines and machine-like components,
such as safety components.

12 Version: 4.1.0 TwinSAFE Logic FB


Notes on the documentation

1.4 Staff qualification


These operating instructions are intended exclusively for trained specialists in control technology and
automation with the relevant knowledge.

The trained specialist personnel must ensure that the applications and use of the described product meet all
safety requirements. This includes all applicable and valid laws, regulations, provisions and standards.

Trained specialists

Trained specialists have extensive technical knowledge from studies, apprenticeships or technical training.
Understanding of control technology and automation is available. Trained specialists can:
• Independently identify, avoid and eliminate sources of hazard.
• Apply relevant standards and directives.
• Implement specifications from accident prevention regulations.
• Evaluate, prepare and set up the workplaces.
• Evaluate, optimize and execute work independently.

TwinSAFE Logic FB Version: 4.1.0 13


Notes on the documentation

1.5 Safety and instruction


Read the contents that refer to the activities you have to perform with the product. Always read the chapter
For your safety in the operating instructions.

Observe the warnings in the chapters so that you can handle and work with the product as intended and
safely.

Explanation of symbols

Various symbols are used for a clear arrangement:


1. The numbering indicates an action that should be taken.
• The bullet point indicates an enumeration.
[…] The square brackets indicate cross-references to other text passages in the document.
[1] The number in square brackets indicates the numbering of a referenced document.

The signal words used in the documentation are classified below.

Signal words

Warning of personal injuries

DANGER
Hazard with high risk of death or serious injury.

WARNING
Hazard with medium risk of death or serious injury.

CAUTION
There is a low-risk hazard that could result in medium or minor injury.

Warning of damage to property or environment

NOTICE
Notes
The environment, equipment, or data may be damaged.

Information on handling the product

This information includes, for example:


Recommendations for action, assistance or further information on the product.

14 Version: 4.1.0 TwinSAFE Logic FB


Notes on the documentation

1.6 Beckhoff Support and Service


Support

Beckhoff Support offers technical advice on the use of individual Beckhoff products and system planning.
The employees support you in the programming and commissioning of sophisticated automation systems.
Hotline: +49 5246/963-157
E-mail: support@beckhoff.com
Web: www.beckhoff.com/support

Training

Training in Germany takes place in our training center at the Beckhoff headquarters in Verl, at subsidiaries
or, by arrangement, at the customer's premises.
Hotline: +49 5246/963-5000
E-mail: training@beckhoff.com
Web: www.beckhoff.com/training

Service

The Beckhoff Service Center supports you with after-sales services such as on-site service, repair service or
spare parts service.
Hotline: +49 5246/963-460
E-mail: service@beckhoff.com
Web: www.beckhoff.com/service

Download area

In the download area you can obtain product information, software updates, the TwinCAT automation
software, documentation and much more.
Web: www.beckhoff.com/download

Headquarters

Beckhoff Automation GmbH & Co. KG


Hülshorstweg 20
33415 Verl
Germany
Phone: +49 5246/963-0
E-mail: info@beckhoff.com
Web: www.beckhoff.com

For the addresses of our worldwide locations, please visit our website at Global Presence.

TwinSAFE Logic FB Version: 4.1.0 15


Notes on the documentation

1.7 Notes on information security


The products of Beckhoff Automation GmbH & Co. KG (Beckhoff), insofar as they can be accessed online,
are equipped with security functions that support the secure operation of plants, systems, machines and
networks. Despite the security functions, the creation, implementation and constant updating of a holistic
security concept for the operation are necessary to protect the respective plant, system, machine and
networks against cyber threats. The products sold by Beckhoff are only part of the overall security concept.
The customer is responsible for preventing unauthorized access by third parties to its equipment, systems,
machines and networks. The latter should be connected to the corporate network or the Internet only if
appropriate protective measures have been set up.

In addition, the recommendations from Beckhoff regarding appropriate protective measures should be
observed. Further information regarding information security and industrial security can be found in our
https://www.beckhoff.com/secguide.

Beckhoff products and solutions undergo continuous further development. This also applies to security
functions. In light of this continuous further development, Beckhoff expressly recommends that the products
are kept up to date at all times and that updates are installed for the products once they have been made
available. Using outdated or unsupported product versions can increase the risk of cyber threats.

To stay informed about information security for Beckhoff products, subscribe to the RSS feed at https://
www.beckhoff.com/secinfo.

16 Version: 4.1.0 TwinSAFE Logic FB


For your safety

2 For your safety

2.1 Duty of care


Read the entire documentation for the TwinSAFE component
• TwinSAFE Application Guide
• Operating instructions for EL6910 TwinSAFE Logic Terminal

The operator must comply with all the requirements and instructions specified in this documentation in order
to fulfill his duty of care. This includes in particular that you
• comply with the provisions defined in the chapter Limitation of liability [} 10].
• only operate the TwinSAFE component when it is in perfect working order.
• provide the operating instructions in a legible condition and complete at the place of use of the
TwinSAFE component.
• do not remove the safety markings attached to the TwinSAFE component and maintain their legibility.

No disposal in domestic waste


Products marked with a crossed-out waste bin must not be disposed of with domestic
waste. The device is considered waste electrical and electronic equipment when it is
disposed of. Observe the national regulations for the disposal of waste electrical and
electronic equipment.

TwinSAFE Logic FB Version: 4.1.0 17


System description

3 System description
The TwinSAFE system consists of safe inputs, safe outputs and logic modules. The TwinSAFE logic
contains function blocks that are parameterized and linked to each other and that form the safety-related
logic. Free programming is not possible. In addition to the non-safety-related logic configuration a fieldbus
configuration is required for mapping the TwinSAFE data packets. These functions are realized via the
TwinCAT System Manager or TwinCAT 3. The safety-relevant TwinSAFE Verifier or TwinCAT 3 loads the
TwinSAFE project onto the logic module and checks the project.

The TwinSAFE Logic Terminal can communicate, via the fieldbus-independent and certified TwinSAFE
protocol with safe input and output terminals, and also via further logic terminals. The TwinSAFE protocol is
the Safety-over-EtherCAT (FSoE) protocol, as disclosed in the EtherCAT Technology Group. For more
information please visit www.ethercat.org.

3.1 TwinSAFE Logic Terminals


The configuration of a TwinSAFE Logic Terminal consists of function blocks and connections that are
consolidated into one or several TwinSAFE groups. TwinSAFE groups can be started and stopped
independently of each other.

Execution order in TwinCAT 3


The execution order of the function blocks corresponds to the order displayed in the project tree in
TwinCAT 3 Editor. The execution order of the function blocks in TwinCAT 3 can be changed in the
properties of each function block. It is additionally displayed in the upper right corner of the function
block diagram. There must be no gaps in the numbering of the execution order.

The function blocks have parameters that you can define for specific applications.

You assign the inputs and outputs of the function blocks to


• the inputs and outputs of TwinSAFE Terminals,
• the inputs and outputs of other function blocks or
• the input variables and output variables of the standard PLC.

A TwinSAFE connection is the unique assignment of a TwinSAFE device to a TwinSAFE group. Only the
function blocks belonging to this TwinSAFE group can be linked to the inputs and outputs of an assigned
TwinSAFE connection. If additional groups are to access the inputs and outputs, you can use the function
block DECOUPLE.

Errors of the TwinSAFE communication within the TwinSAFE group and errors within a function block affect
the complete TwinSAFE group. The TwinSAFE group stops all associated function blocks, which then switch
their outputs into a safe state (FALSE). Errors in the TwinSAFE Logic lead to the entire TwinSAFE Logic
being switched off.

3.1.1 TwinSAFE group


The function blocks are assigned to a TwinSAFE group. All outputs of the group adopt a safe state in the
following situations:
• communication error in an assigned TwinSAFE connection,
• error in an assigned function block (e.g. a discrepancy timeout) or
• error in the assigned local outputs.

The safe state is always the non-energized state at the output, which corresponds to logical 0. The data of a
TwinSAFE connection (and therefore of a TwinSAFE input terminal or TwinSAFE output terminal) are always
assigned to exactly one TwinSAFE group.

18 Version: 4.1.0 TwinSAFE Logic FB


System description

A communication error is indicated by the output ComErr of the TwinSAFE group and acknowledged via the
input ErrAck. A function block error is displayed on the output FbErr and acknowledged on the same input
ErrAck as the communication error. An error on the local outputs (only KL6904) is displayed on the third
output OutErr and once again acknowledged by the same input ErrAck. The safe state of the TwinSAFE
group outputs is removed once the error is no longer present and has been acknowledged.

In addition, the TwinSAFE group has an input Run, which can be used to start and stop the processing of the
assigned function blocks. All TwinSAFE group assigned outputs are in a safe state when stopped. For the
EL6910 and newer logics the input Run must always be linked with a standard signal.

NOTICE
Run and ErrAck of the TwinSAFE group
The error acknowledgement is not automatic, i.e. the input ErrAck must always be linked with a standard
signal.
For the EL6910 and newer logics, the input Run must also always be linked with a standard signal.

3.1.1.1 Inputs and outputs of the TwinSAFE group EL6900/KL6904

Inputs of the TwinSAFE group


Name Permitted type Description
RUN FB-Out TRUE:
Standard-In The function blocks assigned to the TwinSAFE group are executed.
FALSE:
All function blocks assigned to the TwinSAFE group are in the STOP state
and all associated outputs are in the safe state.
If the input is not linked, it is in the TRUE state.
ERR ACK FB-Out All errors in the assigned function blocks and the TwinSAFE connections
Standard-In are acknowledged with the signal sequence FALSE  TRUE  FALSE.

Outputs of the TwinSAFE group


Name Permitted type Description
FB ERR TwinSAFE-Out TRUE:
FB-In At least one assigned function block has an error.

Standard-Out FALSE:
All assigned function blocks have no errors.
Local-Out
COM ERR TwinSAFE-Out TRUE:
FB-In At least one TwinSAFE connection of TwinSAFE group has an error.

Standard-Out FALSE:
All TwinSAFE connections of the TwinSAFE group have no errors.
Local-Out
OUT ERR TwinSAFE-Out TRUE:
FB-In At least one locally assigned output of the TwinSAFE group has an error.

Standard-Out FALSE:
Local-Out All local outputs assigned to the TwinSAFE group have no error.
This only applies to TwinSAFE components that have local outputs.

3.1.1.2 Inputs and outputs of the TwinSAFE group of the EL6910/EJ6910


The EL6910 offers additional inputs and outputs of the TwinSAFE group. This typically also applies to
TwinSAFE components that are based on the logic of the EL6910, such as the EK1960.

TwinSAFE Logic FB Version: 4.1.0 19


System description

Inputs and outputs of the TwinSAFE group EL6910/EJ6910


Group Port Direction Description
Err Ack IN Error Acknowledge for errors within the group
- the signal must be linked to a standard variable
Run/Stop IN 1 - Run; 0 - Stop
- Signal must be linked with a standard variable
Module Fault IN Input for an error output of another used module, e.g. with EK1960
Com Err OUT Communication error in at least one connection
FB Err OUT Error at one or more of the FBs used
Out Err OUT not used
Other Err OUT ModuleFault or AnalogValueFault or WaitComTimeoutFault
Com Startup OUT At least one of the connections in this group is in StartUp.
FB Deactive OUT The group has been deactivated (see EL6910 documentation on
customization, for example).
FB Run OUT All FBs are in the RUN state.
In Run OUT The TwinSAFE group is in the RUN state.

The group state and diagnostics (see Group info data [} 29]) can be loaded via the group properties in the
cyclic process image. The following tables show the possible values.

20 Version: 4.1.0 TwinSAFE Logic FB


System description

3.1.2 TwinSAFE connection


Each safe communication path between the TwinSAFE Logic and TwinSAFE inputs, TwinSAFE outputs or
other TwinSAFE Logic Terminals are referred to as TwinSAFE connection.

A communication partner is thus always the TwinSAFE master, the other the TwinSAFE slave. The
TwinSAFE Logic is always the TwinSAFE master in a TwinSAFE connection to a TwinSAFE input or
TwinSAFE output. In the TwinSAFE connection to another TwinSAFE Logic it may be a TwinSAFE slave.
This assignment is automatically specified by the TwinCAT System Manager, although it can also be defined
by the user.

Both the TwinSAFE master and the TwinSAFE slave have a FSoE address (Safety-over-EtherCAT) that can
be set on the respective TwinSAFE terminal via a DIP switch in order to ensure that any mix-up of the
TwinSAFE data packets is always detected. These FSoE addresses are checked within the TwinSAFE
communication and must be unambiguous in the control system. The TwinSAFE Verifier for each TwinSAFE
logic terminal checks that.

If there are several TwinSAFE logic terminals in the control system, the user must ensure that FSoE
addresses are not assigned more than once. The TwinSAFE verifier can only check one TwinSAFE logic
terminal.

NOTICE
FSoE addresses not assigned more than once
Ensure that unique FSoE addresses are assigned within a configuration.

For each TwinSAFE connection a watchdog time and the corresponding FSoE address for the
communication devices must be set. TwinCAT 2 offers the option of setting a SIL level, however this setting
is not supported at the moment and has no effects on the safety behavior of the system. In another
configuration option a module error (Hardware error or diagnostic message) in the TwinSAFE communication
partner can be set to trigger a communication error in the TwinSAFE group.

The EL6910/EJ6910 support activation of a ComErrAck at each connection. If this signal is connected, the
respective connection must be reset after a communication error via the signal ComErrAck, in addition to the
ErrAck of the TwinSAFE group.

Fig. 1: Connection

3.2 System diagnosis


The states of the TwinSAFE groups, FBs and connections can be checked online in the System Manager.
The diagnostic information can be copied into the cyclic process image.

TwinSAFE groups have inputs and outputs that can be assigned offline and viewed online, as illustrated
below.

If the checkboxes or the properties ‘Map State’ and ‘Map Diag’ are set, the state and diagnostic data for the
group are copied into the cyclic process image and can be linked directly with PLC variables.

TwinSAFE Logic FB Version: 4.1.0 21


System description

The EL6910/EJ6910 additionally reports events in a diag history. It contains events with timestamps. The
user can configure which data are to be stored in the history.

NOTICE
KL6904
With the KL6904 copying of the diagnostic information to the cyclic process image is only possible to a
limited extent. The checkboxes ‘Map State’ and ‘Map Diag’ are not available.

3.2.1 Diagram showing EL6900/KL6904 diagnostics under TwinCAT


2

3.2.1.1 TwinSAFE group diagnostics

Fig. 2: TwinSAFE group inputs/outputs (online)

Status information KL6904/EL6900


Value Status Description
1 RUN All function blocks and TwinSAFE connections assigned to the TwinSAFE group
operate properly, and all TwinSAFE connections assigned to the TwinSAFE group are
up and running.
2 STOP State after initialization
3 SAFE All function blocks and TwinSAFE connections assigned to the TwinSAFE group
operate properly, and at least one of the TwinSAFE connections assigned to the
TwinSAFE group is not yet up and running.
4 ERROR At least one assigned function block or one assigned TwinSAFE connection has
reported an error.
5 RESET A positive edge (FALSE->TRUE) for acknowledgement of a function block or a
TwinSAFE connection error was detected on the ERR_ACK input. The system is
waiting for the negative edge of the ERR_ACK input.

22 Version: 4.1.0 TwinSAFE Logic FB


System description

3.2.1.2 TwinSAFE function block list diagnostics


The status of TwinSAFE FBs is displayed on online summary. The current status data are read from the
EL6900/KL6904 via a manual refresh.

Fig. 3: Function block list online values

If the checkboxes ‘Map State’ and ‘Map Diag’ for the individual TwinSAFE FBs are set, the status and
diagnostic data for the FBs are copied into the cyclic process image and can be linked directly with PLC
variables. The description of the status and diagnostic values can be found under the respective FBs.

NOTICE
KL6904
With the KL6904 copying of the diagnostic information to the cyclic process image is only possible to a
limited extent. The checkboxes ‘Map State’ and ‘Map Diag’ are not available.

Fig. 4: Emergency Stop

3.2.1.3 TwinSAFE connection diagnostics


The TwinSAFE connections status is displayed on the TwinSAFE connection list summary under the
"Connection List" tab. Diagnostics bits are also set in addition to the status.

TwinSAFE Logic FB Version: 4.1.0 23


System description

Fig. 5: Connection List

If the checkboxes ‘Map State’ and ‘Map Diag’ for the individual TwinSAFE connections are set, the status
and diagnostic data for the connections are copied into the cyclic process image and can be linked directly
with PLC variables. In addition, the safe inputs and outputs can be copied into the cyclic process image and
used for diagnostic purposes.

NOTICE
KL6904
With the KL6904 copying of the diagnostic information to the cyclic process image is only possible to a
limited extent. The checkboxes ‘Map State’, ‘Map Diag’‚ ‘Map Inputs’ and ‘Map Outputs’ are not available.
The button “Com Err Ack” is also not available.

24 Version: 4.1.0 TwinSAFE Logic FB


System description

Fig. 6: Variables tab (connection)

Diagnostic information for a connection


Value Description
xxxx 0001 Invalid command
xxxx 0010 Unknown command
xxxx 0011 Invalid connection ID
xxxx 0100 Invalid CRC
xxxx 0101 Watchdog time elapsed
xxxx 0110 Invalid FSoE address
xxxx 0111 Invalid data
xxxx 1000 Invalid communication parameter length
xxxx 1001 Invalid communication parameters
xxxx 1010 Invalid user parameter length
xxxx 1011 Invalid user parameters
xxxx 1100 FSoE master reset
xxxx 1101 Module error detected on slave, with option "Module error is ComError" activated
xxxx 1110 Module error detected on EL290x, with option "Error acknowledge active" activated
xxxx 1111 Slave not yet started, or unexpected error argument
xxx1 xxxx FSoE slave error detected
xx1x xxxx FSoE slave reports Failsafe Value active
x1xx xxxx StartUp
1xxx xxxx FSoE master reports Failsafe Value active

Status information for a connection


Value Description
100 (0x64) Reset state:
The Reset state is used to reinitialize the FSoE connection after power-on or an FSoE
communication error.
101 (0x65) Session state:

TwinSAFE Logic FB Version: 4.1.0 25


System description

Value Description
During the transition to or in the Session state, a session ID is transferred from the FSoE
master to the FSoE slave, which in turn responds with its own session ID.
102 (0x66) Connection state:
In the Connection state, a connection ID is transferred from the FSoE master to the FSoE
slave.
103 (0x67) Parameter state:
In Parameter state safe communication parameters and device-specific application
parameters are transferred.
104 (0x68) Data state:
In the Data state, FSoE cycles are transmitted until either a communication error occurs or
an FSoE node is stopped locally.
105 (0x69) Shutdown state:
In the Shutdown state the connection was shut down by one of the communication partners.
(EL6910 or newer: connection was shut down because a shutdown command was received)
106 (0x6A) Shutdown-Deactive state:
EL6910 or newer: Connection was shut down because the connection was shut down via
the Deactivate inputs of the function block.

Further information can be found in the Safety-over-EtherCAT ETG.5100 specification.

3.2.2 Diagram showing EL69x0 diagnostics under TwinCAT 3


The diagnostics is shown in Safety Project Online View for the hole safety project. In the event of an error
the diagnostic texts are displayed in plain text. Errors are stored in the diag history of the EL/EJ6910, from
where they can be read out.

Fig. 7: Diag History of the EL6910 with a Com Error due to a false CRC

26 Version: 4.1.0 TwinSAFE Logic FB


System description

Diagnostics in the event of an error via Safety Project Online View

Fig. 8: Safety Project Online View

3.2.3 Info data connection


Info data for TwinSAFE / FSoE connections can be enabled on the Connection tab of the alias device.

Fig. 9: Info data connection

TwinSAFE Logic FB Version: 4.1.0 27


System description

The Info Data is shown in the I/O tree structure below the TwinSAFE logic in the process image. From here,
these signals can be linked with PLC variables.

Fig. 10: Connection info data in the I/O tree structure

The status information and diagnostic information contained are identical to the previous description of
TwinCAT 2.

3.2.4 Function blocks info data


Info data for function blocks can be enabled in the properties of the function block.

Fig. 11: Function block properties

The Info Data is shown in the I/O tree structure below the TwinSAFE logic in the process image. From here,
you can link the signals with PLC variables.

28 Version: 4.1.0 TwinSAFE Logic FB


System description

Fig. 12: Function block Info Data in the I/O tree structure

Information on status and diagnostics of the FBs can be found in the respective function block descriptions.

3.2.5 Groups info data


Info data for TwinSAFE groups can be enabled via the properties of the TwinSAFE group. Right-click in an
empty area of the worksheet and select Properties to access these parameters.

Fig. 13: Access to Info Data via Properties

The Info Data is shown in the I/O tree structure below the TwinSAFE logic in the process image. From here,
these signals can be linked with PLC variables.

TwinSAFE Logic FB Version: 4.1.0 29


System description

Fig. 14: TwinSAFE group Info Data in the I/O tree structure

Status information for an EL/EJ69x0 group


Value Status Description
1.0 RUN Input RUN=1, no error in the group, and all connections have started up
without error
2.0 STOP Input RUN = 0
4.0 ERROR Group is in error, see Diagnostic information
5.0 RESET After a group error has occurred, all errors have been rectified and the Err Ack
signal is 1
6.0 START The group remains in this state as long as not all connections have started up
after the start of the group (RUN=1)
7.0 STOPERROR When starting or initializing the group, the group assumes the STOPERROR
state if TwinSAFE connections are assigned to the group.
The group leaves the STOPERROR state to the ERROR state if the Run input
is TRUE.
16.0 DEACTIVE Group was deactivated via customizing
17.0 WAITCOMERROR This state is set when the customizing function “Passivate” is selected and the
system waits for ComError of the group

Diagnostics information for an EL/EJ69x0 group


Value Status Description
0.0 - No error
1.0 FBERROR at least one FB is in ERROR state
2.0 COMERROR at least one connection is faulty
3.0 MODULEERROR the input ModuleFault is 1
4.0 CMPERROR On startup, at least one analog FB input deviates from the last saved value
(Power-On Analog Value Check Error)
5.0 DEACTIVATEERR The timeout has elapsed while waiting for the COM error in "passivate" mode
OR of a manual control unit
6.0 RESTARTERROR The TwinSAFE logic program was restarted because the EtherCAT
connection was restarted or a user logged in without reloading the TwinSAFE
logic program (or parts of it).

30 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4 Function blocks
The function blocks have a fixed functionality. The function blocks can be configured via parameters or
properties. The inputs or outputs of a function block can be inputs or outputs of the local process image, but
outputs of function blocks can also be linked with inputs of other function blocks.

4.1 The function block AND

4.1.1 Functional description


With the FB AND several input signals can be linked via AND to one output signal. The input signal of each
can be set to represent a break contact or a make contact. A make contact means that the corresponding
input signal is negated, before it affects the AND.

The AndIn1 input differs from the AndIn2-AndIn8 inputs in such a way that it can also be linked with a
standard input. This makes it possible to switch off a safe output using a standard signal. Outputs cannot be
switched on but only released using standard signals, since at least two inputs must always be linked for FB
AND (and the second input is a safe one, which prevents switching on).

Fig. 15: Function block AND

4.1.2 Signal description


FB AND inputs
Offset Name Permitted type Data type Description
8.0 AndIn1 TwinSAFE-In BOOL 1st input channel
FB-Out
Standard-In

TwinSAFE Logic FB Version: 4.1.0 31


Function blocks

Offset Name Permitted type Data type Description


9.0 AndIn2 TwinSAFE-In BOOL 2nd input channel
FB-Out
10.0 AndIn3 TwinSAFE-In BOOL 3rd input channel
FB-Out
11.0 AndIn4 TwinSAFE-In BOOL 4th input channel
FB-Out
12.0 AndIn5 TwinSAFE-In BOOL 5th input channel
FB-Out
13.0 AndIn6 TwinSAFE-In BOOL 6th input channel
FB-Out
14.0 AndIn7 TwinSAFE-In BOOL 7th input channel
FB-Out
15.0 AndIn8 TwinSAFE-In BOOL 8th input channel
FB-Out

FB AND outputs
Offset Name Permitted type Data type Description
1.0 AndOut TwinSAFE-Out BOOL Output channel
FB-In
Standard-Out
Local-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
Local-Out TwinSAFE output at the KL6904 (not available for EL6900)

Internal identifier of the FB


Type Description
FB AND This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB AND

Diagnostic information (16-bit value)


Bit Description
0.0-15.0 always 0

Status information (8-bit value)


Value Description
1.0 RUN
If all active inputs AndIn1-AndIn8 are set to 1 (ACTIVE_ANDIN=TRUE), the RUN state is
assumed.
The outputs assume the following values:
AndOut=1

32 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
2.0 STOP
The FB AND module assumes the STOP state if the input FbRun is FALSE.
The outputs assume the following values:
AndOut=0
3.0 SAFE
The SAFE state is assumed if one or more of the active inputs AndIn1-AndIn8 is not 1
(ACTIVE_ANDIN=FALSE).
The outputs assume the following values:
AndOut=0

If the checkboxes 'Map State' and 'Map Diag' are checked, the status and diagnostic data of the FB are
copied to the cyclic process image.

NOTICE
KL6904
The Map State and Map Diag checkboxes do not exist in the case of the KL6904.

4.1.3 FB AND configuration in the TwinCAT System Manager

Fig. 16: FB AND configuration

Use the Settings buttons to the right of two AndIn inputs to configure their behavior. The inputs are always
single-channel. Discrepancy monitoring cannot be used with the FB AND.

The 'AndIn(x)' buttons can only be selected if the corresponding input has been activated via the Settings
button. In the default setting all inputs are disabled.

The FB AND input variables are linked using the 'AndIn(x)' buttons.

The output variable of the FB AND are linked using the 'AndOut' button.

TwinSAFE Logic FB Version: 4.1.0 33


Function blocks

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

The FB AND does not supply any error information and therefore the error button is basically deactivated.

4.1.4 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

Fig. 17: FB AND in TwinCAT 3

Fig. 18: FB AND properties

4.2 The function block OR

4.2.1 Functional description


With the FB OR several input signals can be linked via OR to one output signal. The input signal of each can
be set to represent a break contact or a make contact. A make contact means that the corresponding input
signal is negated, before it affects the OR.

34 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 19: Function block OR

4.2.2 Signal description


FB OR inputs
Offset Name Permitted type Data type Description
8.0 OrIn1 TwinSAFE-In BOOL 1st input channel
FB-Out
9.0 OrIn2 TwinSAFE-In BOOL 2nd input channel
FB-Out
10.0 OrIn3 TwinSAFE-In BOOL 3rd input channel
FB-Out
11.0 OrIn4 TwinSAFE-In BOOL 4th input channel
FB-Out
12.0 OrIn5 TwinSAFE-In BOOL 5th input channel
FB-Out
13.0 OrIn6 TwinSAFE-In BOOL 6th input channel
FB-Out
14.0 OrIn7 TwinSAFE-In BOOL 7th input channel
FB-Out
15.0 OrIn8 TwinSAFE-In BOOL 8th input channel
FB-Out

TwinSAFE Logic FB Version: 4.1.0 35


Function blocks

FB OR outputs
Offset Name Permitted type Data type Description
1.0 OrOut TwinSAFE-Out BOOL Output channel
FB-In
Standard-Out
Local-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
Local-Out TwinSAFE output at the KL6904 (not available for EL6900)

Internal identifier of the FB


Type Description
FB OR This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for FB OR

Diagnostic information (16-bit value)


Bit Description
0.0-15.0 always 0

Status information (8-bit value)


Value Description
1.0 RUN
The RUN state is assumed if one or more of the active inputs OrIn1-OrIn8 is set to 1
(ACTIVE_ORIN=TRUE).
The outputs assume the following values:
OrOut=1
2.0 STOP
If the input FbRun=FALSE, the FB OR module assumes the STOP state.
The outputs assume the following values:
OrOut=0
3.0 SAFE
If all active inputs OrIn1-OrIn8 are 0 (ACTIVE_ORIN=FALSE), the state SAF is assumed.
The outputs assume the following values:
OrOut=0

If the checkboxes 'Map State' and 'Map Diag' are checked, the status and diagnostic data of the FB are
copied to the cyclic process image.

NOTICE
KL6904
The Map State and Map Diag checkboxes do not exist in the case of the KL6904.

36 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.2.3 FB OR configuration in the TwinCAT System Manager

Fig. 20: FB OR configuration

Their characteristics are configured with the setting buttons on the right near the two OrIn inputs, whereby
the inputs are always single-channel. A discrepancy monitoring cannot be used for the OR.

The 'OrIn(x)' buttons can only be selected if the corresponding input has been activated via the Settings
button. In the default setting all inputs are disabled.

The FB OR input variables are linked using the 'OrIn(x)' buttons.

The output variable of the FB OR are linked using the 'OrOut' button.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

The FB OR does not supply any error information and therefore the error button is basically deactivated.

4.2.4 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

TwinSAFE Logic FB Version: 4.1.0 37


Function blocks

Fig. 21: FB OR in TwinCAT 3

Fig. 22: FB OR properties

4.3 The function block OPMODE

4.3.1 Functional description


Operating mode selectors can be realized with the FB OPMODE. The function block has 8 inputs and
8 outputs, which are looped through one-to-one. Up to 8 different operation modes can be selected.

The FB OPMODE sets the corresponding output only if exactly one input is set ("1"). The other outputs
remain in the safe state ("0"). All outputs are in a safe state if there is none or more than one input is set.

If the Restart input is active, the safe state of the outputs is only exited when starting and changing the
operation mode by a rising and falling edge on the Restart input (see also chapter 3.3.4 [} 42] Restart
behavior [} 42]). No time monitoring of the restart signal takes place. The output is switched on when the
restart signal changes from TRUE to FALSE.

A discrepancy time can be specified to monitor the change from one operation mode to the next.

38 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 23: Function block OPMODE

NOTICE
Number of inputs
At least two inputs of FB OPMODE must be connected.

4.3.2 Signal description


FB OPMODE inputs
Offset Name Permitted type Data type Description
0.0 Restart TwinSAFE-In BOOL The signal sequence
FB-Out 0->1->0 must be detected on the restart input, before
Standard-In the safe state of the outputs can be removed, when
starting the FB or when all outputs are switched to the
safe state. No time monitoring of the restart signal
takes place.
8.0 OpIn1 TwinSAFE-In BOOL 1st input channel
FB-Out
9.0 OpIn2 TwinSAFE-In BOOL 2nd input channel
FB-Out
10.0 OpIn3 TwinSAFE-In BOOL 3rd input channel
FB-Out
11.0 OpIn4 TwinSAFE-In BOOL 4th input channel
FB-Out
12.0 OpIn5 TwinSAFE-In BOOL 5th input channel
FB-Out
13.0 OpIn6 TwinSAFE-In BOOL 6th input channel
FB-Out

TwinSAFE Logic FB Version: 4.1.0 39


Function blocks

Offset Name Permitted type Data type Description


14.0 OpIn7 TwinSAFE-In BOOL 7th input channel
FB-Out
15.0 OpIn8 TwinSAFE-In BOOL 8th input channel
FB-Out

Outputs of the FB OPMODE


Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL TRUE:
FB-In The discrepancy time monitoring or the input
Standard-Out monitoring has found an error. The acknowledgement
Local-Out of the error must be carried out via the
ERR_ACK input of the related TwinSAFE group
FALSE:
No error was found.
8.0 OpOut1 TwinSAFE-Out BOOL 1st output channel
FB-In
Standard-Out
Local-Out
9.0 OpOut2 TwinSAFE-Out BOOL 2nd output channel
FB-In
Standard-Out
Local-Out
10.0 OpOut3 TwinSAFE-Out BOOL 3rd output channel
FB-In
Standard-Out
Local-Out
11.0 OpOut4 TwinSAFE-Out BOOL 4th output channel
FB-In
Standard-Out
Local-Out
12.0 OpOut5 TwinSAFE-Out BOOL 5th output channel
FB-In
Standard-Out
Local-Out
13.0 OpOut6 TwinSAFE-Out BOOL 6th output channel
FB-In
Standard-Out
Local-Out
14.0 OpOut7 TwinSAFE-Out BOOL 7th output channel
FB-In
Standard-Out
Local-Out
15.0 OpOut8 TwinSAFE-Out BOOL 8th output channel
FB-In
Standard-Out
Local-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

40 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Type Description
Local-Out TwinSAFE output at the KL6904 (not available for EL6900)

Diagnostic and status information for FB OPMODE

Diagnostic information (16-bit value)


Bit Description
0.0 Discrepancy monitoring error

Internal identifier of the FB


Type Description
FB This description applies to BLG 1.0 (internal version number)
OPMODE

Status information (8-bit value)


Value Description
1.0 RUN
The FB OPMODE module assumes the RUN state if exactly one OpInX input is TRUE.
The outputs assume the following values:
Error=0
OpOutX=OpInX (1<=X<=8)
2.0 STOP
If the input FbRun=FALSE, the FB OPMODE module assumes the STOP state.
The outputs assume the following values:
Error=0
OpOutX=0 (1<=X<=8)
3.0 SAFE
The FB OPMODE module assumes the state SAFE if not exactly one input OpInX is TRUE.
The outputs assume the following values:
Error=0
OpOutX=0 (1<=X<=8)
4.0 ERROR
If the FB OPMODE module detects an error, the FB OPMODE module switches to the
ERROR state and transmits the corresponding diag message to the GROUP module.
The outputs assume the following values:
Error=1
OpOutX=0 (1<=X<=8)
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the associated
group is set to TRUE, the FB OPMODE module assumes the RESET state.
The outputs assume the following values:
Error=0
OpOutX=0 (1<=X<=8)
6.0 START
The FB OPMODE module assumes the START state if the Restart input is active and TRUE
in order to wait for a rising and falling edge of the Restart input before assuming the RUN
state and the corresponding OpOutX output becomes TRUE.
The outputs assume the following values:
Error=0
OpOutX=0 (1<=X<=8)

If the checkboxes 'Map State' and 'Map Diag' are checked, the status and diagnostic data of the FB are
copied to the cyclic process image.

TwinSAFE Logic FB Version: 4.1.0 41


Function blocks

NOTICE
KL6904
The checkboxes 'Map State' and 'Map Diag' are not available for the KL6904.

4.3.3 Configuration of the FB OPMODE in the TwinCAT System


Manager

Fig. 24: FB OPMODE configuration

The manual restart is activated using the "'Activated' " checkbox on the right near the 'Restart' button.

The inputs are activated via the 'Activated' check boxes to the right of the 'OpIn (x)' button.

The 'Restart' or 'OpIn(x)' buttons can only be selected, once the corresponding check box has been selected.

The FB OPMODE input variables are linked using the 'Restart' and 'OrIn(x)' buttons.

The FB OPMODE output variables are linked using the 'Error' and 'OpOut(x)' buttons.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

The discrepancy time is configured using the 'Discrepancy' selection box.

4.3.4 Restart behavior


If exactly one OpIn input is TRUE and the Restart signal is TRUE, Start state (FB State 6) is assumed. The
detection of a change of the Restart signal from TRUE to FALSE triggers a check whether exactly one OpIn
input is still logical 1. The corresponding output is enabled if these criteria are met and the function block is
not in ERROR state.

42 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

NOTICE
Restart input
The function block expects a push button with make contact at the restart input.

CAUTION
Restart
If the risk and hazard analysis indicates that a restart is to be implemented in the safety controller, the
restart signal must be applied to a safe input.

Sample 1

The following diagram shows an error-free behavior with a change of the operation mode and subsequent
acknowledgement of the OPMODE function block via the restart input.

Fig. 25: Restart behavior OPMODE (sample 1)

Sample 2

In the following diagram the Restart is set to TRUE before the operation mode change takes place.
Changing the input OpIn1 from TRUE to FALSE results in a switch to state 3. Once operation mode OpIn2 is
TRUE, the system changes to the Start state (FB State 6), since the Restart input is already TRUE. The
output OpOut2 is activated by changing the Restart input from TRUE to FALSE.

TwinSAFE Logic FB Version: 4.1.0 43


Function blocks

Fig. 26: Restart behavior OPMODE (sample 2)

4.3.5 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

Fig. 27: FB OPMODE in TwinCAT 3

44 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 28: FB OPMODE properties

4.4 The function block ESTOP

4.4.1 Functional description


An emergency stop circuit with up to eight emergency stop inputs (EStopIn1-EStopIn8) can be realized with
the FB ESTOP. Each of the eight inputs can be parameterized as break contact (0 requests the safe state)
or make contact (1 request the safe state).

The first output (EStopOut) goes immediately, and the second output (EStopDelOut) after a configurable
time delay, into the safe state ("0"), once an input requests the safe state. Each FB output can be linked to
several outputs. Therefore, several outputs that switch off immediately (EStopOut) or with a delay
(EStopDelOut) can be realized with just one FB ESTOP.

In order to exit the safe state of the outputs, a rising and falling edge must be detected at the Restart input
(see also chapter 3.4.4 [} 50] Restart behavior [} 50]). No time monitoring of the restart signal takes place.

TwinSAFE Logic FB Version: 4.1.0 45


Function blocks

Fig. 29: Function block ESTOP

A feedback loop can be activated for both outputs. The output EStopOut is returned to the input EDM1 and
the output EStopDelOut to the input EDM2 through external wiring. The EDM inputs are checked as soon as
the FB changes to the START status (6) (see 3.4.4 [} 50] Restart behavior [} 50]). If the EDM inputs then
do not have the signal state "1", the FB ESTOP enters the error state and sets the Error output to 1. The
error state can only be exited again by means of an acknowledgement via the ERR_ACK input of the
associated TwinSAFE group.

Furthermore, the following inputs can be combined to pairs: EStopIn1 / EStopIn2, EStopIn3 / EStopIn4,
EStopIn5 / EStopIn6, EStopIn7 / EStopIn8. The signal states of the two inputs may only deviate from each
other within a configurable discrepancy time. If this discrepancy time is exceeded for an input pair, the FB
ESTOP also enters the error state (FB Error). The error state can only be exited through acknowledgement
via the ERR_ACK input of the associated TwinSAFE group.
In the FB error state, the outputs assume the safe state "0", only the Error output is "1".
The characteristics for acknowledging a discrepancy error can be set via the checkbox Safe Inputs after Disc
Error. If the checkbox is checked, both inputs of the input group that has caused the discrepancy error have
to switch to safe state simultaneously before the error can be reset.

4.4.2 Signal description


FB ESTOP inputs
Offset Name Permitted type Data type Description
0.0 Restart TwinSAFE-In BOOL During start-up (when the corresponding TwinSAFE
FB-Out group is started) or a restart (when an input has
Standard-In requested the safe state), a falling edge must be
detected at the Restart input before the safe state of
the outputs is canceled.

46 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Offset Name Permitted type Data type Description


1.0 EDM1 TwinSAFE-In BOOL EDM1 is the feedback loop for the non-delayed output
FB-Out channel (EStopOut). If this input is parameterized as
Standard-In active, the safe state of the outputs will only be exited
during restart, when the EDM1 supplies the "1" signal.
2.0 EDM2 TwinSAFE-In BOOL EDM2 is the feedback loop for the delayed switching of
FB-Out the output channel (EStopDelOut). If this input is
Standard-In parameterized as active, the safe state of the outputs
will only be exited during restart, when the EDM2
supplies the "1" signal.
8.0 EStopIn1 TwinSAFE-In BOOL 1st input channel: The parameterization is used to
FB-Out specify whether the input behaves as a break contact
(break contact - safe state is requested at logic 0) or as
a make contact (make contact - safe state is requested
at logic 1).
9.0 EStopIn2 TwinSAFE-In BOOL 2nd input channel, behavior like EStopIn1
FB-Out If the discrepancy time is not equal 0, the 1st and 2nd
input channel are considered to be the 1st input pair
and a discrepancy time monitoring is carried out
between both channels.
10.0 EStopIn3 TwinSAFE-In BOOL 3rd input channel or 1st input channel of the 2nd input
FB-Out pair, otherwise corresponds with EStopIn1
11.0 EStopIn4 TwinSAFE-In BOOL 4th input channel or 2nd input channel of the 2nd input
FB-Out pair, otherwise corresponds with EStopIn2
12.0 EStopIn5 TwinSAFE-In BOOL 5th input channel or 1st input channel of the 3rd input
FB-Out pair, otherwise corresponds with EStopIn1
13.0 EStopIn6 TwinSAFE-In BOOL 6th input channel or 2nd input channel of the 3rd input
FB-Out pair, otherwise corresponds with EStopIn2
14.0 EStopIn7 TwinSAFE-In BOOL 7th input channel or 1st input channel of the 4th input
FB-Out pair, otherwise corresponds with EStopIn1
15.0 EStopIn8 TwinSAFE-In BOOL 8th input channel or 2nd input channel of the 4th input
FB-Out pair, otherwise corresponds with EStopIn2

FB ESTOP outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL TRUE:
FB-In The discrepancy time monitoring of an input pair, or
Standard-Out one of the feedback loops, has found an error. The
Local-Out error reset must be carried out via the ERR_ACK input
of the related TwinSAFE group.
FALSE:
No error was found.
1.0 EStopOut TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out
Local-Out
2.0 EStopDelOut TwinSAFE-Out BOOL 2nd output channel, the safe state corresponds to a
FB-In logical 0. The safe state is output with a delay, which
Standard-Out corresponds to the parameterized Delay Time.
Local-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output

TwinSAFE Logic FB Version: 4.1.0 47


Function blocks

Type Description
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
Local-Out TwinSAFE output at the KL6904 (not available for EL6900)

Internal identifier of the FB


Type Description
FB ESTOP This description applies to BLG 1.0 / BLG 2.0 (internal version number)

Diagnostic and status information for FB ESTOP

Diagnostic information (16-bit value)


Bit Description
0.0 Discrepancy error input group 1
1.0 Discrepancy error input group 2
2.0 Discrepancy error input group 3
3.0 Discrepancy error input group 4
4.0 EDM monitoring error EDM1
5.0 EDM monitoring error EDM2
8.0 Discrepancy error input group 1 with activated option "Safe Inputs after Disc Error" (set in addition
to bit 0)
9.0 Discrepancy error input group 2 with activated option "Safe Inputs after Disc Error" (set in addition
to bit 1)
10.0 Discrepancy error input group 3 with activated option "Safe Inputs after Disc Error" (set in addition
to bit 2)
11.0 Discrepancy error input group 4 with activated option "Safe Inputs after Disc Error" (set in addition
to bit 3)

Status information (8-bit value)


Value Description
1.0 RUN
The FB ESTOP module assumes the RUN state if there is no error and no active EStopIn input
requests a safe state.
The outputs assume the following values:
Error=0
EStopOut=1
EStopDelOut=1
2.0 STOP
If the input FbRun=FALSE, the FB ESTOP module assumes the STOP state.
The outputs assume the following values:
Error=0
EStopOut=0
EStopDelOut=0
3.0 SAFE
The FB ESTOP module assumes the SAFE state as long as at least one of the active EStopIn
inputs has requested the safe state.
The outputs assume the following values:
Error=0
EStopOut=0
EStopDelOut=0
4.0 ERROR
If the FB ESTOP module detects an error, the FB ESTOP module switches to the ERROR state
and transmits the corresponding Diag message to the GROUP module.

48 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
The outputs assume the following values:
Error=1
EStopOut=0
EStopDelOut=0
5.0 RESET
If no more errors are present after an error has occurred and the ErrAck input of the associated
group is set to TRUE, the FB ESTOP module assumes the RESET state.
The outputs assume the following values:
Error=0
EStopOut=0
EStopDelOut=0
6.0 START
The FB ESTOP module assumes the START state if the Restart input is TRUE in order to wait for
a rising and falling edge of the Restart input before assuming the RUN state and the outputs leave
the safe state.
The outputs assume the following values:
Error=0
EStopOut=0
EStopDelOut=0
8.0 DELAYOUT
The FB ESTOP module assumes the DELAYOUT state if at least one of the active EStopIn inputs
has requested the safe state, but the delay time for the EStopDelOut output has not yet expired.
The outputs assume the following values:
Error=0
EStopOut=0
EStopDelOut=1

If the checkboxes 'Map State' and 'Map Diag' are checked, the status and diagnostic data of the FB are
copied to the cyclic process image.

NOTICE
KL6904
The checkboxes 'Map State', 'Map Diag' and 'Safe Inputs after Discrepancy Error' are not available in the
KL6904.

TwinSAFE Logic FB Version: 4.1.0 49


Function blocks

4.4.3 FB ESTOP configuration in the TwinCAT System Manager

Fig. 30: FB ESTOP configuration

The characteristics of an input pair are configured with the setting buttons on the right near the two EStopIn
inputs of this input pair.

The 'EStopIn(x)' buttons can only be selected if the corresponding input has been activated via the Settings
button. In the default state all inputs are disabled.

The FB ESTOP input variables are linked using the 'Restart', 'EStopIn(x)' and 'EDM(x)' buttons.

The corresponding feedback loop is activated using the 'Activated' checkbox on the right near the 'EDM(x)'
buttons. The 'EDM(x)' button can only be selected, if the associated feedback loop is activated.

The FB ESTOP output variables are linked using the 'Error', 'EStopOut' and 'EStopDelOut' buttons.

The delay time of the 'EStopDelOut' output is configured via the selection box 'Delay-Time'.

The characteristics for acknowledging a discrepancy error can be set via the checkbox ‘Safe Inputs after
Disc Error’. If the checkbox is checked, both inputs of the input group that has caused the discrepancy error
have to switch to safe state simultaneously before the error can be reset.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.4.4 Restart behavior


If all active EStop-In inputs and all active EDM inputs are TRUE and the Restart signal changes from FALSE
to TRUE, the Start state (FB state 6) is assumed. The detection of a change of the Restart signal from TRUE
to FALSE triggers a check whether all active EStop-In inputs are still TRUE and whether the EDM signal is
still TRUE. The output is enabled if these criteria are met and the function block is not in ERROR state.

50 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

NOTICE
Restart input
The function block expects a push button with make contact at the restart input.

CAUTION
Restart
If the risk and hazard analysis indicates that a restart is to be implemented in the safety controller, the
restart signal must be applied to a safe input.

Sample 1

The following diagram shows the behavior when an emergency stop is triggered via Estop-In and
subsequent acknowledgement of the ESTOP function block via the Restart input. At least one of the EDM
inputs of the FB is active.

Fig. 31: Restart behavior ESTOP (sample 1)

Sample 2

The following diagram shows the behavior of the ESTOP function block, where the change of the Restart
signal from FALSE to TRUE takes place before the change of the EStop inputs from FALSE to TRUE. The
Start state (FB state 6) is only assumed if both signals are TRUE. The output is enabled when the Restart
input changes from TRUE to FALSE. At least one of the EDM inputs of the FB is active.

TwinSAFE Logic FB Version: 4.1.0 51


Function blocks

Fig. 32: Restart behavior ESTOP (sample 2)

Sample 3

In the following diagram the Restart input is set to TRUE before the emergency stop event takes place. Due
to the Restart input signal, the EDM signal is checked immediately when the EStop-In input changes from
TRUE to FALSE. This immediately leads to an EDM error and to the shutdown of the entire TwinSAFE
group.

Fig. 33: Restart behavior ESTOP (sample 3)

Sample 4

If the EDM signal of the ESTOP function block is not evaluated, the time when the change from FALSE to
TRUE may occur at the Restart input is not monitored. This may also be the case before the emergency stop
event. In this case the FB output is enabled when the Restart input changes from TRUE to FALSE.

52 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

NOTICE
EDM signal
If the EDM input of the ESTOP function block does not prevent the device from being switched on again in
the event of a fault, the user must take further measures to prevent this. (refer also to the TwinSAFE
Application Guide, e.g. chapter 2.3).

Fig. 34: Restart behavior ESTOP (sample 4)

4.4.5 ESTOP extension


NOTICE
Support
The extensions described below are only available in the EL/EJ6910 or newer terminals. These options
cannot be used under the EL6900 and KL6904.

Fig. 35: EDM Reset Time

The FB ESTOP can also be used to monitor the change of the state of the feedback signal (EDMn) when the
outputs are switched on.

TwinSAFE Logic FB Version: 4.1.0 53


Function blocks

The inputs EDM1 and EDM2 have been assigned a further parameter Reset Time (ms). Open the properties
of the EDMx by right-clicking on the EDMx input of the ESTOP function block. If this value is not equal to 0,
the timer is started when the output EStopOut is activated. If the EDM input does not switch to FALSE within
this time, a function block error is set and the outputs are switched off.

This function can be switched off by entering 0 as Reset Time (ms).

4.4.6 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

Fig. 36: FB ESTOP in TwinCAT 3

Fig. 37: FB ESTOP properties

54 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

The function Safe Inputs after Disc Error is activated by default for the ESTOP function block in the EL6910
and cannot be disabled. The display of the corresponding parameter and its value only applies if the function
block is used on an EL6900; it can be ignored for the EL6910. A warning is issued if the parameter is set to
TRUE under an EL6910.

4.5 The function block MON

4.5.1 Functional description


A safety door circuit with up to four inputs (MonIn(x)) can be realized with the FB MON for example. Each of
the four inputs can be parameterized as break contact (0 requests the safe state) or make contact (1
requests the safe state).

When an input requests the safe state, the MonOut output immediately switches to the safe state ("0") and
the MonDelOut output switches after a configurable delay. Each FB output can be linked to several outputs.
Therefore, several outputs that switch off immediately (MonOut) or with a delay (MonDelOut) can be realized
with just one FB MON.

In addition there are two Secure inputs, with which the request of the safe state can be bypassed through the
MonIn inputs. The Secure inputs can also be parameterized as break contacts or as make contacts.

The FB restart input can be activated. In order to exit the safe state of the outputs, a rising and falling edge
must be detected at the Restart input with restart active (see also chapter 3.5.4 [} 60] Restart behavior
[} 60]). No time monitoring of the restart signal takes place. In case of an inactive restart the safe state is
exited once the MonIn or Secure inputs no longer request the safe state.

Fig. 38: Function block MON

A feedback loop must be activated for both outputs. The output MonOut is returned to the input EDM1 and
the output MonDelOut to the input EDM2 through external wiring. The EDM inputs are checked as soon as
the FB changes to the START status (6) (see Restart behavior [} 60]).
If Restart is enabled, the FB MON assumes the error state (FB Error) and sets the Error output to 1 if the

TwinSAFE Logic FB Version: 4.1.0 55


Function blocks

EDM inputs do not have the signal state TRUE. The error state can only be exited again by acknowledging
via the ERR_ACK input of the associated TwinSAFE group.
If the restart is deactivated, FB MON remains in the safe state if the EDM inputs do not have the signal state
"1".
An EDM error can therefore only be detected, when the manual restart is active.

NOTICE
EDM monitoring error
FB MON only reports an EDM error if manual restart is active. If manual restart is not active, the FB MON
remains in SAFE state if an EDM error is present.

The following inputs can be combined to pairs: MonIn1 / MonIn2, MonIn3 / MonIn4, Secure1 / Secure2. The
signal states of the two inputs may only deviate from each other within a configurable discrepancy time. If
this discrepancy time is exceeded for an input pair, the FB MON enters the error state (FB Error).

The error state can only be exited through acknowledgement via the ERR_ACK input of the associated
TwinSAFE group

In the FB error state, the outputs assume the safe state "0", only the Error output is "1".

The characteristics for acknowledging a discrepancy error can be set via the checkbox Safe Inputs after Disc
Error. If the checkbox is set, both inputs of the input group that has caused the discrepancy error have to
return logical zero simultaneously before the error can be reset.

The safe state must have been requested at least once on each active MonIn input after starting the FB
MON if the manual function test is active, before an edge of the restart input reacts.

4.5.2 Signal description


FB MON inputs
Offset Name Permitted type Data type Description
0.0 Restart TwinSAFE-In BOOL Manual restart active: When starting the FB or if an
FB-Out input has requested the safe state, the signal
Standard-In sequence 0->1->0 must be detected at the restart input
before the safe state of the outputs is exited.
Manual restart not active: This input is not used. Both
starting and exiting the safe state is carried out
automatically, as long as no input requests any longer
the safe state.
1.0 EDM1 TwinSAFE-In BOOL EDM1 is the feedback loop for the non-delayed output
FB-Out channel (MonOut). If this input is parameterized as
Standard-In active, the safe state of the outputs will only be exited,
when the EDM1 supplies the "1" signal.
2.0 EDM2 TwinSAFE-In BOOL EDM2 is the feedback loop for the delayed switching of
FB-Out the output channel (MonDelOut). If this input is
Standard-In parameterized as active, the safe state of the outputs
will only be exited, when the EDM2 supplies the "1"
signal.
8.0 MonIn1 TwinSAFE-In BOOL 1st input channel: The parameterization is used to
FB-Out specify whether a break contact (safe state is
requested at logic 0) or a make contact (safe state is
requested at logic 1) is linked to this input.
9.0 MonIn2 TwinSAFE-In BOOL 2nd input channel, behaves like MonIn1
FB-Out If the discrepancy time is activated or used, the 1st and
2nd input channels are considered to be the 1st input
pair and a discrepancy time monitoring is carried out
between both channels.
10.0 MonIn3 TwinSAFE-In BOOL 3rd input channel or 1st input channel of the 2nd input
FB-Out pair, otherwise corresponds with MonIn1

56 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Offset Name Permitted type Data type Description


11.0 MonIn4 TwinSAFE-In BOOL 4th input channel or 2nd input channel of the 2nd input
FB-Out pair, otherwise corresponds with MonIn2
12.0 Secure1 TwinSAFE-In BOOL Secure1 enabled: The evaluation of the MonIn(x)
FB-Out inputs can be switched off.
Parameterized as break contact: the inputs MonIn(x)
are ignored if Secure1 is "1". Parameterized as make
contact: the inputs MonIn(x) are ignored if Secure1 is
"0".
If the discrepancy time is not 0, Secure1 and Secure2
are considered as input pairs. The discrepancy time
between the two channels is monitored.
13.0 Secure2 TwinSAFE-In BOOL Secure2 is the 2nd channel of the input pair and
FB-Out otherwise corresponds to Secure1.

FB MON outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL TRUE:
FB-In The discrepancy time monitoring of an input pair, or
Standard-Out one of the feedback loops, has found an error. The
Local-Out error reset must be carried out via the ERR_ACK input
of the related TwinSAFE group.
FALSE:
No error was found.
1.0 MonOut TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out
Local-Out
2.0 MonDelOut TwinSAFE-Out BOOL 2nd output channel, the safe state corresponds to a
FB-In logical 0. The safe state is output with a delay, which
Standard-Out corresponds to the parameterized Delay Time.
Local-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
Local-Out TwinSAFE output at the KL6904 (not available for EL6900)

Internal identifier of the FB


Type Description
FB MON This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for FB MON

Diagnostic information (16-bit value)


Bit Description
0.0 Discrepancy error input group 1
1.0 Discrepancy error input group 2

TwinSAFE Logic FB Version: 4.1.0 57


Function blocks

Bit Description
2.0 Discrepancy error in Secure input group
4.0 EDM monitoring error EDM1
5.0 EDM monitoring error EDM2
8.0 Discrepancy error input group 1 with activated option "Safe Inputs after Disc Error" (set in addition to
bit 0)
9.0 Discrepancy error input group 2 with activated option "Safe Inputs after Disc Error" (set in addition to
bit 1)
10.0 Discrepancy error input group Secure with activated option "Safe Inputs after Disc Error" (set in
addition to bit 2)

Status information (8-bit value)


Value Description
1.0 RUN
The FB MON module assumes the RUN state if there is no error and neither the active MonIn inputs nor the active Secure
inputs request a safe state.
The outputs assume the following values:
Error=0
MonOut=1
MonDelOut=1
2.0 STOP
If the input FbRun=FALSE, the FB MON module assumes the STOP state.
The outputs assume the following values:
Error=0
MonOut=0
MonDelOut=0
3.0 SAFE
The FB MON module assumes the SAFE state as long as at least one of the active MonIn inputs and at least one of the
active Secure inputs has requested the safe state.
The outputs assume the following values:
Error=0
MonOut=0
MonDelOut=0
4.0 ERROR
If the FB MON module detects an error, the FB MON module switches to the ERROR state and transmits the corresponding
Diag message to the GROUP module.
The outputs assume the following values:
Error=1
MonOut=0
MonDelOut=0
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the associated group is set to TRUE, the FB
MON module assumes the RESET state.
The outputs assume the following values:
Error=0
MonOut=0
MonDelOut=0
6.0 START
The FB MON module assumes the START state if the Restart input is active and TRUE, in order to wait for a rising and falling
edge of the Restart input before entering the RUN state and the outputs leave the safe state. This state can only be assumed
if manual restart is active in the configuration data.
The outputs assume the following values:
Error=0
MonOut=0
MonDelOut=0
7.0 ERRORDELAY
The FB MON module assumes the ERRDELAY state if a discrepancy error occurs in the RUN state (DiscError=TRUE), but
the delay time for the MonDelOut output has not yet expired. This state can only be assumed if the Output Delay time in the
configuration data is not equal to 0.
The outputs assume the following values:
Error=0
MonOut=0
MonDelOut=1
8.0 DELAYOUT
The FB MON module assumes the DELAYOUT state if at least one of the active MonIn inputs and at least one of the active
Secure inputs has requested the safe state and the delay time for the MonDelOut output has not yet expired. This state can
only be assumed if the Output Delay time in the configuration data is not equal to 0.
The outputs assume the following values:

58 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
Error=0
MonOut=0
MonDelOut=1
9.0 FUNCTEST
The FB MON module assumes the FUNCTEST state if the manual function test is enabled in order to test all active MonIn
inputs once after startup. This state can only be assumed if the manual function test is active in the configuration data.
The outputs assume the following values:
Error=0
MonOut=0
MonDelOut=0

If the checkboxes 'Map State' and 'Map Diag' are checked, the status and diagnostic data of the FB are
copied to the cyclic process image.

NOTICE
KL6904
The checkboxes 'Map State', 'Map Diag' and 'Safe Inputs after Discrepancy Error' are not available in the
KL6904.

4.5.3 FB MON configuration in the TwinCAT System Manager

Fig. 39: FB MON configuration

The manual restart is activated using the "Manual" checkbox on the right near the 'Restart' button. The
'Restart' button can only be selected, if the manual restart is activated.
The characteristics of the input pair are configured with the setting buttons on the right near the two MonIn or
Secure inputs of an input pair. The 'MonIn(x)' and 'Secure(x)' buttons can only be selected if the
corresponding input has been activated via the Settings button. In the default state all inputs are disabled.

TwinSAFE Logic FB Version: 4.1.0 59


Function blocks

The corresponding feedback loop is activated using the 'Activated' checkbox on the right near the 'EDM(x)'
buttons. The 'EDM(x)' button can only be selected, if the associated feedback loop is activated.
The FB MON input variables are linked using the 'Restart', 'MonIn(x)', 'Secure(x)' and 'EDM(x)' buttons.
The manual function test is activated using the 'Manual Function Test' checkbox.

The FB MON output variables are linked using the 'Error', 'MonOut' and 'MonDelOut' buttons.
The delay time of the 'MonDelOut' output is configured via the selection box 'Delay-Time'.

The characteristics for acknowledging a discrepancy error can be set via the checkbox ‘Safe Inputs after
Disc Error’. If the checkbox is checked, both inputs of the input group that has caused the discrepancy error
have to switch to safe state simultaneously before the error can be reset.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.5.4 Restart behavior


If all active MonIn inputs and the active EDM inputs are TRUE and the Restart signal changes from FALSE
to TRUE, the Start state (FB state 6) is assumed. The detection of a change of the Restart signal from TRUE
to FALSE triggers a check whether all MonIn inputs are still TRUE and whether the EDM signal is still TRUE.
The output is enabled if these criteria are met and the function block is not in ERROR state.

NOTICE
Restart input
The function block expects a push button with make contact at the restart input.

CAUTION
Restart
If the risk and hazard analysis indicates that a restart is to be implemented in the safety controller, the
restart signal must be applied to a safe input.

Sample 1

The following diagram shows the behavior when an event is triggered via MonIn and subsequent
acknowledgement of the MON function block via the Restart input. At least one of the EDM inputs of the FB
is active.

60 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 40: Restart behavior MON (sample 1)

Sample 2

The following diagram shows the behavior of the MON function block; the rising edge of the Restart occurs
before the rising edge of the MonIn inputs. The Start state (FB state 6) is only assumed if both signals are
TRUE. The output is enabled with the falling edge at the Restart input. At least one of the EDM inputs of the
FB is active.

Fig. 41: Restart behavior MON (sample 2)

TwinSAFE Logic FB Version: 4.1.0 61


Function blocks

Sample 3

In the following diagram the Restart is set to TRUE before the MonIn event takes place. With the falling edge
of the MonIn input, the EDM signal is immediately checked due to the Restart input signal. This immediately
leads to an EDM error and to the shutdown of the entire TwinSAFE group. At least one of the EDM inputs of
the FB is active.

Fig. 42: Restart behavior MON (sample 3)

4.5.5 MON extension


NOTICE
Support
The extensions described below are only available in the EL6910 or newer terminals. These options cannot
be used under the EL6900 and KL6904.

Fig. 43: EDM Reset Time

The FB MON can also be used to monitor the change of the state of the feedback signal (EDMn) when the
outputs are switched on.

The inputs EDM1 and EDM2 have been assigned a further parameter Reset Time (ms). Open the properties
of the EDMx by right-clicking on the EDMx input of the MON function block. If this value is not equal to 0, the
timer is started when the output MonOut is activated. If the EDM input does not switch to FALSE within this
time, a function block error is set and the outputs are switched off.

62 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

This function can be switched off by entering 0 as Reset Time (ms).

4.5.6 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

Fig. 44: FB MON in TwinCAT 3

Fig. 45: FB MON properties

The function Safe Inputs after Disc Error is activated by default for the MON function block in the EL6910
and cannot be disabled. The display of the corresponding parameter and its value only applies if the function
block is used on an EL6900; it can be ignored for the EL6910. A warning is issued if the parameter is set to
TRUE under an EL6910.

TwinSAFE Logic FB Version: 4.1.0 63


Function blocks

4.6 The function block DECOUPLE

4.6.1 Functional description


The FB DECOUPLE is for uncoupling of signals from a TwinSAFE connection. The function block has 8
inputs and 8 outputs. The inputs are looped through to the outputs one-to-one. The associated output must
be linked as soon as one of the function block inputs is used. The converse is also valid.

Fig. 46: Function block DECOUPLE

A TwinSAFE connection to a TwinSAFE I/O terminal is always assigned to a TwinSAFE group. Via the FB
DECOUPLE it is possible to pass on the signals of a TwinSAFE connection to other TwinSAFE groups and
thus decouple them.
The function block within an existing TwinSAFE group can be used to subdivide the signals.

The function block must be used in a separate TwinSAFE group in case the signals should be decoupled,
since all used outputs of the TwinSAFE group can be switched off in case of a connection communication
error.
The input signals of a TwinSAFE connection can now be linked with the FB DECOUPLE inputs, and the
outputs distributed over the different TwinSAFE groups. It operates the same way in the other directions, the
outputs of a TwinSAFE connection are linked with the FB DECOUPLE outputs, the FB DECOUPLE inputs
can once again come from various TwinSAFE groups.

4.6.2 Signal description


FB DECOUPLE inputs
Offset Name Permitted type Data type Description
8.0 DecIn1 TwinSAFE-In BOOL 1st input channel
FB-Out

64 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Offset Name Permitted type Data type Description


9.0 DecIn2 TwinSAFE-In BOOL 2nd input channel
FB-Out
10.0 DecIn3 TwinSAFE-In BOOL 3rd input channel
FB-Out
11.0 DecIn4 TwinSAFE-In BOOL 4th input channel
FB-Out
12.0 DecIn5 TwinSAFE-In BOOL 5th input channel
FB-Out
13.0 DecIn6 TwinSAFE-In BOOL 6th input channel
FB-Out
14.0 DecIn7 TwinSAFE-In BOOL 7th input channel
FB-Out
15.0 DecIn8 TwinSAFE-In BOOL 8th input channel
FB-Out

FB DECOUPLE outputs
Offset Name Permitted type Data type Description
8.0 DecOut1 TwinSAFE-Out BOOL 1st output channel
FB-In
Standard-Out
Local-Out
9.0 DecOut2 TwinSAFE-Out BOOL 2nd output channel
FB-In
Standard-Out
Local-Out
10.0 DecOut3 TwinSAFE-Out BOOL 3rd output channel
FB-In
Standard-Out
Local-Out
11.0 DecOut4 TwinSAFE-Out BOOL 4th output channel
FB-In
Standard-Out
Local-Out
12.0 DecOut5 TwinSAFE-Out BOOL 5th output channel
FB-In
Standard-Out
Local-Out
13.0 DecOut6 TwinSAFE-Out BOOL 6th output channel
FB-In
Standard-Out
Local-Out
14.0 DecOut7 TwinSAFE-Out BOOL 7th output channel
FB-In
Standard-Out
Local-Out
15.0 DecOut8 TwinSAFE-Out BOOL 8th output channel
FB-In
Standard-Out
Local-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output

TwinSAFE Logic FB Version: 4.1.0 65


Function blocks

Type Description
TwinSAFE- TwinSAFE output, e.g. on an EL2904/KL2904
Out
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
Local-Out TwinSAFE output at the KL6904 (not available for EL6900)

Internal identifier of the FB


Type Description
FB This description applies to BLG 1.0 (internal version number)
DECOUPLE

Diagnostic and status information for FB DECOUPLE

Diagnostic information (16-bit value)


Bit Description
0.0 always 0

Status information (8-bit value)


Value Description
1.0 RUN
If the input FbRun=TRUE, the FB DECOUPLE module assumes the state RUN.
The outputs assume the following values:
DcOutX=DcInX
2.0 STOP
If the input FbRun=FALSE, the FB DECOUPLE module assumes the STOP state.
The outputs assume the following values:
DcOutX=0

If the checkboxes 'Map State' and 'Map Diag' are checked, the status and diagnostic data of the FB are
copied to the cyclic process image.

NOTICE
KL6904
The checkboxes 'Map State' and 'Map Diag' are not available for the KL6904.

66 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.6.3 FB DECOUPLE configuration in the TwinCAT System


Manager

Fig. 47: FB DECOUPLE configuration

The FB DECOUPLE input variables are linked using the 'DecIn(x)' buttons.

The FB DECOUPLE output variables are linked using the 'DecOut(x)' buttons.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

The FB DECOUPLE does not supply any error information and therefore the error button is basically
deactivated.

4.6.4 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

TwinSAFE Logic FB Version: 4.1.0 67


Function blocks

Fig. 48: FB DECOUPLE in TwinCAT 3

Fig. 49: FB DECOUPLE properties

4.7 The function block TWOHAND

4.7.1 Functional description


The FB TWOHAND implements two-hand control. Both input groups must be actuated simultaneously to
switch the output. Repeated setting of the output is only possible if both input groups were not actuated at
the same time.

Each input group can be configured as a single-channel input, two-channel input or two-channel input with
discrepancy time monitoring. In addition, time monitoring up to 2500 ms between the two input groups can
be defined.
Each input can be configured as break contact (NC) or make contact (NO).

68 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 50: Function block TWOHAND

NOTICE
KL6904
The TWOHAND function block is not available in the KL6904.

4.7.2 Signal description


FB TWOHAND inputs
Offset Name Permitted type Data type Description
8.0 Twohand1 TwinSAFE-In BOOL 1st input channel. The parameterization determines,
FB-Out whether the input is linked to a break contact (safe
state will be requested by logical 0) or make contact
(safe state will be requested by logical 1).
9.0 Twohand2 TwinSAFE-In BOOL 2nd input channel, behavior like Twohand1
FB-Out If the discrepancy time is not equal to 0, the 1st and
2nd input channels are regarded as the 1st input pair
and discrepancy time monitoring is performed between
the two channels if one of the two input channels
requests the safe state
10.0 Twohand3 TwinSAFE-In BOOL 3rd input channel or 1st input channel of the 2nd input
FB-Out pair, otherwise corresponds with Twohand1
11.0 Twohand4 TwinSAFE-In BOOL 4th input channel or 2nd input channel of the 2nd input
FB-Out pair, otherwise corresponds with Twohand2

TwinSAFE Logic FB Version: 4.1.0 69


Function blocks

FB TWOHAND outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL TRUE:
FB-In The discrepancy time monitoring for a two-channel
Standard-Out input group has detected an error. The error must be
acknowledged via the ERR_ACK input of the
corresponding TwinSAFE group
FALSE:
No error was found
1.0 TwoHandOut TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB Twohand This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for FB TWOHAND

Diagnostic information (16-bit value)


Bit Description
0.0 Discrepancy error input pair 1
1.0 Discrepancy error input pair 2
2.0 Discrepancy error between the two input pairs
6.0 Two-hand error - one of the two input pairs is actuated and waiting for the second input pair. The
error is output if the second input pair is now actuated and the first input pair is no longer detected
as actuated.
8.0 Discrepancy error input pair 1 with enabled option "Safe Inputs after Disc Error" (set in addition to bit
0) (not EL6900/KL6904)
9.0 Discrepancy error input pair 2 with enabled option "Safe Inputs after Disc Error" (set in addition to bit
1) (not EL6900/KL6904)
10.0 Discrepancy error between the input pairs with enabled option "Safe Inputs after Disc Error" (set in
addition to bit 2) (not EL6900/KL6904)

Status information (8-bit value)


Value Description
1.0 RUN
The FB TWOHAND module assumes the RUN state if all active inputs are TRUE. The FB
TWOHAND module can only assume the RUN state from one of the states 1BUTTON or
2BUTTON.
The outputs assume the following values:
Error=0
TwoHandOut=1

70 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
2.0 STOP
If the input FbRun=FALSE, the FB TWOHAND module assumes the STOP state.
The outputs assume the following values:
Error=0
TwoHandOut=0
3.0 SAFE
The FB TWOHAND module assumes the SAFE state if all active inputs are FALSE. If all active
inputs of an input group are TRUE, the FB TWOHAND module leaves the SAF state.
The outputs assume the following values:
Error=0
TwoHandOut=0
4.0 ERROR
If the FB TWOHAND module detects an error, the FB TWOHAND module switches to the ERROR
state and transfers the corresponding diag message to the GROUP module.
The outputs assume the following values:
Error=1
TwoHandOut=0
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the associated
group is set to TRUE, the FB TWOHAND module assumes the RESET state.
The outputs assume the following values:
Error=0
TwoHandOut=0
11.0 1BUTTON
If all active inputs of the first input group are TRUE and at least one active input of the second input
group is FALSE, the FB TWOHAND module assumes the 1BUTTON state. The FB TWOHAND
module only assumes the 1BUTTON state from the SAF state.
The outputs assume the following values:
Error=0
TwoHandOut=0
12.0 2BUTTON
If all active inputs of the second input group are TRUE and at least one active input of the first input
group is FALSE, the FB TWOHAND module assumes the 2BUTTON state. The FB TWOHAND
module only assumes the 2BUTTON state from the SAF state.
The outputs assume the following values:
Error=0
TwoHandOut=0
13.0 RELEASE
If at least one active input is FALSE, the FB TWOHAND module assumes the RELEASE state. If all
active inputs are FALSE, the FB TWOHAND module leaves the RELEASE state.
The outputs assume the following values:
Error=0
TwoHandOut=0

TwinSAFE Logic FB Version: 4.1.0 71


Function blocks

4.7.3 FB TWOHAND configuration in the TwinCAT System Manager

Fig. 51: FB TWOHAND configuration

Discrepancy time monitoring between the two input pairs is activated via the 'Discrepancy' checkbox. The
discrepancy time can be set in the selection box next to the checkbox (max. 2500 ms).

The characteristics of the input pair are configured with the setting buttons on the right near the two
TwoHand(x) inputs of an input pair. The 'TwoHand(x)' buttons are only available once the corresponding
input was activated. In delivery state are all inputs are disabled.

The FB TWOHAND input variables are linked using the 'TwoHand(x)' buttons.

The buttons 'Error' and 'TwoHandOut' are used to link the output variables of FB TWOHAND.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.7.4 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

72 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 52: FB TWOHAND in TwinCAT 3

Fig. 53: FB TWOHAND properties

4.8 The function block MUTING

4.8.1 Functional description


FB MUTING is used to realize specified suppression of the protective function, e.g. for transporting material
into the protection area. The function block output remains enabled despite the fact that the connected
sensor (e.g. light curtain) is interrupted. The process is monitored with the aid of muting sensors. The
MUTING inputs are used to verify that they are operated in a defined order.

MUTING can be enabled via the Enable input. If the input is logic 0 an interruption of the protective device
results in immediate shutdown of the FB output. If the input is logical 1 the only takes place if the MUTING
sequence is violated.
The 'Sequential Inputs' checkbox can be used to specify whether 2 inputs are checked in parallel or whether
each input is checked sequentially.
A filter time up to 500 ms can be set for the MUTING inputs in order to prevent bouncing of the MUTING
signals and therefore violation of the MUTING sequence.
The maximum duration of the MUTING process can be monitored via the 'Max. MUTINGTime' parameter.
The MUTING process starts with a logic 1 signal of the first MUTING input and ends with the logic 0 signal of

TwinSAFE Logic FB Version: 4.1.0 73


Function blocks

the last MUTING input. The value can be configured to a maximum of 10 minutes. The value 0 disables the
monitoring.
The 'MutingActive' output of the function block is set during the MUTING process.
The protective device (AOPD - Active Opto-electronic Protection Device, for example a light curtain), is
connected at the OSSDIn(x) inputs.
Feedback signals can be connected at the EDM inputs. In the default setting the inputs are disabled.
Direct outputs are connected via the ‘MuteOut’ button, outputs that are delayed by up to 30 seconds via the
‘MuteDelOut’ button.

Fig. 54: Function block MUTING

NOTICE
KL6904
The MUTING function block is not available in the KL6904.

4.8.2 Signal description


FB MUTING inputs
Offset Name Permitted type Data type Description
0.0 MutingEnabl TwinSAFE-In BOOL Muting can be enabled via the Enable input. If the input
e FB-Out is logic 0 an interruption of the protective device results
Standard-In in immediate shutdown of the FB output.
1.0 EDM1 TwinSAFE-In BOOL EDM1 is the feedback loop for the output channel
FB-Out (MuteOut), which is switched off immediately. If this
Standard-In input as activated, the safe output state is only exited
when EDM1 is set to 1
2.0 EDM2 TwinSAFE-In BOOL EDM2 is the feedback loop for the output channel
FB-Out (MuteDelOut), which is switched off with a delay. If this
Standard-In input as activated, the safe output state is only exited
when EDM2 is set to 1

74 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Offset Name Permitted type Data type Description


8.0 MutingIn1 TwinSAFE-In BOOL The muting inputs are used to verify that they are
FB-Out operated in a defined order.
1st input channel. The parameterization is used to
specify whether the input has to be negated or is used
directly.
9.0 MutingIn2 TwinSAFE-In BOOL 2nd input channel, behavior like MutingIn1
FB-Out If the discrepancy time is not equal to 0, the 1st and
2nd input channels are regarded as the 1st input group
and discrepancy time monitoring takes place between
the two channels if one of the two input channels
requests the safe state
10.0 OSSDIn1 TwinSAFE-In BOOL The protective device (AOPD - Active Opto-electronic
FB-Out Protection Device), for example a light curtain, is
connected at the 'OSSDIn' inputs.
1st input channel. The parameterization is used to
specify whether the input has to be negated or is used
directly.
11.0 OSSDIn2 TwinSAFE-In BOOL OSSDIn2 is the 2nd channel for the protective device
FB-Out and otherwise corresponds to OSSDIn1
If the discrepancy time is not 0, the 1st and 2nd OSSD
inputs are considered as 1 input pair. Discrepancy time
monitoring between the two channels is active if one of
the two input channels requests the safe state.
12.0 MutingIn3 TwinSAFE-In BOOL 3rd input channel or 1st input channel of the 2nd input
FB-Out group, otherwise corresponds with MutingIn1
13.0 MutingIn4 TwinSAFE-In BOOL 4th input channel or 2nd input channel of the 2nd input
FB-Out group, otherwise corresponds with MutingIn2

FB MUTING outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL TRUE:
FB-In The discrepancy time monitoring of a 2-channel input
Standard-Out group has detected an error, the muting sequence was
violated or the maximum muting time was exceeded.
The error reset must be carried out via the ERR_ACK
input of the related TwinSAFE group.
FALSE:
No error was found
1.0 MutingActive TwinSAFE-Out BOOL 1st output channel, indicates the active muting process
FB-In through logic 1.
Standard-Out
2.0 MuteOut TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out
3.0 MuteDelOut TwinSAFE-Out BOOL 2nd output channel, the safe state corresponds to a
FB-In logical 0. The safe state is output with a delay, which
Standard-Out corresponds to the parameterized Output Delay Time

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)

TwinSAFE Logic FB Version: 4.1.0 75


Function blocks

Type Description
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB MUTING This description applies to BLG 1.0 / BLG 2.0 (internal version number)

Diagnostic and status information for FB MUTING

Diagnostic information (16-bit value)


Bit Description
0.0 Discrepancy error in muting input group 1
1.0 Discrepancy error in the OSSD input group
2.0 Discrepancy error in muting input group 2
4.0 EDM monitoring error EDM1
5.0 EDM monitoring error EDM2
6.0 Muting sequence was violated
7.0 Maximum muting time was exceeded
8.0 Discrepancy error MuteIn1/MuteIn2 has not yet been reset (not EL6900)
9.0 Discrepancy error OssdIn1/OssdIn2 has not yet been reset (not EL6900)
10.0 Discrepancy error MuteIn3/MuteIn4 has not yet been reset (not EL6900)

Status information (8-bit value)


Value Description
1.0 RUN
If OssdInActive=TRUE and MutingEnable=FALSE or no muting sequence has yet been started, the FB MUTING module
assumes the RUN state.
The outputs assume the following values:
Error=0
MutingActive=0
MuteOut=1
MuteDelOut=1
2.0 STOP
If the input FbRun=FALSE, the FB MUTING module assumes the STOP state.
The outputs assume the following values:
Error=0
MutingActive=0
MuteOut=0
MuteDelOut=0
3.0 SAFE
If OssdInActive=FALSE and MutingEnable=FALSE, the FB MUTING module assumes the state SAFE.
The outputs assume the following values:
Error=0
MutingActive=0
MuteOut=0
MuteDelOut=0
4.0 ERROR
If the FB MUTING module detects an error, the FB MUTING module switches to the ERROR state and transmits the
corresponding Diag message to the GROUP module.
The outputs assume the following values:
Error=1
MutingActive=0
MuteOut=0
MuteDelOut=0
5.0 RESET
If no more errors are present after an error has occurred and the ErrAck input of the associated group is set to TRUE, the FB
MUTING module assumes the RESET state.
The outputs assume the following values:
Error=0
MutingActive=0
MuteOut=0
MuteDelOut=0

76 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
8.0 DELAYOUT
The FB MUTING module assumes the DELAYOUT state if OssdInActive is FALSE and MutingEnable is FALSE and the delay
time for the MuteDelOut output has not yet expired. If a discrepancy error occurs in the DELAYOUT state, the FB MUTING
module only assumes the ERROR state after the output delay time has elapsed.
The outputs assume the following values:
Error=0
MutingActive=0
MuteOut=0
MuteDelOut=1
9.0 MUTING1 (figure 3-35 [} 78] number 2-3)
The outputs assume the following values:
Error=0
MutingActive=1
MuteOut=1
MuteDelOut=1
10.0 MUTING2 (figure 3‑35 [} 78] number 3-4)
Outputs see State 9
11.0 MUTING3 (figure 3-35 [} 78] number 4-5)
Outputs see State 9
12.0 MUTING4 (figure 3-35 [} 78] number 5-6)
Outputs see State 9
13.0 MUTING5 (figure 3-35 [} 78] number 6-7)
Outputs see State 9
14.0 MUTING6 (figure 3-35 [} 78] number 7-8)
Outputs see State 9
15.0 MUTING7 (figure 3-35 [} 78] number 8-9)
Outputs see State 9
16.0 MUTING8 (figure 3-35 [} 78] number 9-10)
Outputs see State 9
17.0 MUTING9 (figure 3-35 [} 78] number 10-11)
Outputs see State 9

4.8.3 FB MUTING configuration in the TwinCAT System Manager

Fig. 55: FB MUTING configuration

TwinSAFE Logic FB Version: 4.1.0 77


Function blocks

An input through which MUTING can be enabled must be connected via the 'Enable' button.

The 'MUTING(x)' buttons are used to connect the MUTING sensors to the function block. Use the Settings
buttons to the right of two MUTING inputs to configure them. The 'MUTING (x)' buttons can only be selected
when the corresponding input has been activated. All inputs are deactivated in the default setting.

Two-channel evaluation with or without discrepancy time monitoring can be set if the checkbox “Sequential
Inputs” is not set. If the "Sequential Inputs" checkbox is set, only single-channel evaluation can be configured
via the Settings button. In addition, each input can be configured as a break contact (NC) or as a make
contact (NO).

The maximum permitted MUTING period can be set via the 'Max. MUTING Time' text box. If this time
exceeded the function block switches to ERROR state. The maximum MUTING period is 10 minutes. It the
value is set to 0 minutes, monitoring is disabled.

A filter time up to 500 ms can be activated for the MUTING(x) inputs via the "Filtertime MUTING Inputs"
checkbox.

The 'OSSDIn(x)' inputs are connected with the signals from the protective device. Use the Settings button to
the right of the OSSDIn inputs to configure them. The setting options include single- or two-channel
evaluation or two-channel evaluation with discrepancy time monitoring.

Direct outputs are connected via the 'MuteOut' button, delayed outputs via the 'MuteDelOut' button. The
delay time of the 'MuteDelOut' output is configured via the selection box 'Delay-Time'.

The corresponding feedback loop is active using the 'Activated' checkbox on the right near the 'EDM(x)'
buttons. The 'EDM(x)' button can only be selected, if the associated feedback loop is activated.

The error state can be connected via the 'Error' button.

NOTICE
Error state
If the MUTING function was interrupted by an error, the user should ensure via the application that the
material can be removed from the MUTING area. Only then is an error acknowledgement possible.

Via the 'MutingActive' button a signal can be linked that can be used for a MUTING lamp, for example.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.8.3.1 Configuration example with 4 individual MUTING sensors

Fig. 56: Configuration example with 4 individual MUTING sensors

The following screenshot shows the parameterization of FB MUTING for this case. The 'Sequential Inputs'
checkbox is checked. The 4 MUTING inputs are configured and wired as single-channel inputs.

78 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 57: Parameterization of the FB MUTING for 4 individual MUTING sensors

Fig. 58: Sequence for 4 individual MUTING sensors

TwinSAFE Logic FB Version: 4.1.0 79


Function blocks

4.8.3.2 Configuration example with two two-channel MUTING sensors

Fig. 59: Configuration example with two two-channel MUTING sensors

The following screenshot shows the parameterization of FB MUTING for this case. The 'Sequential Inputs'
checkbox is not checked. The 4 MUTING inputs are configured and wired as two-channel inputs with
discrepancy time monitoring.

Fig. 60: Parameterization of the FB MUTING for 2 two-channel MUTING sensors

80 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 61: Parameterization for 2 two-channel MUTING sensors

4.8.4 Extensions FB Muting EL/EJ6910


NOTICE
Support
The extensions described below are only available in the EL6910 or newer terminals. These options cannot
be used under the EL6900 and KL6904.

Fig. 62: EL6910 FB MUTING

TwinSAFE Logic FB Version: 4.1.0 81


Function blocks

In addition to existing the options, the following additional functions are now available:

Option Backwards Mode:


If the option is active, a MUTING sequence is supported in forward and backward direction. If muting sensor
MUTING4 is actuated first, backward direction is assumed, forward direction for MUTING1. A MUTING
sequence must be completed before a new sequence (perhaps in the other direction) can be started.

Option OSSD Check Optional:


This option is used to remove the light curtain from the sequence check. In this case only the muting sensors
Muting1 to Muting4 are checked. The light curtain can be operated at any point within the sequence.

Wiring function change:


If the Sequential Inputs option is active, it is possible to leave the MUTING3 and MUTING4 inputs inactive/
unconnected. Provided the inputs MUTING, MUTING2, OSSD1 and OSSD2 are connected.

Diagnostic and status information for FB MUTING with functional expansion

Diagnostic information (16-bit value)


Bit Description
0.0 Discrepancy error in muting input group 1
1.0 Discrepancy error in the OSSD input group
2.0 Discrepancy error in muting input group 2
4.0 EDM monitoring error EDM1
5.0 EDM monitoring error EDM2
6.0 Muting sequence was violated
7.0 Maximum muting time was exceeded
8.0 Discrepancy error in muting input group 1 was not yet reset
9.0 Discrepancy error in OSSD input group was not yet reset
10.0 Discrepancy error in muting input group 2 was not yet reset

Status information (8-bit value)


Value Description (see Table 3‑48)
1.0 RUN
2.0 STOP
3.0 SAFE
4.0 ERROR
5.0 RESET
8.0 DELAYOUT
9.0 MUTING1 (figure 3‑35 [} 78] number 2-3)
10.0 MUTING2 (figure 3‑35 [} 78] number 3-4)
11.0 MUTING3 (figure 3‑35 [} 78] number 4-5)
12.0 MUTING4 (figure 3‑35 [} 78] number 5-6)
13.0 MUTING5 (figure 3‑35 [} 78] number 6-7)
14.0 MUTING6 (figure 3‑35 [} 78] number 7-8)
15.0 MUTING7 (figure 3‑35 [} 78] number 8-9)
16.0 MUTING8 (figure 3‑35 [} 78] number 9-10)
17.0 MUTING9 (figure 3‑35 [} 78] number 10-11)

4.8.5 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

82 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 63: FB MUTING in TwinCAT 3

Fig. 64: FB MUTING properties

4.9 The function block EDM

4.9.1 Functional description


The FB EDM (External Device Monitor) is used for time monitoring of signals Mon1 and Mon2. Switch-on
and switch-off monitoring can be configured. In default state both monitoring functions are inactive. At least
one of the two monitoring functions must be enabled.

TwinSAFE Logic FB Version: 4.1.0 83


Function blocks

Switch-on monitoring checks whether signal Mon2 is set to 0 within the set time (maximum 10000 ms)
following a switch from 0 to 1 of signal Mon1.

Switch-off monitoring checks whether signal Mon2 is set to 1 within the set time (maximum 10000 ms)
following a switch from 1 to 0 of signal Mon1.

If the set monitoring time is exceeded, the FB EDM enters the error state (FbError) and sets the Error output
to 1. The error state can only be exited again by means of an acknowledgement via the ERR_ACK input of
the associated TwinSAFE group.

Fig. 65: Function block EDM

NOTICE
KL6904
The EDM function block is not available in the KL6904.

4.9.2 Signal description


FB EDM inputs
Offset Name Permitted type Data type Description
8.0 Mon1 TwinSAFE-In BOOL 1st input. The input can be parameterized as a break
FB-Out contact or a make contact.
Standard-In
9.0 Mon2 TwinSAFE-In BOOL 2nd input, which has to assume the value opposite to
FB-Out input 1 within the set times.
Standard-In

84 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

FB EDM outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL TRUE:
FB-In SwitchOn or SwitchOff times were exceeded.
Standard-Out FALSE:
No error occurred.

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE- TwinSAFE output, e.g. on an EL2904/KL2904
Out
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB EDM This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for FB EDM

Diagnostic information (8-bit value)


Bit Description
0.0 Switch-OFF timer elapsed
1.0 Switch-ON timer elapsed

Status information (8-bit value)


Value Description
2.0 STOP
If the input FbRun=FALSE, the FB EDM module assumes the STOP state.
The outputs assume the following values:
Error=0
4.0 ERROR
If the FB EDM module detects an error, the FB EDM module switches to the ERROR state
and transmits the corresponding diag message to the GROUP module.
The outputs assume the following values:
Error=1
5.0 RESET
The FB EDM module assumes the RESET state if no further error is pending after an error
has occurred and the ErrAck input of the corresponding group is set to TRUE.
The outputs assume the following values:
Error=0
14.0 MONOFF
If the input MonIn1=FALSE, the FB EDM module assumes the MONOFF state in order to
carry out switch-off monitoring.
The outputs assume the following values:
Error=0

TwinSAFE Logic FB Version: 4.1.0 85


Function blocks

Value Description
15.0 MONON
If the input MonIn1=TRUE, the FB EDM module assumes the MONON state in order to
carry out switch-on monitoring.
The outputs assume the following values:
Error=0

4.9.3 FB EDM configuration in the TwinCAT System Manager

Fig. 66: FB EDM configuration

The FB EDM input variables are linked using the 'Mon1' and 'Mon2' buttons.

Use the Settings button to right or the two Mon inputs to configure them. Only single-channel evaluation is
available. In addition the inputs can be configured as make contact (NO) or break contact (NC). In the default
state all inputs are disabled.

Use the ‘Switch-On Monitoring’ and ‘Switch-Off Monitoring’ selection boxes to set the switch-on and switch-
off delay time. Use the checkboxes to the left of the text fields to activate the corresponding monitoring time.
Both are disabled in the default state.

Use the 'Error' button to transfer a function block error to the connected output variable. In online mode the
state and error IDs are filled with corresponding information.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.9.4 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

86 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 67: FB EDM in TwinCAT 3

Fig. 68: FB EDM properties

The 'Switch-On Monitoring' and 'Switch-Off Monitoring' text boxes can be used to set the switch on- and
switch-off delay time. Monitoring is disabled if the value is set to 0 ms.

4.10 The function block RS

4.10.1 Functional description


The FB RS realizes a reset / set functionality.
Logic 1 at input Set and logic 0 at input Reset leads to logic 1 at the output.
Logic 0 at input Set and logic 1 at input Reset leads to logic 0 at the output.
If both inputs are set to logic 1, the Reset signal is dominant and leads to logic 0 at the output.
If both inputs are logic 0, the output remains in its current state.

TwinSAFE Logic FB Version: 4.1.0 87


Function blocks

Fig. 69: Function block RS

NOTICE
KL6904
The RS function block is not available in the KL6904.

4.10.2 Signal description


FB RS inputs
Offset Name Permitted type Data type Description
8.0 Reset TwinSAFE-In BOOL 1st input channel; the parameterization indicates
FB-Out whether a break contact or a make contact is linked to
this input.
9.0 Set TwinSAFE-In BOOL 2nd input channel; the parameterization indicates
FB-Out whether a break contact or a make contact is linked to
this input.

FB RS outputs
Offset Name Permitted type Data type Description
1.0 RsOut TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out

88 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

FB RS input and output types

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB RS This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for FB RS

Diagnostic information (16-bit value)


Bit Description
0.0-15.0 always 0

Status information (8-bit value)


Value Description
2.0 STOP
If the input FbRun=FALSE, the FB RS module assumes the STOP state.
The outputs assume the following values:
RsOut=0
3.0 SAFE
If the Reset input is 1, the FB RS module assumes the SAF state.
The outputs assume the following values:
RsOut=0
9.0 SET
If the Reset input is 0 and the Set input is 1, the FB RS module assumes the RUN state.
The outputs assume the following values:
RsOut=1

TwinSAFE Logic FB Version: 4.1.0 89


Function blocks

4.10.3 FB RS configuration in the TwinCAT System Manager

Fig. 70: FB RS configuration

Use the Settings button to the right of the Reset and Set inputs to activate the input signals and configure
them as make contact (NO) or break contact (NC). Both inputs are deactivated in the default state.

The 'Reset' and 'Set' buttons can be used to link the input variables of the FB RS.

The 'RsOut' button can be used to link the output variable of the FB RS.

The error output is inactive since FB RS reports no error.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.10.4 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

Fig. 71: FB RS in TwinCAT 3

90 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 72: FB RS properties

4.11 The function block SR

4.11.1 Functional description


The FB SR realizes a set / reset functionality.
Logic 1 at input Set and logic 0 at input Reset leads to logic 1 at the output.
Logic 0 at input Set and logic 1 at input Reset leads to logic 0 at the output.
If both inputs are set to logic 1, the Set signal is dominant and leads to logic 1 at the output.
If both inputs are logic 0, the output remains in its current state.

Fig. 73: Function block SR

TwinSAFE Logic FB Version: 4.1.0 91


Function blocks

NOTICE
KL6904
The SR function block is not available in the KL6904.

4.11.2 Signal description


FB SR inputs
Offset Name Permitted type Data type Description
8.0 Reset TwinSAFE-In BOOL 2nd input channel; the parameterization indicates
FB-Out whether a break contact or a make contact is linked to
this input.
9.0 Set TwinSAFE-In BOOL 1st input channel; the parameterization indicates
FB-Out whether a break contact or a make contact is linked to
this input.

FB SR outputs
Offset Name Permitted type Data type Description
1.0 SrOut TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out

FB SR input and output types

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB SR This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for FB SR

Diagnostic information (16-bit value)


Bit Description
0.0-15.0 always 0

Status information (8-bit value)


Value Description
2.0 STOP
If the input FbRun=FALSE, the FB SR module assumes the STOP state.
The outputs assume the following values:
SrOut=0

92 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
3.0 SAFE
If the Reset input is 1 and the Set input is 0, the FB SR module assumes the SAF
state.
The outputs assume the following values:
SrOut=0
9.0 SET
If the Set input is 1, the FB SR module assumes the SET state.
The outputs assume the following values:
SrOut=1

4.11.3 FB SR configuration in the TwinCAT System Manager

Fig. 74: FB SR configuration

Use the Settings button to the right of the Reset and Set inputs to activate the input signals and configure
them as make contact (NO) or break contact (NC). In the default state both inputs are disabled.

The 'Reset' and 'Set' buttons can be used to link the input variables of the FB RS.

The 'SrOut' button can be used to link the output variable of the FB RS.

The error output is inactive since FB SR reports no error.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.11.4 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

TwinSAFE Logic FB Version: 4.1.0 93


Function blocks

Fig. 75: FB SR in TwinCAT 3

Fig. 76: FB SR properties

4.12 The function block TON

4.12.1 Functional description


FB TON is used to realize a switch-on delay. Logic 1 at input TONIn is transferred to the output with a set
delay time. The output is not activated if the input is set to 0 again before the delay time has elapsed.
The error output is inactive since the function block sets no errors.

The maximum switch-on delay is 6000 x 100 ms (10 minutes).

94 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 77: Function block TON

NOTICE
KL6904
The TON function block is not available in the KL6904.

4.12.2 Signal description


FB TON inputs
Offset Name Permitted type Data type Description
8.0 TonIn1 TwinSAFE-In BOOL 1st input channel; the parameterization indicates
FB-Out whether a break contact or a make contact is linked to
this input.

FB TON outputs
Offset Name Permitted type Data type Description
1.0 TonOut TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE- TwinSAFE output, e.g. on an EL2904/KL2904
Out

TwinSAFE Logic FB Version: 4.1.0 95


Function blocks

Type Description
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB TON This description applies to BLG 3.0 (internal version number)

Diagnostic and status information for FB TON

Diagnostic information (16-bit value)


Bit Description
0.0-15.0 always 0

Status information (8-bit value)


Value Description
1.0 RUN
If the TimerIn input is 1 and the delay time has expired (DelayTimeExpired=TRUE), the FB
TON module assumes the RUN state.
The outputs assume the following values:
TimerOut=1
2.0 STOP
If the input FbRun=FALSE, the FB TON module assumes the STOP state.
The outputs assume the following values:
TimerOut=0
3.0 SAFE
If the TimerIn input is 0, the FB TON module assumes the SAFE state. If the TimerIn input
changes to 1 in the SAFE state, the FB TON module starts the delay timer with the
DelayTime and changes to the DELAYIN state.
The outputs assume the following values:
TimerOut=0
9.0 DELAYIN
If the TimerIn input is 1 and the delay time has not yet expired (DelayTimeExpired=FALSE),
the FB TON module assumes the DELAYIN state.
The outputs assume the following values:
TimerOut=0

96 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.12.3 FB TON configuration in the TwinCAT System Manager

Fig. 78: FB TON configuration

Use the Settings button to the right of the 'TonIn' button to configure the input as make (NO) or break contact
(NC). The input is deactivated in the default state.
The 'TonIn' button is used to link the input variable of the FB TON.
The 'TonOut' button is used to link the switch-on-delayed output variable of the FB TON.
Use the text box to set the switch-on delay time. The smallest unit is 0.1 s.

The error output is inactive since FB TON reports no error.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.12.4 TON extension


NOTICE
Support
The extensions described below are only available in the EL6910 or newer terminals. These options cannot
be used under the EL6900 and KL6904.

In the EL6910 the FB TON now also supports times between 1 ms and 600 seconds. The function block has
two timebases: 1 ms and 10 ms.
With a timebase of 1 ms the maximum time is 60,000 ms in 1 ms steps.
With a timebase of 10 ms the maximum time is 600,000 ms in 10 ms steps.
The timebase is automatically selected in TC3.1 Safety Editor according to the set time.

NOTICE
FB TON and FB TON2 extension (software 04 - EL6910)
From software version 04 of the EL6910 and newer TwinSAFE Logic components, the FB TON also
supports the timebases of 100 ms and 1000 ms. Switch-on delays of up to 60,000 s can thus be set.

TwinSAFE Logic FB Version: 4.1.0 97


Function blocks

4.12.5 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

Fig. 79: FB TON in TwinCAT 3

Fig. 80: FB TON properties

4.13 The function block TON2

4.13.1 Functional description


The FB TON2 behaves in the same way as the FB TON (see chapter 3.12) but is extended by a feature
which stores the current timer time value on the TwinSafe Logic, so that the logic program can continue
running for the remaining time after start-up. In order to use this function, the Enable input must be set during
the rising edge at TonIn and the function block must be parameterized accordingly (parameter: Starts with
remaining time = True).

NOTICE
Support
The function block TON2 is not available in the KL6904, EL6900 and EL6910 (SW ≤ 03).

98 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 81: Function block TON2

In the properties of the FB TON2 the parameter Starts with remaining time can be enabled in addition to the
diagnostic data.

Fig. 82: FB TON2 properties

In the following timing diagram the TON Delay Time is set to 120 seconds. While TonIn is set, the station is
switched off (EtherCAT state exits OP (8)) and switched on again after a certain time. After switching on, the
logic starts up and starts the active connections. When the TonIn signal is read in again with TRUE within
the logic and the Enable signal is also read in with TRUE (in this example after approx. 35 seconds), the
TON function block is processed with the remaining time. The TonOut output is set after the parameterized
time of 120 seconds has elapsed.

The Enable signal is not shown in the diagram because it is set to TRUE throughout.

TwinSAFE Logic FB Version: 4.1.0 99


Function blocks

Fig. 83: Timing diagram

4.13.2 Signal description


FB TON2 inputs
Offset Name Permitted type Data type Description
8.0 TonIn1 TwinSAFE-In BOOL 1st input channel; the parameterization indicates
FB-Out whether a break contact or a make contact is linked to
this input.
9.0 Enable TwinSAFE-In BOOL If "Save the timer remaining time" is enabled, the state
FB-Out of the Enable signal is checked when the TonIn signal
Standard-In changes from 0 to 1.
Enable Description
FALSE The timer is started with the time that is
parameterized in the FB
TRUE The timer is started with the remaining
running time.
(If the remaining running time is greater
than the time that is parameterized in the
FB, the TwinSAFE Logic changes to the
Global Shutdown state with error code
0x3510)

FB TON2 outputs
Offset Name Permitted type Data type Description
1.0 TonOut TwinSAFE-Out BOOL 1st output; the safe state corresponds to logic 0.
FB-In
Standard-Out

100 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Input and output types


Type Description
TwinSAFE-In TwinSAFE input
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB TON2 This description applies to BLG 3.0 (internal version number)

Status information (8-bit value)


Value Description
1.0 RUN
If the TimerIn input is 1 and the delay time has expired (DelayTimeExpired=TRUE), the FB
TON module assumes the RUN state.
The outputs assume the following values:
TimerOut=1
2.0 STOP
If the input FbRun=FALSE, the FB TON module assumes the STOP state.
The outputs assume the following values:
TimerOut=0
3.0 SAFE
If the TimerIn input is 0, the FB TON module assumes the SAFE state. If the TimerIn input
changes to 1 in the SAFE state, the FB TON module starts the delay timer with the
DelayTime and changes to the DELAYIN state.
If TimerIn changes to 1, "Save remaining time" operation mode is enabled and the Enable
input is TRUE in SAFE state, the FB TON module starts the delay timer with the
DelayTime minus the ExpiredTime stored in the FRAM and switches to DELAYIN state.
If TimerIn changes to 1, "Save remaining time" operation mode is enabled and the Enable
input is FALSE in SAFE state, the FB TON module starts the delay timer with the
DelayTime and switches to DELAYIN state.
If TimerIn changes to 1, "Save remaining time" operation mode is enabled, the Enable
input is TRUE and the ExpiredTime is greater than the DelayTime in SAFE mode, the FB
TON module calls the module CTRLCYC so that it assumes the state GLOBAL-
SHUTDOWN with error code 0x3510.
The outputs assume the following values:
TimerOut=0
9.0 DELAYIN
If the TimerIn input is 1 and the delay time has not yet expired
(DelayTimeExpired=FALSE), the FB TON module assumes the DELAYIN state.
The outputs assume the following values:
TimerOut=0

4.14 The function block TOF

4.14.1 Functional description


FB TOF is used to realize a switch-off delay. Logic 1 at input 'TofIn' is transferred to the output with a set
delay time. The output remains activated if the input is set to 1 again before the switch-off delay time has
elapsed.
The error output is inactive since the function block sets no errors.

TwinSAFE Logic FB Version: 4.1.0 101


Function blocks

The maximum switch-off delay is 6000 x 100 ms (10 minutes).

Fig. 84: Function block TOF

NOTICE
KL6904
The TOF function block is not available in the KL6904.

4.14.2 Signal description


FB TOF inputs
Offset Name Permitted type Data type Description
8.0 TofIn1 TwinSAFE-In BOOL 1st input channel; the parameterization indicates
FB-Out whether a break contact or a make contact is linked to
this input.

FB TOF outputs
Offset Name Permitted type Data type Description
1.0 TofOut TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output

102 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Type Description
TwinSAFE- TwinSAFE output, e.g. on an EL2904/KL2904
Out
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB TOF This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for FB TOF

Diagnostic information (16-bit value)


Bit Description
0.0-15.0 always 0

Status information (8-bit value)


Value Description
1.0 RUN
If the TimerIn input is 1, the FB TOF module assumes the RUN state. If the TimerIn changes
to 0 in the RUN state, the FB TOF module starts the delay timer with the DelayTime and
changes to the DELAYOUT state.
The outputs assume the following values:
TimerOut=1
2.0 STOP
If the input FbRun=FALSE, the FB TOF module assumes the STOP state.
The outputs assume the following values:
TimerOut=0
3.0 SAFE
If the TimerIn input is 0 and the DelayTime has expired (DelayTimeExpired=TRUE), the FB
TOF module assumes the SAFE state.
The outputs assume the following values:
TimerOut=0
8.0 DELAYOUT
If the TimerIn input is 0 and the DelayTime has not yet expired (DelayTimeExpired=FALSE),
the FB TOF module assumes the DELAYOUT state.
The outputs assume the following values:
TimerOut=1

TwinSAFE Logic FB Version: 4.1.0 103


Function blocks

4.14.3 FB TOF configuration in the TwinCAT System Manager

Fig. 85: FB TOF configuration

Use the Settings button to the right of the 'TofIn' button to configure the input as make (NO) or break contact
(NC). The input is deactivated in the default state.
The 'TofIn' button is used to link the input variable of the FB TOF.
The 'TofOut' button is used to link the switch-on-delayed output variable of the FB TOF.
Use the text box to set the switch-on delay time. The smallest unit is 0.1 s.
The error output is inactive since FB TOF reports no error.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.14.4 TOF extension


NOTICE
Support
The extensions described below are only available in the EL6910 or newer terminals. These options cannot
be used under the EL6900 and KL6904.

In the EL6910 the FB TOF now also supports times between 1 ms and 600 seconds. The function block has
two timebases: 1 ms and 10 ms.
With a timebase of 1 ms the maximum time is 60,000 ms in 1 ms steps.
With a timebase of 10 ms the maximum time is 600,000 ms in 10 ms steps.
The timebase is automatically selected in TC3.1 Safety Editor according to the set time.

4.14.5 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

104 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 86: FB TOF in TwinCAT 3

Fig. 87: FB TOF properties

4.15 The function block CONNECTION SHUTDOWN

4.15.1 Functional description


FB CONNECTION SHUTDOWN is used to deactivate a TwinSAFE connection. If the function block input
becomes active, the connection is closed, a shutdown command is sent to the FSoE partner, and feedback
is sent to the output. The connection is closed and the output is set if the communication partner receives a
shutdown command. The output is only reset when the connection to the FSoE partner is in DATA state
again.

Once the input of the function block is no longer active, the FSoE master tries to re-establish the connection
or the FSoE slave responds to the connection again.

This function block is required for modular safety concepts, in which machine components can be
exchanged without stopping the whole safety circuit, e.g. for a tool change. If a modular machine concept is
used, which includes machine options such as an optional feeder, these options should be realized in
dedicated additional TwinSAFE groups.

CAUTION
Deactive inputs
Please note that the signal used to shut down the connection must have the same safety level as the
signals of the shut-down connection.

TwinSAFE Logic FB Version: 4.1.0 105


Function blocks

Fig. 88: Function block CONNECTION SHUTDOWN

NOTICE
KL6904
The Connection Shutdown function block is not available in the KL6904.

On the opposite side the function block is called without connected inputs. The output Deactivated is set
when the connection is terminated due to a shutdown command from the communication partner.

106 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 89: Function block CONNECTION SHUTDOWN on the opposite side

4.15.2 Signal description


FB CONNECTION SHUTDOWN inputs
Offset Name Permitted type Data type Description
8.0 Deactivate1 TwinSAFE-In BOOL 1st input channel. The parameterization determines,
FB-Out whether the input is linked to a break contact (safe
state will be requested by logical 0) or make contact
(safe state will be requested by logical 1).
9.0 Deactivate2 TwinSAFE-In BOOL 2nd input channel, behaves like Deactivate1
FB-Out If the discrepancy time is not equal 0, the 1st and 2nd
input channel are considered to be the 1st input group
and a discrepancy time monitoring is carried out
between both channels, if one of the two input
channels requests the safe state

FB CONNECTION SHUTDOWN outputs


Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL TRUE:
FB-In The discrepancy time monitoring of a 2-channel input
Standard-Out group has detected an error. The error reset must be
carried out via the ERR_ACK input of the related
TwinSAFE group.
FALSE:
No error was found
1.0 Deactivated TwinSAFE-Out BOOL 1st output channel, the safe state corresponds to a
FB-In logical 0.
Standard-Out The output is set when the connection is terminated.

TwinSAFE Logic FB Version: 4.1.0 107


Function blocks

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. on an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. on an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input

Internal identifier of the FB


Type Description
FB CONNECTION This description applies to BLG 1.0 (internal version number)
SHUTDOWN

Diagnostic and status information for FB CONNECTION SHUTDOWN

Diagnostic information (16-bit value)


Bit Description
0.0 Discrepancy error input group 1

Status information (8-bit value)


Value Description
1.0 RUN
If the CONNECTION module has received a shutdown command on the assigned connection,
it switches the connection to the SHUTDOWN state and reports this state to the FB CS
module, which then assumes the RUN state.
If all activated DeactivateX inputs are TRUE, the module switches to the RUN state and
instructs the CONNECTION module to send a shutdown command via the assigned
connection and set it to the SHUTDOWN state.
The outputs assume the following values:
Error=0
Deactivated=1
2.0 STOP
If the input FbRun=FALSE, the FB CS module assumes the STOP state.
The outputs assume the following values:
Error=0
Deactivated=0
3.0 SAFE
If not all activated inputs DeactivateX are TRUE and the assigned connection is not in the
SHUTDOWN state, the FB CS module assumes the SAFE state.
The outputs assume the following values:
Error=0
Deactivated=0
4.0 ERROR
If the FB CS module detects an error, the FB CS module switches to the ERROR state and
transmits the corresponding diag message to the GROUP module.
The outputs assume the following values:
Error=1
Deactivated=0
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the associated
group is set to TRUE, the FB CS module assumes the RESET state.
The outputs assume the following values:
Error=0
Deactivated=0

108 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.15.3 FB ConnectionShutdown configuration in the TwinCAT


System Manager

Fig. 90: FB CONNECTION SHUTDOWN configuration

The Settings button to the right of the Deactivate(x) buttons can be used to activate the inputs and
configured them as make (NO) or break (NC) contacts. In the default state the inputs are disabled.

The 'Deactivate1' and 'Deactivate2' buttons are used to link the input variables of the FB Connection
Shutdown.

The 'Deactivated' button is used to link the output variable of the FB Connection Shutdown. The output
signals with a logical 1 that the connection is terminated.

Use the 'Connection ID' selection box to specify the connection ID of the connection to be terminated via the
function block. The function block uses the Connection ID, not the Connection No. of the TwinSAFE
connection.

The 'Error' button can be used to link the error state to an output variable.

The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to
the cyclic process image.

4.15.4 Display in TwinCAT 3


Display of the function block and its properties in TwinCAT 3.

TwinSAFE Logic FB Version: 4.1.0 109


Function blocks

Fig. 91: FB Connection Shutdown in TwinCAT 3

Fig. 92: FB Connection Shutdown properties

NOTICE
Shutdown
Before a connection can be disabled, it must have started up without error and be in DATA state.
For modular machines, where a module is generally not available, for example, this concept should be
realized via additional TwinSAFE groups.

4.16 The function block ADD

4.16.1 Functional description


The FB ADD is used to add the two connected analog input values and transfer them to the AnalogOut
output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must be selected
to match the input types.

If an overflow or underflow occurs during the addition, the ERROR state is assumed. The AnalogOut output
is then set to 0, the Error output is set to 1.

Once overflow or underflow no longer occurs after an error, the function block can be set to RUN state again
via ErrAck of the TwinSAFE group. The RESET state is assumed when the ErrAck input of the
corresponding group is 1. When the ErrAck input of the corresponding group changes to 0 again, the system
switches from RESET state to RUN state. In RESET state the AnalogOut output and the Error output are 0.

110 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 93: Function block ADD

NOTICE
KL6904/EL6900
The function block ADD is not available in the KL6904 and the EL6900.

4.16.2 Signal description


FB ADD inputs
Offset Name Permitted type Data type Description
0.0- AnalogIn1 TwinSAFE-In n=2: 1st input channel for addition
(n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC n=4:
INT32
UINT32
n- AnalogIn2 TwinSAFE-In m=2: 2nd input channel for addition
(m+n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC m=4:
INT32
UINT32

FB ADD outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
0.0- AnalogOut TwinSAFE-Out n=2: 1st output channel with the addition result
(n-1) FB-In INT16
Standard-Out UINT16
n=4:
INT32
UINT32

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904

TwinSAFE Logic FB Version: 4.1.0 111


Function blocks

Type Description
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB ADD This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB ADD

Diagnostic information
Value Description
0.0 The output AnalogOut is correct
1.0 The output AnalogOut has an underflow
(is less than the smallest possible value)
2.0 The output AnalogOut has an overflow
(is greater than the largest possible value)

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x4080 An underflow has occurred FB number AnalogIn1 AnalogIn2
0x4081 An overflow has occurred FB number AnalogIn1 AnalogIn2

Status information
Value Description
1.0 RUN
The FB ADD module cyclically adds the two analog inputs AnalogIn1 and AnalogIn2. If no
overflow and no underflow occur during the addition, the FB ADD module is in the RUN state.
The outputs assume the following values:
Error=0
AnalogOut=Result of the addition
2.0 STOP
If the input FbRun=FALSE, the FB ADD module assumes the STOP state.
The outputs assume the following values:
Error=0
AnalogOut=0
4.0 ERROR
If the FB ADD module detects an error when checking the value range of AnalogOut during
addition, the FB ADD module switches to the ERROR state and transfers the corresponding Diag
message to the GROUP module.
The outputs assume the following values:
Error=1
AnalogOut=0
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the associated
group is set to TRUE, the FB ADD module assumes the RESET state.
The outputs assume the following values:
Error=0
AnalogOut=0

112 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.16.3 FB ADD configuration in TwinCAT 3

Fig. 94: FB ADD configuration

Fig. 95: FB ADD properties

Fig. 96: FB ADD port properties

A mouse click next to the FB port, here AnalogIn1 and AnalogIn2, can be used to create variables that can
be linked to input signals. Input settings, such as changing the data type or activation of the input, can be
made via the properties of the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

TwinSAFE Logic FB Version: 4.1.0 113


Function blocks

4.17 The function block SUB

4.17.1 Functional description


The FB SUB is used to subtract the AnalogIn2 input from the AnalogIn1 input and transfer it to the
AnalogOut output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must
be selected to match the input types.

If an overflow or underflow occurs during the subtraction, the ERROR state is assumed. The AnalogOut
output is then set to 0, the Error output is set to 1.

Once overflow or underflow no longer occurs after an error, the function block can be set to RUN state again
via ErrAck of the TwinSAFE group. The RESET state is assumed when the ErrAck input of the
corresponding group is 1. When the ErrAck input of the corresponding group changes to 0 again, the system
switches from RESET state to RUN state. In RESET state the AnalogOut output and the Error output are 0.

Fig. 97: Function block SUB

NOTICE
KL6904/KL6900
The function block SUB is not available in the KL6904 and the EL6900.

4.17.2 Signal description


FB SUB inputs
Offset Name Permitted type Data type Description
0.0- AnalogIn1 TwinSAFE-In n=2: 1st input channel for subtraction
(n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC n=4:
INT32
UINT32
n- AnalogIn2 TwinSAFE-In m=2: 2nd input channel for subtraction
(m+n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC m=4:
INT32
UINT32

114 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

FB SUB outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
0.0- AnalogOut TwinSAFE-Out n=2: 1st output channel with the subtraction result
(n-1) FB-In INT16
Standard-Out UINT16
n=4:
INT32
UINT32

FB SUB input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE- TwinSAFE output, e.g. an EL2904/KL2904
Out
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB SUB This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB SUB

Diagnostic information
Value Description
0.0 The output AnalogOut is correct
1.0 The output AnalogOut has an underflow
(is less than the smallest possible value)
2.0 The output AnalogOut has an overflow
(is greater than the largest possible value)

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x4080 An underflow has occurred FB number AnalogIn1 AnalogIn2
0x4081 An overflow has occurred FB number AnalogIn1 AnalogIn2

Status information
Value Description
1 RUN
The FB SUB module cyclically subtracts the two analog inputs AnalogIn1 and AnalogIn2. If
no overflow or underflow occurs during subtraction, the FB SUB module is in the RUN state.
The outputs assume the following values:
Error=0
AnalogOut=result of the subtraction

TwinSAFE Logic FB Version: 4.1.0 115


Function blocks

Value Description
2 STOP
If the input FbRun=FALSE, the FB SUB module assumes the STOP state.
The outputs assume the following values:
Error=0
AnalogOut=0
4 ERROR
If the FB SUB module detects an error when checking the value range of AnalogOut during
subtraction, the FB SUB module switches to the ERROR state and transfers the
corresponding diag message to the GROUP module.
The outputs assume the following values:
Error=1
AnalogOut=0
5 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the
associated group is set to TRUE, the FB ADD module assumes the RESET state.
The outputs assume the following values:
Error=0
AnalogOut=0

4.17.3 FB SUB configuration in TwinCAT 3

Fig. 98: FB SUB configuration

Fig. 99: FB SUB properties

116 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 100: FB SUB port properties

A mouse click next to the FB port, here AnalogIn1 and AnalogIn2, can be used to create variables that can
be linked to input signals. Input settings, such as changing the data type or activation of the input, can be
made via the properties of the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.18 The function block MUL

4.18.1 Functional description


The FB MUL is used to multiply the AnalogIn1 input with the AnalogIn2 input and transfer the result to the
AnalogOut output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must
be selected to match the input types.

If an overflow or underflow occurs during the multiplication, the ERROR state is assumed. The AnalogOut
output is then set to 0, the Error output is set to 1.

Fig. 101: Function block MUL

NOTICE
KL6904/EL6900
The function block MUL is not available in the KL6904 and the EL6900.

TwinSAFE Logic FB Version: 4.1.0 117


Function blocks

4.18.2 Signal description


FB MUL inputs
Offset Name Permitted type Data type Description
0.0- AnalogIn1 TwinSAFE-In n=2: 1st input channel for multiplication
(n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC n=4:
INT32
UINT32
n- AnalogIn2 TwinSAFE-In m=2: 2nd input channel for multiplication
(m+n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC m=4:
INT32
UINT32

FB MUL outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
0.0- AnalogOut TwinSAFE-Out n=2: 1st output channel with the multiplication result
(n-1) FB-In INT16
Standard-Out UINT16
n=4:
INT32
UINT32

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE- TwinSAFE output, e.g. an EL2904/KL2904
Out
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB MUL This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for FB MUL

Diagnostic information
Value Description
0.0 The output AnalogOut is correct
1.0 The output AnalogOut has an underflow
(is less than the smallest possible value)
2.0 The output AnalogOut has an overflow
(is greater than the largest possible value)

118 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x4080 An underflow has occurred FB number AnalogIn1 AnalogIn2
0x4081 An overflow has occurred FB number AnalogIn1 AnalogIn2

Status information
Value Description
1.0 RUN
In the RUN state, the FB MUL module enters the result of the multiplication in the AnalogOut
output.
The outputs assume the following values:
Error=0
AnalogOut=multiplication result
2.0 STOP
If the input FbRun=FALSE, the FB MUL module assumes the STOP state.
The outputs assume the following values:
Error=0
AnalogOut=0
4.0 ERROR
If the FB MUL module detects an error when checking the value range of AnalogOut, the FB
MUL module switches to the ERROR state and transmits the corresponding Diag message to
the GROUP module.
The outputs assume the following values:
Error=1
AnalogOut=0
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the associated
group is set to TRUE, the FB MUL module assumes the RESET state.
The outputs assume the following values:
Error=0
AnalogOut=0

4.18.3 FB MUL configuration in TwinCAT 3

Fig. 102: FB MUL configuration

TwinSAFE Logic FB Version: 4.1.0 119


Function blocks

Fig. 103: FB MUL properties

Fig. 104: FB MUL port properties

A mouse click next to the FB port, here AnalogIn1 and AnalogIn2, can be used to create variables that can
be linked to input signals. Input settings, such as changing the data type or activation of the input, can be
made via the properties of the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.19 The function block DIV

4.19.1 Functional description


The FB DIV is used to divide the AnalogIn1 input by the AnalogIn2 input and transfer the result to the
AnalogOut output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must
be selected to match the input types.

If the AnalogIn2 input is 0, the AnalogOut output is set to 0. In this case no error is output.

If an overflow or underflow occurs during the division, the ERROR state is assumed. The AnalogOut output
is then set to 0, the Error output is set to 1.

The Division Rounding parameter can be used to specify the rounding method to be used.
Parameter Rounding method
Floor Decimal places are truncated
Ceil The next higher integer is returned as result
Round Commercial rounding is used (e.g. 2.5 is rounded to 3)

120 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 105: Function block DIV

NOTICE
KL6904/EL6900
The function block DIV is not available in the KL6904 and the EL6900.

4.19.2 Signal description


FB DIV inputs
Offset Name Permitted type Data type Description
0.0- AnalogIn1 TwinSAFE-In n=2: 1st input channel for division
(n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC n=4:
INT32
UINT32
n- AnalogIn2 TwinSAFE-In m=2: 2nd input channel for division
(m+n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC m=4:
INT32
UINT32

FB DIV outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
0.0- AnalogOut TwinSAFE-Out n=2: 1st output channel with the division result
(n-1) FB-In INT16
Standard-Out UINT16
n=4:
INT32
UINT32

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904

TwinSAFE Logic FB Version: 4.1.0 121


Function blocks

Type Description
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB DIV This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB DIV

Diagnostic information
Value Description
0.0 The output AnalogOut is correct
1.0 The output AnalogOut has an underflow
(is less than the smallest possible value)
2.0 The output AnalogOut has an overflow
(is greater than the largest possible value)

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x4080 An underflow has occurred FB number AnalogIn1 AnalogIn2
0x4081 An overflow has occurred FB number AnalogIn1 AnalogIn2

Status information
Value Description
1.0 RUN
In the RUN state, the FB DIV module enters the result of the division in the AnalogOut
output.
The outputs assume the following values:
Error=0
AnalogOut=division result
2.0 STOP
If the input FbRun=FALSE, the FB DIV module assumes the STOP state.
The outputs assume the following values:
Error=0
AnalogOut=0
4.0 ERROR
If the FB DIV module detects an error when checking the value range of AnalogOut, the FB
DIV module switches to the ERROR state and transmits the corresponding Diag message to
the GROUP module.
The outputs assume the following values:
Error=1
AnalogOut=0
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the
associated group is set to TRUE, the FB DIV module assumes the RESET state.
The outputs assume the following values:
Error=0
AnalogOut=0

122 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.19.3 FB DIV configuration in TwinCAT 3

Fig. 106: FB DIV configuration

Fig. 107: FB DIV properties

Fig. 108: FB DIV port properties

A mouse click next to the FB port, here AnalogIn1 and AnalogIn2, can be used to create variables that can
be linked to input signals. Input settings, such as changing the data type or activation of the input, can be
made via the properties of the FB port.

TwinSAFE Logic FB Version: 4.1.0 123


Function blocks

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.20 The function block COMPARE

4.20.1 Functional description


The FB COMPARE checks the 2-5 analog inputs CompIn1 to CompIn5 for equality within a time and value
tolerance window. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output
CompOut must be selected to match the input types. The Architecture option field can be used to select how
many inputs are to be evaluated. The parameter Allowed Deviation and Tolerance Time (ms) can be used to
specify which deviations between the input values are permitted during which interval. The IsValid output
returns a logical 1 if the comparison has a positive result.
The CompOut output contains the first analog value that meets the comparison criteria.
The ERROR state is assumed if an overflow or underflow occurs. In this case the CompOut and IsValid
outputs are set to 0 and the Error output to 1.

Description of the Architecture radio button


• 1oo2:
The two input values are compared for equality. If an error is detected, the FB outputs CompOut and
IsValid are set to 0.
• 2oo3:
The 3 input signals are compared, and the majority result is used (2 out of 3). If all values outside the
defined limits are different, the CompOut FB output is set to 0 and the IsValid output is reset.
• 3oo5:
The 5 input signals are compared, and the majority result is used (3 out of 5). If fewer than 3 values
within the defined limits are equal, the FB output CompOut is set to 0 and the output IsValid is reset.

Fig. 109: Function block COMPARE

NOTICE
KL6904/EL6900
The function block COMPARE is not available in the KL6904 and the EL6900.

124 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.20.2 Signal description


FB COMPARE inputs
Offset Name Permitted type Data type Description
0.0- CompIn1 TwinSAFE-In n=2: 1st input channel for the comparison (1oo2, 2oo3,
(n-1) FB-Out INT16 3oo5)
Standard-In UINT16
TwinSAFE SC n=4:
INT32
UINT32
n- CompIn2 TwinSAFE-In m=2: 2nd input channel for the comparison (1oo2, 2oo3,
(m+n-1) FB-Out INT16 3oo5)
Standard-In UINT16
TwinSAFE SC m=4:
INT32
UINT32
(m+n)- CompIn3 TwinSAFE-In l=2: 3rd input channel for the comparison (2oo3, 3oo5)
(l+m+n- FB-Out INT16
1) Standard-In UINT16
TwinSAFE SC l=4:
INT32
UINT32
(l+m+n) CompIn4 TwinSAFE-In k=2: 4th input channel for the comparison (3oo5)
- FB-Out INT16
(k+l+m+ Standard-In UINT16
n-1) TwinSAFE SC k=4:
INT32
UINT32
(k+l+m+ CompIn5 TwinSAFE-In j=2: 5th input channel for the comparison (3oo5)
n)- FB-Out INT16
(j+k+l+ Standard-In UINT16
m+n-1) TwinSAFE SC j=4:
INT32
UINT32

FB COMPARE outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
1.0 IsValid TwinSAFE-Out BOOL Output indicating whether the comparison has a
FB-In positive or negative result
Standard-Out (positive=1, negative=0)
0.0- CompOut TwinSAFE-Out n=2: Output channel with the first CompIn input value that
(n-1) FB-In INT16 lies within the comparison result
Standard-Out UINT16
n=4:
INT32
UINT32

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904

TwinSAFE Logic FB Version: 4.1.0 125


Function blocks

Type Description
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB COMPARE This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB COMPARE

Diagnostic information
Value Description
0.0 The output CompOut is correct
1.0 The output CompOut has an underflow
(is less than the smallest possible value)
2.0 The output CompOut has an overflow
(is greater than the largest possible value)

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x4098 An underflow has occurred FB number CompOut Smallest permitted
value
0x4099 An overflow has occurred FB number CompOut Largest permitted value

Status information
Value Meaning
1.0 RUN
The FB COMPARE module assumes the RUN state if enough analog inputs deviate from
each other by no more than the Allowed Deviation (ValuesEqual=TRUE).
The outputs assume the following values:
Error=0
IsValid=1
CompOut=CompInX (X= smallest input that does not deviate)
2.0 STOP
If the input FbRun=FALSE, the FB COMPARE module assumes the STOP state.
The outputs assume the following values:
Error=0
IsValid=0
CompOut=0
3.0 SAFE
The FB COMPARE module assumes the SAFE state if not enough analog inputs deviate
from each other by at most the Allowed Deviation (ValuesEqual=FALSE) and the
DelayOutTimer has expired (DelayOutExpired=TRUE).
The outputs assume the following values:
Error=0
IsValid=0
CompOut=0
4.0 ERROR
If the FB COMPARE module detects an error when checking the value range of CompOut,
the FB COMPARE module switches to the ERROR state and transfers the corresponding
Diag message to the GROUP module.
The outputs assume the following values:

126 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Meaning
Error=1
IsValid=0
CompOut=0
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the
associated group is set to TRUE, the FB COMPARE module assumes the RESET state.
The outputs assume the following values:
Error=0
IsValid=0
CompOut=0
8.0 DELAYOUT
If not enough analog inputs deviate from each other by no more than the allowed deviation
(ValuesEqual=FALSE), the DelayOutTimer is started with the ToleranceTime. As long as
the DelayOutTimer has not expired (DelayOutExpired=FALSE), the FB COMPARE module
assumes the DELAYOUT state.
The outputs assume the following values:
Error=0
IsValid=1
CompOut=unchanged

4.20.3 FB COMPARE configuration in TwinCAT 3

Fig. 110: FB Compare configuration

TwinSAFE Logic FB Version: 4.1.0 127


Function blocks

Fig. 111: FB COMPARE properties

Fig. 112: Properties of the FB COMPARE ports

A mouse click next the FB port, here CompIn1 to CompIn5, can be used to create variables that can be
linked to input signals. Input settings, such as changing the data type or activation of the input, can be made
via the properties of the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

The Architecture option field can be used to choose between 1oo2, 2oo3 or 3oo5 evaluation. The parameter
field Allowed Deviation defines the deviation of the input values from each another. The parameter field
Tolerance time (ms) defines the time within which a valid result must be present at the inputs, in order to
avoid a shutdown.

4.21 The function block LIMIT

4.21.1 Functional description


The FB LIMIT is used to check the AnalogIn input for the values linked to MinValue and MaxValue or the
values entered in the parameters Minimum Value and Maximum Value. The input data types INT16, INT32,
UINT16 and UINT32 are permitted. The In_Limit output is set if the AnalogIn value is within the Minimum
Value and Maximum Value limits. If the value is above the AboveMax limit, it is set below BelowMin.

128 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 113: Function block LIMIT

NOTICE
KL6904/EL6900
The function block LIMIT is not available in the KL6904 and the EL6900.

4.21.2 Signal description


FB LIMIT inputs
Offset Name Permitted type Data type Description
0.0- AnalogIn TwinSAFE-In n=2: Input channel for limitation
(n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC n=4:
INT32
UINT32
n- MinValue TwinSAFE-In m=2: Minimum value
(m+n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC m=4:
INT32
UINT32
(m+n)- MaxValue TwinSAFE-In k=2: Maximum value
(k+m+n FB-Out INT16
-1) Standard-In UINT16
TwinSAFE SC k=4:
INT32
UINT32

FB LIMIT outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out

TwinSAFE Logic FB Version: 4.1.0 129


Function blocks

Offset Name Permitted type Data type Description


1.0 InLimit TwinSAFE-Out BOOL Value is within the minimum/maximum limits
FB-In
Standard-Out
2.0 BelowMin TwinSAFE-Out BOOL Value is below the minimum limit
FB-In
Standard-Out
3.0 AboveMax TwinSAFE-Out BOOL Value is above the maximum limit
FB-In
Standard-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB LIMIT This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB LIMIT

Diagnostic information
Value Description
0.0 No diagnostic information
1.0 MinValue is greater than MaxValue

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x4090 MinValue is greater than FB number MinValue MaxValue
MaxValue

Status information
Value Description
1.0 RUN
If AnalogIn is greater than or equal to MinValue and less than or equal to MaxValue, the
FB LIMIT module assumes the RUN state.
The outputs assume the following values:
Error=0
InLimit=1
BelowMin=0
AboveMax=0
2.0 STOP
If the input FbRun=FALSE, the FB LIMIT module assumes the STOP state.
The outputs assume the following values:
Error=0

130 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
InLimit=0
BelowMin=0
AboveMax=0
3.0 SAFe
If AnalogIn is less than MinValue or greater than MaxValue, the FB LIMIT module assumes
the SAFe state.
The outputs assume the following values:
Error=0
InLimit=0
BelowMin=(AnalogIn<MinValue)
AboveMax=(AnalogIn>MaxValue)
4.0 ERROR
If the FB LIMIT module detects an error, the FB LIMIT module switches to the ERROR
state and transmits the corresponding Diag message to the GROUP module.
The outputs assume the following values:
Error=1
InLimit=0
BelowMin=0
AboveMax=0
5.0 RESET
If no more errors are present after an error has occurred and the ErrAck input of the
associated group is set to TRUE, the FB LIMIT module assumes the RESET state.
The outputs assume the following values:
Error=0
InLimit=0
BelowMin=0
AboveMax=0

4.21.3 FB LIMIT configuration in TwinCAT 3

Fig. 114: FB LIMIT configuration

TwinSAFE Logic FB Version: 4.1.0 131


Function blocks

Fig. 115: FB LIMIT properties

Fig. 116: FB LIMIT port properties

A mouse click next the FB port, here AnalogIn1, MinValue und MaxValue, can be used to create variables
that can be linked to input signals. Input settings, such as changing the data type or activation of the input,
can be made via the properties of the FB port. Either the FB inputs MinValue and MaxValue or the
parameters Minimum Value and Maximum Value can be used. If the FB inputs are active, they are used.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.22 The function block COUNTER

4.22.1 Functional description


The FB Counter is used to realize an up/down counter. The inputs Reset, CountUp and CountDown are of
data type BOOL. The outputs Error, CounterOut and CounterZero are also of data type BOOL. The output
ActValue indicates the current internal counter value and can be of data type INT16, UINT16, INT32 or
UINT32. The parameters Preset Value and Counter Limit can be used to parameterize the counter.

A logical 1 signal at the input Reset causes the internal counter value to be set to the value that is
parameterized via Preset Value. A rising edge at the input CountUp increments the internal counter value by
1. A rising edge at the input CountDown decrements the internal counter value by 1. Once the counter value
specified under CounterLimit is reached, the output CounterOut is set. Once the counter value 0 is reached,
the output CounterZero is set.

If the TwinSAFE group is started (Run=1) and the Reset input is TRUE, the output ActValue is set to
PresetValue. When the group is stopped, ActValue is set to 0. Further status information can be found in
chapter Signal description [} 133].

132 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 117: Function block COUNTER

NOTICE
KL6904/EL6900
The function block Counter is not available in the KL6904 and the EL6900.

4.22.2 Signal description


FB Counter inputs
Offset Name Permitted Data type Description
type
0.0 Reset TwinSAFE-In BOOL Reset input for resetting the counter to Preset Value
FB-Out
Standard-In
TwinSAFE SC
1.0 CountUp TwinSAFE-In BOOL CountUp input for incrementing the internal counter
FB-Out value by 1
Standard-In
TwinSAFE SC
2.0 CountDown TwinSAFE-In BOOL CountDown input for decrementing the internal
FB-Out counter value by 1
Standard-In
TwinSAFE SC

FB Counter outputs
Offset Name Permitted Data type Description
type
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
1.0 CounterOut TwinSAFE-Out BOOL Output is set when the counter limit is reached
FB-In
Standard-Out
2.0 CounterZero TwinSAFE-Out BOOL Output is set when the internal counter value is 0
FB-In
Standard-Out

TwinSAFE Logic FB Version: 4.1.0 133


Function blocks

Offset Name Permitted Data type Description


type
0.0- ActValue TwinSAFE-Out n=2: Current internal counter value
(n-1) FB-In INT16
Standard-Out UINT16
n=4
INT32
UINT32

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB COUNTER This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB Counter

Diagnostic information
Value Description
0.0 No diagnostic information
1.0 The output ActValue has an underflow (is less than the smallest possible value)
2.0 The output ActValue has an overflow (is greater than the largest possible value)

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x40B8 An underflow has occurred FB number ActValue Smallest permitted
value
0x40B9 An overflow has occurred FB number ActValue Largest permitted value

Status information
Value Description
1.0 RUN
In the RUN state, the FB Counter module sets the ActValue output to PresetValue if the
input Reset = TRUE.
If the input Reset = FALSE, the FB Counter module increments the output ActValue if a
rising edge is detected at the input CountUp and decrements it if a rising edge is detected
at the input CountDown (this means that ActValue remains unchanged if both the CountUp
and CountDown inputs detect a rising edge).
The outputs assume the following values:
Error = 0
CounterOut = (ActValue >= CounterLimit)
CounterZero = (ActValue == 0)
Reset=TRUE: ActValue = PresetValue
Reset=FALSE: ActValue = ActValue + n (-1 <= n <= 1)

134 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
2.0 STOP
If the input FbRun = FALSE, the FB Counter module assumes the STOP state.
The outputs assume the following values:
Error = 0
CounterOut = 0
CounterZero = 0
ActValue = 0
4.0 ERROR
If the FB Counter module detects an error when checking the value range of CounterOut,
the FB Counter module switches to the ERROR state and transmits the corresponding diag
message to the GROUP module.
The outputs assume the following values:
Error = 1
CounterOut = 0
CounterZero = 0
ActValue = 0
5.0 RESET
If no more errors are present after an error has occurred and the ErrAck input of the
associated group is set to TRUE, the FB Counter module assumes the RESET state.
The outputs assume the following values:
Error = 0
CounterOut = 0
CounterZero = 0
ActValue = 0

4.22.3 FB Counter configuration in TwinCAT 3

Fig. 118: FB COUNTER configuration

TwinSAFE Logic FB Version: 4.1.0 135


Function blocks

Fig. 119: FB COUNTER properties

Fig. 120: FB COUNTER port properties

A mouse click next to the FB port, here Reset, CountUp, CountDown, Error, CounterOut, CounterZero and
ActValue, can be used to create variables that can be linked to input or output signals. Input settings, such
as changing the data type or activation of the input, can be made via the properties of the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.23 The function block SCALE

4.23.1 Functional description


The FB SCALE is used to multiply the AnalogIn input with the scaling factor and then divided before the
scaling offset is added. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output
must be selected to match the input types. The AnalogIn input can be negated. For data types INT16 and
INT32 this corresponds to multiplication with -1, for data types UINT16 and UINT32 it corresponds to an
XOR function with 0xFFFF or 0xFFFFFFFF.

The Division Rounding parameter can be used to specify the rounding method to be used for the internal
division.
Parameter Rounding method
Floor Decimal places are truncated
Ceil The next higher integer is returned as result
Round Commercial rounding is used (e.g. 2.5 is rounded to 3)

The parameter Multiplication First can be used specify whether the first scaling operation after the optional
negation should be multiplication (TRUE) or division (FALSE).

136 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

In addition, the parameter watchdog (ms) can be used to specify that the AnalogIn input must have changed
within the specified time. If the input remains unchanged within the specified time, the StuckAtError output is
set to TRUE. If the parameter is set to 0, the check is turned off. The StuckAtError output is not a FB error,
which means the TwinSAFE group does not enter an error state. The application program must respond to
this.

Fig. 121: Function block SCALE

NOTICE
KL6904/EL6900
The function block SCALE is not available in the KL6904 and the EL6900.

4.23.2 Signal description


FB Scale inputs
Offset Name Permitted type Data Description
type
0.0- AnalogIn1 TwinSAFE-In n=2: Input for scaling.
(n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC n=4
INT32
UINT32

FB Scale outputs
Offset Name Permitted type Data Description
type
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
1.0 StuckAtError TwinSAFE-Out BOOL Output that is set if the input AnalogIn remains
FB-In unchanged over the parameterized period
Standard-Out

TwinSAFE Logic FB Version: 4.1.0 137


Function blocks

Offset Name Permitted type Data Description


type
0.0- AnalogOut TwinSAFE-Out n=2: Output with the scaled input signal
(n-1) FB-In INT16 Processing order:
Standard-Out UINT16
n=4 AnalogIn negation
INT32 Nominator multiplication scaling factor (configurable)
UINT32
Denominator division scaling factor (configurable)
Addition scaling offset

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB SCALE This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB Scale1

Diagnostic information
Value Description
0.0 No diagnostic information
1.0 The output AnalogOut has an underflow (is less than the smallest possible value).
2.0 The output AnalogOut has an overflow (is greater than the largest possible value).
3.0 A 32-bit overflow occurred during the multiplication.
4.0 A 32-bit overflow occurred during the division due to rounding.

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x40B0 The output AnalogOut has an underflow (is FB number AnalogIn -
less than the smallest possible value).
0x40B1 The output AnalogOut has an overflow (is FB number AnalogIn -
greater than the largest possible value).
0x40B2 A 32-bit overflow occurred during the FB number AnalogIn -
multiplication.
0x40B3 A 32-bit overflow occurred during the FB number AnalogIn -
division due to rounding.

Status information
Value Description
1.0 RUN
In the RUN state, the FB SCALE module enters the result of scaling in the output
AnalogOut.
The outputs assume the following values:

138 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
Error = 0
AnalogOut = result of scaling
StuckAtError = StuckAtErrorDetected
2.0 STOP
If the input FbRun = FALSE, the FB SCALE module assumes the STOP state.
The outputs assume the following values:
Error = 0
AnalogOut = 0
StuckAtError = 0
4.0 ERROR
If the FB SCALE module detects an error when checking the value range of AnalogOut, the
FB SCALE module switches to the ERROR state and transmits the corresponding Diag
message to the GROUP module.
The outputs assume the following values:
Error = 1
AnalogOut = 0
StuckAtError = 0
5.0 RESET
If no more errors are present after an error has occurred and the ErrAck input of the
associated group is set to TRUE, the FB SCALE module assumes the RESET state.
The outputs assume the following values:
Error = 0
AnalogOut = 0
StuckAtError = 0

4.23.3 FB SCALE configuration in TwinCAT 3

Fig. 122: FB SCALE configuration

TwinSAFE Logic FB Version: 4.1.0 139


Function blocks

Fig. 123: FB SCALE properties

Fig. 124: FB SCALE port properties

A mouse click next to the FB Port, here AnalogIn, Error, StuckAtError and AnalogOut, can be used to create
variables that can be linked to input or output signals. Settings such as changing the data type or activation
of the input can be made via the properties of the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.24 The function block SPEED

4.24.1 Functional description


The FB SPEED is used to store the AnalogIn input and calculate a speed from it, based on the specified time
interval. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must be selected
to match the input types. The speed output is given in increments per time interval.

The parameter Time Interval is specified in ms.

140 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 125: Function block SPEED

NOTICE
KL6904/EL6900
The function block SPEED is not available in the KL6904 and the EL6900.

4.24.2 Signal description


FB Speed inputs
Offset Name Permitted type Data type Description
0.0- Position TwinSAFE-In n=2: Input channel for speed calculation
(n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC n=4
INT32
UINT32

FB Speed outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
0.0- Speed TwinSAFE-Out n=2: Output with the calculated speed
(n-1) FB-In INT16
Standard-Out UINT16
n=4
INT32
UINT32

FB Speed input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE- TwinSAFE output, e.g. an EL2904/KL2904
Out
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

TwinSAFE Logic FB Version: 4.1.0 141


Function blocks

Internal identifier of the FB


Type Description
FB SPEED This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB Speed

Diagnostic information
Value Description
0.0 No diagnostic information
1.0 The output Speed has an underflow (is less than the smallest possible value)
2.0 The output Speed has an overflow (is greater than the largest possible value)

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x4088 An underflow has occurred. FB number current position latched position
0x4089 An overflow has occurred. FB number current position latched position

Status information
Value Description
1.0 RUN
In the RUN state, the FB SPEED module enters the result of the speed calculation in the
output Speed.
The outputs assume the following values:
Error = 0
Speed = calculated speed
2.0 STOP
If the input FbRun = FALSE, the FB SPEED module assumes the STOP state.
The outputs assume the following values:
Error = 0
Speed = 0
4.0 ERROR
If the FB SPEED module detects an error when checking the value range of Speed, the FB
SPEED module switches to the ERROR state and transmits the corresponding diag
message to the GROUP module.
The outputs assume the following values:
Error = 1
Speed = 0
5.0 RESET
If there is no longer an error after an error has occurred and the ErrAck input of the
associated group is set to TRUE, the FB SPEED module assumes the RESET state.
The outputs assume the following values:
Error = 0
Speed = 0

142 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.24.3 FB Speed configuration in TwinCAT 3

Fig. 126: FB SPEED configuration

Fig. 127: FB SPEED properties

Fig. 128: FB SPEED port properties

A mouse click next to the FB Port, here Position, Error and Speed, can be used to create variables that can
be linked to input or output signals. Settings such as changing the data type or activation of the input can be
made via the properties of the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

The parameter Overflow Check can be used to specify speed calculation method in the event of an input
signal overflow.

TwinSAFE Logic FB Version: 4.1.0 143


Function blocks

4.25 The function block LOADSENSING

4.25.1 Functional description


The FB LoadSensing can be used to check the AnalogInX and AnalogInY inputs; specifically, whether the
AnalogInY values are within a certain range at position AnalogInX. The input data types INT16, INT32,
UINT16 and UINT32 are permitted. For the AnalogInY values in the table there is a warning level and a
switch-off level. The Outside parameter can be used to specify whether the AnalogInY value has to be within
or outside the defined window.

If Inactive=FALSE, the largest index is determined whose corresponding X-value is still smaller than the
AnalogInX input. The system then checks whether the AnalogInY input is within the corresponding switch-off
level (Y1, Y2) or within the warning level (WY1, WY2). If the value is within the switch-off level, the Valid
output is set. If the value is between the Y1 and WY1 or Y2 and WY2, the Warning output is set in addition.
There can be up to 25 indices.

The Outside parameter can be used to reverse the test, in which case values outside Y1 and Y2 are valid
and the output Valid is set. In this case the warning level must be greater than the switch-off level.

The data in the value table are checked based on the following formulas:

Outside = FALSE: Y1[index] <= WY1[index] < WY2[index] <= Y2[index]


Outside = TRUE: WY1[index] <= Y1[index] < Y2[index] <= WY2[index]

Fig. 129: Function block LOADSENSING

NOTICE
KL6904/EL6900
The function block LOADSENSING is not available in the KL6904 and the EL6900.

144 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 130: Illustration of the check of the characteristic curve

4.25.2 Signal description


FB LoadSensing inputs
Offset Name Permitted type Data type Description
6.0 Inactive TwinSAFE-In BOOL Input for activating the FB
FB-Out
Standard-In
TwinSAFE SC
0.0- AnalogInX TwinSAFE-In n=2: Analog x-value
(n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC n=4
INT32
UINT32
n- AnalogInY TwinSAFE-In m=2: Analog y-value
(m+n-1) FB-Out INT16
Standard-In UINT16
TwinSAFE SC m=4
INT32
UINT32

FB LoadSensing outputs
Offset Name Permitted type Data type Description
1.0 Valid TwinSAFE-Out BOOL This output is set if AnalogInY is within the switch-off
FB-In level.
Standard-Out

TwinSAFE Logic FB Version: 4.1.0 145


Function blocks

Offset Name Permitted type Data type Description


2.0 Warning TwinSAFE-Out BOOL This output is set if AnalogInY is between the switch-
FB-In off level and the warning level.
Standard-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB LoadSensing This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB LoadSensing

Diagnostic information
Value Description
- No diagnostic information

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
- - - - -

Status information
Value Description
1.0 RUN
If InActive = FALSE and AreaValid = TRUE, the FB LS module assumes the RUN state.
The outputs assume the following values:
Valid = 1
Warning = 0
2.0 STOP
If the input FbRun = FALSE, the FB LS module assumes the STOP state.
The outputs assume the following values:
Valid = 0
Warning = 0
3.0 SAFE
If InActive = FALSE, AreaValid = FALSE and AreaValidButWarning = FALSE, the FB LS
module assumes the SAF state.
The outputs assume the following values:
Valid = 0
Warning = 0
16.0 INACTIVE
If InActive = TRUE, the FB LS module assumes the INACTIVE state.
The outputs assume the following values:
Valid = 0
Warning = 0

146 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
17.0 WARNING
If InActive = FALSE and AreaValidButWarning = TRUE, the FB LS module assumes the
WARNING state.
The outputs assume the following values:
Valid = 1
Warning = 1

4.25.3 FB LOADSENSING configuration in TwinCAT 3

Fig. 131: FB LOADSENSING configuration

TwinSAFE Logic FB Version: 4.1.0 147


Function blocks

Fig. 132: FB LOADSENSING table

If values for Y1 and Y2 are specified in the table, values for the warning level WY1 and WY2 must also be
specified.

Fig. 133: FB LOADSENSING properties

148 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 134: FB LOADSENSING port properties

A mouse click next to the FB port, here Inactive, AnalogInX, AnalogInY, Valid and Warning, can be used to
create variables that can be linked to input or output signals. Settings such as changing the data type or
activation of the input can be made via the properties of the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.26 The function block CAMMONITOR

4.26.1 Functional description


The FB CamMonitor can be used to realize an electronic cam controller. In addition to excentric mode,
pendulum mode should also be supported.

CAUTION
FB CAMMONITOR
The FB CAMMONITOR provides a safe evaluation function block, which can output the cam data (TDC,
BDC, UpwardsMove) according to the set fixed values, depending on the current position.

Fig. 135: Function block CAMMONITOR

TwinSAFE Logic FB Version: 4.1.0 149


Function blocks

NOTICE
Function block output UpwardsMove
The output UpwardsMove indicates that the press is in upward motion after passing through BDC. This
signal can be used for muting of light curtains or for accepting the control command at the press.

DANGER
Press position detection!
Position detection must be realized corresponding to the required SIL or performance level. The user or
machine manufacturer must verify that this condition is satisfied.
The position value must be verified based on several analog values or made available to the function block
by other safe means. The former can be realized via the Compare function block, for example.
In addition, an expectation can be generated via the Press_Started input, by reporting a movement request
to the function block. The function block then monitors a change in position within the set parameters.

NOTICE
Excentric/pendulum mode
For excentric mode the Excentric Mode checkbox is set. The inputs TDC2_UpperLimit and
TDC2_LowerLimit must be inactive, or the parameters must be 0.
For pendulum mode the Pendulum Mode checkbox will be set. The inputs TDC2_UpperLimit and
TDC2_LowerLimit or the parameters are used.

NOTICE
KL6904/EL6900
The function block CAMMONITOR is not available in the KL6904 and the EL6900.

4.26.2 General properties of the FB CAMMONITOR

Fig. 136: FB CAMMONITOR properties

150 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 137: FB CAMMONITOR port properties

A mouse click next to the FB Port can be used to create variables that can be linked with input or output
signals. Settings such as changing the data type or activation of the input can be made via the properties of
the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

Sample position detection

In the following sample position detection takes place via 2 separate encoder systems. Scaling and
verification takes place within the TwinSAFE Logic. It is important that the encoder systems use a different
procedure for determining the position and are mechanically decoupled. The user should consider shaft
breakage detection in the mechanical configuration. One channel (here: sin/cos encoder) is transferred to
the EL6910 logic via the TwinSAFE SC technology. The second channel is transferred via the standard
EtherCAT communication of the EL6910.

Fig. 138: Structure diagram of the configuration

TwinSAFE Logic FB Version: 4.1.0 151


Function blocks

Fig. 139: Schematic diagram of the configuration

4.26.3 Use case excentric mode


In excentric mode, only one direction of rotation is permitted. The FB checks that after a cycle the position
stops after TDC (top dead center) plus maximum overrun (OverrunMax). The current overrun or position can
be output after TDC (OverrunTDC).

Once standstill is reached, a new cycle is not permitted until a falling edge is detected at the Reset input.

As a further parameter BDC (bottom dead center) is specified with a lower and upper limit (BDC_LowerLimit
and BDC_UpperLimit). The output CamMonOK is immediately set to FALSE if the press comes to a standstill
without having reached or exceeded TDC, or if the direction of rotation is reversed. If BDC is exceeded the
press is in upward movement. This information is output at the UpwardsMove output of the function block.

The BackwardsMove input is used to notify the function block that backward movement of the press is
permitted. This is only permitted if the position is between TDC1_UpperLimit and BDC_LowerLimit. The
backward movement ends when TDC1_UpperLimit is reached.

4.26.3.1 Schematic diagram of the ranges

Fig. 140: Excentric mode - schematic diagram of the ranges

152 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.26.3.2 Inputs
Offset Name Data type Description
Digital
0.0 Automatic safeBOOL 0: Normal operation
1: Automatic mode (no parameter verification)
1.0 BackwardsMov safeBOOL The input BackwardsMove can be used to move the press in
e backward direction in excentric mode. This is possible until
TDC1_UpperLimit is reached.
2.0 Reset safeBOOL Reset input. Before each press start a falling edge must be
BOOL detected at the input Reset. Only then may a motion take place or
the TDC exited.
3.0 Press_Started safeBOOL If the input is active, a motion or change of position is expected
BOOL when a logical 1 is encountered at the input. To this end the
parameter PressStartDelayTime, MoveDetectionTime and
MinPositionChange must be set.
4.0 OverrunCam safeBOOL not used
5.0 UpwardCam safeBOOL not used
6.0 SettingMode safeBOOL Parameter transfer in setup mode. Internal parameters can be
changed if the input is set to 1.
Analog
0.0-1.0 Position analog Press position. The position value must checked for plausibility
(UINT16/ based on several analog values or made available to the function
UINT32) block by other safe means.
2.0-3.0 TDC1_LowerLi Fixed value Excentric mode:
mit (UINT16/ The input or parameter TDC1_LowerLimit indicates the lower TDC
UINT32) limit (top dead center). It is to the left of TDC.
4.0-5.0 TDC1UpperLi Fixed value Excentric mode:
mit (UINT16/ The input or parameter TDC1_UpperLimit indicates the upper TDC
UINT32) limit (top dead center). It is to the right of TDC.
6.0-7.0 TDC2_LowerLi Fixed value not used
mit (UINT16/
UINT32)
8.0-9.0 TDC2UpperLi Fixed value not used
mit (UINT16/
UINT32)
10.0-11 BDC_LowerLi Fixed value The input or parameter BDC_LowerLimit must be less than
.0 mit (UINT16/ MaxPosition/2 and greater than OverrunMax.
UINT32)
12.0-13 BDC_UpperLi Fixed value The input or parameter BDC_UpperLimit must be greater than
.0 mit (UINT16/ MaxPosition/2 and less than TDC1_LowerLimit.
UINT32)
14.0-15 OverrunMax Fixed value OverrunMax indicates the position at which the press must have
.0 (UINT16/ stopped at the latest in excentric mode. If this value is exceeded
UINT32) without the press stopping, the output CamMonOK is set to
FALSE.
The input or parameter OverrunMax must be greater than
TDC1_UpperLimit and less than BDC_LowerLimit.

4.26.3.3 Outputs
Offset Name Permitted type Description
Digital
0.0 Error safeBOOL Error output
BOOL

TwinSAFE Logic FB Version: 4.1.0 153


Function blocks

Offset Name Permitted type Description


1.0 CamMonOK safeBOOL If all internal checks are without error, the output
BOOL CamMonOK is set. When the group in which the function
block is programmed is started, CamMonOK is set for the
first time when a falling edge is detected at the Reset input.
2.0 UpwardsMove safeBOOL The output UpwardsMove is set to logical 1 between
BOOL BDC_UpperLimit and 0°.
3.0 TDC safeBOOL Boolean output TDC is set if the current position is between
BOOL TDCx_LowerLimit and TDCx_UpperLimit.
4.0 BDC safeBOOL Boolean output BDC is set if the current position is between
BOOL BDC_LowerLimit and BDC_UpperLimit.
Analog
0.0-1.0 OverrunTDC analog Difference between TDC1_LowerLimit and current position
2.0-3.0 OverrunStop analog Difference between position at falling edge at input
Press_Started and current position

4.26.3.4 Parameter
Parameter Description
AllowedPositionJitter The analog position value may jitter somewhat even at standstill; this jitter is
indicated with AllowedPositionJitter.
StopDetectionTime Since the position is usually received via a TwinSAFE connection, its value will
not change in each cycle. For standstill detection the timeframe
(StopDetectionTime) must therefore by specified, within which the position must
only change around the AllowedPositionJitter.
PressStartDelayTime If the input PressStarted is active, the time must be specified after which a
motion must be detected when PressStarted has a positive edge.
MoveDetectionTime If the input PressStarted is active, the time must be specified after which the
position must change when a motion was detected for the first time.
MinPositionChange If the input PressStarted is active, a value must be specified to indicate the
minimum position change within the MoveDetectionTime
MaxPosition The parameter MaxPosition is used to set the maximum permitted position
value during a 360° movement of the press.
Pendulum Mode Checkbox for activating pendulum mode
Excentric Mode Checkbox for activating excentric mode

154 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.26.3.5 Scope recording of the sequence

Fig. 141: ScopeView display of the signal curve

Color Signal description


Current press position (here single-turn resolution 0 to 8192 increments)

OverrunTDC signal (change in position once TDC_LowerLimit is reached)

FB input CamReset (rising and falling edge before a motion may start)

FB input PressStarted (is set to 1 when the press motion is started and set to 0 when the press is
stopped.)
FB output TDC. Press is in top dead center (here set between 8092 and 100 increments). Press 0°
is 8192 or 0 increments.
FB output Upwards. Press is in upward movement. The signal is set when BDC is exited and reset
after 0° or 0 increments.

TwinSAFE Logic FB Version: 4.1.0 155


Function blocks

4.26.3.6 Cam Monitor function block excentric mode settings

Fig. 142: FB CamMonitor in excentric mode

Description of the fixed values of the sample configuration. The user must adjust these values according to
the hardware used.

The MaxPosition of 8192 increments is output in the event of a complete stroke by the encoder system used.
All other fixed values are derived from this MaxPosition (see schematic diagram of the ranges).

4.26.4 Use case: pendulum mode


In pendulum mode both directions of rotation are permitted. Two upper reversal points are parameterized
here.

Since the curve based on which the press is to be moved can or must be adjusted for each product, the
maximum range of the oscillating stroke is set as the limits for the upper reversal points.

The lower reversal point (BDC) is set with an upper and lower limit.

In pendulum mode the system checks that the upper limits (TDC1 and TDC2) are never exceeded. If this
happens, the output CamMonOK is set to FALSE. At the start of the cycle (falling edge at Reset input) the
press may start with any motion (pulsating, reverse, ...) until the lower reversal point (BDC) is reached. After
this only upward movement is permitted. The upward movement is output as a signal (UpwardsMove) at the
function block.

A new start is enabled via the Reset input. If the press is in downward motion without a falling edge having
been detected at the Reset input, the system is stopped immediately by setting CamMonOK to FALSE.

The optional function block inputs for connecting an upward or overrun cam are not supported in this
operation mode. An error is set if they are active erroneously.

156 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.26.4.1 Schematic diagram of the ranges

Fig. 143: Pendulum mode - schematic diagram of the ranges

4.26.4.2 Inputs
Offset Name Data type Description
Digital
0.0 Automatic safeBOOL 0: Normal operation
1: Automatic mode (no parameter verification)
1.0 BackwardsMove safeBOOL The input must be inactive in pendulum mode.
2.0 Reset safeBOOL Reset input. Before each press start a falling edge must be
BOOL detected at the input Reset. Only then may a motion take
place or the TDC exited.
3.0 Press_Started safeBOOL If the input is active, a motion or change of position is
BOOL expected when a logical 1 is encountered at the input. To
this end the parameter PressStartDelayTime,
MoveDetectionTime and MinPositionChange must be set.
4.0 OverrunCam safeBOOL The input OverrunCam must be inactive.
5.0 UpwardCam safeBOOL The input UpwardsCam must be inactive.
6.0 SettingMode safeBOOL Setup mode. Internal parameters can be changed if the
input is set to 1.
Analog
0.0-1.0 Position analog (UINT16/ Press position. The position value must be checked for
UINT32) plausibility from several analog values or made available to
the function block in another safe way, according to the
required SIL/performance level.
2.0-3.0 TDC1_LowerLim Fixed value The input or parameter TDC1_LowerLimit indicates the
it (UINT16/UINT32) lower limit of the TDC in the “left” half of the press. The
value must be greater than the BDC (Bottom Dead Center)
and less than TDC1_UpperLimit.
4.0-5.0 TDC1UpperLimit Fixed value The input or parameter TDC1_UpperLimit indicates the
(UINT16/UINT32) upper limit of the TDC in the “left” half of the press. The
value must greater than TDC1_LowerLimit and less than
MaxPosition.

TwinSAFE Logic FB Version: 4.1.0 157


Function blocks

Offset Name Data type Description


6.0-7.0 TDC2_LowerLim Fixed value The input or parameter TDC2_LowerLimit indicates the
it (UINT16/UINT32) lower limit of the TDC in the “right” half of the press. The
value must be greater than TDC2_UpperLimit and less than
BDC_LowerLimit.
8.0-9.0 TDC2UpperLimit Fixed value The input or parameter TDC2_UpperLimit indicates the
(UINT16/UINT32) upper limit of the TDC in the “right” half of the press. The
value must be greater than 0 and less than
TDC2_LowerLimit.
10.0-11. BDC_LowerLimit Fixed value The input or parameter BDC_LowerLimit must be less than
0 (UINT16/UINT32) MaxPosition/2 and greater than TDC2_LowerLimit.
12.0-13. BDC_UpperLimit Fixed value The input or parameter BDC_UpperLimit must be greater
0 (UINT16/UINT32) than MaxPosition/2 and less than TDC1_LowerLimit.
14.0-15. OverrunMax Fixed value The input or parameter OverrunMax must be disabled or set
0 (UINT16/UINT32) to 0.

4.26.4.3 Outputs
Offset Name Permitted type Description
Digital
0.0 Error safeBOOL Error output (see diagnostic information)
BOOL
1.0 CamMonOK safeBOOL If all internal checks are without error, the output
BOOL CamMonOK is set. When the group in which the function
block is programmed is started, CamMonOK is set for the
first time when a falling edge is detected at the Reset input.
2.0 UpwardsMove safeBOOL Depending in which half the motion is started, the output
BOOL UpwardsMove is set in the other half. The output is set from
BDC_UpperLimit or BDC_LowerLimit until press standstill is
detected.
3.0 TDC safeBOOL Boolean output TDC is set if the current position is between
BOOL TDCx_LowerLimit and TDCx_UpperLimit.
4.0 BDC safeBOOL Boolean output BDC is set if the current position is between
BOOL BDC_LowerLimit and BDC_UpperLimit.
Analog
0.0-1.0 OverrunTDC analog not used
2.0-3.0 OverrunStop analog Difference between position at falling edge at input
Press_Started and current position

4.26.4.4 Parameter
Parameter Description
AllowedPositionJitter The analog position value may jitter somewhat even at standstill; this jitter
is indicated with AllowedPositionJitter.
StopDetectionTime Since the position is usually received via a TwinSAFE connection, its
value will not change in each cycle. For standstill detection the timeframe
(StopDetectionTime) must therefore by specified, within which the
position must only change around the AllowedPositionJitter.
PressStartDelayTime If the input PressStarted is active, the time must be specified after which
a motion must be detected when PressStarted has a positive edge.
MoveDetectionTime If the input PressStarted is active, the time must be specified after which
the position must change when a motion was detected for the first time.
MinPositionChange If the input PressStarted is active, a value must be specified to indicate
the minimum position change within the MoveDetectionTime

158 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Parameter Description
MaxPosition The parameter MaxPosition is used to set the maximum permitted
position value during a 360° movement of the press.
Pendulum Mode Checkbox for activating pendulum mode
Excentric Mode Checkbox for activating excentric mode

4.26.4.5 Scope recording of the sequence

Fig. 144: ScopeView display of the signal curve

Color Signal description


Current press position (here single-turn resolution 0 to 8192 increments). Oscillation between
approx. 1300 and 6500 increments.
FB input CamReset (rising and falling edge before a motion may start)

FB input PressStarted (is set to 1 when the press motion is started and set to 0 when the press is
stopped.)
FB output TDC. Press is in top dead center (here set between 400 and 3696 increments for the
right side and between 4496 and 7796 increments for the left side)
FB output Upwards. Press is in upward movement. The signal is set when BDC is exited and reset
when press standstill is detected.

TwinSAFE Logic FB Version: 4.1.0 159


Function blocks

4.26.4.6 CamMonitor function block settings, pendulum mode

Fig. 145: FB CamMonitor in pendulum mode

Description of the fixed values of the sample configuration. The user must adjust these values according to
the hardware used.

The MaxPosition of 8192 increments is output in the event of a complete stroke by the encoder system used.
All other fixed values are derived from this MaxPosition (see schematic diagram of the ranges).

4.26.5 Use case: hardware cams


In excentric mode an UpwardCam and an OverrunCam can be connected to the function block as Boolean
signals. If these signals are enabled, the system checks that the upward cam is set after BDC (logical 1) and
reset at 0°. The overrun cam is checked for logical 1 after TDC1_LowerLimit and must remain set while the
press is at standstill. The overrun cam may only be reset when the next cycle starts.

The BackwardsMove input is used to notify the function block that backward movement of the press is
permitted. This is only permitted if the UpwardCAM and OverrunCAM inputs are not set. The backward
movement ends when OverrunCAM is reached.

4.26.5.1 Inputs
Offset Name Data type Description
Digital
0.0 Automatic safeBOOL 0: Normal operation
1: Automatic mode (no parameter verification)
1.0 BackwardsMove safeBOOL The input BackwardsMove can be used to move the press
in backward direction in excentric mode. This is possible
until TDC1_UpperLimit is reached.

160 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Offset Name Data type Description


2.0 Reset safeBOOL Reset input. Before each press start a falling edge must be
BOOL detected at the input Reset. Only then may a motion take
place or the TDC exited.
3.0 Press_Started safeBOOL If the input is active, a motion or change of position is
BOOL expected when a logical 1 is encountered at the input. To
this end the parameter PressStartDelayTime,
MoveDetectionTime and MinPositionChange must be set.
4.0 OverrunCam safeBOOL The input OverrunCam must be connected to a Boolean
input.
5.0 UpwardCam safeBOOL The input UpwardsCam must be connected to a Boolean
input.
6.0 SettingMode safeBOOL Parameter transfer in setup mode. Internal parameters can
be changed if the input is set to 1.
Analog
0.0-1.0 Position analog (UINT16/ Press position. The position value must checked for
UINT32) plausibility based on several analog values or made
available to the function block by other safe means.
2.0-3.0 TDC1_LowerLim Fixed value Excentric mode:
it (UINT16/UINT32) The input or parameter TDC1_LowerLimit indicates the
lower TDC limit (top dead center). It is to the left of TDC.
4.0-5.0 TDC1UpperLimit Fixed value Excentric mode:
(UINT16/UINT32) The input or parameter TDC1_UpperLimit indicates the
upper TDC limit (top dead center). It is to the right of TDC.
6.0-7.0 TDC2_LowerLim Fixed value not used
it (UINT16/UINT32)
8.0-9.0 TDC2UpperLimit Fixed value not used
(UINT16/UINT32)
10.0-11. BDC_LowerLimit Fixed value The input or parameter BDC_LowerLimit must be less than
0 (UINT16/UINT32) MaxPosition/2 and greater than OverrunMax.
12.0-13. BDC_UpperLimit Fixed value The input or parameter BDC_UpperLimit must be greater
0 (UINT16/UINT32) than MaxPosition/2 and less than TDC1_LowerLimit.
14.0-15. OverrunMax Fixed value OverrunMax indicates the position at which the press must
0 (UINT16/UINT32) have stopped at the latest in excentric mode. If this value is
exceeded without the press stopping, the output
CamMonOK is set to FALSE.
The input or parameter OverrunMax must be greater than
TDC1_UpperLimit and less than BDC_LowerLimit.

4.26.5.2 Outputs
Offset Name Permitted type Description
Digital
0.0 Error safeBOOL Error output
BOOL
1.0 CamMonOK safeBOOL If all internal checks are without error, the output
BOOL CamMonOK is set. When the group in which the function
block is programmed is started, CamMonOK is set for the
first time when a falling edge is detected at the Reset input.
2.0 UpwardsMove safeBOOL The output UpwardsMove is set to logical 1 between
BOOL BDC_UpperLimit and 0°.
3.0 TDC safeBOOL Boolean output TDC is set if the current position is between
BOOL TDCx_LowerLimit and TDCx_UpperLimit.

TwinSAFE Logic FB Version: 4.1.0 161


Function blocks

Offset Name Permitted type Description


4.0 BDC safeBOOL Boolean output BDC is set if the current position is between
BOOL BDC_LowerLimit and BDC_UpperLimit.
Analog
0.0-1.0 OverrunTDC analog Difference between TDC1_LowerLimit and current position
2.0-3.0 OverrunStop analog Difference between position at falling edge at input
Press_Started and current position

4.26.5.3 Parameter
Parameter Description
AllowedPositionJitter
The analog position value may jitter somewhat even at standstill; this jitter is
indicated with AllowedPositionJitter.
StopDetectionTime Since the position is usually received via a TwinSAFE connection, its value will not
change in each cycle. For standstill detection the timeframe (StopDetectionTime)
must therefore by specified, within which the position must only change around the
AllowedPositionJitter.
PressStartDelayTime If the input PressStarted is active, the time must be specified after which a motion
must be detected when PressStarted has a positive edge.
MoveDetectionTime If the input PressStarted is active, the time must be specified after which the position
must change when a motion was detected for the first time.
MinPositionChange If the input PressStarted is active, a value must be specified to indicate the minimum
position change within the MoveDetectionTime
MaxPosition The parameter MaxPosition is used to set the maximum permitted position value
during a 360° movement of the press.
Pendulum Mode Checkbox for activating pendulum mode
Excentric Mode Checkbox for activating excentric mode

4.26.5.4 Scope recording of the sequence

Fig. 146: ScopeView display of the signal curve

Color Signal description


FB input CamReset (rising and falling edge before a motion may start)

162 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Color Signal description


OverrunCAM (FB input)

UpwardCAM (FB input)

TDC (FB output; here position 64535 to 100)

BDC (FB output; here position 31767 to 33767)

Upwards (FB output)

Current press position. Here one revolution: 0 to 65535 increments

OverrunTDC output. Change in position after TDC1_LowerLimit is reached.

4.26.5.5 CamMonitor function block hardware cam settings

Fig. 147: FB CamMonitor in excentric mode with hardware cams

Description of the fixed values of the sample configuration. The user must adjust these values according to
the hardware used.

The MaxPosition of 65535 increments is output in the event of a complete stroke by the encoder system
used. All other fixed values are derived from this MaxPosition (see schematic diagram of the ranges
excentric mode).

TwinSAFE Logic FB Version: 4.1.0 163


Function blocks

4.26.6 Description of the process

4.26.6.1 Standstill detection


The FB CAMMONITOR detects a standstill (Stopped =TRUE) if the change in position within the
StopDetectionTime is less than or equal to the AllowedPositionJitter.

4.26.6.2 Press movement


If the input PressStarted is TRUE, the function block monitors the press for movement.

The FB CAMMONITOR detects a press movement if the change in position at the Position input within the
MoveDetectionTime is greater than the MinPositionChange.

The PressStartDelayTimer is started when the PressStarted input changes from FALSE to TRUE. When the
PressStartDelayTimer has elapsed, PressStarted is TRUE and no press movement was detected, the
function block detects this and sets CamMonOK to FALSE. An error message is issued via the DiagHistory
of the EL6910.

4.26.6.3 Direction detection


A backward or counter-clockwise movement (MoveContraClockwise=TRUE) is detected if the position has
changed in counter-clockwise direction.

A forward or clockwise movement (MoveClockwise=TRUE) is detected if the position has changed in


clockwise direction.

In order for a movement to be detected, the position must change by more than the MaxPositionJitter within
the StopDetectionTime.

4.26.6.4 SettingMode
If the input SettingMode is set, in excentric mode the fixed values TDC1_LowerLimit, TDC1_UpperLimit,
BDC_LowerLimit, BDC_UpperLimit and OverrunMax are changed retrospectively and saved in a non-volatile
manner. In pendulum mode this applies to the set fixed values TDC1_LowerLimit, TDC1_UpperLimit,
TDC2_LowerLimit, TDC2_UpperLimit, BDC_LowerLimit and BDC_UpperLimit.

4.26.7 Diagnostics messages excentric mode

4.26.7.1 Parameter error


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
In excentric mode the following parameter errors may occur and be reported accordingly.
0x4025 TDC1UpperLimit <= The TDCUpperLimit (%d) is FB instance TDC1Upper Allowed
AllowedPositionJitter lower or equal than the Limit PositionJitter
maximum position jitter (%d)
0x401A (TDC1UpperLimit + The value of TDCUpperLimit FB instance TDC1Upper OverrunMax
2*AllowedPositionJitt (plus twice the maximum Limit +
er) >= OverrunMax position jitter) (%d) is 2*Allowed
greater than or equal to the PositionJitter
value of OverrunMax (%d)
0x4019 (OverrunMax + The value of OverrunMax FB instance OverrunMax BDCLower Limit
2*AllowedPositionJitt (plus twice the maximum + 2*Allowed
er) >= position jitter) (%d) is PositionJitter
BDCLowerLimit greater than or equal to the
value of BDCLowerLimit
(%d)

164 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3


0x4018 (BDCLowerLimit + The value of BDCLowerLimit FB instance BDCLower MaxPosition/2
AllowedPositionJitter (plus maximum position Limit +
) >= MaxPosition/2 jitter) (%d) is greater than or Allowed
equal to the configured PositionJitter
value of 180° (%d)
0x4017 BDCUpperLimit <= The value of BDCUpperLimit FB instance BDCUpper MaxPosition/2 +
(MaxPosition/2 + (%d) is less than or equal to Limit Allowed
AllowedPositionJitter the configured value of 180° PositionJitter
) (plus maximum position
jitter) (%d)
0x4016 (BDCUpperLimit + The value of BDCUpperLimit FB instance BDCUpper TDC1Lower Limit
2*AllowedPositionJitt (plus twice the maximum Limit +
er) >= position jitter) (%d) is 2*Allowed
TDC1LowerLimit greater than or equal to the PositionJitter
value of TDCLowerLimit
(%d)
0x4015 (TDC1LowerLimit + The value of TDCLowerLimit FB instance TDC1Lower MaxPosition
AllowedPositionJitter (plus maximum position Limit +
) > MaxPosition jitter) (%d) is greater than or Allowed
equal to the configured PositionJitter
position of 360° (%d)
0x4002 Position > The Position (%d) is greater FB instance Position MaxPosition+
(MaxPosition than the maximum position Allowed
+AllowedPositionJitt (plus the maximum position PositionJitter
er) jitter) (%d)

4.26.7.2 Movement errors


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
Movement errors reported in function block state ERROR
0x400E Automatic = FALSE The position has been FB instance - -
AND BackwardsMove changed negatively
= FALSE AND
MoveContraClockWis
e =TRUE
0x4013 Automatic = FALSE The BackwardsMove input FB instance - -
AND BackwardsMove is TRUE while the
= TRUE AND movement is clockwise
MoveClockWise=
TRUE
0x4012 Automatic = FALSE The BackwardsMove input FB instance Position -
AND BackwardsMove is TRUE while the Position
= TRUE AND is between 180° and 360°,
(LeftArea = TRUE the actual position is %d
OR
TDCLeftArea=TRUE)

4.26.7.3 Error while OverrunCAM input is active


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
OverrunCAM errors reported in function block state ERROR
0x4005 Automatic = FALSE The OverrunCAM input was FB instance Position -
AND OverrunCAM = TRUE in the area between
TRUE AND OverrunMax and
BDCRightArea= BDCUpperLimit, the actual
TRUE position is %d

TwinSAFE Logic FB Version: 4.1.0 165


Function blocks

Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3


0x4003 Automatic = FALSE The OverrunCAM input was FB instance Position -
AND OverrunCAM = FALSE in the top dead
FALSE AND center area, the actual
TDCArea=TRUE position is %d
0x4004 Automatic = FALSE The OverrunCAM input FB instance Position -
AND LeftArea = changed from FALSE to
FALSE AND TRUE outside the area
OverrunCAM between BDCUpperLimit
changes to TRUE and TDCLowerLimit, the
actual position is %d
0x4006 Automatic = FALSE The OverrunCAM input FB instance Position -
AND changed from TRUE to
OverrunMaxArea = FALSE outside the area
FALSE AND between OverrunMax and
OverrunCAM BDCLowerLimit, the actual
changes to FALSE position is %d

4.26.7.4 Error while UpwardsCAM input is active


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
UpwardsCAM errors reported in function block state ERROR
0x400F Automatic=FALSE The UpwardsCAM input FB instance Position -
AND was TRUE in the area
UpwardsCAM=TRUE between OverrunMax and
AND BDCLowerLimit
OverrunMaxRightArea=
TRUE
0x4007 Automatic=FALSE The UpwardsCAM input FB instance Position -
AND was FALSE in the area
UpwardsCAM=FALSE between BDCUpperLimit
AND LeftArea=TRUE and TDCLowerLimit, the
actual position is %d
0x4008 Automatic = FALSE The UpwardsCAM input FB instance Position -
AND BDCArea=FALSE changed from FALSE to
AND UpwardsCAM TRUE outside the area
changes to TRUE between BDCLowerLimit
and TDCLowerLimit, the
actual position is %d
0x4009 Automatic = FALSE The UpwardsCAM input FB instance Position -
AND TDCArea = changed from TRUE to
FALSE AND FALSE outside the area
UpwardsCAM changes between TDCLowerLimit
to FALSE and OverrunMax, the
actual position is %d

4.26.7.5 Error during starting and stopping in TDC


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
Errors during starting or stopping in TDC reported in function block state ERROR
0x400D In MOVE-TDC state The Position has left the FB instance Position -
Stopped does not top dead center while
change to TRUE while waiting for a stop, the
TDCArea is TRUE actual position is %d
0x400A In MOVE-STOP state The Position was moving FB instance - -
Reset is FALSE and while waiting for a rising
Stopped changes to edge at the Reset input in
FALSE the MOVE-STOP state

166 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3


0x400B In MOVE-START state The Position was moving FB instance - -
Reset is TRUE and while waiting for a falling
Stopped changes to edge at the Reset input in
FALSE the MOVE-START state
0x400C In MOVE-UP state The Position %d in the FB instance Position -
LeftArea and area between OverrunMax
TDCAreaMax become and BDCLowerLimit was
FALSE detected in the MOVE-UP
state
0x4024 In WAIT-FOR-RESET The Position was moving FB instance
state Reset is FALSE while waiting for a falling
and Stopped changes edge on the Reset input in
to FALSE the WAIT-FOR_RESET
state

4.26.7.6 Error while PressStarted input is active


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
Errors reported in function block state ERROR when input PressStarted is TRUE
0x401F If PressStarted is The PressStarted input is FB instance - -
TRUE and Stopped TRUE and the position
does not change to did not move after the
FALSE within the PressStartedDelayTime
PressStartedDelayTim
e
0x4020 PressStarted is TRUE The PressStarted input is FB instance - -
and Stopped changes TRUE and the position
to TRUE has stopped after moving
before
0x4021 PressStarted is TRUE The PressStarted input is FB instance Position Comparison
and Stopped FALSE TRUE and the position position
and position does not has not moved enough,
change by at least the actual position is %d,
MinPositionChange the compare position is
within the %d
MoveDetectionTime

4.26.8 Diagnostic messages pendulum mode

4.26.8.1 Parameter error


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
In pendulum mode the following parameter errors may occur and be reported accordingly.
0x4001 TDC2UpperLimit <= The TDC2UpperLimit (%d) is FB instance TDC2UpperLimit AllowedPositionJitter
AllowedPositionJitter lower or equal than the maximum
position jitter (%d)
0x401E (TDC2UpperLimit + The value of TDC2UpperLimit FB instance TDC2UpperLimit+ TDC2LowerLimit
2*AllowedPositionJitter) >= (plus twice the maximum position 2*
TDC2LowerLimit jitter) (%d) is greater than or AllowedPositionJit
equal to the value of ter
TDC2LowerLimit (%d)
0x401D (TDC2LowerLimit + The value of TDC2LowerLimit FB instance TDC2LowerLimit BDCLowerLimit
2*AllowedPositionJitter) >= (plus twice the maximum position + 2*
BDCLowerLimit jitter) (%d) is greater than or AllowedPositionJit
equal to the value of ter
BDCLowerLimit (%d)
0x4018 (BDCLowerLimit + The value of BDCLowerLimit FB instance BDCLowerLimit + MaxPosition/2
AllowedPositionJitter) >= (plus maximum position jitter) AllowedPositionJit
MaxPosition/2 (%d) is greater than or equal to ter
the configured value of 180° (%d)

TwinSAFE Logic FB Version: 4.1.0 167


Function blocks

Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3


0x4017 BDCUpperLimit <= The value of BDCUpperLimit FB instance BDCUpperLimit MaxPosition/2 +
(MaxPosition/2 + (%d) is less than or equal to the AllowedPositionJitter
AllowedPositionJitter) configured value of 180° (plus
maximum position jitter) (%d)
0x4016 (BDCUpperLimit + The value of BDCUpperLimit FB instance BDCUpperLimit+ TDC1LowerLimit
2*AllowedPositionJitter) >= (plus twice the maximum position 2*AllowedPosition
TDC1LowerLimit jitter) (%d) is greater than or Jitter
equal to the value of
TDCLowerLimit (%d)
0x401C (TDC1LowerLimit + The value of TDC1LowerLimit FB instance TDC1LowerLimit TDC1UpperLimit
2*AllowedPositionJitter) >= (plus twice the maximum position +
TDC1UpperLimit jitter) (%d) is greater than or 2*AllowedPosition
equal to the value of Jitter
TDC1UpperLimit (%d)
0x401B (TDC1UpperLimit + The value of TDC1UpperLimit FB instance TDC1UpperLimit+ MaxPosition
AllowedPositionJitter) >= (plus the maximum position jitter) AllowedPositionJit
MaxPosition (%d) is greater than or to equal ter
the configured position of 360°
(%d)
0x4002 Position > (MaxPosition The Position (%d) is greater than FB instance Position MaxPosition +
+AllowedPositionJitter) the maximum position (plus the AllowedPositionJitter
maximum position jitter) (%d)
0x4010 Position overruns The Position has a circle overflow FB instance
MaxPosition in Pendulum Mode, actual
position=%d, last position=%d

4.26.8.2 Movement errors


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
Movement errors reported in function block state ERROR
0x4022 In MOVE-UP- The Position has changed FB instance Position last position
CLOCKWISE state counter clockwise while
MoveContraClockwis moving up clockwise (actual
e becomes TRUE Position=%d, old
Position=%d)
0x4023 In MOVE-UP- The Position has changed FB instance Position last position
CONTRA- clockwise while moving up
CLOCKWISE state counter clockwise (actual
MoveClockwise Position=%d, old
becomes TRUE Position=%d)
0x4011 In MOVE-STOP-TDC The Position has moved FB instance Position last position
state Reset is FALSE while waiting for a rising
and Stopped changes edge at the Reset input in
to FALSE Pendulum Mode, actual
position=%d, compare
position=%d
0x4014 In MOVE-START- The Position has moved FB instance Position last position
TDC state Reset is while waiting for a falling
TRUE and Stopped edge at the Reset input in
changes to FALSE Pendulum Mode, actual
position=%d, last
position=%d
0x4024 In WAIT-FOR-RESET The Position was moving FB instance Position -
state Reset is FALSE while waiting for a falling
and Stopped changes edge on the Reset input in
to FALSE the WAIT-FOR_RESET
state

4.26.8.3 Error while PressStarted input is active


Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3
Errors reported in function block state ERROR when input PressStarted is TRUE

168 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3


0x401F If PressStarted is The PressStarted input is FB instance - -
TRUE and Stopped TRUE and the position did
does not change to not move after the
FALSE within the PressStartedDelayTime
PressStartedDelayTim
e
0x4020 PressStarted is TRUE The PressStarted input is FB instance - -
and Stopped changes TRUE and the position has
to TRUE stopped after moving before
0x4021 PressStarted is TRUE The PressStarted input is FB instance Position Comparison
and Stopped FALSE TRUE and the position has position
and position does not not moved enough, the
change by at least actual position is %d, the
MinPositionChange compare position is %d
within the
MoveDetectionTime

4.26.9 Status information


The FB CamMonitor can have the following states. They are made available to the user via the diagnostic
information.
Value Designation Description
1.0 0x01 RUN The function block is in RUN state, the CamMonOK output is 1, and the other outputs
are set according to the current position.
(general)
2.0 0x02 STOP The function block is in STOP state, all outputs are FALSE or 0.
(general)
3.0 0x03 SAFE The function block is SAFE state, i.e. the press motion is not as expected. All outputs
are FALSE or 0.
(general)
4.0 0x04 ERROR Function block error (see diagnostic messages table). Error output is TRUE, all other
outputs are FALSE.
(general)
5.0 0x05 RESET The function block assumes the RESET state if no further error is pending after an
error has occurred and the ErrAck input of the corresponding group is set to TRUE.
(general)
6.0 0x06 START If the STOP state is exited with RESET = TRUE, the function block assumes the
START state.
(general)
15.0 0x0F WAIT-FOR-RESET The function block assumes the WAIT-FOR-RESET state if Reset is FALSE and
ErrAck is set to FALSE in RESET state.
(general)
16.0 0x10 MOVE-STOP The function block is in MOVE-STOP state, i.e. no change in position was detected in
the TDC range. The press is stopped in the TDC range.
(Excentric mode)
17.0 0x11 MOVE-START The function block assumes the MOVE-START state if the Reset input becomes
TRUE in MOVE-STOP state.
(Excentric mode)
18.0 0x12 MOVE-DOWN The function block assumes the MOVE-DOWN state if the Reset input becomes
FALSE in MOVE-START state.
(Excentric mode)
19.0 0x13 MOVE-UP The function block assumes the MOVE-UP state if LeftArea becomes TRUE in MOVE-
DOWN state.
(Excentric mode)
20.0 0x14 MOVE-TDC The function block assumes the MOVE-TDC state if TDCAreaMax becomes TRUE in
MOVE-UP state.
(Excentric mode)
32.0 0x20 MOVE-DOWN-CLOCKWISE The function block assumes the MOVE-DOWN-CLOCKWISE state when a downward
movement starts in clockwise direction.
(Pendulum mode)
33.0 0x21 MOVE-UP-CLOCKWISE The function block assumes the MOVE-UP-CLOCKWISE state if LeftArea becomes
TRUE in MOVE-DOWN-CLOCKWISE state.
(Pendulum mode)
34.0 0x22 MOVE-UP-TDC1 The function block assumes the MOVE-UP-TDC1 state if TDC1Area or
TDC1ExceededArea becomes TRUE in MOVE-DOWN-CLOCKWISE or MOVE-UP-
(Pendulum mode)
CLOCKWISE state.
35.0 0x23 MOVE-STOP-TDC1 The function block assumes the MOVE-STOP-TDC1 state if the press is stopped in
MOVE-UP-TDC1 state.
(Pendulum mode)

TwinSAFE Logic FB Version: 4.1.0 169


Function blocks

Value Designation Description


36.0 0x24 MOVE-START-TDC1 The function block assumes the MOVE-START-TDC1 state if the input Reset
becomes TRUE in MOVE-STOP-TDC1 state.
(Pendulum mode)
37.0 0x25 MOVE-DOWN-CONTRA- The function block assumes the MOVE-DOWN-CONTRA-CLOCKWISE state when a
CLOCKWISE downward movement starts in counter-clockwise direction.
(Pendulum mode)
38.0 0x26 MOVE-UP-CONTRA- The function block assumes MOVE-UP-CONTRA-CLOCKWISE state if RightArea
CLOCKWISE becomes TRUE in MOVE-DOWN-CONTRA-CLOCKWISE state.
(Pendulum mode)
39.0 0x27 MOVE-UP-TDC2 The function block assumes the MOVE-UP-TDC2 state if TDC2Area or
TDC2ExceededArea becomes TRUE in MOVE-DOWN-CONTRA-CLOCKWISE or
(Pendulum mode)
MOVE-UP-CONTRA-CLOCKWISE state.
40.0 0x28 MOVE-STOP-TDC2 The function block assumes the MOVE-STOP-TDC2 state if the press is stopped in
MOVE-UP-TDC2 state.
(Pendulum mode)
41.0 0x29 MOVE-START-TDC2 The function block assumes the MOVE-START-TDC2 state if the input Reset
becomes TRUE in MOVE-STOP-TDC2 state.
(Pendulum mode)

Internal identifier of the FB


Type Description
FB CamMonitor This description applies to BLG 1.0 / BLG 2.0 (internal version number)

4.27 The function block SLI

4.27.1 Functional description


The FB SLI is used to save the Position input when a rising edge is encountered at input SLI (LatchPosition).
As long as SLI is set to TRUE, the system checks whether the position is within the limits LatchPosition -
Limit neg and LatchPosition + Limit pos. If this is the case the output SLIActive is set to TRUE. If the position
leaves the defined range, SLIActive is set to FALSE. The PositionDiff output indicates the current difference
between Position and LatchPosition. A falling edge at SLIActive also results in setting of the output
PositionDiff to 0. The input data types INT16, INT32, UINT16 and UINT32 are permitted for Position. The
output PositionDiff supports the output data types INT16 and INT32.

The parameters Limit pos and Limit neg are UINT32 values and are therefore always specified positive.

170 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 148: Function block SLI

NOTICE
KL6904/EL6900
The function block SLI is not available in the KL6904 and the EL6900.

4.27.2 Signal description


FB SLI inputs
Offset Name Permitted type Data type Description
0.0 SLI TwinSAFE-In BOOL Input for activating the function and saving the current
FB-Out position.
TwinSAFE SC
0.0- Position TwinSAFE-In n=2 Position value. Is saved with the rising edge at SLI and
(n-1) FB-Out INT16 compared with the saved position as long as SLI
TwinSAFE SC UINT16 remains set and the difference is output at PositionDiff.
n=4:
INT32
UINT32

FB SLI outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
1.0 SLIActive TwinSAFE-Out BOOL SLIActive is set if SLI is TRUE and PositionDiff is within
FB-In the defined limits.
Standard-Out
0.0- PositionDiff TwinSAFE-Out n=2 Output of the difference position between the saved
(n-1) FB-In INT16 (LatchPosition) and current position. PositionDiff is set
Standard-Out n=4: to 0 if SLIActive is FALSE.
INT32

TwinSAFE Logic FB Version: 4.1.0 171


Function blocks

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

FB SLI parameters
Parameter Description
Limit pos Permitted deviation of the saved position (LatchPosition) in positive direction
(UINT32)
Limit neg Permitted deviation of the saved position (LatchPosition) in negative direction
(UINT32)

Internal identifier of the FB


Type Description
FB SLI This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB SLI

Diagnostic information
Value Description
0.0 No diagnostic information
1.0 Underflow (PositionDiff < -NegLimit)
2.0 Overflow (PositionDiff > PosLimit)

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x40C0 An underflow has occurred FB instance Position LatchPosition
0x40C1 An overflow has occurred FB instance Position LatchPosition

Status information
Value Description
1.0 RUN
In the RUN state, the FB SLI module determines the PositionDiff and checks whether
-NegLimit <= PositionDiff <= PosLimit applies.
The outputs assume the following values:
Error = 0
SLIActive = 1
PositionDiff = Position - LatchPosition
2.0 STOP
If the input FbRun=FALSE, the FB SLI module assumes the STOP state.
The outputs assume the following values:
Error = 0
SLIActive = 0
PositionDiff = 0
3.0 SAFE
If the input SLI=FALSE, the FB SLI module assumes the SAFE state.
The outputs assume the following values:

172 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
Error = 0
SLIActive = 0
PositionDiff = 0
4.0 ERROR
If the FB SLI module detects an error when checking the permitted range for the PositionDiff, the
FB SLI module switches to the ERROR state and transmits the corresponding Diag message to
the GROUP module.
The outputs assume the following values:
Error = 1
SLIActive = 0
PositionDiff = 0
5.0 RESET
If no more errors are present after an error has occurred and the input ErrAck of the associated
group is set to TRUE, the FB SLI module assumes the RESET state. The FB SLI module should
only exit the RESET state if ErrAck=FALSE and SLI=FALSE.
The outputs assume the following values:
Error = 0
SLIActive = 0
PositionDiff = 0
7.0 EXCEEDED
If ExceededSupport = TRUE and PositionDiff < NegLimit (underflow) or PositionDiff > PosLimit
(overflow) is in the RUN state, the FB SLI2 module assumes the EXCEEDED state.
The outputs assume the following values:
Error = 0
SLIActive = 0
PositionDiff = Position - LatchPosition

4.27.3 FB SLI configuration in TwinCAT 3

Fig. 149: FB SLI configuration

TwinSAFE Logic FB Version: 4.1.0 173


Function blocks

Fig. 150: FB SLI properties

Fig. 151: FB SLI port properties

A mouse click next to the FB Port can be used to create variables that can be linked with input or output
signals. Settings such as changing the data type or activation of the input can be made via the properties of
the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.28 The function block SLI2

4.28.1 Functional description


The FB SLI2 corresponds to the function block SLI with the exception of the outputs. SLI2 has two outputs
and two more parameters than SLI.

174 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 152: Function block SLI2

This chapter therefore only describes the outputs, the parameters and the status information. All further
information can be found in chapter The function block SLI [} 170].

4.28.2 Description of the signals

4.28.2.1 Outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
1.0 SLIActive TwinSAFE-Out BOOL SLIActive is set if SLI is TRUE and PositionDiff is within
FB-In the defined limits.
Standard-Out
0.0- PositionDiff TwinSAFE-Out n=2 Output of the difference position between the saved
(n-1) FB-In INT16 (LatchPosition) and current position. PositionDiff is set
Standard-Out n=4: to 0 if SLIActive is FALSE.
INT32
2.0 BelowMin BOOL Falling below the latch position
3.0 AboveMax BOOL Exceeding the latch position

4.28.2.2 Parameter
Parameter Description
Limit pos Permitted deviation of the saved position (LatchPosition) in positive direction
(UINT32)
Limit neg Permitted deviation of the saved position (LatchPosition) in negative direction
(UINT32)
OverflowAllowed Overflow allowed or not allowed
ExceededSupport If an underflow or overflow occurs in the RUN state, the FB changes to the
EXCEEDED state instead of ERROR

TwinSAFE Logic FB Version: 4.1.0 175


Function blocks

4.28.2.3 Diagnostic message

Status information
Value Description
1.0 RUN
In the RUN state, the FB SLI2 module determines the PositionDiff and checks whether
-NegLimit <= PositionDiff <= PosLimit applies.
The outputs assume the following values:
Error = 0
SLIActive = 1
BelowMin = 0
AboveMax = 0
PositionDiff = Position - LatchPosition
2.0 STOP
If the input FbRun = FALSE, the FB SLI2 module assumes the STOP state.
The outputs assume the following values:
Error = 0
SLIActive = 0
BelowMin = 0
AboveMax = 0
PositionDiff = 0
3.0 SAFE
If the input SLI = FALSE, the FB SLI2 module assumes the SAFE state.
The outputs assume the following values:
Error = 0
SLIActive = 0
BelowMin = 0
AboveMax = 0
PositionDiff = 0
4.0 ERROR
If the FB SLI module detects an error when checking the permitted range for the PositionDiff, the
FB SLI2 module switches to the ERROR state and transmits the corresponding Diag message to
the GROUP module.
The outputs assume the following values:
Error = 1
SLIActive = 0
BelowMin = 0
AboveMax = 0
PositionDiff = 0
5.0 RESET
If no more errors are present after an error has occurred and the input ErrAck of the associated
group is set to TRUE, the FB SLI2 module assumes the RESET state. The FB SLI 2 module
should only exit the RESET state if ErrAck = FALSE and SLI = FALSE.
The outputs assume the following values:
Error = 0
SLIActive = 0
PositionDiff = 0
7.0 EXCEEDED
If ExceededSupport = TRUE and PositionDiff < NegLimit (underflow) or PositionDiff > PosLimit
(overflow) in the RUN state, the FB SLI2 module assumes the EXCEEDED state.
The outputs assume the following values:
Error = 0
SLIActive = 0
BelowMin = Underflow
AboveMax = Overflow
PositionDiff = Position - LatchPosition

176 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.28.3 FB SLI2 configuration in TwinCAT 3

Fig. 153: FB SLI2 configuration

In the function block view, you have the option of defining the permissible deviation of the saved position in
the positive and negative direction. By clicking next to the FB port, you can create variables that can be
linked to input or output signals.

Fig. 154: FB SLI2 port properties

Settings such as changing the data type or activation of the port can be made via the properties of the FB
Port.

TwinSAFE Logic FB Version: 4.1.0 177


Function blocks

Fig. 155: FB SLI2 properties

The entries "Map Diag" and "Map State" in the properties window of the FB define which diagnostic functions
of the FB are mapped in the cyclic process image. In the parameter settings, you can define whether an
overflow is allowed or not and whether the FB in the RUN state should switch to the EXCEEDED state in the
event of an underflow or overflow.

Under "Miscellaneous", you can select the position at which the function block is to be executed in the
execution order.

It is possible to change the instance name in both views.

Further information on the parameters can be found in chapter Parameter [} 175].

178 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.29 The function block SLP

4.29.1 Functional description


With a valid position SafePosionValid=1, the FB SLP monitors the current position for the specified limits
PositionUpperLimit and PositionLowerLimit.

Fig. 156: Function block SLP

4.29.1.1 Multiturn operation mode


In Multiturn mode, the complete 64 bits of SafePosition, SafePositionLowerLimit and SafePositionHigherLimit
are used in the comparisons.

SafePosValid = TRUE, SafePositionLowerLimit ≤ SafePosition ≤ SafePositionHigherLimit

FB SLP TRUE
PositionInLimit 1
BelowMin 0
AboveMax 0

SafePosValid = TRUE and SafePosition < SafePositionLowerLimit

FB SLP FALSE
PositionInLimit 0
BelowMin 1
AboveMax 0

SafePosValid = TRUE und SafePosition > SafePositionHigherLimit

FB SLP FALSE

TwinSAFE Logic FB Version: 4.1.0 179


Function blocks

PositionInLimit 0
BelowMin 0
AboveMax 1

4.29.1.2 Singleturn operation mode


In Singleturn mode, only the lower 32 bits of SafePosition, SafePositionLowerLimit and
SafePositionHigherLimit are used in the comparisons.

SafePosValid = TRUE and SafePositionLowerLimit ≤ SafePositionHigherLimit

If InLimit = TRUE

PositionInLimit 1
BelowMin 0
AboveMax 0

If InLimit = FALSE

PositionInLimit 0
BelowMin 0
AboveMax 0

SafePosValid = TRUE and SafePositionLowerLimit ≥ SafePositionHigherLimit

If InLimit = TRUE

PositionInLimit 1
BelowMin 0
AboveMax 0

If InLimit = FALSE

PositionInLimit 1
BelowMin 0
AboveMax 0

4.29.2 Description of the signals

4.29.2.1 Inputs and outputs

Inputs

Offset Name Data type Description


0.0-3.0 SingleturnPos UDINT Current single-turn position
4.0-7.0 MultiturnPos DINT Current multi-turn position
0.0 SafePosValid BOOL Indicates the validity of the current safe position.
0 = SafePosition invalid
1 = SafePosition valid
a-b SingleturnPosUL UDINT Upper limit of the single-turn position
c-d MultiturnPosUL DINT Upper limit of the multi-turn position
e-f SingleturnPosLL UDINT Lower limit of the single-turn position
g-h MultiturnPosLL DINT Lower limit of the multi-turn position

180 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Outputs

Offset Name Data type Description


0.0 Error BOOL Indicates an error during the brake test.
0 = no error
1 = error
1.0 PositionInLimit BOOL Indicates whether the current position is within the limits.
0 = Position outside the limits
1 = Position within the limits
2.0 BelowMin BOOL Indicates whether the current position is within the limits.
0 = Lower limit is adhered to
1 = Lower limit is not reached
3.0 AboveMax BOOL Indicates whether the current position is within the limits.
0 = Upper limit is adhered to
1 = Lower limit is exceeded

Internal identifier of the FB


Type Description
FB SLP This description applies to BLG 1.0 (internal version number)

4.29.2.2 Parameter
You can adjust the following parameters both in the function block view and in the "Properties" window:

Parameter Description
MultiTurn Pos UL Upper limit of the multi-turn position
SingleTurn Pos UL Upper limit of the single-turn position
MultiTurn Pos LL Lower limit of the multi-turn position
SingleTurn Pos LL Lower limit of the single-turn position
ScaledView UpperLimit Scaled value from MultiTurn Pos UL and SingleTurn Pos UL
ScaledView LowerLimit Scaled value from MultiTurn Pos LL and SingleTurn Pos LL

You can adjust the following parameters in the "Properties" window:

Parameter Description
Scaling Factor Numerator Numerator value for the NC scaling factor
This factor is only used for the display in the editor and is not required for the
logic.
Scaling Factor Denominator Denominator value for the NC scaling factor
This factor is only used for the display in the editor and is not required for the
logic.
Encoder Mask Encoder mask from NC configuration
Encoder Sub Mask Encoder sub mask from NC configuration
Scaling Unit Textual specification of the unit of the scaled value for the display in the
function block view

4.29.2.3 Diagnostic messages

Diagnostic information
Offset Signal
0.0 FB-Type (=78)
1.0 FB State

TwinSAFE Logic FB Version: 4.1.0 181


Function blocks

Offset Signal
2.0 FB Diag
3.0 AnalogMask

Diagnostic information FB State


Offset Signal
1.0 RUN
2.0 STOP
3.0 SAFE
4.0 ERROR
5.0 RESET
6.0 START

Diagnostic information FB Diag


Offset Signal
0.0 MultiturnPos_LL>MultiturnPos_UL
1.0 MultiturnPos_LL=MultiturnPos_UL AND
SingleturnPosLL>SingleturnPos_UL

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x40D0 The multi-turn position lower limit FB instance MultiturnPos_LL MultiturnPos_UL
is greater than the multi-turn
position upper limit.
0x40D1 The multi-turn position lower limit FB instance SingleturnPos_LL SingleturnPos_UL
corresponds to the multi-turn
position upper limit. The single-
turn position lower limit is greater
than the single-turn position upper
limit.

Status information
Value Description
1.0 RUN
If SafePosValid=TRUE, the FB SLP compares with the lower limit SafePositionLowerLimit and
the upper limit SafePositionHigherLimit. If InLimit=TRUE, the FB SLP switches to the RUN state.
The outputs assume the following values:
Error=0
PositionInLimit=1
BelowMin=0
AboveMax=0
2.0 STOP
If the input FbRun=FALSE, the FB SBT module switches to the STOP state.
The outputs assume the following values:
Error=0
PositionInLimit=0
BelowMin=0
AboveMax=0
3.0 SAFE
If the input SafePosValid=TRUE, the FB SLP compares the SafePosition with the lower limit
SafePositionLowerLimit and the upper limit SafePositionHigherLimit. If InLimit=FALSE, the FB
SLP module switches to the SAF state.
The outputs assume the following values:
Error=0

182 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
PositionInLimit=0
BelowMin=according to the comparison results
AboveMax=according to the comparison results
4.0 ERROR
When in multi-turn mode
• LL_Active=TRUE or UL_Active=TRUE and
• MultiturnPos_LL>MultiturnPos_UL applies (LimitError),
the FB SLP module switches to the ERROR state and transmits the Diag message 0x40D0 to the
Group module.
When in multi-turn mode
• LL_Active=TRUE or UL_Active = TRUE and
• MultiturnPos_LL=MultiturnPos_UL and
• SingleturnPos_LL>SingleturnPos_UL applies (LimitError),
the FB SLP module switches to the ERROR state and transmits the Diag message 0x40D1 to the
Group module.
The outputs assume the following values:
Error=1
PositionInLimit=0
BelowMin=0
AboveMax=0
5.0 RESET
If no more errors are present after an error has occurred and the input ErrAck of the associated
group is set to TRUE, the FB SLP module switches to the RESET state.
The outputs assume the following values:
Error=0
PositionInLimit=0
BelowMin=0
AboveMax=0
6.0 START
If the input SafePosValid=FALSE, the FB SLP module switches to the START state.
The outputs assume the following values:
Error=0
PositionInLimit=0
BelowMin=0
AboveMax=0

TwinSAFE Logic FB Version: 4.1.0 183


Function blocks

4.29.3 FB SLP configuration in TwinCAT 3

Fig. 157: Function block SLP

In the function block view, you have the option of setting the upper and lower limits of the single-turn and
multi-turn position. By clicking next to the FB port, you can create variables that can be linked to input or
output signals.

Fig. 158: FB SLP port properties

Settings such as changing the data type or activation of the port can be made via the properties of the FB
Port.

184 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 159: FB SLP properties

The entries "Map Diag" and "Map State" in the properties window of the FB define which diagnostic functions
of the FB are mapped in the cyclic process image.

Under "Miscellaneous", you can select the position at which the function block is to be executed in the
execution order.

It is possible to change the instance name in both views.

Further information on the parameters can be found in chapter Parameter [} 181].

TwinSAFE Logic FB Version: 4.1.0 185


Function blocks

4.30 The function block SBT

4.30.1 Functional description


The function block SBT is used to test the function of a holding brake in one drive direction.

If you want to check both drive directions, you must use 2 instances of the SBT function block and the
BrakeValid result from both function blocks within the user logic.

The BrakeValid signal is not set during the brake test and may have to be bypassed with the SBT signal for
the duration of the brake test.

The function block SBT sets the output BrakeValid=0 on a rising edge (SBT=1). The output RemainingTime
continues to decrement unchanged and the function block sets the output TestError=0.

Fig. 160: Function block SBT

As soon as SBT=1 and SBTIn=0, the system checks whether the value of ActCurrentIq is equal to or greater
than the value of MinCurrentIq for the duration of MinDuration. A check is also made to ensure that the
SingleTurn position does not change more than MaxPositionDeviation.

If the test is successful

TestError 0
BrakeValid 1
RemainingTime BrakeTestInterval
The timer until the next brake test is reset.

SBT=1 after expiry of BrakeTestInterval

TestError 1
BrakeValid 0
RemainingTime 0

If the test fails

TestError 1
BrakeValid 0
RemainingTime continue decrementing unchanged

186 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

SBT=0 and no test performed

TestError 0
BrakeValid unchanged
RemainingTime continue decrementing unchanged

4.30.2 Description of the signals

4.30.2.1 Inputs and outputs

Digital inputs

Offset Name Data type Description


0.0 SBT BOOL Specifies whether a brake test should be started or not.
0 = Brake test not active
1 = Start brake test
1.0 SBC In BOOL Indicates whether the brake is applied or released.
0 = Brake applied
1 = Brake released

Analog inputs

Offset Name Data type Description


0.0-3.0 SingleturnPos UINT32 Indicates the current safe position.
4.0-7.0 ActCurrentIq INT32 Indicates the torque-forming current of the axis.
8.0-11.0 MinCurrentIq INT32 Specifies the torque-forming current for the minimum
required torque of the axis.

Digital outputs

Offset Name Data type Description


0.0 TestError BOOL Indicates an error during the brake test.
0 = no error
1 = error
1.0 BrakeValid BOOL Indicates the test result.
0 = last test negative
1 = last test positive

Analog outputs

Offset Name Data type Description


0.0-3.0 RemainingTime UINT32 Indicates the remaining time until the next brake test in
seconds.

Internal identifier of the FB


Type Description
FB SBT This description applies to BLG 1.0 (internal version number)

4.30.2.2 Parameter
Parameter Description
MinCurrentIq Torque-forming current for the minimum required torque of the axis

TwinSAFE Logic FB Version: 4.1.0 187


Function blocks

Parameter Description
BrakeTestInterval Interval between brake tests in seconds.
The preset value is 28800.
MaxPosititionDeviation Maximum deviation of the position during the brake test
MinDuration Minimum required test duration for the brake test in tenths of a second
The preset value is 10.
MaxDuration Maximum total duration of the brake test in tenths of a second
The preset value is 200.

4.30.2.3 Diagnostic messages

Diagnostic information
Offset Signal
0.0 FB-Type (=79)
1.0 FB State
2.0-3.0 MinDurationTimerLatch
4.0-5.0 MaxDurationTimerLatch
6.0-9.0 LatchedSingleturnPosition
10.0-13.0 RemainingTimeLatch
14.0-17.0 RemainingTime (in s)
18.0 Status:
Bit 0: LastTestResult
19.0 Inputs of the last cycle

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x40DA The single-turn position exceeds FB instance SingleturnPosition MaxPositionDeviatio
the maximum position deviation. Diff n
0x40D8 The maximum duration of the FB instance FB-State=0x12 LatchPosition
brake test has expired without the
test being successfully completed.
0x40D9 The time remaining for the next FB instance FB-State=0x14 LatchPosition
brake test has expired and no new
brake test has been started.

Status information
Value Description
1.0 RUN
If
• SBT=FALSE,
• the last brake test was successful and
• RemainingTime ≤ BrakeTestInterval,
the SBT module switches to the RUN state.
The outputs assume the following values:
• TestError = 0
• BrakeValid = 0
• RemainingTime = current remaining time
2.0 STOP
If
• FbRun = FALSE

188 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
the SBT module switches to the STOP state.
The outputs assume the following values:
• TestError = 0
• BrakeValid = 0
• RemainingTime = 0
3.0 SAF
If
• SBT = FALSE,
• the last brake test was not successful and
• RemainingTime>BrakeTestInterval
the SBT module switches to the SAF state.
The outputs assume the following values:
• TestError = 0
• BrakeValid = 0
• RemainingTime = current remaining time
4.0 TESTING
If
• SBT = TRUE
the SBT module switches to the TESTING state and loads the MaxDurationTimer with the
MaxDurationTime.
The outputs assume the following values:
• TestError = 0
• BrakeValid = 0
• RemainingTime = 0 or current remaining time
4.1 TEST-OK
If
• the brake test was successful and
• no falling edge was detected at input SBT
the SBT module switches to the TEST-OK state.
The outputs assume the following values:
• TestError = 0
• BrakeValid = 0
• RemainingTime = current remaining time
4.2 TEST-FAILED
If
• SBT = TRUE and
• TestFailed = TRUE, TestExpired = TRUE or TimerExpired = TRUE
the SBT module switches to the TEST-FAILED state.
The outputs assume the following values:
• TestError = 0
• BrakeValid = 0
• RemainingTime = 0 or current remaining time
5.0 MONS-ERROR
If
• TimerExpired = TRUE and
• SBT = FALSE

TwinSAFE Logic FB Version: 4.1.0 189


Function blocks

Value Description
the SBT module changes to the state Mons-ERROR and sets LastTestResult = FALSE.
The outputs assume the following values:
• TestError = 0
• BrakeValid = 0
• RemainingTime = 0

4.30.3 FB SLT configuration in TwinCAT 3

Fig. 161: Function block SBT

In the function block view, you have the option of setting the torque-generating current for the minimum
required torque of the axis. By clicking next to the FB port, you can create variables that can be linked to
input or output signals.

Fig. 162: FB SBT port properties

Settings such as changing the data type or activation of the port can be made via the properties of the FB
Port.

190 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 163: FB SBT properties

The entries "Map Diag" and "Map State" in the properties window of the FB define which diagnostic functions
of the FB are mapped in the cyclic process image.

You can also set the interval between two brake tests and the minimum and maximum duration of a brake
test in the parameter settings. Under "Miscellaneous", you can select the position at which the function block
is to be executed in the execution order.

It is possible to change the instance name in both views.

Further information on the parameters can be found in chapter Parameter [} 187].

TwinSAFE Logic FB Version: 4.1.0 191


Function blocks

4.31 The function block ADVPOSMON

4.31.1 Functional description


The FB ADVPOSMON supports the function SIL 3 EnDat 3 jump monitoring.

With an AX8000 with integrated EnDat 3 encoder, a SIL 3 / PL e category 4 can also be achieved with
additional measures. For this purpose, the function block "AdvPosMon" must be used for additional
monitoring of position and speed.

NOTICE
Integration in Safe Motion functions
You must integrate the additional measures into every Safe Motion function that is to be loaded with SIL 3 /
PL e category 4. For more information on integration in Safe Motion functions, see the chapter AdvPosMon
with integrated EnDat 3 encoder in document [5] at References [} 12].

Fig. 164: Function block ADVPOSMON

4.31.2 Description of the signals

4.31.2.1 Inputs and outputs

Inputs

Offset Name Data type Description


0.0 Enable BOOL Indicates the status of automatic position
monitoring.
0 = inactive
1 = active
8.0 Restart BOOL Restart when the FB is in the OverRange state.
This function is optional.

Outputs

Offset Name Data type Description


0.0 Error BOOL Indicates an error.
0 = no error
1 = error, automatic position monitoring is inactive
1.0 Active BOOL Indicates the status of automatic position
monitoring.

192 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Offset Name Data type Description


0 = inactive
1 = active
2.0 Wait BOOL Indicates the FB activity.
0 = the FB is not activated
1 = the FB is activated, but the parameterized
encoder instance is not yet referenced, the
extended position monitoring is inactive
3.0 OverRange BOOL Indicates diagnostic coverage is falling short.
0 = diagnostic coverage is ≥ 99%
1 = the diagnostic coverage is < 99% due to
excessive speed, extended position monitoring is
inactive

4.31.2.2 Parameter
You can adjust the following parameters both in the function block view and in the "Properties" window:

Parameter Description
ChA Primary Feedback Primary feedback from channel A
ChA Secondary Feedback Secondary feedback from channel A
ChB Primary Feedback Primary feedback from channel B
ChB Secondary Feedback Secondary feedback from channel B

4.31.2.3 Diagnostic messages

Diagnostic information
Offset Signal
0.0 FB-Type (=80)
1.0 FB State
2.0 FB ADVPOSMON Diagnosis
3.0 SAFEDRIVEFEEDBACK instance (0-3)

Diagnostic information FB State


Offset Signal
1.0 RUN
2.0 STOP
3.0 SAFE
4.0 ERROR
5.0 RESET
6.0 START
0x10 WAIT-FOR-RESTART

Diagnostic information FB Diag


Offset Signal
0.0-2.0 SAFEDRIVEFEEDBACK instance (1-4) that has changed to the ERROR state
3.0-7.0 Reserve (0)

Status information
Value Description
1.0 RUN

TwinSAFE Logic FB Version: 4.1.0 193


Function blocks

Value Description
If
• ENABLED = TRUE and
• the assigned SAFEDRIVEFEEDBACK module is in error mode
the ADVPOSMON module switches to the RUN state.
The outputs assume the following values
• Error = 0
• if POS_REF_OK = TRUE and POS_CHECK_OK = TRUE:
Active = 1
• if POS_REF_OK = FALSE:
Wait = 1
• if POS_REF_OK = TRUE and POS_CHECK_OK = FALSE:
OverRange = 1
2.0 STOP
If
• FbRun = FALSE
the ADVPOSMON module switches to the STOP state.
The outputs assume the following values:
• Error = 0
• Active = 0
• Wait = 0
• OverRange = 0
3.0 SAFE
If
• ENABLED = FALSE and
• the assigned SAFEDRIVEFEEDBACK module is in error mode
the ADVPOSMON module switches to the SAF state.
The outputs assume the following values:
• Error = 0
• Active = 0
• Wait = 0
• OverRange = 0
4.0 ERROR
If
• SDFB_ERROR = TRUE
the ADVPOSMON module changes to the ERROR state and transfers the Diag message 0x38D1
to the Diag history.
The outputs assume the following values:
• Error = 1
• Active = 0
• Wait = 0
• OverRange = 0
5.0 RESET
If in the ERROR state
• ErrAck (of the Group) = TRUE and
• the assigned SAFEDRIVEFEEDBACK module is in error mode
the ADVPOSMON module switches to the RESET state.

194 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Value Description
The outputs assume the following values:
• Error = 0
• Active = 0
• Wait = 0
• OverRange = 0
6.0 START
If in the WAIT-FOR-RESTART state
• Restart = TRUE and
• the assigned SAFEDRIVEFEEDBACK module is in error mode
the ADVPOSMON module switches to the START state.
The outputs assume the following values:
• Error = 0
• Active = 0
• Wait = 0
• OverRange = 1
7.0 WAIT-FOR-RESTART
If in the RUN state
• OverRange = 1 and
• RESTART_ACTIVE = TRUE and
• the assigned SAFEDRIVEFEEDBACK module is in error mode
the ADVPOSMON module switches to the WAIT-FOR-RESTART state.
The outputs assume the following values:
• Error = 0
• Active = 0
• Wait = 0
• OverRange = 1

4.31.3 Configuration of FB ADVPOSMON in TwinCAT 3

Fig. 165: Function block ADVPOSMON

In the function block view, you have the option of selecting the feedback. By clicking next to the FB port, you
can create variables that can be linked to input or output signals.

TwinSAFE Logic FB Version: 4.1.0 195


Function blocks

Fig. 166: Properties of the ports of the FB ADVPOSMON

Settings such as changing the data type or activation of the port can be made via the properties of the FB
Port.

Fig. 167: Properties of the FB ADVPOSMON

The entries "Map Diag" and "Map State" in the properties window of the FB define which diagnostic functions
of the FB are mapped in the cyclic process image. You can also choose the feedback in the parameter
settings. Under "Miscellaneous", you can also select where the function block should be executed in the
execution order.

It is possible to change the instance name in both views.

Further information on the parameters can be found in chapter Parameter [} 193].

196 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.32 The function block Envelope

4.32.1 Functional description


The FB Envelope is used to create an envelope from the amount of InValue plus the defined Offset and to
check during each function block call cycle whether InValue violates this envelope. The input data types
INT16, INT32, UINT16 and UINT32 are permitted for InValue. Time after in Target starts running when
InValue reaches the range between -TargetValue and +TargetValue. The time is reset when InValue exits
this range and the time has not yet elapsed and restarts if InValue enters the range again. If InValue remains
within the range, the output SafeFunctionOut is set to FALSE when Time after inTarget has elapsed. The
output SafeFunctionOut is set to FALSE once MaxTime has elapsed at the latest.

This function block can typically be used for SS1 or SS2 safety function, for example.

Fig. 168: Time curve of FB Envelope

TwinSAFE Logic FB Version: 4.1.0 197


Function blocks

Fig. 169: Function block Envelope

NOTICE
KL6904/EL6900
The function block Envelope is not available in the KL6904 and the EL6900.

4.32.2 Signal description


FB Envelope inputs
Offset Name Permitted type Data type Description
0.0 SafeFunction TwinSAFE-In BOOL Input for the safety function.
FB-Out
0.0- InValue TwinSAFE-In N=2: Position or analog value to be monitored for deceleration
(n-1) FB-Out INT16 or change in direction of 0 within an envelope curve.
Standard-In UINT16
TwinSAFE SC n=4:
INT32
UINT32

FB Envelope outputs
Offset Name Permitted type Data type Description
0.0 Error TwinSAFE-Out BOOL Error output (see diagnostic information)
FB-In
Standard-Out
1.0 SafeFunction TwinSAFE-Out BOOL Output with the safety function (delayed and envelope-
Out FB-In monitored)
Standard-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904

198 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Type Description
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

FB Envelope parameters
Parameter Description
Target Value Target window of InValue, symmetrical around 0
Offset Offset values, which is added to the amount of InValue and then forms
the start point of the envelope as positive and negative value.
Time after in Target (ms) Time after which the SafeFunctionOut output is switched off, if it is
within the TargetValue
Max Time (ms) Maximum time, after which the SafeFunctionOut output is switched off.

Internal identifier of the FB


Type Description
FB Envelope This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB Envelope

Diagnostic information
Value Description
0.0 No diagnostic information
1.0 Underflow (InValue below the envelope)
2.0 Overflow (InValue above the envelope)
3.0 InValue Error
4.0 MaxTimeExpired

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
0x40C8 InValueExpired AND InValue < 0 FB instance InValue MinAllowedValue
0x40C9 InValueExpired AND InValue > 0 FB instance InValue MaxAllowedValue
0x40CA InValueError=TRUE FB instance InValue -
0x40CB MaxTimeExpired=TRUE FB instance InValue -

Status information
Value Description
1.0 RUN
If the input SafeFunction=TRUE, the FB ENV module assumes the RUN state.
The outputs assume the following values:
Error=0
SafeFunctionOut=1
2.0 STOP
If the input FbRun=FALSE, the FB ENV module assumes the STOP state.
The outputs assume the following values:
Error=0
SafeFunctionOut=0
3.0 SAFE
If the input SafeFunction=FALSE, MaxTimeExpired=TRUE or TimeAfterInTargetExpired=TRUE,
the FB ENV module assumes the SAFE state.

TwinSAFE Logic FB Version: 4.1.0 199


Function blocks

Value Description
The outputs assume the following values:
Error=0
SafeFunctionOut=0
4.0 ERROR
If the FB ENV module detects an error, the FB ENV module switches to the ERROR state and
transmits the corresponding Diag message to the GROUP module.
The outputs assume the following values:
Error=1
SafeFunctionOut=0
5.0 RESET
If there is no longer an error after an error has occurred and the input ErrAck of the associated
group is set to TRUE, the FB ENV module assumes the RESET state.
The outputs assume the following values:
Error=0
SafeFunctionOut=0
8.0 DELAYOUT
If the input SafeFunction=FALSE, InValueInTarget=TRUE, TimeAfterInTargetExpired=TRUE and
MaxTimeExpired=FALSE, the FB ENV module assumes the DELAYOUT state.
The outputs assume the following values:
Error=0
SafeFunctionOut=1
9.0 MONITOR
If the input SafeFunction=FALSE, InValueInTarget=FALSE and MaxTimeExpired=FALSE, the
FB ENV module assumes the MONITOR state and monitors whether the InValue is still within
the envelope (InValueExpired=FALSE).
To do this, the FB ENV module calculates the maximum permissible difference by first
multiplying the InValueDec with the elapsed time since the transition to the MONITOR state. This
intermediate result is subtracted from InValueLatch (InValue at the time of the state transition to
the MONITOR state); the value must not be smaller than the TargetValue. If this difference is
less than the amount of the current InValue, InValueExpired=TRUE is set.
The outputs assume the following values:
Error=0
SafeFunctionOut=1

4.32.3 FB Envelope configuration in TwinCAT 3

Fig. 170: FB Envelope configuration

200 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 171: FB Envelope properties

Fig. 172: FB Envelope port properties

A mouse click next to the FB Port can be used to create variables that can be linked with input or output
signals. Settings such as changing the data type or activation of the input can be made via the properties of
the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.33 The function block ViolationCounter

4.33.1 Functional description


The FB ViolationCnt can be used to realize a weighted error counter. The counter is enabled (TRUE) or
disabled (FALSE) via the Enable input. If the counter is disabled, the InputOK output is set to FALSE,
ActViolationCnt is set to 0. If Enable is set to TRUE, Input is checked whenever the function block is called. If
the input is TRUE (in case of negation of Input: FALSE), the error counter is decremented by the value
Decrement No Error; if the input is FALSE (in case of negation of Input: TRUE), the error counter is
incremented by Increment Error. InputOK is set to FALSE when the error counter reaches the Counter Limit.

TwinSAFE Logic FB Version: 4.1.0 201


Function blocks

Fig. 173: Function block ViolationCnt

NOTICE
KL6904/EL6900
The function block ViolationCnt is not available in the KL6904 and the EL6900.

4.33.2 Signal description


FB ViolationCnt inputs
Offset Name Permitted type Data Description
type
0.0 Input TwinSAFE-In BOOL This value is checked whenever the function block is
FB-Out called. It ensures that the error counter is incremented or
Standard-In decremented.
Input not negated:
TRUE - counter is decremented
FALSE - counter is incremented
Input negated:
TRUE - counter is incremented
FALSE - counter is decremented
1.0 Enable TwinSAFE-In BOOL Input for activating the function.
FB-Out
Standard-In

FB ViolationCnt outputs
Offset Name Permitted type Data Description
type
1.0 InputOK TwinSAFE-Out BOOL This output is set to TRUE if Enable is TRUE and the
FB-In internal error counter is below the counter limit.
Standard-Out
0.0- ActViolation TwinSAFE-Out UINT16 Indicates the current internal counter value if the input
(n-1) Cnt FB-In (n=2) Enable is TRUE, otherwise the output is set to 0.
Standard-Out UINT32
(n=4)

202 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

FB ViolationCnt parameters
Parameter Description
Increment Error Number by which the internal counter is incremented
Decrement No Error Number by which the internal counter is decremented
Counter Limit Limit for the internal counter. Above the limit, the output InputOK is set to FALSE.

Internal identifier of the FB


Type Description
FB ViolationCnt This description applies to BLG 1.0 (internal version number)

Diagnostic and status information for the FB ViolationCnt

Diagnostic information
Value Description
0.0 No diagnostic information

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
- - - - -

Status information
Value Description
1.0 RUN
If the input Enable=TRUE and LimitOverrun=FALSE, the FB VIOCNT module
assumes the RUN state and modifies the ActViolationCnt.
The outputs assume the following values:
InputOK=1
ActViolationCnt = current value
2.0 STOP
If the input FbRun=FALSE, the FB VIOCNT module assumes the STOP state.
The outputs assume the following values:
InputOK=0
ActViolationCnt = 0
3.0 SAFE
If the input Enable=TRUE and LimitOverrun=TRUE, the FB VIOCNT module assumes
the SAFE state and modifies the ActViolationCnt.
The outputs assume the following values:
InputOK=0
ActViolationCnt = current value

TwinSAFE Logic FB Version: 4.1.0 203


Function blocks

Value Description
6.0 START
If the input Enable=FALSE, the FB VIOCNT module assumes the START state.
The outputs assume the following values:
InputOK=0
ActViolationCnt = 0

4.33.3 FB ViolationCnt configuration in TwinCAT 3

Fig. 174: FB ViolationCnt configuration

Fig. 175: FB ViolationCnt properties

204 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Fig. 176: FB ViolationCnt port properties

A mouse click next to the FB Port can be used to create variables that can be linked with input or output
signals. Settings such as changing the data type or activation of the input can be made via the properties of
the FB port.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

4.34 The function block XOR

4.34.1 Functional description


The XOR function block provides the user with up to 8 XOR (exclusive or) functions (XOR1 to XOR8). Two
inputs Xor1In(x) and 2 inputs Xor2In(x) are linked in exclusive or mode. The result is output at output
XorOut(x).

NOTICE
Support
The function block XOR is not available in the KL6904, EL6900 and EL6910 (SW ≤ 03).

TwinSAFE Logic FB Version: 4.1.0 205


Function blocks

Fig. 177: Configuration of the XOR function block

4.34.2 Signal description


FB XOR inputs
Offset Name Permitted type Data Description
type
0.0 Xor1In1 TwinSAFE-In BOOL Input1 of XOR1
FB-Out
TwinSAFE SC
1.0 Xor2In1 TwinSAFE-In BOOL Input2 of XOR1
FB-Out
TwinSAFE SC
2.0 Xor1In2 TwinSAFE-In BOOL Input1 of XOR2
FB-Out
TwinSAFE SC
3.0 Xor2In2 TwinSAFE-In BOOL Input2 of XOR2
FB-Out
TwinSAFE SC
4.0 Xor1In3 TwinSAFE-In BOOL Input1 of XOR3
FB-Out
TwinSAFE SC
5.0 Xor2In3 TwinSAFE-In BOOL Input2 of XOR3
FB-Out
TwinSAFE SC

206 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

Offset Name Permitted type Data Description


type
6.0 Xor1In4 TwinSAFE-In BOOL Input1 of XOR4
FB-Out
TwinSAFE SC
7.0 Xor2In4 TwinSAFE-In BOOL Input2 of XOR4
FB-Out
TwinSAFE SC
8.0 Xor1In5 TwinSAFE-In BOOL Input1 of XOR5
FB-Out
TwinSAFE SC
9.0 Xor2In5 TwinSAFE-In BOOL Input2 of XOR5
FB-Out
TwinSAFE SC
10.0 Xor1In6 TwinSAFE-In BOOL Input1 of XOR6
FB-Out
TwinSAFE SC
11.0 Xor2In6 TwinSAFE-In BOOL Input2 of XOR6
FB-Out
TwinSAFE SC
12.0 Xor1In7 TwinSAFE-In BOOL Input1 of XOR7
FB-Out
TwinSAFE SC
13.0 Xor2In7 TwinSAFE-In BOOL Input2 of XOR7
FB-Out
TwinSAFE SC
14.0 Xor1In8 TwinSAFE-In BOOL Input1 of XOR8
FB-Out
TwinSAFE SC
15.0 Xor2In8 TwinSAFE-In BOOL Input2 of XOR8
FB-Out
TwinSAFE SC

FB XOR outputs
Offset Name Permitted type Data Description
type
8.0 XorOut1 TwinSAFE-Out BOOL Output of XOR1
FB-In
Standard-Out
9.0 XorOut2 TwinSAFE-Out BOOL Output of XOR2
FB-In
Standard-Out
10.0 XorOut3 TwinSAFE-Out BOOL Output of XOR3
FB-In
Standard-Out
11.0 XorOut4 TwinSAFE-Out BOOL Output of XOR4
FB-In
Standard-Out
12.0 XorOut5 TwinSAFE-Out BOOL Output of XOR5
FB-In
Standard-Out
13.0 XorOut6 TwinSAFE-Out BOOL Output of XOR6
FB-In
Standard-Out
14.0 XorOut7 TwinSAFE-Out BOOL Output of XOR7
FB-In
Standard-Out

TwinSAFE Logic FB Version: 4.1.0 207


Function blocks

Offset Name Permitted type Data Description


type
15.0 XorOut8 TwinSAFE-Out BOOL Output of XOR8
FB-In
Standard-Out

Input and output types


Type Description
TwinSAFE-In TwinSAFE input, e.g. an EL1904/KL1904
Standard-In Standard PLC variable (output in the PLC %Q*)
FB-Out TwinSAFE FB output
TwinSAFE-Out TwinSAFE output, e.g. an EL2904/KL2904
Standard-Out Standard PLC variable (input in the PLC %I*)
FB-In TwinSAFE FB input
TwinSAFE SC Input of a TwinSAFE connection (TwinSAFE SC technology)

Internal identifier of the FB


Type Description
FB XOR This description applies to BLG 1.0 / BLG 2.0 (internal version number)

Diagnostic and status information for FB XOR

Diagnostic information
Value Description
0.0 No diagnostic information

Diag Message
Text ID Meaning Parameter 1 Parameter 2 Parameter 3
- - - - -

Status information
Value Description
1.0 RUN
If the input FbRun=TRUE, the FB XOR module assumes the RUN state.
The outputs assume the following values depending on the active input pairs
(configuration: FB Input Active):
XorOutY = (Xor1InY XOR Xor2InY) AND FB Input Active(Y) with Y = {1,2 .. 8}
2.0 STOP
If the input FbRun=FALSE, the FB XOR module assumes the STOP state.
The outputs assume the following values:
XorOutY = 0 with Y = {1,2 ... 8}

208 Version: 4.1.0 TwinSAFE Logic FB


Function blocks

4.34.3 Configuration of the FB XOR in TwinCAT 3

Fig. 178: FB XOR configuration

A mouse click next to the respective FB Port can be used to create variables that can be linked to input or
output signals. The properties of the FB Port can be used for settings such as port activation.

The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic
process image.

Fig. 179: Properties of the FB XOR

TwinSAFE Logic FB Version: 4.1.0 209


Function blocks

Fig. 180: Port properties of the FB XOR

210 Version: 4.1.0 TwinSAFE Logic FB


Appendix

5 Appendix

5.1 Support and Service


Beckhoff and their partners around the world offer comprehensive support and service, making available fast
and competent assistance with all questions related to Beckhoff products and system solutions.

Beckhoff's branch offices and representatives

Please contact your Beckhoff branch office or representative for local support and service on Beckhoff
products!

The addresses of Beckhoff's branch offices and representatives round the world can be found on her internet
pages: www.beckhoff.com

You will also find further documentation for Beckhoff components there.

Support

The Beckhoff Support offers you comprehensive technical assistance, helping you not only with the
application of individual Beckhoff products, but also with other, wide-ranging services:
• support
• design, programming and commissioning of complex automation systems
• and extensive training program for Beckhoff system components
Hotline: +49 5246 963 157
e-mail: support@beckhoff.com
web: www.beckhoff.com/support

Service

The Beckhoff Service Center supports you in all matters of after-sales service:
• on-site service
• repair service
• spare parts service
• hotline service
Hotline: +49 5246 963 460
e-mail: service@beckhoff.com
web: www.beckhoff.com/service

Headquarters Germany

Beckhoff Automation GmbH & Co. KG

Hülshorstweg 20
33415 Verl
Germany
Phone: +49 5246 963 0
e-mail: info@beckhoff.com
web: www.beckhoff.com

TwinSAFE Logic FB Version: 4.1.0 211


List of figures

List of figures
Fig. 1 Connection ................................................................................................................................... 21
Fig. 2 TwinSAFE group inputs/outputs (online)...................................................................................... 22
Fig. 3 Function block list online values................................................................................................... 23
Fig. 4 Emergency Stop........................................................................................................................... 23
Fig. 5 Connection List ............................................................................................................................ 24
Fig. 6 Variables tab (connection) ........................................................................................................... 25
Fig. 7 Diag History of the EL6910 with a Com Error due to a false CRC............................................... 26
Fig. 8 Safety Project Online View........................................................................................................... 27
Fig. 9 Info data connection..................................................................................................................... 27
Fig. 10 Connection info data in the I/O tree structure .............................................................................. 28
Fig. 11 Function block properties ............................................................................................................. 28
Fig. 12 Function block Info Data in the I/O tree structure......................................................................... 29
Fig. 13 Access to Info Data via Properties ............................................................................................... 29
Fig. 14 TwinSAFE group Info Data in the I/O tree structure..................................................................... 30
Fig. 15 Function block AND ..................................................................................................................... 31
Fig. 16 FB AND configuration .................................................................................................................. 33
Fig. 17 FB AND in TwinCAT 3 ................................................................................................................. 34
Fig. 18 FB AND properties ....................................................................................................................... 34
Fig. 19 Function block OR........................................................................................................................ 35
Fig. 20 FB OR configuration..................................................................................................................... 37
Fig. 21 FB OR in TwinCAT 3.................................................................................................................... 38
Fig. 22 FB OR properties ......................................................................................................................... 38
Fig. 23 Function block OPMODE ............................................................................................................. 39
Fig. 24 FB OPMODE configuration .......................................................................................................... 42
Fig. 25 Restart behavior OPMODE (sample 1)........................................................................................ 43
Fig. 26 Restart behavior OPMODE (sample 2)........................................................................................ 44
Fig. 27 FB OPMODE in TwinCAT 3 ......................................................................................................... 44
Fig. 28 FB OPMODE properties............................................................................................................... 45
Fig. 29 Function block ESTOP................................................................................................................. 46
Fig. 30 FB ESTOP configuration.............................................................................................................. 50
Fig. 31 Restart behavior ESTOP (sample 1)............................................................................................ 51
Fig. 32 Restart behavior ESTOP (sample 2)............................................................................................ 52
Fig. 33 Restart behavior ESTOP (sample 3)............................................................................................ 52
Fig. 34 Restart behavior ESTOP (sample 4)............................................................................................ 53
Fig. 35 EDM Reset Time.......................................................................................................................... 53
Fig. 36 FB ESTOP in TwinCAT 3............................................................................................................. 54
Fig. 37 FB ESTOP properties .................................................................................................................. 54
Fig. 38 Function block MON..................................................................................................................... 55
Fig. 39 FB MON configuration.................................................................................................................. 59
Fig. 40 Restart behavior MON (sample 1) ............................................................................................... 61
Fig. 41 Restart behavior MON (sample 2) ............................................................................................... 61
Fig. 42 Restart behavior MON (sample 3) ............................................................................................... 62
Fig. 43 EDM Reset Time.......................................................................................................................... 62
Fig. 44 FB MON in TwinCAT 3................................................................................................................. 63

212 Version: 4.1.0 TwinSAFE Logic FB


List of figures

Fig. 45 FB MON properties ...................................................................................................................... 63


Fig. 46 Function block DECOUPLE ......................................................................................................... 64
Fig. 47 FB DECOUPLE configuration ...................................................................................................... 67
Fig. 48 FB DECOUPLE in TwinCAT 3 ..................................................................................................... 68
Fig. 49 FB DECOUPLE properties........................................................................................................... 68
Fig. 50 Function block TWOHAND .......................................................................................................... 69
Fig. 51 FB TWOHAND configuration ....................................................................................................... 72
Fig. 52 FB TWOHAND in TwinCAT 3 ...................................................................................................... 73
Fig. 53 FB TWOHAND properties ............................................................................................................ 73
Fig. 54 Function block MUTING............................................................................................................... 74
Fig. 55 FB MUTING configuration............................................................................................................ 77
Fig. 56 Configuration example with 4 individual MUTING sensors .......................................................... 78
Fig. 57 Parameterization of the FB MUTING for 4 individual MUTING sensors ...................................... 79
Fig. 58 Sequence for 4 individual MUTING sensors ................................................................................ 79
Fig. 59 Configuration example with two two-channel MUTING sensors .................................................. 80
Fig. 60 Parameterization of the FB MUTING for 2 two-channel MUTING sensors.................................. 80
Fig. 61 Parameterization for 2 two-channel MUTING sensors................................................................. 81
Fig. 62 EL6910 FB MUTING .................................................................................................................... 81
Fig. 63 FB MUTING in TwinCAT 3........................................................................................................... 83
Fig. 64 FB MUTING properties ................................................................................................................ 83
Fig. 65 Function block EDM ..................................................................................................................... 84
Fig. 66 FB EDM configuration .................................................................................................................. 86
Fig. 67 FB EDM in TwinCAT 3 ................................................................................................................. 87
Fig. 68 FB EDM properties....................................................................................................................... 87
Fig. 69 Function block RS ........................................................................................................................ 88
Fig. 70 FB RS configuration ..................................................................................................................... 90
Fig. 71 FB RS in TwinCAT 3 .................................................................................................................... 90
Fig. 72 FB RS properties.......................................................................................................................... 91
Fig. 73 Function block SR ........................................................................................................................ 91
Fig. 74 FB SR configuration ..................................................................................................................... 93
Fig. 75 FB SR in TwinCAT 3 .................................................................................................................... 94
Fig. 76 FB SR properties.......................................................................................................................... 94
Fig. 77 Function block TON ..................................................................................................................... 95
Fig. 78 FB TON configuration .................................................................................................................. 97
Fig. 79 FB TON in TwinCAT 3 ................................................................................................................. 98
Fig. 80 FB TON properties ....................................................................................................................... 98
Fig. 81 Function block TON2 ................................................................................................................... 99
Fig. 82 FB TON2 properties ..................................................................................................................... 99
Fig. 83 Timing diagram ............................................................................................................................ 100
Fig. 84 Function block TOF...................................................................................................................... 102
Fig. 85 FB TOF configuration................................................................................................................... 104
Fig. 86 FB TOF in TwinCAT 3.................................................................................................................. 105
Fig. 87 FB TOF properties ....................................................................................................................... 105
Fig. 88 Function block CONNECTION SHUTDOWN............................................................................... 106
Fig. 89 Function block CONNECTION SHUTDOWN on the opposite side ............................................. 107
Fig. 90 FB CONNECTION SHUTDOWN configuration............................................................................ 109

TwinSAFE Logic FB Version: 4.1.0 213


List of figures

Fig. 91 FB Connection Shutdown in TwinCAT 3...................................................................................... 110


Fig. 92 FB Connection Shutdown properties ........................................................................................... 110
Fig. 93 Function block ADD ..................................................................................................................... 111
Fig. 94 FB ADD configuration .................................................................................................................. 113
Fig. 95 FB ADD properties ....................................................................................................................... 113
Fig. 96 FB ADD port properties................................................................................................................ 113
Fig. 97 Function block SUB...................................................................................................................... 114
Fig. 98 FB SUB configuration................................................................................................................... 116
Fig. 99 FB SUB properties ....................................................................................................................... 116
Fig. 100 FB SUB port properties ................................................................................................................ 117
Fig. 101 Function block MUL ..................................................................................................................... 117
Fig. 102 FB MUL configuration .................................................................................................................. 119
Fig. 103 FB MUL properties ....................................................................................................................... 120
Fig. 104 FB MUL port properties................................................................................................................ 120
Fig. 105 Function block DIV ....................................................................................................................... 121
Fig. 106 FB DIV configuration .................................................................................................................... 123
Fig. 107 FB DIV properties......................................................................................................................... 123
Fig. 108 FB DIV port properties ................................................................................................................. 123
Fig. 109 Function block COMPARE........................................................................................................... 124
Fig. 110 FB Compare configuration ........................................................................................................... 127
Fig. 111 FB COMPARE properties ............................................................................................................ 128
Fig. 112 Properties of the FB COMPARE ports ......................................................................................... 128
Fig. 113 Function block LIMIT.................................................................................................................... 129
Fig. 114 FB LIMIT configuration................................................................................................................. 131
Fig. 115 FB LIMIT properties ..................................................................................................................... 132
Fig. 116 FB LIMIT port properties .............................................................................................................. 132
Fig. 117 Function block COUNTER ........................................................................................................... 133
Fig. 118 FB COUNTER configuration ........................................................................................................ 135
Fig. 119 FB COUNTER properties............................................................................................................. 136
Fig. 120 FB COUNTER port properties...................................................................................................... 136
Fig. 121 Function block SCALE ................................................................................................................. 137
Fig. 122 FB SCALE configuration .............................................................................................................. 139
Fig. 123 FB SCALE properties................................................................................................................... 140
Fig. 124 FB SCALE port properties............................................................................................................ 140
Fig. 125 Function block SPEED................................................................................................................. 141
Fig. 126 FB SPEED configuration.............................................................................................................. 143
Fig. 127 FB SPEED properties .................................................................................................................. 143
Fig. 128 FB SPEED port properties ........................................................................................................... 143
Fig. 129 Function block LOADSENSING ................................................................................................... 144
Fig. 130 Illustration of the check of the characteristic curve ...................................................................... 145
Fig. 131 FB LOADSENSING configuration ................................................................................................ 147
Fig. 132 FB LOADSENSING table............................................................................................................. 148
Fig. 133 FB LOADSENSING properties..................................................................................................... 148
Fig. 134 FB LOADSENSING port properties ............................................................................................. 149
Fig. 135 Function block CAMMONITOR .................................................................................................... 149
Fig. 136 FB CAMMONITOR properties...................................................................................................... 150

214 Version: 4.1.0 TwinSAFE Logic FB


List of figures

Fig. 137 FB CAMMONITOR port properties .............................................................................................. 151


Fig. 138 Structure diagram of the configuration ......................................................................................... 151
Fig. 139 Schematic diagram of the configuration....................................................................................... 152
Fig. 140 Excentric mode - schematic diagram of the ranges ..................................................................... 152
Fig. 141 ScopeView display of the signal curve......................................................................................... 155
Fig. 142 FB CamMonitor in excentric mode............................................................................................... 156
Fig. 143 Pendulum mode - schematic diagram of the ranges.................................................................... 157
Fig. 144 ScopeView display of the signal curve......................................................................................... 159
Fig. 145 FB CamMonitor in pendulum mode ............................................................................................. 160
Fig. 146 ScopeView display of the signal curve......................................................................................... 162
Fig. 147 FB CamMonitor in excentric mode with hardware cams.............................................................. 163
Fig. 148 Function block SLI........................................................................................................................ 171
Fig. 149 FB SLI configuration..................................................................................................................... 173
Fig. 150 FB SLI properties ......................................................................................................................... 174
Fig. 151 FB SLI port properties .................................................................................................................. 174
Fig. 152 Function block SLI2...................................................................................................................... 175
Fig. 153 FB SLI2 configuration................................................................................................................... 177
Fig. 154 FB SLI2 port properties ................................................................................................................ 177
Fig. 155 FB SLI2 properties ....................................................................................................................... 178
Fig. 156 Function block SLP ...................................................................................................................... 179
Fig. 157 Function block SLP ...................................................................................................................... 184
Fig. 158 FB SLP port properties................................................................................................................. 184
Fig. 159 FB SLP properties........................................................................................................................ 185
Fig. 160 Function block SBT ...................................................................................................................... 186
Fig. 161 Function block SBT ...................................................................................................................... 190
Fig. 162 FB SBT port properties ................................................................................................................ 190
Fig. 163 FB SBT properties........................................................................................................................ 191
Fig. 164 Function block ADVPOSMON...................................................................................................... 192
Fig. 165 Function block ADVPOSMON...................................................................................................... 195
Fig. 166 Properties of the ports of the FB ADVPOSMON.......................................................................... 196
Fig. 167 Properties of the FB ADVPOSMON............................................................................................. 196
Fig. 168 Time curve of FB Envelope.......................................................................................................... 197
Fig. 169 Function block Envelope .............................................................................................................. 198
Fig. 170 FB Envelope configuration ........................................................................................................... 200
Fig. 171 FB Envelope properties................................................................................................................ 201
Fig. 172 FB Envelope port properties ........................................................................................................ 201
Fig. 173 Function block ViolationCnt.......................................................................................................... 202
Fig. 174 FB ViolationCnt configuration....................................................................................................... 204
Fig. 175 FB ViolationCnt properties ........................................................................................................... 204
Fig. 176 FB ViolationCnt port properties .................................................................................................... 205
Fig. 177 Configuration of the XOR function block ...................................................................................... 206
Fig. 178 FB XOR configuration .................................................................................................................. 209
Fig. 179 Properties of the FB XOR ............................................................................................................ 209
Fig. 180 Port properties of the FB XOR ..................................................................................................... 210

TwinSAFE Logic FB Version: 4.1.0 215


More Information:
www.beckhoff.com/twinsafe

Beckhoff Automation GmbH & Co. KG


Hülshorstweg 20
33415 Verl
Germany
Phone: +49 5246 9630
info@beckhoff.com
www.beckhoff.com

You might also like