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)
You don’t usually want that with polled modbus Items. Set it false.
I don’t really understand your PLC setup. Is it -
the light can be turned on/off by writing to coil 33472?
the status of the light can be read from coil (?) 147
Maybe show us the OH1 setup that worked the way you wanted.
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
end_if
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?
I just want OH to be passive and do all main things in the PLC
the PLC has an read only range all coils bellow 32768 and above are read write.
with your example I put the register 33472 and there I could use it from OH site. so Enable and disable it via OH but I cannot disable it from PLC site.
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
xxx.things