jisotalo/ads-client

On-change subscription is re-triggered when restarting application

dotKokott opened this issue · 2 comments

I noticed that a on change subscription callback will be called again when the application is restarted (ergo the subscription re-initialized) although a previous run of the application has consumed the subscription already.

Following steps:

  1. Subscribe to changes of "variableA" that is initially false.
  2. variableA changes to true
  3. Callback subscribing to variableA triggers
  4. Call disconnect and close application
  5. Restart application, re-initialize subscriptions
  6. Callback subscribing to variableA triggers again

Is this desired behaviour? Is there a suggested way to work around this as I usually just want to consume an onchange once per change.

Thank you!

Hi @dotKokott!

Sorry for late reply. If I remember right this is a standard feature of PLC subscription.

However I will check it out.

I checked this using latest ads-client and also C# library by Beckhoff. Both have the same behaviour.

When subscribing to a variable (creating device notification), the target PLC system always sends the latest value.