Closed SuperJojo2001 closed 8 years ago
Instead we are using the following code var pkt = Put() .word8(this.unitId) .put(pdu), buf = pkt.buffer()
and now we are able to select the slave address the command is addressed to using the unitId known from Modbus TCP already.
Created the pull request #56
Using node-red-contrib-modbus which is based on "node-modbus" I have no chance today to send any serial request to an address other than 1. So whatever I do on the serial line I see always a value 0x01 as first byte sent to the serial line.
I went to the source code and in the current onSend function...
var onSend = function (pdu) {
buf = pkt.buffer();
... I see that the first byte is set to value 1 always. This shall be change to enable the possibility to sent to different slave addresses other than 1.
watch Modbus RTU spec here http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf