Main Content

Import or Create DDS Definitions

DDS concepts such as Domains, Topics, Types, and Quality of Service (QoS) need to be brought into the Simulink® environment to model and configure DDS applications in Simulink. DDS definitions are stored in the DDS Dictionary, which is a section of the Simulink data dictionary that contains DDS properties.

You can import Interface Definition Language (IDL) files that contain DDS data type definitions and XML files that contain DDS data types, domain data, and QoS definitions into the DDS Dictionary by using the DDS Application Quick Start or directly by using the import feature on the DDS Dictionary toolbar. You can review definitions or create additional definitions interactively by using the DDS Dictionary user interface.

Import DDS Definitions by Using the DDS Application Quick Start

You can use the DDS Application Quick Start to import XML and IDL definitions or create default definitions. The DDS Application Quick Start configures your application for a DDS vendor (RTI or eProsima) and provides the framework to model.

The DDS Application Quick Start dialogue opens when you open a model that is not configured for DDS in the DDS Blockset app. You can reopen the DDS Application Quick Start from the DDS tab by clicking Quick Start.

Specify Application Name and Vendor

In the DDS Application Quick Start dialogue, first specify the DDS application name and vendor.

Display of vendor options in Set Application pane of DDS Application Quick Start.

Vendor selection does not affect simulation, so if you do not intend to generate code, you can accept the default vendor. For more information about the vendor setup for DDS Blockset, see DDS Blockset System Requirements.

Specify Source of DDS Definitions

Next specify the source of your DDS definitions for your application. You can create and associate a DDS Dictionary with your application by using one of these options:

  • Use existing dictionary — If you have an existing DDS Dictionary, you can associate that dictionary with your new DDS application and reuse the definitions. This option is ideal for building applications set to similar requirements or standards.

  • Import from IDL/XML — If you have DDS definitions outside of Simulink, you can specify a list of IDL and XML files to be imported. A new DDS Dictionary is created based on these definitions and then associated with your application. IDL and XML specifications enable maximum flexibility and control over your definitions.

  • Create and use default dictionary — If you would like to have a new DDS Dictionary created for you that uses a set of predefined default definitions, you can select to create and use a default dictionary. This option is the quickest and simplest option to get started.

Display of dictionary options in Associate Dictionary pane of DDS Application Quick Start.

Transition from DDS to Simulink Environment

To complete, click Finish. The Quick Start creates and associates a DDS Dictionary with your application and configures the application so that you can generate an executable specific to RTI or eProsima.

Display of configured settings in Finish pane of DDS Application Quick Start.

Import DDS Definitions Directly by Using the DDS Dictionary

To import XML and IDL definitions into the DDS Dictionary directly:

  1. Under the DDS app tab, click Code Interface > DDS Dictionary to open the DDS Dictionary.

  2. On the DDS Dictionary toolbar, click Import.

    Display of DDS Dictionary. Import button is located to the left in the toolbar.

  3. In the Import window, browse for and select IDL and XML files that you want to import, and then click Open. If any of the imported type, domain, or QoS definitions clash with definitions already in the dictionary, a notification displays.

Review or Edit DDS Definitions

Verify Definitions

To verify your DDS definitions, you can use the DDS Dictionary or Code Mappings editor.

To verify Domain, Topic, Type, or QoS definitions, use the DDS Dictionary to view and edit these definitions. For more information, see Manage DDS Definitions.

To verify imported DataReader and DataWriter definitions, use the Code Mappings editor. To view the readers and writers, open the editor, set Configuration Mode to Use Reader XML Path or to Use Writer XML Path and verify that they appear as drop-down list options for the inports or outports. If you select a reader or writer, you can also verify its Topic and QoS properties loaded in the editor. For more information, see Interactively Configure DDS Interface.

Troubleshoot

If your imported definitions are not correct, examine and correct any errors in the imported IDL or XML file or the DDS Dictionary, and then associate the new definitions with your DDS application. To update or change vendor information, on the DDS tab, select Quick Start and update the vendor.

Import Considerations and Limitations

  • Import multiple IDL and XML files — You can import multiple XML or IDL files for the eProsima or RTI vendor.

  • Duplicate data imported — Imported XML files pull additional XML files referenced by the include element into the DDS Dictionary. If an XML file is referenced multiple times, its definitions are imported each time, resulting in duplicates.

For IDL import, DDS Blockset supports the data types and semantics as specified in this table.

IDL Types and SemanticsSupported?Limitations
Primitive typesYeslong double, wchar, wstring, and value types are not supported.
ArraysYesArrays of strings and multidimensional arrays are not supported.
SequencesNo 
MapsNo 
StructuresYes 
UnionsNo 
BitsetsNo 
EnumerationsNo 
BitmasksNo 
ModulesYes 
Data types with a keyYes 
Including other IDL filesYes 
AnnotationsNoOnly @key is supported. All others are ignored. @optional members are not supported.
Forward declarationYes 
IDL 4.2 aliasesYes 
IDL 4.2 commentsYes 

See DDS Blockset Limitations and Considerations for additional information.

See Also

|

Related Topics