Main Content

Compose Architecture Visually

Create and edit visual diagrams to represent system architecture in System Composer™. Use architectural elements including components, ports, and connections in the system composition. Model hierarchy in architecture by decomposing components. Navigate through the hierarchy.

Create an Architecture Model

A System Composer architecture represents a system of components and how they interface with each other structurally and behaviorally. You can represent specific architectures using alternate views.

Different types of architectures describe different aspects of systems:

  • Functional architecture describes the flow of data in a system.

  • Logical architecture describes the intended operation of a system.

  • Physical architecture describes the platform or hardware in a system.

A System Composer model is the SLX file that contains architectural information including components, ports, connectors, interfaces, and behaviors.

An architecture model includes a top-level architecture that holds the composition of the system. This top-level architecture also allows definition of interfaces of this system with other systems.

Start with a blank architecture model to model the physical and logical architecture of a system. Use one of these three methods to create an architecture model:

  • At the MATLAB® Command Window, enter:

    systemcomposer

    Select Architecture Model.

    Simulink new selection menu specifying a system composer architecture model create model selection.

  • From a Simulink® model or a System Composer architecture model. On the Simulation tab, select New model, and then select Architecture .

    New System Composer model.

  • At the MATLAB Command Window, enter:

    archModel = new_system('ModelName','Architecture');
    open_system(archModel)

    where ModelName is the name of the new model.

Save the architecture model. On the Simulation tab, select Save All . The architecture model is saved as an .slx file.

The architecture model includes a top-level architecture that holds the composition of the system. This top-level architecture also allows definition of interfaces of this system with other systems. The composition represents a structured parts list — a hierarchy of components with their interfaces and interconnections. Edit the composition in the Composition Editor.

System Composer display on Simulink with labels for the Toolstrip on top, the Model browser on the left, the Element palette directly to the left of the model Composition in the center, and the Interface Editor at the bottom.

This example shows a motion control architecture, where a sensor obtains information from a motor, feeds that information to a controller, which in turn processes this information to send a control signal to the motor so that it moves in a certain way. You can start with this rough description and add component properties, interface definitions, and requirements as the design progresses.

Components

A component is a nontrivial, nearly independent, and replaceable part of a system that fulfills a clear function in the context of an architecture. A component defines an architecture element, such as a function, a system, hardware, software, or other conceptual entity. A component can also be a subsystem or subfunction.

The Component element in System Composer can represent a component at any level of the system hierarchy, whether it is a major system component that encompasses many subsystems, such as a controller with its hardware and software, or a component at the lowest level of hierarchy, such as a software module for messaging.

Represented as a block, a component is a part of an architecture model that can be separated into reusable artifacts.

Add Components

Use one of these methods to add components to the architecture:

  • Draw a component — In the canvas, left-click and drag the mouse to create a rectangle. Release the mouse button to see the component outline. Select the Component block option to commit.

  • Create a single component from the palette —

    Clicking and dragging a component and then committing it.

  • Create multiple components from the palette —

    Committing a second component.

Name a Component

Each component must have a name that is unique within the same architecture level. The name of the component is highlighted upon creation so you can directly type the name. To change the name of a component, click the component and then click its name.

A component with the name Sensor.

The Sensor component after selecting the name to edit it.

Move a Component

Move a component simply by clicking and dragging it. Blue guidelines may appear to help align the component with other components.

Click and drag a component named Component1 to move it and it lines up with other components.

Resize a Component

Resize a component by dragging corners.

  1. Pause the pointer over a corner to see the double arrow.

    Pointer is on the bottom right of Component1.

  2. Click the corner and drag while holding the mouse button down. If you want to resize the component proportionally, hold the Shift button as well.

    Clicking and dragging the bottom right of Component1 to resize it.

  3. Release the mouse button when the component reaches the size you want.

Delete a Component

Click a component and press Delete to delete it. To delete multiple components, select them while holding the Shift key down, then press Delete.

Ports

A port is a node on a component or architecture that represents a point of interaction with its environment. A port permits the flow of information to and from other components or systems.

There are different types of ports:

  • Component ports are interaction points on the component to other components.

  • Architecture ports are ports on the boundary of the system, whether the boundary is within a component or the overall architecture model.

