Export Activate Models to Functional Mock-up Units with Source Code

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!
Find more posts tagged with
- Select the SuperBlock that you want to export, and write in the Activate Prompt Command: vssPProjExportToFMU(struct('fmufile','E:\myfmufilename.fmu'));
- Note that you must have installed visual studio build tools.
- There is a (beta) version of C code generation on Activate:

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/
Hi Yannik,
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.


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 Yannik,
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.
Thanks, João.
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.