Author Topic: Subscription Poll Rate Modify  (Read 745 times)

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Subscription Poll Rate Modify
« on: May 08, 2019, 09:43:43 AM »
Hello,

I am already subscribed to an address and reading data at 100ms rate.
How can I modify the subscription poll rate to 50ms while the subscription is running?
If I re-subscribe with the new poll rate would I have 2 separate subscriptions running or would the new one replace the old one?

Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Subscription Poll Rate Modify
« Reply #1 on: May 08, 2019, 09:56:52 AM »
Each driver instance is only capable of a single poll rate. If you want different poll rates, simply create multiple instances of the driver.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Subscription Poll Rate Modify
« Reply #2 on: May 08, 2019, 10:07:48 AM »
I see.. So the poll rate is per driver not per subscription.

If this is the case, then why do I have to specify a poll rate in the .subscribe function?

The subscribe is already tied to a driver that has a preset poll rate why set another poll rate for the subscribe function?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Subscription Poll Rate Modify
« Reply #3 on: May 08, 2019, 10:17:08 AM »
The poll rate parameter in the subscribe call does nothing. That was a leftover parameter for a customer specific project where they wanted a certain driver to be able to poll each subscription at different rates. It was a very extensive modification and not implemented in other drivers. The only thing that does something is the PollRateOverride property.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Subscription Poll Rate Modify
« Reply #4 on: May 08, 2019, 10:24:55 AM »
Okay that's perfect.

Thank you very much.