How to make an FMU debugging-friendly in Simulink?
조회 수: 5 (최근 30일)
이전 댓글 표시
We are trying to develop an FMU that is compatible with Simulink. We are using Matlab 2023b+ on Windows x64. The FMU is FMI v3.0 and was originally generated using MSVC 2022 on Windows. The FMU only support co-simulation currently.
We are able to successfully use the FMU using `fmusim`, the executable provided here: https://github.com/modelica/Reference-FMUs . The FMU also correctly works in FMPy https://github.com/CATIA-Systems/FMPy . The FMU also passes the validation check here: https://fmu-check.herokuapp.com/ . However, when we try in Simulink, the simulation stays stuck on t=0.0, i.e. the start. We have added logs to the FMU and are able to see which statement the execution is stuck on, though, the reason for that is not clear.
To solve this, we would like to try to debug by placing breakpoints and view the value of the local variables etc. When trying to use the fmudialog.compileFMUSources we get a few compile errors. How can one better control the exact compile command that is used by compileFMUSources? The FMU depends on third-party libraries that needs to be correctly linked, hence having access to compile command would be helpful. Is there a way to pass the Makefile or CMakeLists to aid with the FMU building? Is there a way to avoid re-compilation since it was recently compiled with MSVC?
Attaching an empty FMU for context here. This is "empty" as in it does include the any numerical processing but includes the FMU piping, stepping, output passing, logging, a third party dependency - curl and CMakeLists as we use it, a README with build instructions. (`python build/build.py x86_64-windows`). Also, includes the resulting FMU in the build folder.
댓글 수: 4
Christian Bertsch
2024년 6월 16일
@Chintan: The FMU can still be standard-compliant. It does not have to be generated by a tool. Using the checkers as a good indication, especially for the validity of the modelDescription.xml.
Importing your FMU with FMIKit in Simulink could be an option. Even though FMIKit states ML/SL Support until 2023a, to my experience this works also in newer versions.
Regarding the native FMU import in ML/SL and recompilation with debug information: I am not sure, whether fmudialog.compileFMUSources considers the Build Confguration that you could provide with your FMU: https://fmi-standard.org/docs/3.0.1/#BuildConfiguration, where you could pass compiler options.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deploy Standalone Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!