Guy on Simulink

Simulink & Model-Based Design

Projects Export Profile 2

Posted by Guy Rouleau,

After my last post on FMU import and export, someone asked me if exporting a Simulink model to an FMU was a good way to hide the model and protect intellectual property.

The answer is: No!

An FMU is simply a compressed archive. If you try changing the extension of an FMU to .zip and extracting it, you will find that it contains the original model. If you want to protect your IP, what I recommend is to protect the model. Once this is done, you can leverage the project export profile feature to automatically package only what should be shared.

Let's look at an example project I put together to highlight this workflow.

The Project

Here is what my example project looks like:

My example project

In this project, my top model "f14_top.slx" is simply a wrapper containing a Model block. With the shortcuts "Use Source" and "Use Protected", I can re-configure it in one click to either reference f14.slx in normal mode or reference its protected version f14.slxp.

Referencing the model

Let's look at the details...

Project Shortcuts

As mentioned above, I created two MATLAB scripts that I marked as shortcuts "Use Source" and "Use Protected". While I am developing the model, I need to work with the unprotected source model. For that, I click the "Use Source" shortcut, which executes:

Normal Mode

When I am ready to share the project, I can build the protected target and reconfigure the top model to reference it:

Protected Mode

Labels

To differentiate the files I want to share from the rest of the project, I use labels. Those will be used later to create an export profile.

When right-clicking on a file in the Project, I select Add Labels and can create new labels or select existing ones. In my case, I created the labels Source, Protected and Internal:

Creating labels

Export Profiles

The last thing to do is create an export profile, which can be done from the Share menu:

Export Profile

In my new profile, I can select which labels I do not want to be included when I will export the project.

Manage Export Profile

If I export the project using this profile, here is what the resulting project will look like:

Exported Project

Now it's your turn

Do you have different workflows to protect your IP and share projects? Let us know in the comments below.

18 views (last 30 days)  | |

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.