FMU Export with bus signal as Input/Output
12 views (last 30 days)
Show older comments
Hi,
I use the "Tool-Coupling Co-Simulation FMU Export for Simulink" toolbox from Simulink to export a FMU.
When I use the data type "Inherit: auto" for input and output the FMU is ok. But when I use bus signals for Input
and output I get the error:
Error in supplied FMU: An error occurred in function 'fmi2Instantiate' for block 'assembly/FMU' during simulation. To debug your FMU file, select the "Enable FMU Debug Logging" check box. For more information, see the FMU troubleshooting documentation.
Component:Simulink | Category:Model error
FMU block assembly/FMU is simulating a tool-coupling FMU exported from Simulink. To simulate this FMU, install 'Tool-Coupling Co-Simulation FMU Export for Simulink' Support Package and launch MATLAB slave sessions using MATLAB pool management script. Make sure you have set up correct environment variables. For more information, see 'Use the Exported Tool-Coupling FMU'.
When I generate this error I have to restart the matlab session via the fmu-matlab-setup.cmd skript.
I attach the working FMU: "FMU_test_scalar" and the faulty FMU: "FMU_test_bus".
0 Comments
Answers (1)
Kautuk Raj
on 11 Dec 2024
To resolve the issue with your FMU in Simulink, you need to set up a separate MATLAB instance to act as the slave session for co-simulation.
Begin by launching a new MATLAB session and executing the command shareMATLABForFMUCoSim. Make sure this session remains free from any other running scripts or models.
Next, open another MATLAB session of the same release. In this second session, load the Simulink model containing your Tool-Coupling FMU and proceed to simulate it. This approach ensures that the FMU utilizes the first MATLAB session for co-simulation, allowing it to function correctly without errors.
For more details on this, you can refer to the MathWorks documentation from the latest release (as of now, R2024b): https://www.mathworks.com/help/simulink/ug/export-model-as-tool-coupling-fmu.html
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!