I changed from OH1 to nowOH2.5.0 M1 and started to make all new configs, I got most things to work, but I have an bit trouble with the modbus communication.
What I want to do is I have e.g. an switch for the light, I want to control the light with OH but I also have physical switches which have to work in paralell, so I did in OH1 just change from my PLC the state of the modbus coil if it was changed from the physical switch and OH1 just changed the state. In OH2 i can not do this in this way it looks like OH is always forcing its state and push it every cycle.
I tried to use different read and write adress but the state of the switch was always off and didn’t switched to the state of the read adress.
is there an different way?
here my is my setup:
PLC : Wago 8202 with e!cockpit
OS: 4.15.0-45-generic #48-Ubuntu
Running in an VM
java: OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
xLicht01 is an global Variable which is mapped to Modbus coil 33472
xDiSPS is an discrete input from the physical switch
xDoSPS is the output to the light relay
(*when OH xLicht is true and I get an impuls from my physical switch i want to switch off the light *)
if xLicht01 and xDiSPS then
xDoSPS := false; //turn off the light relay
xLicht01:= false; //switch off the modbus coil so that OH also know the light is off
so If I try to switch off the xLicht01 it always gets enabled again during each poll. So the current state of the modbus coil does not get read if there is an change. Do i need some extra code sniped to do this?
So, I think you want your data Thing to have a read start at 33472 and a write start at 147 ? That’s fine, you just need to make sure the poller that “owns” that data Thing includes the read address (write address doesn’t matter)
None of that is anything like the OH1 config you’ve shown us, though.
That would convert to