This figure illustrates the various options in the Create Protected Model dialog box.
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.
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.
Default: Off
Share a Web view of the protected model. For password protection, create and verify a password with a minimum of four characters.
Do not share a Web view of the protected model.
Protect Models to Conceal Contents (Embedded Coder)
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.
Default: On
User can simulate the protected model. For password protection, create and verify a password with a minimum of four characters.
User cannot simulate the protected model.
Protect Models to Conceal Contents (Embedded Coder)
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.
Default: Off
User can generate code for the protected model. For password protection, create and verify a password with a minimum of four characters.
User cannot generate code for the protected model.
To generate code, you must also select the Simulate check box.
This parameter enables Code interface and Content type.
Code Generation Requirements and Limitations (Embedded Coder)
Protect Models to Conceal Contents (Embedded Coder)
Specify the interface for the generated code.
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.
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.
Code Generation Requirements and Limitations (Embedded Coder)
Protect Models to Conceal Contents (Embedded Coder)
Select the appearance of the generated code.
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'
.
This parameter is enabled by selecting the Use generated code check box.
Protect Models to Conceal Contents (Embedded Coder)
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.
Default: Off
User can generate HDL code for the protected model. For password protection, create and verify a password with a minimum of eight characters.
User can simulate but cannot generate HDL code for the protected model.
To generate HDL code, you must also select the Simulate check box.
Code Generation Requirements and Limitations (Embedded Coder)
Protect Models to Conceal Contents (Embedded Coder)
Specify the path of the folder to contain the protected model.
Default: Current working folder
A model that you protect must be available on the MATLAB® path.
Protect Models to Conceal Contents (Embedded Coder)
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.
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.
Protect Models to Conceal Contents (Embedded Coder)
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.
Default: Off
Create a harness model for the protected model.
Do not create a harness model for the protected model.
To clear the check box for this parameter, set Contents
to Protected model (.slxp) only
.
Protect Models to Conceal Contents (Embedded Coder)
Name of the project archive that contains the generated files. The project inside the archive uses the same name.
Default:
modelname
_protected
To enable this parameter, set Contents to
Protected model (.slxp) and dependencies in a
project
.
Protect Models to Conceal Contents (Embedded Coder)