Main Content

DDS Dictionary

Manage DDS aspects of an application

Description

To manage the DDS aspects of your applications in the Simulink® environment, you can use a section of the Simulink data dictionary that contains DDS properties called the DDS Dictionary. The DDS Dictionary is an intuitive graphical interface that enables you to quickly create and edit the DDS Domains, Topics, Data Samples, and Quality of Service (QoS)...

The DDS Dictionary is composed of three management tabs.

Types

The Types tab manages the DDS data types that are used to publish and subscribe Data Samples to the DDS network. The tab can also be used to view and edit the Simulink equivalent data types that are used to compute the application logic in the Simulink environment.

Domains

The Domains tab manages the Domains, Topics, and Registered Types so that applications can be configured to publish and subscribe to Topics.

QoS

The QoS tab manages the Quality of Service (QoS) available for a DDS application.

Open the DDS Dictionary

  • Open a model in the DDS Blockset app. On the DDS tab, click Code Interface and select DDS Dictionary.

  • In a Simulink data dictionary, if DDS definitions are available, a DDS Libraries node appears in the dictionary. If you open the DDS Libraries section of the Simulink data dictionary, in the Details pane, you can click Open DDS Libraries to open the graphical interface for the DDS Dictionary.

Examples

expand all

This example shows how to import additional XML files to include more DDS definitions in your DDS Dictionary.

  1. Open the DDS Dictionary.

  2. Click Import.

  3. Select additional XML files and click Open.

This example shows how to create and configure new DDS data types and their equivalent Simulink data types.

  1. Open the DDS Dictionary.

  2. Create a new DDS data type library. On the DDS Dictionary toolstrip, click Library.

  3. Create DDS data types. Select the new library and create the following new DDS data types:

    • Create a DDS Struct data type. On the DDS Dictionary toolstrip, click Struct. Select the new DDS type and in the Details pane, view its Simulink equivalent data type, a Simulink.Bus object.

    • Create a DDS Const data type. On the DDS Dictionary toolstrip, click Const. Select the new DDS type and in the Details pane, view its Simulink equivalent data type, a numeric MATLAB® variable.

    • Create a DDS Enum data type. On the DDS Dictionary toolstrip, click Enum. Select the new DDS type and in the Details pane, view its Simulink equivalent data type, a Simulink Enumerated data type.

This example shows how to create and configure a new Domain and Topic.

  1. Open the DDS Dictionary. Click the Domain tab.

  2. Create a new Domain. On the DDS Dictionary toolstrip, click Domain.

    • Edit the Domain name. For the new Domain, in the Name column, edit the name directly in the spreadsheet.

    • Edit the Domain ID. For the new Domain, in the Domain ID column, edit the Domain ID directly in the spreadsheet.

  3. Create a Registered Type. To create a new Topic you must first create a Registered Type for your new Domain. Select the new Domain, in the Details pane, click the link icon to create a Registered Type.

  4. Create a new Topic. On the DDS Dictionary toolstrip, click Topic.

    • Set the Registered Type for a Topic. Select the new Topic. In the Details pane, from the Registered Type drop-down, select a Registered Type from the listed options.

    • Set the Quality of Service (QoS) for a Topic. Select the new Topic. In the Details pane, from the Topic QoS drop-down, select a QoS profile from listed options.

This example shows how to import, view, and edit the Quality of Service (QoS) for your DDS application.

  1. Open the DDS Dictionary.

  2. Import QoS from XML.

  3. In the DDS Dictionary, click the QoS tab and view QoS profiles and policies. In the Details pane, set QoS policy values as needed.

  4. (Optional) Duplicate or delete QoS profiles in your dictionary. To duplicate a QoS profile, select a profile and click Duplicate. To delete a QoS profile, select a profile and click Delete

Parameters

Types

The names of DDS data type libraries or DDS data types available in the DDS Dictionary.

Example: TypeLibrary, ShapeType

The DDS data type in the DDS Dictionary. Supported DDS data types are Const, Enum, and Struct.

To view the equivalent Simulink data type for a DDS data type, select a DDS data type to open the Details pane and review the corresponding Simulink data type information.

DDS Data TypeSimulink Data Type
Constnumeric MATLAB variable
EnumEnumeration
StructSimulink.Bus object

Example: Const, Enum, Struct

Domains

The names of Domain Libraries, Domain Modules, Domains, and Topics available in the DDS Dictionary.

Example: ShapesDomainLibrary, ShapesLibrary, Circle

Domain ID you can set to specify a Domain.

Example: 1

The DDS data type that a Topic uses for its Data Samples.

Example: ShapeType

QoS

The names of Quality of Service (QoS) libraries and profiles.

Example: BuiltInQosLibrary, Event, DataReaderQoS

The QoS Type is a read-only field that shows if a QoS profile is specified for DataReaders or DataWriters.

Example: DataReaderQoS

Introduced in R2021a