Receive a DDS message
Simulink Real-Time / DDS
The DDS Receive block receives a DDS message for a selected topic in the Simulink® Real-Time™ model. The block allows you to attach a simulink data dictionary containing the DDS data definitions with the model.
The DDS Receive and DDS Send blocks let Simulink Real-Time applications communicate with Data Distribution Service (DDS) middleware applications through a shared Simulink data dictionary. These blocks are compatible with the DDS Blockset, which includes a DDS dictionary that lets you manage, create, and edit your DDS definitions in Simulink. You can import DDS specifications as XML files to create a skeleton Simulink model as a starting point for developing algorithms for DDS applications. For more information, see How does DDS Blockset Work? (DDS Blockset).
The DDS Receive block receives a DDS message for a selected topic in the real-time application. You attach a Simulink data dictionary containing the DDS data definitions to the block. You can create a new data dictionary or associate an existing data dictionary to the block and select a topic, data writer path, and Quality of Service (QoS) from the data dictionary.
The DDS Receive block and DDS Send block have some limitations:
You can use these blocks in the top level of a model. These blocks cannot be used in the referenced models.
You can use these blocks in a real-time application. These blocks cannot be used for simulation in normal mode, accelerator mode, or rapid accelerator mode.
You cannot use these blocks in protected models.
DDS Msg — DDS message
simulink message of Bus type
Returns the DDS message sent.
Data Dictionary — Associate a data dictionary
string | char
Associate a simulink data dictionary containing dds data definitions or create a new data dictionary for the model.
Topic — Select a topic name
string scalar | char vector
Select a topic from the drop-down menu for the data.
Reader XML Path — Data writer XML path
select the data writer XML path.
Reader QoS — Quality of service
Select the quality of service from the drop-down menu.
Sample time — Sample time
-1 (default) | numeric
Enter the base sample time or a multiple of the base sample time.
-1 means that the sample time is inherited.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2022b
- How does DDS Blockset Work? (DDS Blockset)