Is it possible to export Tool-coupling FMU from Simulink model with compiled MEX S function? [r2019b]
조회 수: 4 (최근 30일)
이전 댓글 표시
hi, i try to export a FMU from Simulink model in which has a compiled MEX S function. I import the generated FMU to Simulink and it could not run successfully.
Is this only possible to export FMU with white box model?
Thanks in advance.
댓글 수: 0
답변 (1개)
Yash
2025년 1월 9일
You can use S-Function Builder block. This allows you to integrate existing C/C++ code into Simulink. The S-Function Builder block creates a S-Function wrapper for your external code, enabling you to generate a FMU from it. Refer here for more info:
Do ensure that the source code of the S-Function block is on MATLAB path so that Simulink can access it. Refer to this MATLAB Answer for more info: https://www.mathworks.com/matlabcentral/answers/826290-how-to-export-simulink-model-which-contains-s-function-block-mex-file-to-stand-alone-fmu
If your S-Function is on MATLAB path but MATLAB doesn't seem to find it, refer to this for a possible resolution: https://www.mathworks.com/matlabcentral/answers/735042-s-function-does-not-exist-but-is-clearly-in-the-matlab-path
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Create Standalone FMU에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!