Communicating DDS Entities with different type bounds

By default, a DataWriter of an unbounded type won’t be able to communicate with a DataReader of a bounded type. DDS includes the max size of a bounded type as part of the data type information (known as TypeCode or TypeObject). Since the data type information is used during the Discovery phase, if data types aren’t compatible, DDS Entities won’t match and won’t be able to communicate. Even if both sides are using a bounded type, if the bound of the type on the Publisher's side is larger than the one on the Subscriber’s side, they won’t be able to communicate.

This is a common scenario when communicating a string in a LabVIEW application using the RTI DDS Toolkit with a non-LabVIEW application. By default, RTI DDS Toolkit creates strings which are bounded to 1024 characters. This might not be the case in the non-LabVIEW application. 

There are two options to enable communication between DDS Entities with different type bounds:

  • Ignore the bounds from the Subscriber side and the Publisher side (recommended). To do so, set the DomainParticipant’s property dds.type_consistency.ignore_sequence_bounds to 1:

    Note: Applies to RTI Connext DDS 5.1.0 and above.

    <participant_qos>
        <property>
            <value>
                <element>
                    <name>dds.type_consistency.ignore_sequence_bounds</name>
                    <value>1</value>
                </element>
            </value>
        </property>
    </participant_qos>         

    In LabVIEW, the default profile LabVIEWLibrary::DefaultProfile already does this. So all the built-in LabVIEW profiles that inherit from this one have this property set. You can find these built-in profiles in the file: <LabVIEW folder> vi.lib\_RTI DDS Toolkit for LabVIEW_internal_deps\RTI_LABVIEW_CONFIG.documentationONLY.xml.

  • Force the matching process to use the type name instead of the data type during the Discovery phase. To do so, don’t send the TypeCode and TypeObject on the Publisher side:

    Note: Applies to RTI Connext DDS 5.0.0 and above.

    <participant_qos>
        <resource_limits>
            <type_code_max_serialized_length>0</type_code_max_serialized_length>
            <type_object_max_serialized_length>0</type_object_max_serialized_length> 
        </resource_limits>
    </participant_qos>         

    In LabVIEW, these QoS are included in the profile LabVIEWLibrary::NoTypeCodeProfile.