- Check FMI and FMU Type Compatibility: Confirm the FMU’s FMI version (1.0/2.0/3.0) and type (Co-Simulation or Model Exchange) are supported by your Simulink version, and use the correct FMU block.
- Set Appropriate Solver and Step Size: Use a fixed-step solver (like ode4 or discrete) and set the communication step size explicitly (e.g., 0.01), not as inherited.
- Configure FMU Block Parameters: Enable detailed logging in the FMU block and ensure all FMU inputs are connected with compatible data types.
- Check for DLLs and Dependencies: Ensure all DLLs that came with the FMU are present, unblocked (on Windows), and that the FMU’s file path has no spaces or special characters.
- Match Sample Time and Data Types: Align the Simulink sample time with the FMU’s expected step size, and use Data Type Conversion blocks if needed.
- Test with a Known-Good FMU: Import a simple, standard FMU (e.g., from FMI Cross-Check) into Simulink to confirm that your environment is set up correctly.
- Review Simulink Diagnostic Viewer: Check the Diagnostic Viewer after the error for more detailed messages that can pinpoint the cause.
I got an error when I tried to simulate my simulink model with an FMU from KULI SW (1-D Modelling tool)
1 回表示 (過去 30 日間)
古いコメントを表示
Error:An error occurred while running the simulation and the simulation was terminated
Caused by: Unexpected exception (class _com_error) was caught.
Tried to change the solver options from variable step to fixed step and vice versa and also change the communication step size in the FMU from inherited (-1) to 0 and 1 ... Nothing worked and am not able to understand if the issue is with my original 1-d model or the link between the FMU and the simulink. It would be great , if someone can help me sort this out .
0 件のコメント
回答 (1 件)
Vidhi Agarwal
2025 年 7 月 10 日
Following are the troubleshooting steps that you can try to resolve the issue:
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!