Implement Components in Simulink

System design and architecture definition can involve a behavior definition for some components, such as the algorithm for a data processing component. Components in System Composer™ architecture models can define behavior using Simulink® models by linking components to Simulink models.

Create a Simulink Behavior Model

When a component does not require further decomposition from an architecture standpoint, you can design and define its behavior in Simulink.

  1. Right-click the component and select Create Simulink Behavior.

    Right-click menu selection for the 'Data Processing' component selecting 'Create Simulink Behavior...'

  2. Provide a model name. The default name is the name of the component.

    Create Simulink Behavior dialog with new model name 'Data Processing' with options browse, OK, cancel, and help.

  • A new Simulink model with the provided name is created. The root level ports of the Simulink model reflect the ports of the component.

  • The component in the architecture model is linked to the Simulink model. The Simulink icon on the component indicates this is a Simulink link.

The data processing component with referenced Simulink model between chevrons with arrow pointing to what is inside. There is a Simulink base model inside with in-ports and out-ports designated.

You can continue with providing specific dynamics and algorithms in the referenced Simulink model. Adding root-level ports in the Simulink model creates additional ports on the System Composer Reference Component block.

You can access and edit a referenced Simulink model by double-clicking the component in the architecture model. When you save the architecture model, all unsaved Simulink behavior models it references must also be saved, and all linked components updated.

Options to save reference models recursively with 'Save All', or to save the current model and refresh the parent model with 'Save'. There is also an option to 'Cancel' the save operation.

Link to an Existing Simulink Behavior Model

You can link to an existing Simulink behavior model from a System Composer component, provided that the component is not already linked to a reference architecture. Right-click the component and select Link to Model. Type in or browse for the name of a Simulink model.

Link to model dialog with existing model name 'Data Processing'. Press Enter for OK.

Any subcomponents and ports that are present in the components get deleted when the component links to a Simulink model.

You can link protected Simulink models (.slxp) to create component behaviors. You can also convert an already linked Simulink behavior model to a protected model, and the change is reflected after refreshing the model.

Related Topics