Main Content

Configure DDS Application Model for External Mode Simulation

DDS Blockset provides validation support by enabling you to configure and run your DDS Blockset application models in Simulink® external mode. External mode establishes a TCP/IP communication channel between a Simulink model and the corresponding DDS application generated from the model.

With external mode, you can enable parameter tuning and signal monitoring, which allows you to modify or tune block parameters in real time. When you change a parameter value in your model, Simulink downloads the updated value to the executing DDS application, allowing you to monitor the system response.

To configure your DDS application model for external mode:

  1. In Simulink, create or open a model configured for DDS.

    Use a model that contains message blocks that send and receive data samples from the DDS network, application logic, and inports and outports configured as DDS data types. For more information, see Model DDS Applications.

  2. Open the DDS Application Designer app.

  3. Open the Configuration Parameters. Under Code Generation, click Interface to display the options.

  4. In the Interface pane:

    1. Select External mode.

    2. Under External mode configuration, set Transport layer to XCP over TCP/IP.

      Use the defaults for the rest of the external mode configuration settings.

    3. Click Apply.

    After you click Apply, the Hardware tab opens.

  5. In the Simulink canvas, select a signal in your model that you want to monitor, right-click the selected signal, and select Log Selected Signals to enable logging. Repeat for additional signals as needed.

  6. On the Hardware tab, click Monitor and Tune.

    The system generates code, deploys the code, and connects to the application.

You can use the Simulation Data Inspector or other monitoring methods to observe the signals that you selected in the model.

If using the Simulation Data Inspector to monitor signals, you can enable code execution profiling, which allows visualization of the generated code execution. For more information, see Visualize Task Scheduling in XCP External Mode Simulation (Embedded Coder). (since R2023b)

For more information about running and monitoring external mode simulations, see External Mode Simulation by Using XCP Communication (Embedded Coder).

Related Topics