Main Content

Interactively Configure DDS Interface

To connect a DDS application to publish and subscribe to the DDS network, configure a DDS interface. A DDS interface is the connection point between the application and the DDS network. Specifically, the interface defines the Topic and Quality of Service (QoS) for the DataReaders and DataWriters in an application. In an application model, the inports represent DataReaders and the outports represent DataWriters. To configure an interface, use the Code Mappings editor and Property Inspector to configure the ports as readers and writers that meet your application requirements.

Open DDS Interface Configuration Environment

To configure your DDS interface, configure the Topics in the Code Mappings editor and configure the QoS in the Property Inspector. To open the Code Mappings editor, with a model open in the DDS Blockset app, on the DDS tab, click Code Interface and select Individual Code Element Mappings. To view the QoS specification, in the Property Inspector, expand the Code section.

Select Configuration Mode

To configure the interface, use one of these configuration modes:

  • Use Topic and QoS

  • Use Reader/Writer XML Path

Use Topic and QoS

The Topic and QoS configuration mode enables a simplified, quick, and intuitive way to configure a DDS interface that does not require prior XML specification of DataReaders and DataWriters. You can use the Code Mappings editor to select Topics for your application and the DDS Blockset generates the necessary DataReaders and DataWriters to connect to the DDS network. If you would like to specify QoS for the generated readers and writers, you can use the Property Inspector to select a QoS profile.

Use Reader/Writer XML Path

The Use Reader/Writer XML Path configuration mode supports using imported XML specifications and provides customization and control over DataReaders and DataWriters. The XML Path configuration mode enables you to import and assign previously specified DDS applications with minimal effort. Additionally, XML specifications provide the ability to control specific properties of DataReaders and DataWriters. You can use the Code Mappings editor to select previously defined DataReaders and DataWriters from imported XML for the model ports and the Topic and QoS properties from those definitions load into the application.

Comparison of Configuration Modes

The differences between these configuration modes are listed in this table.

Configuration ModeRequirementsSource of Topic OptionsSource of QoS OptionsBenefits
Use Topic and QoSNoneTopics defined in the DDS Dictionary
  • Default QoS

  • Built in QoS profiles

  • Imported XML QoS profiles

  • Ideal for DDS newcomers

  • No XML specification necessary

  • DDS Blockset manages underlying DataReader/DataWriter specifications so you do not have to manage, create, or troubleshoot these entities

Use Writer/Reader XML PathDataReader or DataWriter must be specified in imported XMLTopics specified within DataReader/DataWriter definitionsQoS specified within DataReader/DataWriter definitions
  • Easily map DDS applications defined in XML into Simulink®

  • Supports customization and control with explicit DataReader/DataWriter specifications

Configure DDS Interface by Using Topic and QoS

To configure a DDS interface by using Topic and QoS:

  1. Open a model in the DDS Blockset app.

  2. Import or create DDS definitions. The Topic and QoS configuration mode does not require prior XML specifications so you can use the DDS Application Quick Start to create a default dictionary for your application as well as use an existing DDS dictionary or imported XML.

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

  4. Configure the inports and outports. The inports represent DataReaders used to subscribe to Topics. The outports represent DataWriters used to publish Topics.

    1. Select the configuration mode. For the Configuration Mode, select Use Topic and QoS.

    2. Select the Topic. For each inport or outport in the application model, you can select a Topic specified in the drop-down options by its path (DomainLibrary/Domain/Topic). The set of drop-down options shows the Topics that are specified with the same DDS data type as the port. If you do not see a Topic that you expected, review the port data type and the Registered Type for the Topic.

    3. Select the QoS. To specify QoS, in the Property Inspector, expand the Code section and select a QoS profile from the Reader QoS or Writer QoS drop-down options. You have several options to configure QoS:

      • You can leave the QoS policy as the default. The default QoS profile is the default provided by your target DDS vendor (RTI or eProsima). To see details of this profile, refer to your vendor documentation.

      • You can select from built-in QoS profiles. The built-in QoS profiles are profiles provided by the DDS Blockset. These profiles provide a set of QoS policies applicable to event-based, real-time event-based, real-time stream, and stream applications.

      • You can select from QoS profiles imported from XML. Imported QoS profiles also appear as options in this drop-down list.

      For more information, see Manage QoS.

    4. To generate the DataReaders and DataWriters, press Ctrl+D. You can now view the DataReaders and DataWriters in the editor.

  5. Build and deploy application to DDS network.

Configure DDS Interface by Using Reader or Writer XML Path

To configure a DDS interface by using Reader or Writer XML Path:

  1. Open a model in the DDS Blockset app.

  2. Import DDS definitions. The Use Reader/Writer XML Path configuration mode requires prior XML specifications of readers and writers so you must import XML by using the DDS Application Quick Start or DDS Dictionary.

  3. Configure the DDS interface. Open the Code Mappings editor. On the DDS tab, click Code Interface and select Individual Element Code Mappings.

  4. Configure inports and outports. The inports represent DataReaders used to subscribe to Topics. The outports represent DataWriters used to publish Topics.

    1. Select the configuration mode. For the Configuration Mode, for the inports select Use Reader XML Path or for the outports select Use Writer XML Path.

    2. Select the DataReader or DataWriter. For the inport Reader XML Path or for the outport Writer XML Path field, select the reader or writer from the drop-down list specified by its path (myParticipant/MySubscriber/MyRdr). The Topic and QoS fields load as read-only based on your XML definitions. To change the Topic or QoS properties for the readers and writers, update and reimport the XML definitions. The set of drop-down options shows the readers and writers that are specified with the same DDS data type as the port. If you do not see a reader or writer that you expected, review the port data type and the XML specification of the reader or writer.

  5. Build and deploy application to DDS network. Build the model and use the executable to deploy the application.

Considerations and Limitations

  • DDS Definitions — The DDS Topics and QoS for your application are retrieved from the DDS Dictionary associated with your application model. Ensure that this dictionary is on your MATLAB® path.

  • Data Types — Inports and outports must have the same DDS data type as the Topic that they subscribe to or publish.

  • Unique Reader/Writer Mapping — Inports and outports must map to unique DataReaders and DataWriters. For example, two different inports cannot map to the same DataReader, and two different outports cannot map to the same DataWriter.

  • Accurate Data Management — Inports and outports must map to Topics and Quality of Service (QoS) definitions that can be found in the associated DDS dictionary or XML. For example, if you map the ports for a DDS application, and then remove Topics or QoS profiles from the dictionary, you might create invalid mappings where previously mapped ports now are configured to deleted definitions.

  • Mixed Mapping Configuration Modes — When you configure a DDS interface, you can use different configuration modes to map different inports and outports. For example, you can use Use Topic and QoS to configure one inport and Use Reader XML Path to configure a different inport within the same model.

See Also

|

Related Topics