Which IEC 61131-3 languages are best for programmable safety controllers?
Just as programmable logic controllers (PLCs) were a disruptive technology to manufacturing, replacing physical relays with configurable software logic, so too are we seeing a similar displacement of relays and hardwiring in machine and personal safety circuits and relays by the programmable safety controller (PSC).
However, instead of freely coding with a full variability language such as C, C++, Java or Pascal, the safety logic is connected or configured via a simpler interface, with less manual coding involved. But what is this simpler configuration interface, and why do we want or need it?
Get your subscription to Control Design’s daily newsletter.
The IEC 61131-3 standard is a widely adopted framework for industrial automation and control, defining programming languages for PLCs and now PSCs. It provides a foundation for engineers to use standardized programming methods to create and manage control systems, ensuring reliability and compatibility across different devices, systems and vendors. For PSCs, IEC 61131-3 extends the base functionality to meet the rigorous safety requirements that are essential for critical industrial applications.
How to restrict the instruction set
One of the key aspects of programming for safety is restricting the available instruction set in PSCs to ensure that only safe and predictable behaviors are possible. These restricted instructions are necessary to meet safety standards, such as IEC 61508 and ISO 13849, and avoid potentially dangerous or non-deterministic actions.
By restricting the instruction set, manufacturers ensure that safety controllers can be more easily validated, verified and certified for industrial use in safety-critical applications.
The instruction set for safety controllers is restricted in the following way:
- Safety-critical instructions: The instruction set typically excludes complex or non-deterministic instructions that could lead to unpredictable behaviors, such as floating-point arithmetic, certain timers and some advanced functions not guaranteed to operate within strict timing constraints.
- Simplified operations: Only simple, deterministic instructions are allowed, ensuring that the controller behaves in a manner that is predictable and verifiable. For instance, operations such as AND, OR, NOT, SET, RESET and basic timers and counters are allowed, which are easy to analyze and validate for functional safety.
- Limited use of external libraries: In many cases, PSCs restrict the use of third-party libraries or complex algorithms that cannot be fully verified for safety-critical applications.
Which IEC 61131-3 languages are safety-applicable?
IEC 61131-3 defines five programming languages, but, for programmable safety controllers, only a subset of these is typically used, depending on the level of complexity required and the type of safety application.
The most commonly used languages for PSCs include the following:
- Ladder logic or ladder diagram (LD): This is the most widely used language in safety applications due to its intuitive, diagrammatic nature, which resembles electrical relay diagrams. It’s well-suited for designing safety circuits with clear, understandable logic.
- Function block diagram (FBD): This is another popular language, especially for more complex safety functions. It provides a graphical representation of blocks, or functions, and their interconnections, making it easy to represent and manage safety functions that involve multiple steps or processes.
- Structured text (ST): Although less common in safety applications, structured text is used in more complex control algorithms where structured, textual programming is needed. In safety controllers, the use of structured text may be restricted to simple operations due to the need for determinism.
Languages such as instruction list (IL) and sequential function chart (SFC) are typically avoided in safety-critical applications because they are either less intuitive or not as suitable for ensuring determinism and traceability of safety-related logic.
Tools that ensure safety requirements are met
One of the critical aspects of working with programmable safety controllers is ensuring that the program is correct and reliable and meets safety standards. As part of the IEC 61131-3 standard extensions for safety, specific measures and tools are integrated into the development environment to ensure that the program meets safety requirements.
- Automatic safety checks: Many programming environments used for safety controllers have built-in automatic checks that ensure the program adheres to safety standards. These tools can analyze the code for potential risks, such as logic errors, non-deterministic behavior or violations of the IEC 61508 or ISO 13849 standards.
- Safety function verification: PSC programming environments often include safety function verification tools that automatically test the design of the safety functions against safety requirements. For example, the software might ensure that the safety functions—emergency stops or interlocks, for instance—are correctly implemented with the required level of redundancy and fault tolerance.
- Code review and traceability: To meet certification standards, engineers must maintain detailed records of program reviews, testing procedures and validation results. Tools integrated into PSC programming environments often allow users to track changes and log every modification made to the safety program, ensuring complete traceability.
In summary, the extensions to the IEC 61131-3 standard for programmable safety controllers ensure that safety systems are easy to program, validate, and maintain while adhering to the rigorous safety standards required in industrial environments. The restricted instruction set minimizes the risk of errors, while the use of languages like ladder logic, function block diagram and structured text ensures that safety programs are simple, deterministic and easy to validate. Program validation, change tracking and compliance management tools integrated into these environments further strengthen the safety integrity of the system, making it easier for industrial programmers to develop reliable, certified safety applications.