Documentation Twincat Safety
Total Page:16
File Type:pdf, Size:1020Kb
Documentation TwinCAT Safety PLC PC based Safety Controller Version: 1.2.0 Date: 2017-06-29 Table of contents Table of contents 1 Foreword .................................................................................................................................................... 5 1.1 Notes on the documentation........................................................................................................... 5 1.2 Safety instructions .......................................................................................................................... 6 1.2.1 Delivery state ..................................................................................................................... 6 1.2.2 Operator's obligation to exercise diligence ........................................................................ 6 1.2.3 Description of safety symbols ............................................................................................ 7 1.3 Documentation issue status............................................................................................................ 7 2 System description ................................................................................................................................... 8 2.1 Extension of the Beckhoff I/O system with safety functions ........................................................... 8 2.2 TwinCAT Safety PLC...................................................................................................................... 8 2.3 Safety concept ................................................................................................................................ 8 3 Product description................................................................................................................................. 10 3.1 Intended use ................................................................................................................................. 10 3.2 Technical data .............................................................................................................................. 12 3.3 Safety parameters ........................................................................................................................ 13 3.4 Project design limits...................................................................................................................... 13 4 Operation.................................................................................................................................................. 14 4.1 Installation..................................................................................................................................... 14 4.1.1 Safety instructions............................................................................................................ 14 4.1.2 Specifications for transport and storage .......................................................................... 14 4.1.3 Mechanical installation..................................................................................................... 14 4.1.4 Electrical installation......................................................................................................... 15 4.1.5 Software installation......................................................................................................... 15 4.1.6 TwinSAFE reaction times................................................................................................. 15 4.2 Configuration of the TwinCAT Safety PLC in TwinCAT................................................................ 17 4.2.1 Configuration requirements.............................................................................................. 17 4.2.2 Creating a safety project in TwinCAT 3 ........................................................................... 17 4.2.3 CRC distribution............................................................................................................... 39 4.2.4 Downloading the safety application ................................................................................. 40 4.2.5 Activating the safety application....................................................................................... 41 4.2.6 Safety and CRC toolbars ................................................................................................. 42 4.2.7 Info data ........................................................................................................................... 43 4.2.8 Task settings.................................................................................................................... 48 5 Safety C application development ......................................................................................................... 50 5.1 Programming in Safety C.............................................................................................................. 50 5.1.1 Differentiation between programming in Safety C and C/C++ ......................................... 50 5.1.2 Source code templates .................................................................................................... 51 5.2 Safe coding rules .......................................................................................................................... 55 5.2.1 Definitions ........................................................................................................................ 55 5.2.2 General ............................................................................................................................ 56 5.2.3 Strong typing.................................................................................................................... 58 5.3 Permissible language scope......................................................................................................... 66 5.3.1 Simple data types ............................................................................................................ 66 5.3.2 Enumeration types ........................................................................................................... 68 5.3.3 Data structures................................................................................................................. 68 5.3.4 Simple statements............................................................................................................ 69 5.3.5 Control structures............................................................................................................. 70 5.3.6 Expressions and operators .............................................................................................. 73 TwinCAT Safety PLC Version: 1.2.0 3 Table of contents 5.3.7 Literals and constants ...................................................................................................... 74 5.3.8 Function calls and user-defined functions........................................................................ 75 5.3.9 Asserts and traces ........................................................................................................... 76 5.4 Performance optimizations ........................................................................................................... 78 5.5 Interfacing with the I/O level ......................................................................................................... 79 5.6 Verification and validation............................................................................................................. 81 5.7 Online diagnostics ........................................................................................................................ 82 5.8 Safe Helper Functions .................................................................................................................. 86 5.8.1 Safe logic functions ......................................................................................................... 86 5.8.2 Safe integer arithmetic functions ..................................................................................... 89 5.8.3 Safe bit shift functions...................................................................................................... 97 5.8.4 Safe conversion functions (Boolean to integer) ............................................................. 100 5.8.5 Safe conversion functions (integer to integer) ............................................................... 102 6 Graphical application development..................................................................................................... 111 7 Appendix ................................................................................................................................................ 112 7.1 Support and Service ................................................................................................................... 112 7.2 Certificates.................................................................................................................................. 113 4 Version: 1.2.0 TwinCAT Safety PLC Foreword 1 Foreword 1.1 Notes on the documentation Target group This description is aimed specifically at trained qualified persons with a control and automation technology background, who are familiar with the current national and international standards and guidelines. These persons must be trained in the development, validation and verification of safety-related applications