Manage DDS aspects of an application
To manage the DDS aspects of your applications in the Simulink® environment, you can use a section of the Simulink data dictionary that contains DDS properties called the DDS Dictionary. The DDS Dictionary is an intuitive graphical interface that enables you to quickly create and edit the DDS Domains, Topics, Data Samples, and Quality of Service (QoS)...
The DDS Dictionary is composed of three management tabs.
The Types tab manages the DDS data types that are used to publish and subscribe Data Samples to 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.
The Domains tab manages the Domains, Topics, and Registered Types so that applications can be configured to publish and subscribe to Topics.
The QoS tab manages the Quality of Service (QoS) available for a DDS application.
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.
This example shows how to import additional XML files to include more DDS definitions in your DDS Dictionary.
Open the DDS Dictionary.
Select additional XML files and click Open.
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
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.
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.
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
Name— Names of DDS data type libraries and data types
The names of DDS data type libraries or DDS data types available in the DDS Dictionary.
Example: TypeLibrary, ShapeType
Type— DDS data type
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|
Example: Const, Enum, Struct
Name— Names of Domain libraries, modules, Domains, and Topics
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
Domain ID you can set to specify a Domain.
Topic Type— DDS data type specified for a Topic
The DDS data type that a Topic uses for its Data Samples.
Name— Names of QoS libraries and profiles
The names of Quality of Service (QoS) libraries and profiles.
Example: BuiltInQosLibrary, Event, DataReaderQoS
QoS Type— Specifies the type of QoS profile
The QoS Type is a read-only field that shows if a QoS profile is specified for DataReaders or DataWriters.