Main Content

DDS Dictionary

Manage DDS aspects of an application

Since R2021a

Description

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

DDS Dictionary with the Types tab displayed.

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 to Data Samples in 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.

DDS dictionary with the Types tab displaying Base, Common, and Shapes modules with their respective types.

See Type for more information, including details about full names and short names.

Domains

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

DDS dictionary displaying the Domains tab.

See Topic Type for more information.

QoS

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

DDS dictionary displaying the Quality of Service tab.

See QoS Type for more information.

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 and Interface Definition Language (IDL) files to include more DDS definitions in your DDS Dictionary.

  1. Open the DDS Dictionary.

  2. Click Import.

  3. Select additional XML or IDL 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

expand all

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

The Details pane displays the full name and short name of a DDS data type. Fullname is a concatenation of the full path of the nested module names defined in the namespace hierarchy for the data type. Shortname is a version of the long name that is shortened by using a unique identifier representing the namespace hierarchy.

For Struct types, the Details pane also displays Base, which is the base of the data type. If you specify a base for a Struct type, the Simulink bus object contains elements of the base type in addition to the elements defined for the data type. DDS Blockset checks for name conflicts and prevents the addition of elements with the same name in the hierarchy.

Type names are represented in Simulink and generated code as follows:

  • For new DDS dictionaries created in R2022b, data type names are the short names.

  • For DDS dictionaries created in R2022a or earlier, data type names are the full names.

For example, the data type name for a Simulink object in R2022a is represented as the full name, which is the module name appended to the instance name: Shapes_Rectangle, Base_Polygon, Common_Origin. In R2022b, these data types are represented as the short names, S_Rectangle, B_Polygon, C_Origin.

For DDS dictionaries created in R2022a or earlier and moved to R2022b, data type names are represented as the full names for backward compatibility.

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

Version History

Introduced in R2021a

expand all