Modbus Errorcode 6 with Beckhoff BK9050

Hi OpenHAB Forum.

i have installed OpenHAB2 today and trayed something with my Beckhoff BK9050.
with this config i can read all the bit`s from my 3 Controller:

tcp.BK9050_H1.connection=192.168.5.6:502:60:0:0:3
tcp.BK9050_H1.type=holding
tcp.BK9050_H1.id=1
tcp.BK9050_H1.start=2056
tcp.BK9050_H1.length=4
tcp.BK9050_H1.valuetype=bit

tcp.BK9050_H2.connection=192.168.5.5:502:60:0:0:3
tcp.BK9050_H2.type=holding
tcp.BK9050_H2.id=1
tcp.BK9050_H2.start=2048
tcp.BK9050_H2.length=4
tcp.BK9050_H2.valuetype=bit

tcp.BK9050_G1.connection=192.168.5.7:502:60:0:0:3
tcp.BK9050_G1.type=holding
tcp.BK9050_G1.id=1
tcp.BK9050_G1.start=2056
tcp.BK9050_G1.length=1
tcp.BK9050_G1.valuetype=bit

My problem is i can’t write anything to the BK9050

016-12-26 00:04:01.755 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (BK9050_H1): error when executing write request (net.wimpi.modbus.msg.WriteSingleRegisterRequest@4b429c): Error Code = 6
2016-12-26 00:04:02.434 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (BK9050_H1): error when executing write request (net.wimpi.modbus.msg.WriteSingleRegisterRequest@1f41fd8): Error Code = 6
2016-12-26 00:04:03.000 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (BK9050_H1): error when executing write request (net.wimpi.modbus.msg.WriteSingleRegisterRequest@c951d3): Error Code = 6
2016-12-26 00:04:03.585 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (BK9050_H1): error when executing write request (net.wimpi.modbus.msg.WriteSingleRegisterRequest@1370972): Error Code = 6
2016-12-26 00:04:03.994 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (BK9050_H1): error when executing write request (net.wimpi.modbus.msg.WriteSingleRegisterRequest@4b31e7): Error Code = 6

i think the items and the mapping are ok, because i trayed a third Party modbos tool and set some bits and i can read the correct state

Switch	mb_licht_OG_Office				"Büro"					<light>		(rOG_Office)			{modbus="BK9050_H1:47"}

That’s right. Even though the Modbus binding provides a convenience feature to read bits from holding register tyres, there is no means to write individual bits.

Does the Beckhoff unit provide access as coil types?

Or see

1 Like

Hi rossko57,
after changing the config to coil, the start Position and the length it looks greate.

thx!

tcp.BK9050_H1.connection=192.168.5.6:502:60:0:0:3
tcp.BK9050_H1.type=coil
tcp.BK9050_H1.id=1
tcp.BK9050_H1.start=0
tcp.BK9050_H1.length=64
tcp.BK9050_H1.valuetype=bit

tcp.BK9050_H2.connection=192.168.5.5:502:60:0:0:3
tcp.BK9050_H2.type=coil
tcp.BK9050_H2.id=1
tcp.BK9050_H2.start=0
tcp.BK9050_H2.length=64
tcp.BK9050_H2.valuetype=bit

tcp.BK9050_G1.connection=192.168.5.7:502:60:0:0:3
tcp.BK9050_G1.type=coil
tcp.BK9050_G1.id=1
tcp.BK9050_G1.start=0
tcp.BK9050_G1.length=64
tcp.BK9050_G1.valuetype=bit