- https://www.mathworks.com/matlabcentral/answers/2131646-fmi2exitinitializationmode-error
- https://www.mathworks.com/matlabcentral/answers/521393-how-do-i-import-my-fmu-properly
How to run a simulink model with a "co-simulation" fmu and bus signals?
6 ビュー (過去 30 日間)
古いコメントを表示
Hello together,
i want to handle some bus signals with an imported FMU.
The picture below shows the desired functional struturce of the model. The model has a Co-Simulation module.

The FMU-block:

The FMU works itself fine without any interruption or warnings. The Matlab-function block only do some basic calculations and all in- and outputs are from data type double.
But when i simulate the parent simulink model, which includes the fmu block, i receive the following error messsage:
An error occurred while running the simulation and the simulation was terminated
Caused by:
- Error in supplied FMU: An error occurred in function 'fmi2ExitInitializationMode' for block 'FMU_Testmodell/FMU' during simulation. To debug your FMU file, select the "Enable FMU Debug Logging" check box. For more information, see the FMU troubleshooting documentation.
I used the debugger, but it shows me only the same error message again.
MathWorks only shows an example of a simulink model which use bus signals and a "Model-Exchange" FMU.
So i am asking me, if it´s even possible to run a simulation with bus signals and a co-simulation module?
When yes, why does this error appear?
Does anyone have a solution for this problem?
Or is it also possible to export a model-exchange fmu with matlab?
Thanks and kind regard
Tobias
0 件のコメント
回答 (1 件)
Yash
2025 年 1 月 20 日
編集済み: Yash
2025 年 1 月 20 日
Check out these MATLAB Answers posts with the same error message:
It is possible that the error you are observing is due to incorrect modelDescription.xml file. In the XML file, check if the variability for the variables is set to discrete to match its C implementation.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!