Codesys
The virtual safety controller
In a two-part series of articles, we shed light on the PLC's path to virtual control. In this second part of the article series, the focus is on functionally safe controllers - i.e. safety controllers. Can they also be virtualized?
The abstraction of machine control systems makes sense: the consistent further development of control technology towards virtual control systems significantly reduces the effort required for acquisition, commissioning, expansion, maintenance and decommissioning. With virtual control systems based on container or hypervisor technologies, only the software determines the function - the hardware provides the abstracted substructure for it. Because the dependency on specific devices has been broken, modern control architectures with security-by-design and dynamic microservices can be easily implemented. But what about functionally secure applications?
EU regulations and national laws stipulate that people must be protected: Machines with potential hazards of all kinds must be safeguarded for their entire life cycle - either through design measures or safe control technology in accordance with the state of the art. IEC 61508 defines this state of the art with basic terms, design principles and general aspects for the use of electronic control systems in machines and systems. For example, the safety requirement levels SIL (Safety Integrity Level) 1 to 4 are described, based on the severity and frequency of exposure, among other things. Due to the legal situation, a machine or system must be approved by an accredited institute before commissioning - including all components used to achieve the requirement level and the implemented control application.
| Reading tip: Read the previous article about the PLC's path to a virtual PLC here |
|---|
The multi-channel capability of control systems used to protect against system faults is mandatory from SIL2 onwards. And at the latest for SIL3, which is required in many industrial applications, at least one instance, usually hardware, must monitor the correct execution of the safety function. In order to reduce the discrete two-channel nature with double the hardware effort, CPU manufacturers have developed special processors with different architectures, such as lock-step CPU or safety island as a monitoring layer. Unfortunately, this welcome approach also massively increases the dependency on certain components. Especially in the current situation with disrupted supply chains and component shortages, this dependency can lead to painful problems. Especially as the processors mentioned for the required certification are not easily replaceable.
Two-channel capability via software
Processing of the safety application in two separate software channels with coded processing.
© CodesysWith virtual controllers, there is no need to rely on additional hardware to achieve dual-channel capability. After all, the hardware is completely abstracted. Nevertheless, dual-channel capability can also be created here using software through diversified encoding. What is behind this term? The technology is based on the coded processing method. This method can detect errors in the data and control flow of programs through a redundant view of the control information and has been known for more than 30 years. It divides the processing of the application software into two logical software channels, without any special requirements on the underlying hardware. The first channel executes the realized safety application in the original. The second channel uses the same application, but executes it with the algorithms of the coded processing and can therefore already detect errors on its own. Both channels run sequentially one after the other in one process on one CPU core. They are constantly compared, as is also the case with hardware solutions for functional safety.
As a result, errors are detected much more frequently. Diversified encoding distributes the secure inputs to both channels in the same way and, conversely, the outputs of both channels are merged into secure outputs. This includes data streams generated by secure network or fieldbus protocols. Additional fine-grained monitoring of the control flow in the coded channel carried out at runtime of the safety application provides a further safety criterion. SIListra Systems' safety concept designed in this way has been approved by TÜV SÜD and the first product certifications up to SIL3 have been issued.
The process in detail
Screenshot of Codesys Development System with SIL3 application (right) on a virtual safety controller (left in the tree).
© CodesysThe following questions arise when considering the procedure:
Question 1: Why is this process only being used now if it has been known for a long time?
In fact, the first products with coded processing were released at the beginning of the 2000s. However, they have not gained widespread acceptance. The computationally intensive algorithms from this time led to a runtime extension of up to 1000 times! Code generated in this way, executed on the then current CPUs, was simply unusable for real applications. Today, not only are the processors considerably more powerful, but the software algorithms behind coded processing have also been fundamentally optimized. The application code generated by coded processing, together with the necessary diagnostic functions, is now only 5 to 15 times slower than the purely functional code. At the same time, the synchronization points and CPU and memory tests required for discrete safety controllers, which significantly reduce the load on the CPU, are no longer necessary. In view of the performance of modern processors, nothing stands in the way of the use of soft safety solutions in industrial applications.
Screenshot of a visualization interface with measurement results from four virtual safety controllers and different I/O systems.
© CodesysQuestion 2: How can coded processing be combined with virtual controllers?
Instead of using redundant hardware to create two channels as before, the possibilities of virtualization are now available: Both channels now no longer run in parallel on separate physical systems, but sequentially in a virtualized machine, for example in a container or hypervisor. One of the two channels is transformed and executed using coded processing. Diversified encoding is used to compare the results before and after execution. This provides the user with an equivalent solution to that known from physical security control systems. But now with the huge advantage of no longer being tied to dedicated hardware. They can even set up functionally safe control systems as often as they like or in fine granularity and run them on the platforms that are available to them - be it industrial hardware in the control cabinet or IT hardware somewhere in the server room. As already described in the second part of the article series, I/Os can be addressed in real time via virtualized LAN ports. This also applies to Industrial Ethernet protocols with approval for safety-critical applications, such as FSoE (Fail Safe over EtherCAT) or PROFIsafe (F-Host / F-Client).
Question 3: How can users benefit from this?
Using Codesys as an example, the question can be answered as follows: The user deploys or orchestrates their controller on the available hardware and decides whether functionally safe applications should run. If this is the case, a second parallel container is created when the virtual controller is deployed. The application in the safety container is also processed using coded processing. The coded and the original application monitor each other during operation and can immediately assume the safe state if errors are detected. The user uses one and the same tool for project planning: the Codesys Development System. To configure the safe application, he uses the certified add-on modules, which extend the purely functional part. They enable the user to program in the safe IEC 61131-3 editor and download the application code with approved procedures to the virtual safety controller. He only notices that these are virtualized devices when connecting the safety I/O modules in the application. Of course, the configuration of a safety application is in principle more complex than the purely functional part - physical and virtual safety controllers do not differ in this respect. However, there are considerable differences when it comes to installation, maintenance, updates and other aspects.
| Reading tip: You can read the previous article about the PLC's path to a virtual PLC here |
|---|
The orchestration of the virtual controller is identical for the functional or safety application - there are only economic aspects in terms of license costs. The important thing is that the user can prepare for the safety acceptance of his machine or system with a virtualized safety PLC in exactly the same way as he would have done with dedicated devices. With the patented process from SIListra Systems in the virtual safety controller 'Codesys Virtual Safe Control SL', the entire system is approved in accordance with the Machinery Directive as usual, although certified safety hardware is no longer required. The abstraction of the safety controller is therefore the logical next step. Device manufacturers and users alike benefit from this. By integrating the technology, they can now implement safety control systems without a two-channel hardware structure. All they need to provide in order to implement a safety PLC is a suitable computer architecture with industrial properties as well as hardware abstraction via a container and an optional underlying hypervisor. The reduction in effort and costs benefits everyone. Of course, such virtualized control systems will not replace all previous control architectures. But machine and plant manufacturers and, above all, the operators of such systems are given additional degrees of freedom with such a virtual
additional degrees of freedom with such a virtual safety controller.
The voice of the user
Virtual control was the main topic of discussion between users and manufacturers at the one-day Techday 2023.
© CodesysThe virtual PLC was the prominent topic at the Codesys Technology Day on May 10 in Kempten. Keynote speaker Dr. Henning Löser from the Audi Production Lab formulated his vision right at the beginning in front of 500 visitors: "I would like all hardware to disappear from the store floor. I would like to have functionality on site... and functionality is software." To illustrate this, he posed the question: "How are we supposed to manage 15,000 Windows PC changeovers in our plants if this has to be done during a 20-minute shift break?" Looking at the data centers, he says: "The problem is solved differently there than it has been for us in the factory so far." He therefore believes it is important to separate software applications from hardware in the future, with the major advantage that "all applications can then be provided with the same hardware 100 percent of the time." Löser is not sure whether these applications will all be able to run in the cloud in the future: "We have a complete time spectrum of 8 ms from controller to robot and back," he says. Audi is therefore initially planning to establish edge landscapes within the respective factory. A newly established internal department - EC4P (Edge Cloud For Production) - is to drive this project forward.
In the next block of presentations, the audience was able to see live that Codesys already has something up its sleeve to meet these customer requirements: Codesys Virtual Control SL, orchestrated and administered from the Industry 4.0 platform Automation Server. The product managers presented the current performance data using a demonstrator with Profinet and EtherCAT modules. For the first time, they also showed the development status of the virtual safety controller and explained how a two-channel version is possible without a hardware connection. Another premiere was the presentation of Codesys Go!, a new IEC 61131-3 development interface with operation in the browser, hosted on servers, PCs or even dedicated control hardware.


















