Reading batch entries

5 posts / 0 new
Last post
Offline
Last seen: 2 years 4 months ago
Joined: 07/16/2015
Posts: 19
Reading batch entries

I've gently modified the Hello World IDL example.

I'm sending 100 near simultaneous messages and these all appear on the wire (visible on Wireshark).

Reading them however I only get the last of the packet - so instead of 100 I get about 6 - and always the last value in the packet on the wire. So batch working really well....except I'm not getting all the data.

I was assuming that in reading them perhaps "take" should return multiple values - except the length() parameter steadfastly returns a value of 1.

Any ideas what this might be?

Offline
Last seen: 2 years 4 months ago
Joined: 07/16/2015
Posts: 19

I think I've kinda answered my own problem....the problem relates to the way the data is keyed. DDS is declaring the 20+ samples in the same packet as superseded by the last one so is discarding them.

Found the cause....not sure how to fix it - my application for DDS requires those intervening states.

Gerardo Pardo's picture
Offline
Last seen: 1 week 3 days ago
Joined: 06/02/2010
Posts: 602

The number of samples maintained per key is controlled by the HISTORY Qos Policy both on the DataWriter and the DataReader side.

By default both DataReader and DataWriter set HISTORY kind to KEEP_LAST and the corresponding HISTORY depth is to 1. This explains what you are seeing.

You can either change the depth to a larger value (e.g. 50). Or else set HISTORY kind to KEEP_ALL.

Gerardo

Offline
Last seen: 2 years 4 months ago
Joined: 07/16/2015
Posts: 19

Thanks Gerardo - I can't currently make it work but I'll keep working on it, it's probably me doing something silly but I now have somewhere to direct my attention.

One thing that concerns me is I can't tie up the KEEP_LAST documentation in the API reference you've linked to with the values that end up in the XML QoS file. They're kinda similar but I couldn't build the QoS file from the docs, only by copying from examples.

Gerardo Pardo's picture
Offline
Last seen: 1 week 3 days ago
Joined: 06/02/2010
Posts: 602

Hello David,

When editing the XML files, are you using an XSD aware editor like Eclipse or VisualStudio. And furthermore are you making sure the schema location in the XML is pointing to the right XSD as in:

<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:nonamespaceschemalocation="http://community.rti.com/schema/5.2.0/rti_dds_qos_profiles.xsd" version="5.2.0">

This is the same as it is done in the bundled and generated examples. If you do both things, then the editor will assist you with auto-completion and offering the different choices so it should be fairly obvious how things map...

Gerardo