Importing FMU
Once the runtime FMU has been exported from TwinCAT, the next step is to load the FMU from the selected FMI importer tool. The procedure depends on the tool. You can usually select an interface type in the FMI importer tool. This is where you set up co-simulation.
In Simulink®, the FMU Block is used for the FMU import. A Bus selector and a Scope Block are also used in this minimal example. The inputs and outputs of the FMU are interpreted as bus signals in Simulink®, so the bus object must also be created with the command fmudialog.createBusType before the first simulation start.
fmudialog.createBusType('model/FMU')
The resulting block diagram in Simulink® is shown in the figure below: