The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
Hello,
I would like to export an activate model to fmu with c source code.
I already done this in matlab/ simulink with the command: exportToFMU2CS('mdlName','SaveSourceCodeToFMU','on')
How could I do this in activate?
Thank you for your help!
Hi Yannik,
Is there any specific reason why you're using code instead of the interface to export the FMU model?
There is a very easy way to export an FMU model on Activate's interface:
1) Create a Superblock of your C block:
2) Export the FMU as Model exchange:
3) Import that model using FMU block:
4) Manipulate the input port and Run:
I attached the models (SCM + FMU), please see if it works for your purposes!
Thanks, João.
Hi João,
thank you for your help! Unfortunately your solution don't solve my Problem.
I need the C header and C sources, wich describe the fmu. They are in the folder "sources" in the ZIP file. How could I export the fmu with this optional directory?
The following is from the FMI Specification 2.0.3:
https://fmi-standard.org/downloads/
Hi João, thank you for your help! Unfortunately your solution don't solve my Problem. I need the C header and C sources, wich describe the fmu. They are in the folder "sources" in the ZIP file. How could I export the fmu with this optional directory? The following is from the FMI Specification 2.0.3: https://fmi-standard.org/downloads/
Did you try to change the extension of your .FMU to .ZIP and access the files inside it?
Hi Yannik, Did you try to change the extension of your .FMU to .ZIP and access the files inside it?
That makes no difference. The exported Simulink fmu is .fmu and i could access the files inside. And in the simulink export .fmu is the "sources" folder.
If you really want the C source code in the FMU, you have 02 options:
Note that (1) will export the FMU exactly as you want, but there are some blocks in Activate that aren't supported to be exported yet.
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…
Join us for a community conversation on accelerating your motor simulation workflow with Simcenter Simlab. In this beginner-friendly session, we'll introduce the platform's automated model-building capabilities and show how easy it is to set up your first electric motor analysis. You'll see the basic steps of geometry…
Join us for a Community Conversation where we'll discuss practical approaches to analyzing complex electromagnetic models using hybrid solver techniques. This session will provide a general overview of how different computational methods can be combined within a single simulation to address models containing varied…