Overview of System Composer API
The System Composer™ application programming interface (API) allows you to create or change System Composer architecture models and linked artifacts from the MATLAB® Command Window. By placing System Composer API commands in a MATLAB function or script, you can:
Automate your architecture model modification operations by executing several editing steps in a single command.
Eliminate repetitive architecture model creation steps by producing a "base" System Composer model that you can reuse as a template for later changes.
Produce a specialized report of your architecture model and linked artifacts with Simulink® Report Generator™.
The System Composer API consists of objects that represent architecture model elements. For
example, the API objects systemcomposer.arch.Component
and systemcomposer.arch.Connector
represent components and connectors in a
System Composer model. When you modify the writable properties of an API object or call one of
its object functions, you affect the corresponding object in the System Composer model. When you use the System Composer model canvas to perform an operation on an object in the architecture model,
you affect the corresponding API object.
Note
You cannot undo any operation in the System Composer model canvas or editing tool that you perform by using the System Composer API. If you perform an editing operation through the API, the Undo and Redo buttons in the quick access toolbar are disabled.
Hierarchy of System Composer API Objects for Model Building
System Composer API objects are organized in a containment hierarchy. Each architectural
element is owned by a root architecture. For example, if component A
contains component B
in a System Composer model, then the API object for the architecture of component
A
contains the API object for the architecture of component
B
.
This diagram shows the hierarchy of objects in the System Composer model builder API.
The hierarchy consists of levels of containment that depends on depth:
Model — The
systemcomposer.arch.Model
object is the representation of the SLX file that stores information about a System Composer model where you build your architectural description of the system you are designing.Root Architecture — A System Composer model begins with a root architecture represented by a
systemcomposer.arch.Architecture
object.A root is at the top of an architecture hierarchy. A root architecture has a boundary defined by its architecture ports that surround the system of interest.
Component — A component represented by a
systemcomposer.arch.Component
object shares the properties and attributes of a Component block.A component is a replaceable part of a system that fulfills a clear function in the context of an architecture. A component defines an architectural element, such as a function, another system, hardware, software, or other conceptual entity. A component can also be a subsystem or subfunction.
Architecture — The architecture of a component is represented by a
systemcomposer.arch.Architecture
object.A System Composer architecture represents a system of components and how they interface with each other structurally and behaviorally.
Port — A component port exists on the outside of components, represented by a
systemcomposer.arch.ComponentPort
object. An architecture port exists within a component port, accessible on the system boundary when you double-click the component, represented by asystemcomposer.arch.ArchitecturePort
object.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.
Connector — A connector, represented by a
systemcomposer.arch.Connector
object, connects two ports.Connectors are lines that provide connections between ports. Connectors describe how information flows between components or architectures.
Interface Data Dictionary — An interface data dictionary, represented by a
systemcomposer.interface.Dictionary
object, exists as part of the model or an external SLDD file that contains interface definitions.An interface data dictionary is a consolidated list of interfaces and value types in an architecture and where you use them in the architecture.
Data Interface — Assign data interfaces, represented by a
systemcomposer.interface.DataInterface
object, to ports in your architecture model.A data interface defines the kind of information that flows through a port. The same interface can be assigned to multiple ports. A data interface can be composite, meaning that it can include data elements that describe the properties of an interface signal.
Data Element — Further clarify interfaces with data elements, represented by a
systemcomposer.interface.DataElement
object.A data element describes a portion of an interface, such as a communication message, a calculated or measured parameter, or other decomposition of that interface.
Value Type — A value type, represented by a
systemcomposer.ValueType
object, clarifies a data element and can be used as an interface assigned to a port.A value type can be used as a port interface to define the atomic piece of data that flows through that port and has a top-level type, dimension, unit, complexity, minimum, maximum, and description.