getDeploymentType - Get deployment type of model - MATLAB (original) (raw)
Main Content
Get deployment type of model
Since R2022a
Syntax
Description
[depType](#mw%5F52b2bba5-87f2-43cc-ac9b-be773413fb03) = getDeploymentType([coderMapObj](#mw%5F10115847-e1ac-4896-8106-e143b38fa49b))
returns the deployment type of the model specified by code mappings objectcoderMapObj
. 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
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 thegetDeploymentType
function.
openExample("CounterModel.slx"); cm = coder.mapping.utils.create("CounterModel"); depType = getDeploymentType(cm)
The default deployment type of a model is Automatic
.
To specify the deployment type of a model, use thesetDeploymentType
function.
setDeploymentType(cm,"Subcomponent")
Input Arguments
Code mapping object (model code mappings), returned by a call to functioncoder.mapping.api.get
.
Output Arguments
The deployment type of the model code mappings object, returned asAutomatic
, Component
, orSubcomponent
.
Deployment Type | Description |
---|---|
Automatic | Embedded CoderĀ® determines the deployment type based on the model hierarchy context |
Component | The top model that generates code. The model generates a standalone algorithm. The component code exposes its interface to other components in the system.Component deployment type is only valid for models with a service interface code configuration. |
Subcomponent | A model reference that a component model uses. The generated code entry points are symbolically scoped to the parent component. |
Version History
Introduced in R2022a