We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Embedded Software

Embedded Software

Data Distribution Service with SCADE Suite

Tagged:

    • SolutionSolution
      Participant

      Introduction

      The demand for efficient, reliable, and real-time communication between components has never been higher. From avionics to automotive systems, engineers are challenged to ensure seamless data exchange while adhering to strict safety and performance requirements. As software grows increasingly complex, the tools and protocols we use to design and implement these systems must evolve to meet users’ needs.



      Photo credit: Saketh @ Unsplash

      In this article, we will first cover the specific requirements of users that seek to create robust systems. They require predictable, high-performance data communication, easy integration with existing tools, and scalability for future growth. We will explore how the Data Distribution Service (DDS) protocol addresses these needs, offering a standardized, flexible publish/subscribe solution for real-time communication.

      We will then delve into integrating DDS communication with SCADE Suite. Through this integration, developers can harness DDS’s capabilities directly within SCADE’s familiar framework, enabling efficient workflow and system consistency.

      Finally, to illustrate the synergy between DDS and SCADE Suite, we will walk through a practical example that demonstrates how to set up and manage DDS communication in an embedded system. By the end of this article, you will have a comprehensive understanding of how DDS can streamline development and enhance communication in your SCADE-based projects.

      Understanding user needs

      First, we’ll focus on understanding the users’ needs and why DDS is a perfect fit.

      To begin with, the user may necessitate a communication solution that not only facilitates real-time data exchange but also ensures seamless connectivity.

      Beyond real-time functionality, they also require reliability, expecting mechanisms that guarantee accurate and consistent data delivery, even under challenging network conditions. As systems grow more complex, scalability becomes equally critical – a communication solution must be capable of accommodating an increasing number of devices and components.

      Furthermore, users need the capacity to prioritize and ensure specific levels of service quality for different types of data and messages. Flexibility is another key factor, as communication systems must adapt to changing requirements and diverse application scenarios with ease.

      Frequently, users seek a decentralized communication model to avoid complex point-to-point connections and facilitate system maintenance. In parallel, data security remains a paramount concern, with users expecting robust encryption, authentication, and access control mechanisms to safeguard information.

      Seamless integration with existing systems and tools, such as SCADE Suite, emerges as an essential factor to streamline development endeavors. Finally, Users are inclined towards a communication solution that not only curtails overhead but also optimizes data transmission, thereby augmenting overall performance.

      Now we’ll explore what DDS communication is, and how it is implemented.

      Introducing DDS as a solution

      DDS stands for Data Distribution Service and is an Object Management Group standard. This communication operates through a decentralized pub/sub model where data producers publish, or write, data and data consumers subscribe to, or read, data. The DDS middleware automatically routes data, ensuring that subscribers receive only relevant information based on their interests.

      Indeed, to communicate with each other, DataWriters and DataReaders must:

      • use the same Topic name for the same DDS data type
      • be members of the same DDS domain.

      The data shared by a publisher and subscriber is described by a Topic, a data object comprised of a name and a data type. Subscribers receive data only for the topics they are interested in. Each topic has a unique name associated with it, allowing subscribers to express their interest in receiving data related to that particular topic. A DDS domain is a concept used to bind individual applications together for communication. Each DDS domain has a unique integer domain ID.



      Quality of service parameters guarantee data delivery priorities. Security mechanisms, content-based filtering, and automatic discovery enhance efficiency and reliability, making DDS a robust solution for real-time communication in distributed systems.

      Consider the example below. Application 1 publishes messages onto the Yellow topic, using it as output. Applications 2 and 3 subscribe to the Yellow topic; it is an input of these two applications. Application 2 publishes messages onto the Blue topic and Application 1 subscribes to the Blue topic. Applications share information on the DDS domain.



      Integrating DDS Communication in SCADE Suite

      Integrating Data Distribution Service communication within a SCADE Suite project involves establishing a seamless flow of data between different components or systems.

      DDS is a middleware protocol that enables efficient data exchange between distributed applications, making it valuable for safety-critical systems like those developed using SCADE Suite. Here’s a breakdown of the integration process:

      • First, understand the communication needs of your SCADE Suite project. Identify which data needs to be shared, the frequency of exchanges, quality-of-service requirements, and any latency constraints.
      • Choose a DDS implementation that aligns with your project’s requirements. This can be an open-source C++ implementation such as Open DDS, or a commercial application like RTI Connext-DDS.
      • Define data types and interfaces that need to be communicated via DDS, as well as topics to map the data within your SCADE Suite model to DDS data structures. This ensures consistency between the data processed by your SCADE components and the data communicated through DDS.

      RTI is an Ansys partner and Ansys has developed a tool to connect SCADE applications to RTI Connext-DDS. The rest of this article will assume an integration using RTI Connext-DDS.

      SCADE Suite is dedicated to the development of control software. In real-life systems, it is frequently necessary to have several embedded control software applications running in parallel and reliably exchanging data. This was the motivation to develop a SCADE Suite plugin to RTI Connext-DDS.

      Below is a diagram showing the architecture in place to exchange a variable named C between two applications, using a DDS Topic named Speed:



      Consider the following example. The aim is to exchange the C variable between two SCADE Suite models, from App1 to App2:



      Using RTI Connext-DDS simplifies this step. From SCADE Suite, the user simply needs to select Inputs or Ouputs that need to be mapped to topics. SCADE inputs will be mapped to DDS DataReaders, and SCADE outputs to DataWriters.

      In the SCADE IDE, in the properties of the desired input or output, under section Integration, select “RTI Connext-DDS” as a tool and check the “Connext-DDS topic” box. The name of a topic defaults to the name of the I/O; a different name may be specified (here “Speed”).



      • Set communication parameters to define the communication environment.
        In SCADE Suite, once the RTI Connext-DDS extension has been selected in Code Integration settings, a Connext-DDS tab appears. In this one, you may specify the different parameters like the Domain name or ID.
        Note that, in this tab, checking the “Generate IDL file” box will generate an Interface Definition Language file listing the data types and interfaces.



      • Configure the DDS middleware parameters, such as quality-of-service settings, data reliability, and communication bandwidth. Tailor these configurations to align with your project’s requirements.
        When running on host, you may specify a periodicity for the generated code’s main loop. This ensures your models publish and subscribe data at the same rate.



      • Finally, generate the executable code from your SCADE Suite model. This code will include the DDS-related code that handles data exchange between your SCADE operators and external systems using DDS.



      Example of DDS Communication with SCADE Suite

      Below is an example video showing two SCADE Suite applications exchanging variables C and D using RTI Connext-DDS:



      Explore further

      In this article, we’ve seen how to set up communication between SCADE Suite components using RTI DDS as a messaging layer.

      You may download the example in this blog here. Here are the requirements to use it:

      • For viewing, you need an installation of SCADE Suite 2024 R2 or later, and the SCADE Python plugin for RTI Connext-DDS.
      • For code generation and running, you need the above plus an installation of RTI Connext-DDS, as well as an installation of Visual Studio 2017 or 2019.

      You may start a 30-day free trial of SCADE Suite using this link. The SCADE/RTI Connext-DDS connector plugin is available upon request to your usual Ansys contact.

      If you’d like to know more about how Ansys SCADE can improve your testing workflow, you may contact us from the Ansys Embedded Software page.

      About the author



      Axelle Moreau (LinkedIn) is an Embedded Software Application Engineer at Ansys since 2022. She provides guidance and support during software development with SCADE solutions, delivers training, and helps to explore Ansys SCADE capabilities in industries such as aeronautics, railway, energy…