Main Content

Manage Interfaces with Data Dictionaries

Engineering systems often share interface definitions across multiple components or subsystems. Data interfaces in System Composer™ can be stored either locally in a model or in a data dictionary, depending on the maturity of your system.

For interfaces terminology, see Define Port Interfaces Between Components.

An interface data dictionary is a consolidated list of interfaces and value types in an architecture and where you use them in the architecture.

You can save local interfaces on a System Composer model in an interface data dictionary using the Interface Editor. You can reuse data dictionaries between models that need to use a given set of interfaces, elements, and value types. Data dictionaries that you link to models are stored in separate SLDD files.

For more advanced data dictionary referencing techniques, see Reference Data Dictionaries.

Note

When you load existing interface data dictionaries, Simulink® automatically migrates them to the Architectural Data section of the Simulink data dictionary. In addition to the Interface Editor, you can also use the Architectural Data Editor and Simulink.dictionary.ArchitecturalData programmatic interfaces to manage and modify interfaces and value types. For more information on managing architectural data, see Store Shared Data in Architectural Data Section and Store Data in Architectural Data Section Programmatically.

Mobile Robot Architecture Model with Interfaces

This example shows a mobile robot hardware architecture with interfaces defined.

Save, Link, and Delete Interfaces

By default, interfaces are stored within the architecture model and are not visible outside the model. If you are in the initial stages of building a system model, store interfaces locally to limit the number of files that need to be managed. However, if your model is mature to the point of leveraging componentization workflows like reference architectures and behaviors, storing interfaces in a data dictionary gives you the ability to share interface definitions across the model hierarchy.

Use the save interface menu to save a data interface to a new or existing data dictionary. To create a new data dictionary, select Save to new dictionary. Provide a data dictionary name.

The robot interfaces data dictionary shown in the Interface Editor window. Below the data dictionary are the interfaces.

You can also add interface definitions in the model from an existing data dictionary by selecting Link existing dictionary to link the data dictionary to the model.

Use the interface import button to import interface definitions from a Simulink bus object, either from a MAT-file or the workspace.

Delete a data interface from a data dictionary using the delete interface button. If the data interface is already being used by ports in a currently open model, the software returns a warning message. The data interface is then removed from any ports in the open model that are associated with the data interface.

If a data interface is deleted from a data dictionary upon opening another model that shares the data dictionary, a warning will be presented on startup if the deleted interface is used by ports in that model. The Diagnostic Viewer offers an option to remove the deleted interface from all ports that are still using it. You can also select ports individually and delete their missing interfaces.

The 'sensor data' interface is selected. The confirm delete interface warning message says: Are you sure you want to delete interface: 'sensor data'? This will remove interface from all ports associated with that interface. This action cannot be undone. The default selection is No.

A System Composer model and a data dictionary are separate artifacts. Even when you link the data dictionary to the model, you must save changes to the data dictionary (an SLDD file) separately from changes to the model (an SLX file). To save changes to a linked data dictionary, use the save interface button and select Save dictionary. Once you save a data dictionary, other models can use its interface definitions if you link the data dictionary to those models, which allows multiple models to share the same interface definitions.

See Also

| | | | | |

Related Topics