Processing int16 values

Hi all, first post so apologies if I do this wrong.

I’m trying to process data from Modbus and the values are mostly listed as int16. I’m seeing numbers but none of them correspond to the values I’m expecting.

I was expecting something like:-

outputvalueindecimal = parseInt(msg.payload);
or
outputvalueindecimal = int16(msg.payload);

I see 0x???? when I click on the number in the debug screen but the value shown in debug is nothing like I was seeing via another interface.

I’ve searched all over the net and can’t find any straightforward simple answer.

Any help would be much appreciated. Thanks.

You probably want to look at Steves node-red-contrib-buffer-parser node which is great for slicing up things like this as often the bytes maybe be swapped or otherwise

That is EXACTLY what I was looking for. My problem now is that I am having trouble getting the variables in the node to correctly align with the Modbus Spec. If I was to send the first few registers, would you mind helping me with the settings please?

The spec for the first register reads:-

Address: 40001, Size: 2, Name: blah, Type uint32 and is supposed to contain "SunS". I can see 0x53756e53 in the debug but I cannot get it to decode properly.

This is how far I have got:-

{"topic":"eb39b2fd.caaee8","messageId":"5fd739ab8ff3f24d5365c569","payload":[{"type":"uint32be","name":"ID","offset":0,"length":-1,"offsetbit":0,"scale":"1","mask":"","id":0,"value":1400204883}],"queueLengthByUnitId":{"unitId":1,"queueLength":0},"queueUnitId":1,"unitId":1,"modbusRequest":{"value":1607940523366,"unitid":"1","fc":3,"address":"40000","quantity":"2","messageId":"5fd739ab8ff3f24d5365c569"},"responseBuffer":{"data":[21365,28243],"buffer":[83,117,110,83]},"_msgid":"719e10b7.d779c","originalPayload":[21365,28243],"specification":{"options":{"byteSwap":[],"resultType":"array","singleResult":true,"msgProperty":"payload","setTopic":false},"items":[{"type":"uint32be","name":"ID","offset":0,"length":-1,"offsetbit":0,"scale":"1","mask":"","id":0,"value":1400204883}]},"values":[1400204883],"objectResults":{"ID":{"type":"uint32be","name":"ID","offset":0,"length":-1,"offsetbit":0,"scale":"1","mask":"","id":0,"value":1400204883}},"keyvalues":{"ID":1400204883},"arrayResults":[{"type":"uint32be","name":"ID","offset":0,"length":-1,"offsetbit":0,"scale":"1","mask":"","id":0,"value":1400204883}],"buffer":[83,117,110,83]}

I am sure it is a simple fix but I'm going blind now looking at it.

Ok. First bit of progress... The Spec I'm following is obviously rubbish. The first field above is a String - Length 4. Got "SunS" at last.

Hi, your flow export is not valid.

If you still need help or any advice on how to grab and convert your data in the most efficient and consistent manner, give me a shout.

At this point I’ve tried just about every combination of Type, Length and Offset I can think of. Can you tell me why it’s not valid please?

Certainly could use any help you can offer. Thanks.

Regards,

Ian

Perhaps you did not use the right technique for exporting it. You should select the nodes to export and then either use Ctrl+E or Export via the menu. Then paste it here. I see you did use the right technique when pasting it in.
Out of interest, how did you export it the first time?

I edited @Ianmidd post to format the JSON export - thats when i realised it was only a partial part of the flow (not even a full node)

@Ian this is how to export...
OVX2rsQAUx

This is how to paste correctly - surround your code with three backticks ...
```
like this
```
See this post for more details - How to share code or flow json

What I posted was the debug node payloads. All the settings are in there, I thought. Anyway here are the nodes as far as I have got.

[{"id":"a6ef7a61.320aa","type":"debug","z":"3b66c770.7ea918","name":"Flex Getter","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":1380,"wires":[]},{"id":"eb39b2fd.caaee8","type":"modbus-getter","z":"3b66c770.7ea918","name":"Load","showStatusActivities":true,"showErrors":true,"logIOActivities":false,"unitid":"1","dataType":"HoldingRegister","adr":"40000","quantity":"37","server":"fa971e4c.0eaa6","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":310,"y":1380,"wires":[["a6ef7a61.320aa","45cc6637.f52cc"],["a6ef7a61.320aa"]]},{"id":"781c433c.f42664","type":"inject","z":"3b66c770.7ea918","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":1380,"wires":[["eb39b2fd.caaee8"]]},{"id":"703d6667.18c618","type":"debug","z":"3b66c770.7ea918","name":"Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":1460,"wires":[]},{"id":"45cc6637.f52cc","type":"buffer-parser","z":"3b66c770.7ea918","name":"","data":"responseBuffer.data","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"string","name":"ID","offset":0,"length":4,"offsetbit":0,"scale":"1","mask":""},{"type":"uint16be","name":"DID","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"Block","offset":5,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Manufacturer","offset":5,"length":32,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Model","offset":6,"length":32,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"array","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":true,"setTopic":false,"outputs":1,"x":330,"y":1460,"wires":[["703d6667.18c618"]]},{"id":"fa971e4c.0eaa6","type":"modbus-client","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.10.31","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

You should be sending your Buffer parser the buffer .. hence the name "Buffer parser" :wink:
image

You were sending msg.responseBuffer.data

Also i believe the length should be image for all

Changed it from .data to . buffer and there seems to be no difference. Also the Length set to 1 is not working, so "SunS" comes out as "S".

Actually, I take that back. The Buffer comes out as an Array of individual fields whereas the Data comes out somehow grouped together.

Can you copy/paste another message coming from the Flex Getter Debug node ? .. double click it first and configure it to Complete msg object

Also is there some link to the documentation for your modbus device ?

In your Mobus Getter setup you start reading from 40000 ? it can be confusing because some manufacturers start from 0 and some from 1

This time I used the Buffer.buffer as you said.

{"topic":"eb39b2fd.caaee8","messageId":"5fd7cdca5c5a707be129c8d7","payload":[{"type":"string","name":"ID02","offset":0,"length":4,"offsetbit":0,"scale":"1","mask":"","id":0,"value":"SunS"},{"type":"byte","name":"DID03","offset":5,"length":1,"offsetbit":0,"scale":"1","mask":"","id":1,"value":1},{"type":"uint16be","name":"Block04","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":"","id":2,"value":65},{"type":"string","name":"Manufacturer05","offset":8,"length":32,"offsetbit":0,"scale":"1","mask":"","id":3,"value":"SolarEdge \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"Model21","offset":18,"length":32,"offsetbit":0,"scale":"1","mask":"","id":4,"value":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000SE4000\u0000\u0000\u0000\u0000"},{"type":"string","name":"Version45","offset":44,"length":8,"offsetbit":0,"scale":"1","mask":"","id":5,"value":"00\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"SerialNumber","offset":40,"length":32,"offsetbit":0,"scale":"1","mask":"","id":6,"value":"SE4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}],"queueLengthByUnitId":{"unitId":1,"queueLength":0},"queueUnitId":1,"unitId":1,"modbusRequest":{"value":1607978442267,"unitid":"1","fc":3,"address":"40000","quantity":"65","messageId":"5fd7cdca5c5a707be129c8d7"},"responseBuffer":{"data":[21365,28243,1,65,21359,27745,29253,25703,25888,0,0,0,0,0,0,0,0,0,0,0,21317,13360,12336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12336,12339,11826,12600,13824,0,0,0,14150,12597,12342,17463,0,0,0,0,0,0,0,0,0],"buffer":[83,117,110,83,0,1,0,65,83,111,108,97,114,69,100,103,101,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,69,52,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,51,46,50,49,56,54,0,0,0,0,0,0,0,55,70,49,53,48,54,68,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"_msgid":"861638c3.74b758","originalPayload":[21365,28243,1,65,21359,27745,29253,25703,25888,0,0,0,0,0,0,0,0,0,0,0,21317,13360,12336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12336,12339,11826,12600,13824,0,0,0,14150,12597,12342,17463,0,0,0,0,0,0,0,0,0],"specification":{"options":{"byteSwap":[],"resultType":"array","singleResult":true,"msgProperty":"payload","setTopic":false},"items":[{"type":"string","name":"ID02","offset":0,"length":4,"offsetbit":0,"scale":"1","mask":"","id":0,"value":"SunS"},{"type":"byte","name":"DID03","offset":5,"length":1,"offsetbit":0,"scale":"1","mask":"","id":1,"value":1},{"type":"uint16be","name":"Block04","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":"","id":2,"value":65},{"type":"string","name":"Manufacturer05","offset":8,"length":32,"offsetbit":0,"scale":"1","mask":"","id":3,"value":"SolarEdge \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"Model21","offset":18,"length":32,"offsetbit":0,"scale":"1","mask":"","id":4,"value":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000SE4000\u0000\u0000\u0000\u0000"},{"type":"string","name":"Version45","offset":44,"length":8,"offsetbit":0,"scale":"1","mask":"","id":5,"value":"00\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"SerialNumber","offset":40,"length":32,"offsetbit":0,"scale":"1","mask":"","id":6,"value":"SE4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}]},"values":["SunS",1,65,"SolarEdge \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000SE4000\u0000\u0000\u0000\u0000","00\u0000\u0000\u0000\u0000\u0000\u0000","SE4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"],"objectResults":{"ID02":{"type":"string","name":"ID02","offset":0,"length":4,"offsetbit":0,"scale":"1","mask":"","id":0,"value":"SunS"},"DID03":{"type":"byte","name":"DID03","offset":5,"length":1,"offsetbit":0,"scale":"1","mask":"","id":1,"value":1},"Block04":{"type":"uint16be","name":"Block04","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":"","id":2,"value":65},"Manufacturer05":{"type":"string","name":"Manufacturer05","offset":8,"length":32,"offsetbit":0,"scale":"1","mask":"","id":3,"value":"SolarEdge \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},"Model21":{"type":"string","name":"Model21","offset":18,"length":32,"offsetbit":0,"scale":"1","mask":"","id":4,"value":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000SE4000\u0000\u0000\u0000\u0000"},"Version45":{"type":"string","name":"Version45","offset":44,"length":8,"offsetbit":0,"scale":"1","mask":"","id":5,"value":"00\u0000\u0000\u0000\u0000\u0000\u0000"},"SerialNumber":{"type":"string","name":"SerialNumber","offset":40,"length":32,"offsetbit":0,"scale":"1","mask":"","id":6,"value":"SE4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}},"keyvalues":{"ID02":"SunS","DID03":1,"Block04":65,"Manufacturer05":"SolarEdge \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","Model21":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000SE4000\u0000\u0000\u0000\u0000","Version45":"00\u0000\u0000\u0000\u0000\u0000\u0000","SerialNumber":"SE4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},"arrayResults":[{"type":"string","name":"ID02","offset":0,"length":4,"offsetbit":0,"scale":"1","mask":"","id":0,"value":"SunS"},{"type":"byte","name":"DID03","offset":5,"length":1,"offsetbit":0,"scale":"1","mask":"","id":1,"value":1},{"type":"uint16be","name":"Block04","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":"","id":2,"value":65},{"type":"string","name":"Manufacturer05","offset":8,"length":32,"offsetbit":0,"scale":"1","mask":"","id":3,"value":"SolarEdge \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"Model21","offset":18,"length":32,"offsetbit":0,"scale":"1","mask":"","id":4,"value":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000SE4000\u0000\u0000\u0000\u0000"},{"type":"string","name":"Version45","offset":44,"length":8,"offsetbit":0,"scale":"1","mask":"","id":5,"value":"00\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"SerialNumber","offset":40,"length":32,"offsetbit":0,"scale":"1","mask":"","id":6,"value":"SE4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}],"buffer":[83,117,110,83,0,1,0,65,83,111,108,97,114,69,100,103,101,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,69,52,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,51,46,50,49,56,54,0,0,0,0,0,0,0,55,70,49,53,48,54,68,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}

The data is getting clearer but the last 4 fields should come out as:-
Model = SE4000,
Version = (unknown for sure, looks like 0003.218 in the input),
SerialNumber is known to be "7F1506D7-71,
and
Modbus ID should be "1" I believe.

This is only the header block. I hope I catch on soon or this is gonna be a long night.

I think you should start reading from 40001 instead of 40000 so the offset doesnt get messed up

From the net i found this .. does it apply for your device ?

I dont have to much exprerience with modbus but something like this ? for sure im wrong with the offset for the last couple of values so you have to experiment

Thats the Spec they gave me Its SunSpec Modbus. Not 100% convinced its correct yet.

I will try changing the Register and Offset values right now. Thx

Ok. Configuring like your example I get this:-

{"topic":"eb39b2fd.caaee8","messageId":"5fd7d6055c5a707be129c8e4","payload":[{"type":"uint32le","name":"ID","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"","id":0,"value":16798574},{"type":"int16le","name":"DID","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":"","id":1,"value":16640},{"type":"int16le","name":"Block","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":"","id":2,"value":28499},{"type":"string","name":"Manufacturer05","offset":10,"length":1,"offsetbit":0,"scale":"1","mask":"","id":3,"value":"r"},{"type":"string","name":"Model","offset":18,"length":1,"offsetbit":0,"scale":"1","mask":"","id":4,"value":"\u0000"},{"type":"string","name":"Version45","offset":44,"length":8,"offsetbit":0,"scale":"1","mask":"","id":5,"value":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"SerialNumber","offset":40,"length":32,"offsetbit":0,"scale":"1","mask":"","id":6,"value":"4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}],"queueLengthByUnitId":{"unitId":1,"queueLength":0},"queueUnitId":1,"unitId":1,"modbusRequest":{"value":1607980549489,"unitid":"1","fc":3,"address":"40001","quantity":"65","messageId":"5fd7d6055c5a707be129c8e4"},"responseBuffer":{"data":[28243,1,65,21359,27745,29253,25703,25888,0,0,0,0,0,0,0,0,0,0,0,21317,13360,12336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12336,12339,11826,12600,13824,0,0,0,14150,12597,12342,17463,0,0,0,0,0,0,0,0,0,0],"buffer":[110,83,0,1,0,65,83,111,108,97,114,69,100,103,101,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,69,52,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,51,46,50,49,56,54,0,0,0,0,0,0,0,55,70,49,53,48,54,68,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"_msgid":"caa8fe31.d4715","originalPayload":[28243,1,65,21359,27745,29253,25703,25888,0,0,0,0,0,0,0,0,0,0,0,21317,13360,12336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12336,12339,11826,12600,13824,0,0,0,14150,12597,12342,17463,0,0,0,0,0,0,0,0,0,0],"specification":{"options":{"byteSwap":[],"resultType":"array","singleResult":true,"msgProperty":"payload","setTopic":false},"items":[{"type":"uint32le","name":"ID","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"","id":0,"value":16798574},{"type":"int16le","name":"DID","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":"","id":1,"value":16640},{"type":"int16le","name":"Block","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":"","id":2,"value":28499},{"type":"string","name":"Manufacturer05","offset":10,"length":1,"offsetbit":0,"scale":"1","mask":"","id":3,"value":"r"},{"type":"string","name":"Model","offset":18,"length":1,"offsetbit":0,"scale":"1","mask":"","id":4,"value":"\u0000"},{"type":"string","name":"Version45","offset":44,"length":8,"offsetbit":0,"scale":"1","mask":"","id":5,"value":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"SerialNumber","offset":40,"length":32,"offsetbit":0,"scale":"1","mask":"","id":6,"value":"4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}]},"values":[16798574,16640,28499,"r","\u0000","\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"],"objectResults":{"ID":{"type":"uint32le","name":"ID","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"","id":0,"value":16798574},"DID":{"type":"int16le","name":"DID","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":"","id":1,"value":16640},"Block":{"type":"int16le","name":"Block","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":"","id":2,"value":28499},"Manufacturer05":{"type":"string","name":"Manufacturer05","offset":10,"length":1,"offsetbit":0,"scale":"1","mask":"","id":3,"value":"r"},"Model":{"type":"string","name":"Model","offset":18,"length":1,"offsetbit":0,"scale":"1","mask":"","id":4,"value":"\u0000"},"Version45":{"type":"string","name":"Version45","offset":44,"length":8,"offsetbit":0,"scale":"1","mask":"","id":5,"value":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},"SerialNumber":{"type":"string","name":"SerialNumber","offset":40,"length":32,"offsetbit":0,"scale":"1","mask":"","id":6,"value":"4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}},"keyvalues":{"ID":16798574,"DID":16640,"Block":28499,"Manufacturer05":"r","Model":"\u0000","Version45":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","SerialNumber":"4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},"arrayResults":[{"type":"uint32le","name":"ID","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"","id":0,"value":16798574},{"type":"int16le","name":"DID","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":"","id":1,"value":16640},{"type":"int16le","name":"Block","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":"","id":2,"value":28499},{"type":"string","name":"Manufacturer05","offset":10,"length":1,"offsetbit":0,"scale":"1","mask":"","id":3,"value":"r"},{"type":"string","name":"Model","offset":18,"length":1,"offsetbit":0,"scale":"1","mask":"","id":4,"value":"\u0000"},{"type":"string","name":"Version45","offset":44,"length":8,"offsetbit":0,"scale":"1","mask":"","id":5,"value":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},{"type":"string","name":"SerialNumber","offset":40,"length":32,"offsetbit":0,"scale":"1","mask":"","id":6,"value":"4000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}],"buffer":[110,83,0,1,0,65,83,111,108,97,114,69,100,103,101,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,69,52,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,51,46,50,49,56,54,0,0,0,0,0,0,0,55,70,49,53,48,54,68,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}

Do these values look correct?

image

I used your payload from the above post & the info in the modbus parameters screenshot

demo flow...

[{"id":"8fa37f7a.7c8a7","type":"inject","z":"553814a2.1248ec","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1040,"y":240,"wires":[["a54b9385.4e6c1"]]},{"id":"a54b9385.4e6c1","type":"function","z":"553814a2.1248ec","name":"","func":"\nreturn { \"topic\": \"eb39b2fd.caaee8\", \"messageId\": \"5fd7cdca5c5a707be129c8d7\", \n\"payload\": [{ \"type\": \"string\", \"name\": \"ID02\", \"offset\": 0, \"length\": 4, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 0, \"value\": \"SunS\" }, \n{ \"type\": \"byte\", \"name\": \"DID03\", \"offset\": 5, \"length\": 1, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 1, \"value\": 1 }, \n{ \"type\": \"uint16be\", \"name\": \"Block04\", \"offset\": 6, \"length\": 1, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 2, \"value\": 65 }, \n{ \"type\": \"string\", \"name\": \"Manufacturer05\", \"offset\": 8, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 3, \n\"value\": \"SolarEdge \\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, \n{ \"type\": \"string\", \"name\": \"Model21\", \"offset\": 18, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 4, \"value\": \n\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000SE4000\\u0000\\u0000\\u0000\\u0000\" }, { \"type\": \"string\", \"name\": \"Version45\", \"offset\": 44, \"length\": 8, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 5, \"value\": \"00\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, \n{ \"type\": \"string\", \"name\": \"SerialNumber\", \"offset\": 40, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 6, \"value\": \"SE4000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }], \"queueLengthByUnitId\": { \"unitId\": 1, \"queueLength\": 0 }, \"queueUnitId\": 1, \"unitId\": 1, \"modbusRequest\": { \"value\": 1607978442267, \"unitid\": \"1\", \"fc\": 3, \"address\": \"40000\", \"quantity\": \"65\", \"messageId\": \"5fd7cdca5c5a707be129c8d7\" }, \n\"responseBuffer\": \n{ \"data\": [21365, 28243, 1, 65, 21359, 27745, 29253, 25703, 25888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21317, 13360, 12336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12336, 12339, 11826, 12600, 13824, 0, 0, 0, 14150, 12597, 12342, 17463, 0, 0, 0, 0, 0, 0, 0, 0, 0], \n\"buffer\": Buffer.from([83, 117, 110, 83, 0, 1, 0, 65, 83, 111, 108, 97, 114, 69, 100, 103, 101, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 69, 52, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 51, 46, 50, 49, 56, 54, 0, 0, 0, 0, 0, 0, 0, 55, 70, 49, 53, 48, 54, 68, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) }, \n\"_msgid\": \"861638c3.74b758\", \"originalPayload\": [21365, 28243, 1, 65, 21359, 27745, 29253, 25703, 25888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21317, 13360, 12336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12336, 12339, 11826, 12600, 13824, 0, 0, 0, 14150, 12597, 12342, 17463, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"specification\": { \"options\": { \"byteSwap\": [], \"resultType\": \"array\", \"singleResult\": true, \"msgProperty\": \"payload\", \"setTopic\": false }, \"items\": [{ \"type\": \"string\", \"name\": \"ID02\", \"offset\": 0, \"length\": 4, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 0, \"value\": \"SunS\" }, { \"type\": \"byte\", \"name\": \"DID03\", \"offset\": 5, \"length\": 1, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 1, \"value\": 1 }, { \"type\": \"uint16be\", \"name\": \"Block04\", \"offset\": 6, \"length\": 1, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 2, \"value\": 65 }, { \"type\": \"string\", \"name\": \"Manufacturer05\", \"offset\": 8, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 3, \"value\": \"SolarEdge \\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, { \"type\": \"string\", \"name\": \"Model21\", \"offset\": 18, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 4, \"value\": \"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000SE4000\\u0000\\u0000\\u0000\\u0000\" }, { \"type\": \"string\", \"name\": \"Version45\", \"offset\": 44, \"length\": 8, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 5, \"value\": \"00\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, { \"type\": \"string\", \"name\": \"SerialNumber\", \"offset\": 40, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 6, \"value\": \"SE4000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }] }, \"values\": [\"SunS\", 1, 65, \"SolarEdge \\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\", \"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000SE4000\\u0000\\u0000\\u0000\\u0000\", \"00\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\", \"SE4000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"], \"objectResults\": { \"ID02\": { \"type\": \"string\", \"name\": \"ID02\", \"offset\": 0, \"length\": 4, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 0, \"value\": \"SunS\" }, \"DID03\": { \"type\": \"byte\", \"name\": \"DID03\", \"offset\": 5, \"length\": 1, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 1, \"value\": 1 }, \"Block04\": { \"type\": \"uint16be\", \"name\": \"Block04\", \"offset\": 6, \"length\": 1, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 2, \"value\": 65 }, \"Manufacturer05\": { \"type\": \"string\", \"name\": \"Manufacturer05\", \"offset\": 8, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 3, \"value\": \"SolarEdge \\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, \"Model21\": { \"type\": \"string\", \"name\": \"Model21\", \"offset\": 18, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 4, \"value\": \"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000SE4000\\u0000\\u0000\\u0000\\u0000\" }, \"Version45\": { \"type\": \"string\", \"name\": \"Version45\", \"offset\": 44, \"length\": 8, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 5, \"value\": \"00\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, \"SerialNumber\": { \"type\": \"string\", \"name\": \"SerialNumber\", \"offset\": 40, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 6, \"value\": \"SE4000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" } }, \"keyvalues\": { \"ID02\": \"SunS\", \"DID03\": 1, \"Block04\": 65, \"Manufacturer05\": \"SolarEdge \\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\", \"Model21\": \"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000SE4000\\u0000\\u0000\\u0000\\u0000\", \"Version45\": \"00\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\", \"SerialNumber\": \"SE4000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, \n\"arrayResults\": [{ \"type\": \"string\", \"name\": \"ID02\", \"offset\": 0, \"length\": 4, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 0, \"value\": \"SunS\" }, { \"type\": \"byte\", \"name\": \"DID03\", \"offset\": 5, \"length\": 1, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 1, \"value\": 1 }, { \"type\": \"uint16be\", \"name\": \"Block04\", \"offset\": 6, \"length\": 1, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 2, \"value\": 65 }, { \"type\": \"string\", \"name\": \"Manufacturer05\", \"offset\": 8, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 3, \"value\": \"SolarEdge \\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, { \"type\": \"string\", \"name\": \"Model21\", \"offset\": 18, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 4, \"value\": \"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000SE4000\\u0000\\u0000\\u0000\\u0000\" }, { \"type\": \"string\", \"name\": \"Version45\", \"offset\": 44, \"length\": 8, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 5, \"value\": \"00\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }, { \"type\": \"string\", \"name\": \"SerialNumber\", \"offset\": 40, \"length\": 32, \"offsetbit\": 0, \"scale\": \"1\", \"mask\": \"\", \"id\": 6, \"value\": \"SE4000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\" }], \n    \"buffer\": Buffer.from([83, 117, 110, 83, 0, 1, 0, 65, 83, 111, 108, 97, 114, 69, 100, 103, 101, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 69, 52, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 51, 46, 50, 49, 56, 54, 0, 0, 0, 0, 0, 0, 0, 55, 70, 49, 53, 48, 54, 68, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) };","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1050,"y":300,"wires":[["546944da.d37fec","45cc6637.f52cc"]]},{"id":"546944da.d37fec","type":"debug","z":"553814a2.1248ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1210,"y":300,"wires":[]},{"id":"45cc6637.f52cc","type":"buffer-parser","z":"553814a2.1248ec","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"string","name":"ID","offset":0,"length":4,"offsetbit":0,"scale":"1","mask":""},{"type":"uint16be","name":"DID","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint16be","name":"Length","offset":5,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Manufacturer","offset":6,"length":32,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Model","offset":38,"length":32,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Version","offset":70,"length":16,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"SerialNo","offset":86,"length":32,"offsetbit":0,"scale":"1","mask":""},{"type":"uint16be","name":"DeviceAddress","offset":118,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":true,"setTopic":false,"outputs":1,"x":1070,"y":360,"wires":[["703d6667.18c618"]]},{"id":"703d6667.18c618","type":"debug","z":"553814a2.1248ec","name":"Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1210,"y":360,"wires":[]}]

The manual is a bit misleading.
For SunSpec_ID 40001 it says its type is UINT32 but then goes on to say its a string "SunS" :wink:

@Ianmidd I think you need to read more than 65 registers if you want to include DeviceAddress that is at register 40069.

@Steve-Mcl In these cases (mix types) .. what does Length represent .. it depends on the type ?