Create and edit visual diagrams to represent system architecture in System Composer™. Use visual architecture elements, components, ports, and connections in the system composition. Model hierarchy in architecture by decomposing components. Navigate through the hierarchy.
Start with a blank architecture model to model physical and logical architecture of a system. 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. Use one of these methods to create an architecture model:
At the command line, type
Select Architecture Model.
From a Simulink model or a System Composer architecture model. On the Simulation tab, select New , and then select Architecture .
At the MATLAB command line, type:
archModel = new_system('ModelName','Architecture'); open_system(archModel)
ModelName is the name of the new model.
Save the architecture model. On the Simulation tab, select
. The architecture model is saved as an
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.
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.
A component is a nontrivial, nearly-independent, and replaceable part of a system that fulfills a clear function in the context of an architecture. 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 encompass 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.
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. Click the light blue outline to commit.
Create a single component from the palette —
Create multiple components from the palette —
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.
Move a component simply by clicking and dragging it. Blue guidelines may appear to help align the component with other components.
Resize a component by dragging corners.
Hover the pointer over a corner to see the double arrow.
Left-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.
Release the mouse button when the component reaches the size you want.
Click a component and press Delete to delete it. To delete multiple components, select them while holding the Shift key down, then press Delete or right-click and select Delete from the context menu.
A port represents the connection point of a component to other components. 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 Interfaces.
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.
Pause over the side of a component. A + sign and a port outline appear.
Click the port outline. The component is shaded blue and a port arrow appears.
Click the arrow to commit the port. You can also name the port at this point.
An output port is shown with the icon and an input port is shown with the icon. By default, a port created on the top or left edge of a component is an input port, and a port created on the bottom or right edge is an output port. To designate port direction at creation, after you click the edge, pause over the arrow outline to see direction options. Select Input or Output before committing the port.
You can move any port to any component edge after creation.
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.
Every port is created with a name. To change the name, click it and edit.
Ports of a component must have unique names.
You can move a port to any side of a component. Select the port and use arrow keys.
|Arrow Key||Original Port Edge||Port Movement|
|Up||Left or right||If below other ports on the same edge, move up, if not, move to the top edge|
|Top or bottom||No action|
|Right||Top or bottom||If to the left of other ports on the same edge, move right, if not, move to the right edge|
|Left or right||No action|
|Down||Left or right||If above other ports on the same edge, move down, if not, move to the bottom edge|
|Top or bottom||No action|
|Left||Top or bottom||If to the right of other ports on the same edge, move left, if not, move to the left edge|
|Left or right||No 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 by selecting it and pressing the Delete button.
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 two ports by dragging a line:
Click one of the ports.
Keep the mouse button down while dragging a line to the other port.
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.
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.
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.
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.
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.
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.
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. You can setup a profile with Stereotypes ahead of time to capture the Architecture properties represented in such descriptions. Subsequently, you can use MATLAB programming to create and customize the various Architectural elements through the set of programmatic APIs.