Hi,
For discrete inputs everything is working fine.
For digital outputs/coils, it’s working … but getting these error messages.
Getting these errors with Modbus and Beckhoff BC9100 / Digital Output
16:10:24.605 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘DO01’ received command ON
16:10:24.669 [INFO ] [arthome.event.ItemStatePredictedEvent] - DO01 predicted to become ON
16:10:24.694 [INFO ] [smarthome.event.ItemStateChangedEvent] - DO01 changed from OFF to ON
16:10:24.935 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed when executing request (BasicModbusWriteCoilRequestBlueprint@89da23[slaveId=1,reference=0,functionCode=WRITE_COIL,bits=SingleBitArray(bit=1),maxTries=3]). Will try again soon. Error was: net.wimpi.modbus.ModbusSlaveException Error Code = 4 [operation ID c2ca648b-fe2c-44d5-a6c4-42099609d1cf]
16:10:25.015 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (BasicModbusWriteCoilRequestBlueprint@89da23[slaveId=1,reference=0,functionCode=WRITE_COIL,bits=SingleBitArray(bit=1),maxTries=3]). Will try again soon. Error was: net.wimpi.modbus.ModbusSlaveException Error Code = 4 [operation ID c2ca648b-fe2c-44d5-a6c4-42099609d1cf]
16:10:25.096 [ERROR] [ort.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (BasicModbusWriteCoilRequestBlueprint@89da23[slaveId=1,reference=0,functionCode=WRITE_COIL,bits=SingleBitArray(bit=1),maxTries=3]). Aborting. Error was: net.wimpi.modbus.ModbusSlaveException Error Code = 4 [operation ID c2ca648b-fe2c-44d5-a6c4-42099609d1cf]
16:10:25.110 [ERROR] [ternal.handler.ModbusDataThingHandler] - Thing modbus:data:beckhoff:coils:do01 ‘Modbus Data’ had ModbusSlaveErrorResponseExceptionImpl error on write: ModbusSlaveErrorResponseException(error=4)
16:10:25.129 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘modbus:data:beckhoff:coils:do01’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveErrorResponseExceptionImpl) with write. Request: BasicModbusWriteCoilRequestBlueprint@89da23[slaveId=1,reference=0,functionCode=WRITE_COIL,bits=SingleBitArray(bit=1),maxTries=3]. Description: ModbusSlaveErrorResponseException(error=4). Message: Slave responsed with error=4
16:10:25.217 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘modbus:data:beckhoff:coils:do01’ changed from OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveErrorResponseExceptionImpl) with write. Request: BasicModbusWriteCoilRequestBlueprint@89da23[slaveId=1,reference=0,functionCode=WRITE_COIL,bits=SingleBitArray(bit=1),maxTries=3]. Description: ModbusSlaveErrorResponseException(error=4). Message: Slave responsed with error=4 to ONLINE
Beckhoff
BC9100 (factory reseted and set to fieldbus)
4x KL1408 | 8-channel digital input
2x KL2408 | 8-channel digital output
RasberryPi
Things:
Bridge modbus:tcp:beckhoff [ host=“192.168.5.253”, port=502, id=1 ] {
Bridge poller discreteInputs [ start=0, length=32, refresh=1000, type=“discrete” ] {
Thing data di01 [ readStart=“0”, readValueType=“bit” ]
Thing data di02 [ readStart=“1”, readValueType=“bit” ]
}
Bridge poller coils [ start=0, length=16, refresh=1000, type=“coil” ] {
Thing data do01 [ readStart=“0”, readValueType=“bit”, writeStart=“0”, writeValueType=“bit”, writeType=“coil” ]
Thing data do02 [ readStart=“1”, readValueType=“bit”, writeStart=“1”, writeValueType=“bit”, writeType=“coil” ]
}
}
Items:
Switch DO01 “Digital Output index 01 [%d]” (beckhoff_out) { channel=“modbus:data:beckhoff:coils:do01:switch” }
Switch DO02 “Digital Output index 02 [%d]” (beckhoff_out) { channel=“modbus:data:beckhoff:coils:do02:switch” }
When changing output state from outside openhab the status changs in openhab without error msg
2020-04-07 16:28:02.952 [vent.ItemStateChangedEvent] - DO01 changed from ON to OFF
2020-04-07 16:28:07.413 [vent.ItemStateChangedEvent] - DO01 changed from OFF to ON
Anyone an idea please?