Export Standalone-FMU with non standard capability flags

3 ビュー (過去 30 日間)
Andreas Raab
Andreas Raab 2022 年 2 月 15 日
回答済み: Anshuman 2024 年 1 月 23 日
Hello, I would like to export a standalone FMU from a Simulink model.
For that FMU I would like to change the standard capability flags for canGetAndSetFMUstate and canSerializeFMUstate.
I can't find any checkbox in the model. Neither is there any information in the documentation. There is only a small hint that it is possible to import models with those settings.
Can anyone help me how I can change those flags?

回答 (1 件)

Anshuman
Anshuman 2024 年 1 月 23 日
Specific capability flags such as 'canGetAndSetFMUstate' and 'canSerializeFMUstate', are not directly accessible through a graphical user interface or a checkbox in Simulink. However there is an alternative way to achieve this. Firstly, you will need to export the FMU from Simulink.
  • Open the model to export.
  • Under Solver > Type, select "Fixed-step" for a Co-Simulation FMU or "Variable-step" for a Model Exchange FMU.
  • From the Simulation tab, click the drop-down button for "Save".
  • In the "Export Model To" section, click "Standalone FMU".
  • Click "Create" to export to FMU.
After exporting the FMU, you can modify the capability flags by editing the "modelDescription.xml" file within the FMU.
  1. Rename the FMU file extension from .fmu to .zip.
  2. Open the "modelDescription.xml" file in a text editor and locate the <CoSimulation ...> element.
  3. There you will find the above-mentioned flags and you can modify them as per your usecase.
  4. After saving the changes, rename the file extension back to ".fmu".
Note that, modifying the FMU in this way is not recommended and may lead to some unexpected results in the workflow.

カテゴリ

Help Center および File ExchangeCreate Standalone FMU についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by