RobbeM
(Robbe)
June 17, 2018, 6:02pm
1
Hello, I’m new to Openhab and modbus.
I’ve recently bought a house which I’d like to control via Openhab and a Wago 750-881 PLC.
I’ve been trying to set up the modbus binding with the Wago PLC, but I can’t see any values in the basic UI.
I’ve configured the WAGO PLC as modbus master as seen below:
(Openhab runs on IP 192.168.1.2)
I can poll the values with a modbus slave simulator:
I think the value 221is in register address 40001 and the value 2 in address 40002 right?
When I got this working, I tried to show the value in OpenHab.
I installed the modbus binding and configured it like this:
tcp.wago.connection=192.168.1.150:502
tcp.wago.type=holding
tcp.wago.id=1
tcp.wago.start=0
tcp.wago.length=2
tcp.wago.valuetype=uint16
The items file:
Number MyCounter0 "My Counter low [%d]" (All) {modbus="wago:0"}
Sitemap file:
Text item=MyCounter0 label="My counter0"
But value “0” is shown in the basic UI.
Also found this topic: Modbus TCP WAGO binding where it was said to put :rtu behing the modbus tcp connection string, but that also doesn’t work…
Does anyone have any idea why the value 211 is not showing?
If you need any extra information, just let me know!
Thanks!
RobbeM
(Robbe)
June 18, 2018, 7:57pm
2
I’ve found the answer myself. I’ll post it here and hope I can help someone with it.
I’ve discovered that OpenHab is actually the modbus master. So I didn’t have to configure anything on the Wago PLC. The Wago PLC is a modbus slave without any configuration.
The Wago 750-881 manual gives the mapping of modbus addresses to PLC addresses. For example %MW0 is at modbus address 12288.
modbus.cfg had to be configured like this:
tcp.wagomwnul.connection=192.168.1.150:502
tcp.wagomwnul.type=holding
tcp.wagomwnul.id=0
tcp.wagomwnul.start=12288
tcp.wagomwnul.length=10
tcp.wago.valuetype=uint16
And read MW0 via:
Number nvrammw0 "My Counter low [%d]" (All) {modbus="wagomwnul:0"}
Hi, i have actually also a problem with my Wago 750-881 plc.
im using since years a program on my plc that controls the lights in my house.
for example the program uses the following modbus variable to switch the light using a signal from Modbus (actually IP-Symcon)
fbLichtWohnzimmerLinks AT %MX0.3 :BOOL; (ModBus 12291 )
no i want to switch this variable by using openhab2 version 2.3 (the new modbus binding)
things:
Bridge modbus:tcp:hv1 [ host=“192.168.2.10”, port=502 ] {
Bridge poller coil [ start=12291, length=2, refresh=1000, type="holding" ] {
Thing data do4 [ readStart="12291", readValueType="bit", writeStart="12291", writeValueType="bit", writeType="coil" ]
Thing data do5 [ readStart="12292", readValueType="bit", writeStart="12292", writeValueType="bit", writeType="coil" ]
}
}
items:
Switch DO4 “Digital Output index 4 [%d]” { channel=“modbus:data:hv1:coil:do4:switch” }
Switch DO5 “Digital Output index 5 [%d]” { channel=“modbus:data:hv1:coil:do5:switch” }
I can do what i want but i dont get any reaction or response by the PLC.
Please help me, actually ißm going crazy
PS: i activated the modbus binding by adding modbus to the addons.cfg is that right
gitMiguel
(Miika Jukka)
August 15, 2018, 9:55pm
4
As you are running OH 2.3 you have to install the binding through Eclipse Marketplace.