Main Content

Simulink.ProtectedModel.getConfigSet

Get configuration set for current protected model target or for specified target

Description

configSet = Simulink.ProtectedModel.getConfigSet(protectedModel) returns the configuration set object for the current, protected model target.

example

configSet = Simulink.ProtectedModel.getConfigSet(protectedModel,targetID) returns the configuration set object for a specified target that the protected model supports.

example

Examples

collapse all

Get the configuration set for the currently configured, protected model target.

Load the model and save a local copy.

openExample('sldemo_mdlref_counter');
save_system('sldemo_mdlref_counter','mdlref_counter.slx');

Add a required password for modifying a protected model. If you do not add a password, you are prompted to set a password when you create a modifiable, protected model.

Simulink.ModelReference.ProtectedModel.setPasswordForModify(...
'mdlref_counter','password');

Create a modifiable, protected model with support for code generation.

Simulink.ModelReference.protect('mdlref_counter','Mode',...
'CodeGeneration', 'Modifiable',true, 'Report',true);

Get the configuration set for the currently configured target.

cs = Simulink.ProtectedModel.getConfigSet('mdlref_counter')

Get the configuration set for a specified target that the protected model supports.

Load the model and save a local copy.

openExample('sldemo_mdlref_counter');
save_system('sldemo_mdlref_counter','mdlref_counter.slx');

Add a required password for modifying a protected model. If you do not add a password, you are prompted to set a password when you create a modifiable, protected model.

Simulink.ModelReference.ProtectedModel.setPasswordForModify(...
'mdlref_counter','password');

Create a modifiable, protected model with support for code generation.

Simulink.ModelReference.protect('mdlref_counter','Mode',...
'CodeGeneration', 'Modifiable',true, 'Report',true);

Configure the unprotected model to support a new target.

 set_param('mdlref_counter', 'SystemTargetFile', 'ert.tlc'); 
 save_system('mdlref_counter');

Add support to the protected model for the new target. You are prompted for the modification password.

 Simulink.ProtectedModel.addTarget('mdlref_counter');

Verify that support for the new target has been added to the protected model.

 st = Simulink.ProtectedModel.getSupportedTargets('mdlref_counter')

Get the configuration set for the added target.

cs = Simulink.ProtectedModel.getConfigSet('mdlref_counter','ert')

Input Arguments

collapse all

Protected model name, specified as a string or character vector.

Identifier for selected target, specified as a string or character vector. The target identifier is the root of the Code Generation > System Target file (SystemTargetFile) parameter. For example, if the System Target file is ert.tlc, the target identifier is ert.

Output Arguments

collapse all

Configuration set, specified as a Simulink.ConfigSet object

Version History

Introduced in R2015a