Is it possible to only read instances of a topic where the key is not equal to something?
Here are some simplified details to help explain my question. I'm opening a dataReader and dataWriter for the Topic: "Channels". The "Channels" topic contains two keys: "ChannelName", and "Origin" (both of which are strings). The "Origin" field is used to denote which target originally generated the data. Each target will be responsible for publishing it's own data. Since I'm already keeping each target's own channels in shared memory on the target, I want to ignore the instances of the "Channels" topic that originate from the same target. So in essence, I would like to create a content filter or query condition that will only return instances of "Channels" that were generated from another system. Something like "Origin" != "Target_A".
All documentation I have found on content filters and query conditions seems to indicate that the only valid operations are:
Let me know if there is a way to create this filter, or feel free to recommend a different solution to this problem if I'm going about it inefficiently.
Solved! Go to Solution.
Ok, for some reason, I completely overlooked the '<>' comparison in the list. The following query condition works as intended:
(Origin <> 'Target_A')
I guess I would still like to know if there is a better way to go about this. Is this going to be the highest performance? Or does anyone have a better way of doing this?
As you know the condition before creating your entity, and this doesn't change during run-time, I recommend you to use ContentFilteredTopic instead of QueryCondition. ContentFilteredTopic is faster and allows write-side filtering.
About other options, you may want to have a look at partitions, and multichannel. You can configure these parameters through QoS. Here I put a link to some examples (they are not in LabVIEW, but you only need the USER_QOS_PROFILES.xml)
Partition example: https://community.rti.com/examples/partitions
Multichannel example: https://community.rti.com/examples/multichannel
There are no tests on the performance of these options.