We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Watch the YouTube video for SDM630 reading Modbus buffer in Node-RED flow.
The msg.payload.buffer is an 8Bit buffer, which you can read as you need it.
first 8Bit: msg.payload.buffer.read...(0,1)
msg.payload.buffer.read...(0,1)
first 16Bit: msg.payload.buffer.read...(0,2)
msg.payload.buffer.read...(0,2)
first 32Bit: msg.payload.buffer.read...(0,4)
msg.payload.buffer.read...(0,4)
first 64Bit: msg.payload.buffer.read...(0,8)
msg.payload.buffer.read...(0,8)
first 128Bit: msg.payload.buffer.read...(0,16)
msg.payload.buffer.read...(0,16)
and so on ...
Happy reading!
Looks like the buffer library has changed to remove the buffer field. Now it works like this (using an optional async function):
buffer
let r = await client.readHoldingRegisters(3000, 4); let value1 = r.payload.readFloatBE(0); let value2 = r.payload.readFloatBE(2);