- 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)
조회 수: 6 (최근 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!