You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to detect changes in my slave image in a way similar to described here: #64
My code looks like this:
`
SimpleProcessImage spi = new SimpleProcessImage(unitId);
ObservableRegister or = new ObservableRegister();
or.setValue(bb.getShort());
or.addObserver(this);
spi.setInputRegister(address,or);
`
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.
The text was updated successfully, but these errors were encountered:
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.
I am trying to detect changes in my slave image in a way similar to described here:
#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.
The text was updated successfully, but these errors were encountered: