Enable Co-Simulation for Industrial Automation by an FMU Exporter for IEC 61499 Models Jose Cabral, Monika Wenger, Alois Zoitl fortiss GmbH Forschungsinstitut des Freistaats Bayern f¨ ur softwareintensive Systeme und Services unchen, Deutschland Email: {cabral, wenger, zoitl}@fortiss.org Abstract—Different causes have contributed to the shift of paradigm in the automation field from centralized to modular and distributable. Software and hardware of Programmable Logic Controllers (PLCs) have evolved to be synchronized with the demands nowadays and new standards are trying to follow this trend. One of them is the IEC 61499 standard, which is intended for modelling distributed industrial solutions with a vendor-independent format. This shifting is also bringing new challenges and this paper focuses on the virtual commissioning of plants, which can become a harder task when the system is distributed and involves different interconnected modules. A major problem when doing a virtual commissioning is the coupling between the different physical systems and controlling tools since many vendors still offer closed integrated solutions. Functional Mockup Interface (FMI) is a standard for a co- simulation interface which intends to fill the gaps between different modelling tools, by packaging the models into Func- tional Mockup Unit (FMU) and allowing a co-simulation master algorithm to have access to the inside model through the proposed interface. This paper presents a mapping between IEC 61499 models and the FMI standard and an implementation of a tool that can export IEC 61499 models into FMUs, which would allow the co-simulation of physical plants and the PLCs software that controls it. An experiment is shown where a simple Proportional- Integral-Derivative (PID) controller of a tank system is exported as an FMU and co-simulated together with a tank system modelled using OpenModelica. I. I NTRODUCTION The fourth revolution in the industry (Industry 4.0 or Smart Factory) wants to transform industry the same way the Internet transformed the computers, and even go further. Although the concept of Industry 4.0 may not be the same for all involved parts, some concepts have a strong presence. The Internet is again one of the main actors in this revolution, bringing connectivity to the smallest components in the automation chain. As the revolution is encouraging the flexibility of its parts, centralized systems are evolving to more distributed and modular ones [1]. The heart of these systems is the PLC controlling the logic of the automation. Transforming automation systems from centralized to more modular ones, triggered the creation of the IEC 61499 [2] standard, which complements the well established IEC 61131 [3] and focuses on the missing qualities of distributed systems, not present in the IEC 61131 or even needed in the times it was written. As in other fields, the automation software to be deployed into the real systems must be tested beforehand, because stops in the production of any kind, desired or not, cost money. In the automation field, the need for these steps can be higher since an error can not only stop the production but also damage machines and even humans involved. When one talks about virtual commissioning in the automa- tion field, the logic of PLCs is tested against the virtual rep- resentations of the systems they are controlling. This reduces the actual commissioning time and in case of software updates, these can be safely tested. In many cases, the testing starts with Software-in-the-loop (SIL) where the software to be tested runs on a computer different to the one where it will finally run. Digital inputs and outputs are simulated and connected to a virtual system. On a second step, in Hardware-in-the-loop (HIL) tests, the software runs on the real hardware where it will run once the installation is completed. The inputs and outputs of the hardware are actually triggered, and some type of coupling is added to connect these to the virtual system to be controlled [4]. In both cases, normally both logic and the virtual representa- tion of a system are tightly coupled, and combining tools from different vendors can be a hard task. With the new paradigm of distributed systems, the integration of different tools from different vendors is a greater need. The term co-simulation can be seen as SIL where models from different fields are simulated together by a master that controls them. One of the standards in co-simulation that has gained attention in the last years is FMI [5], which defines an interface between models that are packaged in so-called FMUs. FMI can be very useful to automation systems, where hardware’s manufacturers can offer their FMU (intellectual property can be maintained) to software developers to test their controlling software against it. FMI allows the co-simulation to be tool-independent, making the integration of several models, normal in distributed systems, an easier task. This paper presents a mapping between IEC 61499 models to the FMI standard and an FMU exporter from a model in IEC 61499, allowing the developer to test the logic of the system against physical models from domain-specific tools. In Section II an overview of the work being done that is related to this paper is presented, together with a brief presentation of the key players to this paper. In Section III the