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

Use subscriptions for data changes #63

Open
justinozavala opened this issue Aug 11, 2024 · 6 comments
Open

Use subscriptions for data changes #63

justinozavala opened this issue Aug 11, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@justinozavala
Copy link

Does self.callback_queue = Queue() member of the client class work? Would it be possible to use it for automatic enqueuing of changing data of some group? Would it be possible to use use through the gateway?

Thank you!

@renzop
Copy link
Collaborator

renzop commented Aug 12, 2024

Hi, this is a good idea. I have looked at it lately in another context, i think it should be possible. The group reading stuff would need some love (aka refactoring) since it is mostly untouched from since the old openopc library. Would you like to giv e it a try and create a pullrequest?

@pensur
Copy link

pensur commented Aug 12, 2024

I am using group read successfully, reading 18000 items each 10 seconds without issues.
I'll give a try, though I don't master python.

Correct me if I'm wrong, the steps would be:

  • install python 32 bits
  • test the queue with a local opc server
  • expose the queue to pyro through a function
  • test remotely

Edit: I'm Justino, was logged with the company user in the phone.

@justinozavala
Copy link
Author

It didn't work as i expected. I think the queue is just to wait for one new value inside a read request call. I don't understand what the update parameter means, as changing it does nothing in my tests. Also if I don't explicitly ask for device values the server always return cached values.

@renzop
Copy link
Collaborator

renzop commented Aug 14, 2024

I think it is not implemented as you expect. But OPC DA supports event based update of groups via a subscription to a group object. Check out the OpcDa Specificaition of the OPC Foundation, and the fine graybox_opc_automation_wrapper.py helps you as well.

But if you don't want to invest that much time, i go quite good results with normal group reading and polling.

@renzop renzop added the enhancement New feature or request label Sep 4, 2024
@miguetronic
Copy link

I wanted to follow up and ask if there have been any advancements or updates regarding the subscription model implementation.

@renzop
Copy link
Collaborator

renzop commented Sep 10, 2024

We did not plan to work on this issue. But every contribution (Pull request) is welcome.
I wonder what the your goal is.

When you create a group and read this synchronously you can easily read more than 10 times a second... Most OPC DA applications (I know) don't have a higher update rate than 100ms. Then you can do the change detection in your application.

Please write down what you want to achieve and provide a code example that works with the matricon simulation server. Try to write it as precisely as possible.

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

No branches or pull requests

4 participants