-
Notifications
You must be signed in to change notification settings - Fork 111
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
Modbus TCP Slave / How to detect process image change #64
Comments
The best way is to implement you own ProcessImage and handle the updates. You could do that explicitly or extend SimpleProcessImage. |
Thanks Steve, That was helpful. Implementing my own ProcessImage is beyond my skill level. I looked into extending SimpleProcessImage and using Observable to handle changes, but that creates this Multiple Inheritance requirement that is also beyond my skill level to work through. Everything seems to be working well, and stable. I'll keep looking to find someway to detect and handle when the ProcessImage is changed. There is an Observer interface that's included in j2mod. Not sure what the differences are between that and the normal Observer - but in either case, I'm not sure where to plug it in. I'll report back - Thanks for your help |
I think I have a handle on it. It looks like using the ObservableDigitalOut and ObservableRegister is the way to go, rather than trying to extend SimpleProcessImage. The following seems to work well (so I'm good - thanks for your help):
|
I learn something new every day! I've never used the Observable features of j2mod before. |
(I posted this on the sourceforge site, but I saw you moved here - sorry for duplicate post)
I have question about modbus TCP slave. I have the simple tutorial working (the one from the Wiki) and masters can connect to it and read/write the process image
Question:
On my slave device, what's the best way to detect if the process image has been changed (by the master of course).
The text was updated successfully, but these errors were encountered: