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
Push based change notification #3
Comments
Modbus doesn't have any provision for event-based notification, unfortunately. I have created my own event-based classes that sit on top of this driver but haven't rolled it into the PLC class. I go back and forth on whether this is the responsibility of the driver or not. More or less what I have done in the past is set up a poll rate and a timer to request data from the PLC at that interval. If the data has changed from it's last state, fire the datachanged event. There are similar events for when a connection is established and when the PLC disconnects. Underneath it's just dumb polling, but for services and applications sitting on top of the driver, it 'feels' event-driven. |
Yeah, that's what I've done too, I just don't like the polling stuff. From the top of my mind, I think I was getting a refreshrate of approx. 30-40 ms to read all the DB's. I have some code laying around, will see if I can get to something usefull for this library! |
Sounds good. I usually have been using a rate of between 250-500ms because I just have some perpetual counters that I need to track for data collection purposes. Even that, I could probably get away with slower. We have hundreds of devices, though. Thanks for your support! |
I agree that s7netplus shouldn't be dealing with the polling. It can perfectly be done using extension methods or as a separate consumer of the s7netplus API, so there's no reason to include it in the library. Can this issue be closed? (The more issues there are, the smaller the chance is someone will try to fix them all). |
Closing as wontfix. |
Would it be possible (probably depends on hardware being used) to let the PLC send updates about register changes automatically to listeners?
As far as I know, if I want to monitor all the DB's in a PLC, we have to poll for the db values. So is there a way to turn this around? If so, could we implement such a 'listener'?
The text was updated successfully, but these errors were encountered: