Co-simulation is a key step in the development of today's complex cyber-physical systems (CPS), specially in the integration and validation activities. However, performing a co-simulation involving models developed in different environments and possibly deployed in different platforms with mixed real-time and non real-time constraints is a challenging engineering task. A promising technology that could help overcome communication and synchronisation difficulties is the non-proprietary standard Distributed Co-simulation Protocol (DCP). This standard defines an application-level communication protocol, independent of the platform and the communication medium, that regulates the exchange of information between the co-simulation entities. This paper presents a co-simulation interface based on the DCP standard. It offers a novel approach to apply the DCP standard. Instead of using it as a model encapsulation mechanism, having to develop an specific DCP slave for each application, it is proposed to use it as a generic co-simulation interface. To this end, a Simulink library has been developed, allowing to connect models developed in Simulink with the outside world in an standardised way. Moreover, by exploiting the code generation potential of Simulink, a wide variety of devices become accessible, thus enabling x-in-the-loop simulations, which are commonly used tests in the verification and validation process of CPSs. This library has been tested in a soft real-time co-simulation application between a Simulink instance and an application running on a Xilinx Zynq Ultrascale+ System-on-Chip. As an additional contribution, an analysis of DCP synchronisation problems when simulating closed-loop systems composed of two slaves is performed. Finding that the main causes are the occurrence of random delays and that the simulations of the two slaves start at an arbitrary time. A possible solution to this problem is also presented.
INDEX TERMSControl systems, co-simulation interface, distributed co-simulation protocol, model-based design, model testing, simulink, x-in-the-loop.