Main Content

Manage Domains

The DDS middleware platform requires that applications specify a Domain, Topic, and Registered Type to publish and subscribe to the DDS network. DDS provides a network, the Global Data Space, that can be partitioned into subnetworks, Domains, and then into categories of data, Topics. To use DDS, your application must specify the Domain it wants to participate in, the Topic it wants to subscribe or publish data to, and the DDS data type for that data, referred to as the Registered Type for the Topic. You can use the DDS Dictionary to import, create, and edit the Domain, Topic, and Registered Types to meet your application requirements.

To create and manage Domains, Topics, and Registered Types for applications:

To learn how to create Domains, Topics, and Registered Types, see Create Domains, Create Topics, and Register DDS Data Types for Topics. To learn how to apply these definitions to publish and subscribe to DDS, see Subscribe to a Topic, and Publish a Topic.

Import Domains and Topics

If you have previously or would like to specify DDS definitions by using IDL or XML, you can use the DDS Application Quick Start to import those definitions into a DDS Dictionary. If you would like to import more than one XML file or you are working in an existing DDS Dictionary, you can use the DDS Dictionary to import additional XML files. To import from the DDS Dictionary, on the dictionary toolstrip, click Import to select and upload additional XML files.

View Domains, Topics, and Registered Types

To open a DDS Dictionary to configure Domains, Topics, and Registered Types, on the DDS tab, click Code Interface and select DDS Dictionary. In the DDS Dictionary, click the Domains tab.

Display of Domains tab in DDS Dictionary.

Alternatively, you can open the DDS Dictionary from a Simulink® data 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.

Edit Domains, Topics, and Registered Types

You can use the DDS Dictionary to configure these aspects of the Domains, Topics, and Registered Types available for your DDS application:

Edit Domains

Organize Domains in the DDS Dictionary.  To organize large numbers of Domains, you can group the Domains into libraries. To create a Domain library, on the DDS Dictionary toolstrip, click Library. To duplicate a library, select a library, on the toolstrip, click Duplicate. If you duplicate a library the Domains and Topics contained within that library are also duplicated and reproduced in the duplicate library. To delete a library, on the toolstrip, click Delete.

Create New Domains.  To create a new Domain, select a library, and then on the DDS Dictionary toolstrip, click Domain.

Configure Domain Names.  To change the name of a Domain, in the Name column, click and directly edit the spreadsheet.

Configure Domain IDs.  To change a Domain ID, select the Domain. In the Domain ID column, click and directly edit the spreadsheet.

Configure Registered Types Domains.  To configure the Registered Types for Domains, select a Domain. In the Details pane, click the link button to add a Registered Type. To edit the name and DDS type for your Registered Type, use the Name and TypeRef fields. To manage the Registered Types for the Domain, use the duplicate and delete buttons. To register a type for a Topic, the data type must be registered for its Domain.

Duplicate Domains.  To duplicate a Domain, select the Domain, and then on the DDS Dictionary toolstrip, click Duplicate.

Delete Domains.  To delete a Domain, select the Domain, and then on the DDS Dictionary toolstrip, click the Delete.

Edit Topics

Create new Topics.  To create a new Topic, select a Domain, on the DDS Dictionary toolstrip, click Topic.

Configure Topic Names.  To change the name of a Topic, in the Name column, click and directly edit the spreadsheet.

Configure Registered Types Topics.  To configure the Registered Type for a Topic, select the Topic. In the Details pane, use the Registered Type drop-down list to select from the DDS data type options. The available options are DDS data types that are in the DDS Dictionary and registered with the Domain. If you do not see a DDS data type that you expected, verify or create the DDS data type in the dictionary, and then register the data type with the Domain for it to appear as an option. After the data type is registered, it appears as the Topic Type for the Topic.

Configure QoS for Topics.  To configure the QoS for a Topic, select the Topic. In the Details pane, use the Topic QoS drop-down list to select from the available QoS profiles in the DDS Dictionary. If you do not see the QoS profiles that you expected, import the necessary QoS profiles to the DDS Dictionary.

Duplicate Topics.  To duplicate a Topic, select a Topic, and then on the DDS Dictionary toolstrip, click Duplicate.

Delete Topics.  To delete a Topic, select the Topic, and then on the DDS Dictionary toolstrip, click Delete.

Edit Registered Types

Create Registered Types.  To create Registered Types, select a Domain. In the Registered Types section of the Details pane, click the link button to add a Registered Type. The DDS data types available are the types in the dictionary. To change the name of a Registered Type, click and directly edit the Name field. To change the DDS data type of a Registered Type, click in the TypeRef field and select from the drop-down options.

Duplicate Registered Types.  To duplicate a Registered Type, select a Registered Type and click the Duplicate button.

Delete Registered Types.  To delete a Registered Type, select a Registered Type and click the Delete button.

Examples

These examples show incrementally how to create the Domains, Topics, and Registered Types needed to configure DDS applications. The examples then show how to apply these definitions to enable applications to publish and subscribe to data on the DDS network.

