Hello community
I have a problem with Modbus writing. Reading works!
•Hardware: RPi 3 B+
•OS: openhabian
•openHAB version: openHAB 2.4
I defined an Item:
Number PVWertzumSchreiben “Wert [%.3f kW]” { channel=“modbus:data:TwinCat:holding:write0000:number” }
For testing, i wrote a value in (for ex. 34.21) and show it in the sitemap.
If i do a comment in front of the {, the 34.21 are showed. But if I activat the {}, it doesn’t work anymore.
If the problem is the Item or something later, I don’t know.
And I defined a Thing:
Bridge modbus:tcp:TwinCat [ host=“192.168.1.99”, port=502, id=1 ] {
Bridge poller holding [ start=12288, length=46, refresh=1000, type=“holding” ] {
Thing data holding0000 [ readStart=“12288”, readValueType=“float32_swap” ]
Thing data holding0002 [ readStart=“12290”, readValueType=“float32_swap” ]
Thing data holding0004 [ readStart=“12292”, readValueType=“float32_swap” ]
// geht so weiter…
Thing data holding0042 [ readStart=“12330”, readValueType=“float32_swap” ]
Thing data holding0044 [ readStart=“12332”, readValueType=“float32_swap” ]
}
Bridge poller items [ start=12388, length=2, refresh=1000, type=“discrete” ] {
Thing data write0000 [ writeStart=“12388”, writeValueType=“float32_swap”, writeType=“holding” ]
}
}
The first part, the reading, works!
Later, the writing, doesn’t work.
I’m sure, the 12388 are correct. I can read and write it with “Modbus Poll”-program and see the canges in the PLC and the other way.
But I don’t know if the type=“discrete” is correct or if they “holding” should be.
And if “poller items” is correct, I don’t know as well…
In the “event.log” I see something “strange”, but I can’t understand:
2019-08-26 21:29:17.042 [ome.event.ItemCommandEvent] - Item ‘PVWertzumSchreiben’ received command 34.21
2019-08-26 21:29:17.047 [nt.ItemStatePredictedEvent] - PVWertzumSchreiben predicted to become 44.2
He is receiving the command, to write 34.21. But somehow, the 44.2 from later stay there from a test without {}.
Can someone help me, please?