Main Content

Take DDS Sample

Receive data samples from DDS network

Since R2021a

  • Take DDS Sample block

Libraries:
DDS Blockset

Description

The DDS Blockset provides Take DDS Sample and Write DDS Sample blocks to help model DDS applications. The Take DDS Sample block receives samples from the DDS network and converts them to signals that can be used in the Simulink® environment. The Write DDS Sample block takes signals from the Simulink environment and converts them to samples to send data into the DDS network. These blocks are preconfigured to be compatible with the DDS network and provide type checking functionality.

Code generation for DDS Blockset requires an Embedded Coder® license.

Examples

Ports

Input

expand all

Receives samples from the DDS network. Samples are converted to signals that can be used within the Simulink environment. The conversion preserves the value and data type of the original DDS sample.

Data Types: bus

Output

expand all

Shows whether a sample was received successfully from the DDS network. If a sample was received successfully the block outputs 1, otherwise it outputs 0.

Dependencies

To enable this port, select the check box labeled Show receive status.

Data Types: double

Converted signal that can be used in the Simulink environment.

Data Types: bus

Parameters

expand all

Select this parameter to show whether a sample was received from the DDS network. If a sample was received successfully the block outputs 1, otherwise it outputs 0.

Programmatic Use

Block Parameter: ShowQueueStatus
Type: character vector
Values: 'on' | 'off'
Default: 'off'

Since R2025a

Select this parameter to connect to a live DDS network during simulation. When Connect to live network is selected:

  • The block image changes.

    Take DDS Sample block with Connect to live network enabled.

  • During simulation, the block connects to a live DDS network based on the model setup, reads DDS messages from the defined topic, and provides the subscriber sample data for processing in the Simulink model algorithm.

Programmatic Use

Block Parameter: ConnectToLive
Type: character vector
Values: 'on' | 'off'
Default: 'off'

Extended Capabilities

expand all

Version History

Introduced in R2021a

expand all