For example, a sensor might have data ports to communicate with a motor and a controller. Its input port takes data from the motor, and the output port delivers data to the controller. You can specify data properties by defining an interface as described in Define Port Interfaces Between Components.

Add a Component Port

Represent the relationship between components by defining directional interface ports. You can organize the diagram by positioning ports on any edge of the component, in any position.

  1. Pause over the side of a component. A + sign and a port outline appear.

    Adding a component port to the right side of the Sensor component. The port displays as a light blue outline until you commit to it.

  2. Click the port outline. A set of options appear for an Input, Output, or Physical port.

    The port before committing it.

  3. Select Output to commit the port. You can also name the port at this point.

    The port named OutBus after committing the port.

An output port is shown with the icon, an input port is shown with the icon, and a physical port is shown with the physical port icon.

You can move any port to any component edge after creation.

Add an Architecture Port

You can also create a port for the architecture that contains components. These system ports carry the interface of the system with other systems. Pause on any edge of the system box and click when the + sign appears. Click the left side to create input ports and click the right side to create output ports.

Model with three components and one InBus architecture port and one OutBus architecture port.

Name a Port

Every port is created with a name. To change the name, click it and edit.

A selected port name ready to be edited.

Ports of a component must have unique names.

Move a Port

You can move a port to any side of a component. Select the port and use arrow keys.

Arrow KeyOriginal Port EdgePort Movement
UpLeft or rightIf below other ports on the same edge, move up, if not, move to the top edge
Top or bottomNo action
RightTop or bottomIf to the left of other ports on the same edge, move right, if not, move to the right edge
Left or rightNo action
DownLeft or rightIf above other ports on the same edge, move down, if not, move to the bottom edge
Top or bottomNo action
LeftTop or bottomIf to the right of other ports on the same edge, move left, if not, move to the left edge
Left or rightNo action

The spacing of the ports on one side is automatic. There can be a combination of input and output ports on the same edge.

Delete a Port

Delete a port by selecting it and pressing the Delete button.

Connections

Connectors are lines that provide connections between ports. Connectors describe how information flows between components or architectures. A connector allows two components to interact without defining the nature of the interaction. Set an interface on a port to define how the components interact.

Connections are visual representations of data flow from an output port to an input port. For example, a connection from a motor to a sensor carries positional information.

Connect Existing Ports

Connect two ports by dragging a line:

  1. Click one of the ports.

  2. Keep the mouse button down while dragging a line to the other port.

  3. Release the mouse button at the destination port. A black line indicates the connection is complete. A red-dotted line appears if the connection is incomplete.

The process of connecting two ports.

You can take these steps in both directions — input port to output port, or output port to input port. You cannot connect ports that have the same direction.

A connection between an architecture port and a component port is shown with tags instead of lines.

The Motor component is connected to the architecture.

Connect Components Without Ports

To quickly create ports and connections at the same time, drag a line from one component edge to another. The direction of this connection depends on which edges of the components are used - left and top edges are considered inputs, right and bottom edges are considered outputs. You can also perform this operation from an existing port to a component edge.

Creating a port upon connecting a port to a component without ports.

You can create a connection between an edge that is assumed to be an input only with an edge that is assumed to be an output. For example, you cannot connect a top edge, which is assumed to be an input, with another top edge, unless one of them already has an output port.

Branch Connections

Connect an output port to multiple input ports by branching a connection. To branch, right-click an existing connection and drag to an input port while holding the mouse button down. Release the button to commit the new connection.

Right-clicking on a connection to branch it.

Create New Components Through Connections

If you start a connection from an output port and release the mouse button without a destination port, a new component tentatively appears. Accept the new component by clicking it.

Attempt to make a new connection and a suggested component appears in light blue to be accepted by clicking on it.

Importing Architectures

By combining the programmatic APIs of System Composer with MATLAB support for loading and parsing many different file and databased formats, you can import external architecture descriptions into System Composer. For details, see Import and Export Architecture Models.

You can setup a profile with stereotypes ahead of time to capture the architecture properties represented in such descriptions. For details, see Define Profiles and Stereotypes.

Subsequently, you can use MATLAB programming to create and customize the various architectural elements. For details, see Build Architecture Models Programmatically.

See Also

Functions

Blocks

Related Topics