Why does only one of my Reader VIs get the new samples?

A normal scenario in RTI Connext DDS is to have a Publisher that generates samples and several Subscribers that receive the generated data. In other words, the expected out-of-the-box behavior is for all Subscribers to get all the data. This is so because each Subscriber has its own DataReader for that Topic. This way, the new samples are stored in the DataReader’s queue and they are read when needed.

If you run the same scenario from LabVIEW using the RTI DDS Toolkit, the behavior changes. The toolkit has been designed to reduce the number of entities created and, therefore, minimize the memory and CPU overloads. For example:

  • Only one DomainParticipant is created per domain.
  • We reuse the implicit Publisher and Subscriber, avoiding to create new ones.
  • Only one DataReader/DataWriter is created per Topic.

 Keeping this in mind, it is easy to understand what’s going to happen in our “normal” scenario. When we create a Writer VI, we are creating a DomainParticipant (1) and a DataWriter (2) internally. Then, if we create a Reader VI in the same LabVIEW instance, the DomainParticipant is reused (3) and only a DataReader is created (4). When a second or third data Reader VIs are created, the DomainParticipant (5) AND the DataReader are reused (6)! This way, all Reader VIs share the same queue. If you set  the flag ONLY_NEW_SAMPLES to ‘ true’ when reading, this can cause that only one of the Readers gets the data.

Entities creation

From version 1.2.0.90 of the RTI DDS Toolkit for LabVIEW and on, we have implemented the concept of Exclusive Readers. These readers are not shared between Reader Nodes and use 'take' instead of 'read' when recovering data from the DataReader queue. See mor details in the GettingStarted Guide. The default configuration, however, remains the same as explained below.

This behavior was designed focusing on LabVIEW users and the Real-Time targets. Please give us your feedback about how this affects your application in the comments and we will work to improve it.