var rawData = new ArrayBuffer(4);
var intView = new Uint16Array(rawData);
var fltView = new Float32Array(rawData);
intView[0] = msg.payload[1]; //low
intView[1] = msg.payload[0]; //high
msg.payload = fltView[0];
return msg;
Steve,
sorry this will be the final request if possible the Modbus TCP node toiled when under pressure with the amount of variables I was pulling back from the server so switched to the alternative "flex getter" which brings the data back in a different format to the original node.
Lack of programming skills let me down badly but this is the return I get from this alternative node:
I would like to do exactly the same as before but with this output I need to apply the same function to the two numbers inside the values array where as before it came back simply as array with the older node. do I simply need to add the word "values:"
I couldn't get it to work.
Nairn
But your function node was set convert msg.payload.data to a string.
As msg.payload.data didnt exist you got the error message.
Hi All, with the electric meters well and truly cracked through previous and much appreciated help! I am now adding heat meters to the project. these are coming in to the system in a slightly different way. After getting the various data sheets from the supplier these registers are listed as example:
Modbus Memory = 56Size in bytes = 4
contents = Values in integerData type = Double word 32 Bitthis is the result from the debug output from the device: