Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event driven read plc values #173

Closed
zoltyczerwony opened this issue Sep 21, 2022 · 1 comment
Closed

Event driven read plc values #173

zoltyczerwony opened this issue Sep 21, 2022 · 1 comment

Comments

@zoltyczerwony
Copy link

Hi, i'd like to ask how to approach this problem:
i have 3 vars that i would like to monitor, but i'm interested only on change of value not on value itself and as a callback i would like to read 10 other vars. Using c++ and AdsSyncAddDeviceNotificationReq i'm not able to do this - it reacts on var change but when i try to read other var i get exception. Should i be using multi threading or remove notification, read vars and add new notification?

@pbruenn
Copy link
Member

pbruenn commented Sep 21, 2022

Sounds like you are trying that in the context of your notification callback?
Yes, you have to decouple your callback from the next AdsRequest, so what I would do is let the notification callback wakeup another thread which updates the 10 other variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants