It appears that you already have a JSON structure -- from the attached image, I can see that
msg.payload is a single javascript object with 2 fields: "data" and "buffer". It looks like each field holds information from the same 20 bytes of modbus register data. So
msg.payload.buffer is a javascript buffer of those 20 bytes, and
msg.payload.data is an array of the equivalent 10 integers, taken 2-bytes at a time. But only you can know what is being stored in those registers, or what the numbers mean.
If you are having trouble accessing individual elements of the JSON structure, it may help to read the tutorials about javascript
objects and
arrays on the W3Schools site -- I use it all the time to find the javascript functions I need to manipulate my data.
If the registers should be holding measurements that are floating point numbers, you can process the buffer values into numbers using the node-red-contrib-binary node (although to be honest, I have not figured out the packet syntax to make this node work). Another option is to use a function node and create a view of the buffer as 4- or 8-byte floats, using the
DataView functions built-in to javascript. If you are still stuck, please let us know what data the registers hold, in what order and byte sizes, and any expected values for those fields.
--
Steve