Implement Component Behavior in Simulink

Create and use Simulink® models to specify component behavior.

Create a Simulink Behavior Model

When a component reaches the level of abstraction suitable for design, you can design its behavior using Model-Based Design or specify its intended behavioral model using a Stateflow® chart that can serve as a guide for detailed implementation in Simulink. Right-click the component and select Create Simulink Behavior.

Right click menu option for component named 'Data Processing' to select 'Create Simulink Behavior.'

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

Create Simulink behavior dialog for new model name specified as 'Data Processing'. Press Enter for OK.

  • A new Simulink model with the provided name is created. The root level ports of the Simulink model are preconfigured from the ports of the component in the architecture model.

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

The block for Data Processing with a Simulink model icon on the top right, pointing to the view once we double click on it, with input and output ports in a Simulink model window.

You can now go on to provide a specific algorithm implementation in the referenced Simulink model. Adding root-level ports in the Simulink model creates additional ports on the referencing component.

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 are deleted when the component links to a Simulink model and the component derives its ports from the root ports specified in the Simulink model.