Create a Data Distribution Service for Real-Time Systems application
In this tutorial, you will learn to create a Data Distribution Service for Real-Time Systems (DDS) application by using IBM® Rational Rhapsody Developer for C++.
Learning objectives
In this tutorial, you will learn how to complete these tasks:- Add the DDS profile to your model
- Create a ddsDiagram diagram
- Define the topicStruct and add a key attribute
- Create a topic
- Add a domain participant for your topicStruct
- Create a publisher entity and a dataWriter entity
- Add a domain participant for your publisher entity
- Add code in order to publish data to your topic
- Create a subscriber entity and a dataReader entity
- Add a domain participant for your subscriber entity
- Listen to DDS events that are related to the dataReader entity
- Add code to receive updates about your topic
- Filter the updated data by using a content-filtered topic
- Add quality of service elements
Time required
4 hours- Introduction: Create a Data Distribution Service for Real-Time Systems application
You can create a Data Distribution Service for Real-Time Systems (DDS) application by using the DDS profile. This profile supports modeling, generating code, and running applications that use standard API code for DDS applications. - Lesson 1: Add the DDS profile to your model
To create a Data Distribution Service for Real-Time Systems (DDS) application, add the DDS profile to your model. - Lesson 2: Create a ddsDiagram diagram
Create a ddsDiagram diagram for your Data Distribution Service for Real-Time Systems (DDS) application. You use a ddsDiagram diagram to add DDS terms from the DDS profile. A ddsDiagram diagram is a type of object model diagram. - Lesson 3: Define the topicStruct and add a key attribute
Because Data Distribution Service for Real-Time Systems (DDS) applications share data, you must define the shared data for your application. Data structs that will have multiple instances should have a key attribute or attributes. The key attribute, or attributes, distinguishes between different instances. - Lesson 4: Create a topic
A Data Distribution Service for Real-Time Systems (DDS) application shares data through topic elements. - Lesson 5: Add a domain participant for your topicStruct
A domain participant is a component element that indicates that the component contains elements that are related to Data Distribution Service for Real-Time Systems (DDS). - Lesson 6: Create publisher and dataWriter entities
In this lesson, you create a package in which you create a ddsDiagram diagram. On this diagram, you add the publisher element. This element is your publisher entity. Then, you create a dataWriter entity for your publisher entity. - Lesson 7: Add a domain participant for your publisher entity
In this lesson, you add a domain participant for your MyPublisher publisher entity. - Lesson 8: Add code in order to publish data to your topic
In this lesson, you add some code so that you can publish data to your MyTopic topic element. - Lesson 9: Create subscriber and dataReader entities
In this lesson, you create a subscriber entity and a dataReader entity. - Lesson 10: Add a domain participant for your subscriber entity
In this lesson, you add a domain participant for your MySubscriber subscriber entity. - Lesson 11: Listen to Data Distribution Service for Real-Time Systems events related to the dataReader entity
To receive an event when your MyTopic topic element is updated, attach a listener to your MyDataReader dataReader. In this lesson, you learn how to listen to DDS events that are related to your dataReader. - Lesson 12: Add code to receive updates about your topic
In this lesson, you add code to read received data from the MyTopic topic element and to handle the data. - Lesson 13: Create ddsDiagram for waitset scenario
When building DDS models, you can use listeners for asynchronous communication or waitsets for synchronous communication. This lesson provides the instructions for creating a ddsDiagram for a scenario that involves the use of waitsets. - Lesson 14: Add a domain participant for your subscriber entity (waitset scenario)
In this lesson, you add a domain participant for your MySubscriber_Synchronous subscriber entity. - Lesson 15: Add Waitset and StatusCondition to the model
In this lesson, you add Waitset and StatusCondition elements to your DDS diagram. - Lesson 16: Run the application
In this lesson, you run the DDS application that you designed. - Lesson 17: Filter the updated data by using a content-filtered topic
In this lesson, you filter the updated data by using a content-filtered topic. - Lesson 18: Add quality of service elements
In this lesson, you add quality of service elements to the Data Distribution Service for Real-Time Systems (DDS) application. - Summary: Create a Data Distribution Service for Real-Time Systems application
You have learned how to create a Data Distribution Service for Real-Time Systems (DDS) application.