can someone help me how to correctly convert the payload of a ModbusTCP return? I need the value in watts. Currently, a value of 65123 (from register 1066) or similar comes from the register. Unit is UNIT16.
Another register (2066) contains -> active power = (value in # 1066) * 10 ^ (value in # 2066) - which is a multiplication by a power of ten, right? But no idea how I do it ...
Modbus returns "0" from 2066.
What do I have to enter in a function node for the conversion?
let value = 65123; // replace with value from register 1066
let exponent = 0; // replace with value from register 2066
let activePower = value * Math.pow(10, exponent);
msg.payload = activePower;
return msg
sorry i have no idea how tcl scripts work or how to use them in node-red
(i was under the impression that you had them in NR already)
you cant use some Modbus nodes to get the values from you device ?