DDS Dictionary
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).
More
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.
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.
See Topic Type for more information.
QoS
The QoS tab manages the Quality of Service (QoS) available for a DDS application.
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
Import XML Files
This example shows how to import additional XML and Interface Definition Language (IDL) files to include more DDS definitions in your DDS Dictionary.
Open the DDS Dictionary.
Click Import.
Select additional XML or IDL files and click Open.
Configure Types
This example shows how to create and configure new DDS data types and their equivalent Simulink data types.
Open the DDS Dictionary.
Create a new DDS data type library. On the DDS Dictionary toolstrip, click Library.
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.
Configure Domains and Topics
This example shows how to create and configure a new Domain and Topic.
Open the DDS Dictionary. Click the Domain tab.
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.
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.
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.
Configure Quality of Service (QoS)
This example shows how to import, view, and edit the Quality of Service (QoS) for your DDS application.
Open the DDS Dictionary.
Import QoS from XML.
In the DDS Dictionary, click the QoS tab and view QoS profiles and policies. In the Details pane, set QoS policy values as needed.
(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
Name
— Names of DDS data type libraries and data types
character vector
The names of DDS data type libraries or DDS data types available in the DDS Dictionary.
Example: TypeLibrary, ShapeType
Type
— DDS data type
character vector
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 Type | Simulink Data Type |
---|---|
Const | Numeric MATLAB variable |
Enum | Enumeration |
Struct | Simulink.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
Name
— Names of Domain libraries, modules, Domains, and Topics
character vector
The names of Domain Libraries, Domain Modules, Domains, and Topics available in the DDS Dictionary.
Example: ShapesDomainLibrary, ShapesLibrary, Circle
Domain ID
— ID of a Domain
character vector
Domain ID you can set to specify a Domain.
Example: 1
Topic Type
— DDS data type specified for a Topic
character vector
The DDS data type that a Topic uses for its Data Samples.
Example: ShapeType
Name
— Names of QoS libraries and profiles
character vector
The names of Quality of Service (QoS) libraries and profiles.
Example: BuiltInQosLibrary, Event, DataReaderQoS
QoS Type
— Specifies the type of QoS profile
character vector
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 R2021aR2024a: Import IDL files directly
The DDS Dictionary supports importing data type definitions from Interface Definition Language (IDL) files directly into the DDS Dictionary for vendors RTI or eProsima. You can import multiple IDL files at once or a mix of IDL and XML files.
R2022b: Support for shortened version of DDS data type names
The DDS Dictionary now includes a shortened version of DDS data type names for use in Simulink and in the generated code.
Before R2022b, a data type name was represented in Simulink and generated code as the full name, which is a concatenation of the full path of module names defined in the namespace hierarchy for the type. This representation sometimes resulted in object names that exceeded the 63 character limit. The short name for a data type is a version of the long name that is shortened by using a unique identifier representing the namespace hierarchy.
For new DDS dictionaries created in R2022b, the dictionary displays the full name, short name, and base of a DDS data type. Simulink and code generation use the short name for Simulink.Bus objects, enumerated types, and constants, with appropriate C++ aliases for the namespace and full names in the generated code.
For DDS dictionaries from previous releases moved to R2022b, Simulink and code generation use the full name for backward compatibility.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)