Configure modbus NOT to poll

Hi all,

I’m currently playing around with the modbus binding, I’ve got a working setup (meaning i write values to the NOVRAM memory of my PLC) but the setup trows an error when polling for data:

10:06:13.490 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (wago750): Error getting modbus data for request net.wimpi.modbus.msg.ReadCoilsRequest@1d0cb3e. Error: Erro
ode = 3. Endpoint ModbusTCPSlaveEndpoint@14d46e4[address=192.168.1.16,port=502]. Connection: TCPMasterConnection@1fdb605[socket=Socket[addr=/192.168.1.16,port=502,localport=50605]]

My configuration is as follows:

tcp.wago750.connection=192.168.1.16:502:60:0:0:3:100
tcp.wago750.type=coil
tcp.wago750.start=12288
tcp.wago750.valuetype=bit
tcp.wago750.length=0 (i get an error code 3 when setting this to 8)

I don’t really know what’s causing this error (any input?). At the moment however I don’t require the modbus binding to poll for data. Is there any way I can configure openhab2 not to poll? In the PaperUI I can see that i’m using modbus binding v1.10.0. Let me know if any more information is required from my end.

EDIT: I don’t know if the connection errors are causing this but not all Modbus commands are getting trough to my PLC. I’m using the following item configuration:

Switch DO_01_2 “Kitchenlight”
{mqtt=“<[mosquitto:test/Topic:command:ON:DO_01_2=1],
<[mosquitto:test/Topic:command:OFF:DO_01_2=0]”,
modbus=“>[wago750:2:trigger=ON,transformation=1],
>[wago750:3:trigger=OFF,transformation=1]”}

Thank you for any input

Well that is clearly not valid. There’s not much to say or do about errors on an invalid config.

Binding v1.10 supports write-only devices, see

Confident about that address? It does not fall in the “traditional” modbus coil range of 9999, though that does not necessarily make it invalid.

So to test this any further I made some modifications (using articla from Ssalonen above, thanks rossko57!); idecided to use try to use the modbus polling instead of MQTT to update the state of the switch.

configuration:

tcp.wago750.connection=192.168.1.16:502:60:0:0:3:100
tcp.wago750.type=coil
tcp.wago750.start=512
tcp.wago750.valuetype=bit
tcp.wago750.length=8

First attempt; different registers for setting switch on and off (values are handled by PLC program)

Switch DO_01_2 “Kitchenlight”
{modbus=“<[wago750:0],
>[wago750:11776:trigger=ON,transformation=1],
>[wago750:11777:trigger=OFF,transformation=1]”}

Second attempt; same registers for setting switch on and off (values are handled by PLC program)

Switch DO_01_2 “Kitchenlight”
{modbus=“<[wago750:0],
>[wago750:11776:trigger=ON,transformation=1],
>[wago750:11776:trigger=OFF,transformation=-1]”}

Notes: the WAGO 750-881 novram memory starts at address 12288 (start = 512 + 11776 offset), in the examples above the logic works using node-red with modbus to test to setup.

In both attempts the ON function works but the OFF functions doesn’t do anything, am I doing anything wrong? anyone any input on how to troubleshoot this?

update: still investigating this. I’m currently reviewing the item below:

Switch DO_01_2 “Kitchenlight”
{modbus="<[wago750:0],

[wago750:11776:trigger=ON,transformation=1],
[wago750:11777:trigger=OFF,transformation=1]"}

I installed the modbus slave cmd tool from modbus to troubleshoot. When NodeRed performs the write operation to register 12288 and 12289 there’s no difference then the write’s executed by OpenHab. Yet with NodeRed the register set to 1 in my PLC on the OFF trigger while OpenHab doesn’t… Any way I can enable some extra tracing or something to see what’s going wrong?

update: got the binding above to work by restarting openhab after item config change. Thanks for the help!