Main Content

setDeploymentType

Set deployment type of model

Description

example

setDeploymentType(myCodeMappingObj, depType) sets the deployment type of the model specified by code mappings object myCodeMappingObj to the type specified by depType. The deployment type controls the code interfaces at different levels of a model hierarchy. The code generator uses the deployment type to:

  • Enforce peer and nesting rules in the model hierarchy.

  • Map model elements to code interface definitions.

  • Generate code that uses the appropriate interface to connect to other parts of the hierarchy.

Examples

collapse all

The deployment type of a model controls the code interfaces at different levels of a model hierarchy.

To access the deployment type of a model, use the getDeploymentType function.

load_system('rtwdemo_counter');
cm = coder.mapping.utils.create('rtwdemo_counter');
depType = getDeploymentType(cm)
depType =

    'Automatic'

The default deployment type of a model is Automatic.

To specify the deployment type of a model, use the setDeploymentType function.

setDeploymentType(cm, 'Component')

Input Arguments

collapse all

Code mapping object (model code mappings), returned by a call to function coder.mapping.api.get.

The deployment type of the model, specified as Automatic, Component, or Subcomponent.

Deployment TypeDescription
AutomaticEmbedded Coder® determines the deployment type based on the model hierarchy context
ComponentThe top model that generates code. The model generates a standalone algorithm. The component code exposes its interface to other components in the system.
SubcomponentA model reference that a component model uses. The generated code entry points are symbolically scoped to the parent component.

Data Types: char

Version History

Introduced in R2022a