Hi have a modbus device that uses 32bit signed big-endian formatted number
So in the script using
:local modbusread [/iot modbus read-holding-registers slave-id=1 num-regs=2 reg-addr=514 as-value once];
This gives the result as 15,3492 so how can this be formatted to give the actual register value of 986532 to send to the IoT MQTT
To be more specific, each member of the array I think is 16-bit. So you can multiple the first element (15) * 65536, the add the 2nd 16-bits (3492) to that.
So 15*65536+3492 = 986532, which is what you’re expecting.
I don’t have a KNOT, but this should be pretty close: