+3 votes
140 views
in Knowledge Base by Dimitrije Jelić (400 points)
closed by Ognjen G.

Hi!

Can I import an FMU file that doesn't contain the source code and run it on Typhoon HIL? 

If I want to share an FMU with another organization, I would like for a code inside of it to be protected.

Thanks,

 

closed with the note: This question is part of the official Typhoon HIL Knowledge Base and is locked to new answers. You can still provide feedback by posting comments to the answer.

1 Answer

+4 votes
by Dimitrije Jelić (400 points)
selected by Debora Santo
 
Best answer

Greetings,

There is an option to precompile the FMU, which would make a new precompiled FMU zip file. Source files are compiled and linked into a static library while all source and header files from the original FMU zip are deleted.

You can do this by using our Schematic API function:

precompile_fmu() - link

Example of usage of this function is in the attachment. Make sure to put the FMU and script in the same folder, and to adjust the path variable in the script (link to download the script).

When running the script, use the command:

typhoon-python script.py

When you execute it, another FMU should appear with _precompiled appended. This FMU won't contain source code.

When you import it into the Typhoon FMU component, the Platforms parameter should list "typhoon", as it is presented in the figure below:



 

Hope this helps!

Best regards,

...