Create Protected Model

This figure illustrates the various options in the Create Protected Model dialog box.

Create Protected Model: Overview

Create a protected model (.slxp) that allows read-only view, simulation, and code generation of the model with optional password protection.

To open the Create Protected Model dialog box, right-click the model block that references the model for which you want to generate protected model code. From the context menu, select Subsystem & Model Reference > Create Protected Model for Selected Model Block.

See Also

Open read-only view of model

Share a view-only version of your protected model with optional password protection. View-only version includes the contents and block parameters of the model.

Settings

Default: Off

On

Share a Web view of the protected model. For password protection, create and verify a password with a minimum of four characters.

Off

Do not share a Web view of the protected model.

Alternatives

Simulink.ModelReference.protect

See Also

Simulate

Enable user to simulate a protected model with optional password-protection. Selecting Simulate:

  • Enables protected model Simulation Report.

  • Sets Mode to Accelerator. You can run normal, accelerator, and rapid accelerator mode simulations.

  • Displays only binaries and headers.

  • Enables code obfuscation.

Settings

Default: On

On

User can simulate the protected model. For password protection, create and verify a password with a minimum of four characters.

Off

User cannot simulate the protected model.

Alternatives

Simulink.ModelReference.protect

See Also

Use generated code

Allows user to generate code for the protected model with optional password protection. Selecting Use generated code:

  • Enables Simulation Report and Code Generation Report for the protected model.

  • Enables code generation.

  • Enables support for simulation.

Settings

Default: Off

On

User can generate code for the protected model. For password protection, create and verify a password with a minimum of four characters.

Off

User cannot generate code for the protected model.

Dependencies

  • To generate code, you must also select the Simulate check box.

  • This parameter enables Code interface and Content type.

Alternatives

Simulink.ModelReference.protect

See Also

Code interface

Specify the interface for the generated code.

Settings

Default: Model reference

Model reference

Specifies the model reference interface, which allows use of the protected model within a model reference hierarchy. Users of the protected model can generate code from a parent model that contains the protected model. In addition, users can run Model block software-in-the-loop (SIL) or processor-in-the-loop (PIL) simulations to verify code.

Top model

Specifies the standalone interface. Users of the protected model can run Model block SIL or PIL simulations to verify the protected model code.

Dependencies

  • Requires an Embedded Coder® license

  • This parameter is enabled if you:

    • Specify an ERT (ert.tlc) system target file.

    • Select the Use generated code check box.

Alternatives

Simulink.ModelReference.protect

See Also

Content type

Select the appearance of the generated code.

Settings

Default: Obfuscated source code

Binaries

Includes only compiled binaries for the generated code.

Obfuscated source code

Includes obfuscated source code.

Readable source code

Includes readable source code and readable code comments.

The options Obfuscated source code and Readable source code by default include only the minimal header files required to build the code with the chosen build settings. These options correspond to using the Simulink.ModelReference.protect with the 'OutputFormat' option set to 'MinimalCode'. To include header files found on the include path in the protected model, use the Simulink.ModelReference.protect function and set the 'OutputFormat' option to 'AllReferencedHeaders'.

The Binaries option corresponds to using the Simulink.ModelReference.protect function with the 'OutputFormat' option set to 'CompiledBinaries'.

Dependencies

This parameter is enabled by selecting the Use generated code check box.

Alternatives

Simulink.ModelReference.protect

See Also

Use generated HDL code

Allows user to generate HDL code for the protected model with optional password protection. Selecting Use generated HDL code:

  • Enables Simulation Report and HDL Code Generation Report for the protected model.

  • Enables support for HDL code generation.

  • Enables support for simulation.

Settings

Default: Off

On

User can generate HDL code for the protected model. For password protection, create and verify a password with a minimum of eight characters.

Off

User can simulate but cannot generate HDL code for the protected model.

Dependencies

To generate HDL code, you must also select the Simulate check box.

Alternatives

Simulink.ModelReference.protect

See Also

Destination folder

Specify the path of the folder to contain the protected model.

Settings

Default: Current working folder

Dependencies

A model that you protect must be available on the MATLAB® path.

Alternatives

Simulink.ModelReference.protect

See Also

Contents

Option to package supporting files, including a harness model, with the protected model in a project archive. The type and number of supporting files depends on the model being protected. Examples of supporting files are a MAT-file with base workspace definitions and a data dictionary pruned to relevant definitions. The supporting files are not protected.

Note

Before sharing the project, check whether the project contains the necessary supporting files. If supporting files are missing, simulating or generating code for the related harness model can help identify them. Add the missing dependencies to the project and update the harness model as needed.

Settings

Default: Protected model (.slxp) and dependencies in a project

Protected model (.slxp) and dependencies in a project

Create a project archive that contains the protected model, its dependencies, and its harness model. The supporting files are not protected. The project archive is a single file that allows for easy sharing.

Protected model (.slxp) only

Create only the protected model. If the protected model has dependencies, you must share them separately. Similarly, if you create a harness model for the protected model, you must share the harness model separately.

Alternatives

Simulink.ModelReference.protect

See Also

Create harness model for protected model

Create a harness model for the protected model. The harness model provides an isolated environment for the protected model, which is referenced by a Model block.

Settings

Default: Off

On

Create a harness model for the protected model.

Off

Do not create a harness model for the protected model.

Dependencies

To clear the check box for this parameter, set Contents to Protected model (.slxp) only.

Alternatives

Simulink.ModelReference.protect

See Also

Name of project archive (.mlproj)

Name of the project archive that contains the generated files. The project inside the archive uses the same name.

Settings

Default: modelname_protected

Dependencies

To enable this parameter, set Contents to Protected model (.slxp) and dependencies in a project.

Alternatives

Simulink.ModelReference.protect

See Also