How can I write Log messages from FMU exported from MATLAB/Simulink

조회 수: 5 (최근 30일)
Nils Lande
Nils Lande 2025년 1월 7일
댓글: Nils Lande 2025년 1월 20일
An FMU can issue log messages througt the fmiCallbackLogger member of the fmiCallbackFunction.
I have an FMU that is exported from Simulink (version 2024) that has a 'MATLAB Function' block that contains MATLAB code.
How can I write FMU log messages from the MATLAB code inside this block?
If I enable 'Debug Logging' in the fmpy.gui tool I can indeed see log messages coming from MATLAB :
CommunicationStepSize=0.2, LocalSolverStepSize=0.2
Local solver will do 1 steps from t = 0.2.
getReal vr:0, value:0.000000
getReal vr:1, value:0.000000
getReal vr:2, value:0.000000
getReal vr:3, value:0.000000
getReal vr:4, va lue:0.000000
But how do I add my own log messages?

답변 (1개)

Yash
Yash 2025년 1월 19일
Follow this issue thread which includes an implementation of custom FMU log messages, along with an example model and FMU to demonstrate this functionality: https://github.com/CATIA-Systems/FMIKit-Simulink/issues/92
  댓글 수: 1
Nils Lande
Nils Lande 2025년 1월 20일
Thank you!
I read through the link, but I'm not sure how I can make that work with Simulink Compiler (Simulink 2024).

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deploy Standalone Applications에 대해 자세히 알아보기

태그

제품


릴리스

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by