Create Domains

This example shows how to import, create, and configure Domains.

  1. (Optional) Import Domains. If you would like to import Domains, use the DDS Application Quick Start or DDS Dictionary.

  2. Open the DDS Dictionary. On the DDS tab, click Code Interface and select DDS Dictionary.

  3. Click the Domains tab.

  4. Create a Domain. On the DDS Dictionary toolstrip, click Domain.

  5. Configure the Domain. To configure the Domain name and Domain ID, click and edit the spreadsheet.

  6. Create Topics within the Domain as necessary.

Create Topics

This example shows how to import, create, and configure Topics.

  1. (Optional) Import Topics. If you would like to import Topics, use the DDS Application Quick Start or DDS Dictionary.

  2. Open the DDS Dictionary. On the DDS tab, click Code Interface and select DDS Dictionary.

  3. Topics are contained within Domains. To configure Topics, click the Domains tab.

  4. Select or create a Domain.

  5. Create a Topic. On the DDS Toolstrip, click Topic.

Register DDS Data Types for Topics

This example shows how to create and configure Registered Types for Topics. To configure a Registered Type for a Topic, create the DDS data type in the DDS Dictionary, register the data type with the Domain, and then register the data type with the Topic.

  1. Open the DDS Dictionary. On the DDS tab, click Code Interface and select DDS Dictionary.

  2. Registered Types are contained within Domains. To configure Registered Types, click the Domains tab.

  3. Register a DDS data type with the Domain. In the Details pane, in the Registered Types section, click the link button to create a Registered Type. Adjust the Name and TypeRef as necessary.

  4. Associate the Registered Type for a Topic. In the Details pane, in the Topics section, the Topics for the selected Domain are displayed. To set the Registered Type for a Topic, click in the Register TypeRef field and select from the drop-down options. The options reflect the Registered Types for the Domain.

  5. Verify the Registered Type for the Topic. You can view the data type associated with the Registered Type for a Topic in the Topic Type column in the spreadsheet. Alternatively, you can select the Topic. In the Details pane, the Registered Type field shows the Registered Type for the Topic. You can also use the Registered Type drop-down to adjust the Registered Type for the Topic.

    Display of Details pane under the Domains tab when Circle topic is selected in the DDS Dictionary.

Subscribe to a Topic

This example shows at a high level how to use the DDS Dictionary to create a Topic and then configure the application modeled in Simulink to subscribe to that Topic.

  1. Create a Topic in the DDS Dictionary.

    1. Open the DDS Dictionary. Topics are contained within Domains. To configure Topics, click the Domains tab.

    2. Create a Domain. On the toolstrip, click Domain.

    3. Create a Topic. Select the Domain, from the toolstrip, click Topic. Click and edit the spreadsheet to configure the Topic.

    4. Registered a DDS data type for the Topic. Select the Domain, in the Details pane, register a DDS data type and then apply it to the Topic.

    5. Close the DDS Dictionary.

  2. In the application model the inports act as DataReaders and must have the same DDS data type as the Topic they subscribe to. Configure the inports to the Registered Type for the Topic.

  3. Configure the DDS interface to subscribe to the Topic.

    1. Open the Code Mappings editor to configure the DDS interface. From the DDS tab, click Code Interface and select Individual Element Code Mappings.

    2. Select the Topic. For the inports in the model, select the Topic specified in the drop-down options by its path (DomainLibrary/Domain/Topic).

  4. Build and deploy the application to subscribe to the Topic.

For more information about how to configure a model, see Model DDS Applications. For more information about how to configure the inports, see Interactively Configure DDS Interface.

Publish a Topic

This example shows at a high level how to use the DDS Dictionary to create a Topic and then configure the application modeled in Simulink to publish for that Topic.

  1. Create a Topic in the DDS Dictionary.

    1. Open the DDS Dictionary. Topics are contained within Domains. To configure Topics, click the Domains tab.

    2. Create a Domain. On the toolstrip, click Domain.

    3. Create a Topic. Select the Domain, on the toolstrip, click Topic. Click and edit the spreadsheet to configure the Topic.

    4. Registered a DDS data type for the Topic. Select the Domain, in the Details pane, register a DDS data type and then apply it to the Topic.

    5. Close the DDS Dictionary.

  2. In the application model, the outports act as DataWriters and must have the same DDS data type as the Topic they publish. Configure the outports to the Registered Type for the Topic.

  3. Configure the DDS interface to subscribe to the Topic.

    1. Open the Code Mappings editor to configure the DDS interface. On the DDS tab, click Code Interface and select Individual Element Code Mappings.

    2. Select the Topic. For the inports in the model, select the Topic specified in the drop-down options by its path (DomainLibrary/Domain/Topic).

  4. Build and deploy the application to publish the Topic.

For more information about how to configure a model, see Model DDS Applications. For more information about how to configure the outports, see Interactively Configure DDS Interface.

See Also

|

Related Topics