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:
- Subscribe to changes of "variableA" that is initially false.
- variableA changes to true
- Callback subscribing to variableA triggers
- Call disconnect and close application
- Restart application, re-initialize subscriptions
- 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.