Closed pan-henryk closed 6 years ago
Could well be. Unfortunately we don't use this pattern at 4NG so it doesn't get a lot of love from us. If you could put together a unit test, I'll take a look at figuring out the problem.
After creating a simple test I was able to find the problem - it is a misleading naming inconsistency (probably be the same issue in my code). In ProcessImage InputRegisters (F04) are added using addRegister function, while HoldingRegisters (F03) are added using addInputRegister function.
Here is the test: https://github.com/steveohara/j2mod/pull/85
Test case added
I am trying to detect changes in my slave image in a way similar to described here: https://github.com/steveohara/j2mod/issues/64
My code looks like this:
`
SimpleProcessImage spi = new SimpleProcessImage(unitId);
`
I can read this register from master (so general setup is ok), but if I try to write to it, update method of observer is never called. At the message level slave receives write request and responds to it. Is there a chance that slave refactoring broke it?
I am using Modbus TCP.