Adding two values

@Becker, do you want my help or not? I have better things to do mate.

  1. get me some data to play with...

  2. copy the values using the COPY button in the DEBUG output...
    Vmz3Zy8Buu

  3. Paste the results in your reply
    ```
    like this
    ```

  4. tell me what the values SHOULD be

Becker .. we see that you have your debug nodes set to show only the msg.payload
In case you missed that detail .. a debug node can be set to show complete msg

image

1 Like

ah, didn´t know, sorry.

{"topic":"df8249b3.d3713","messageId":"5f6f2b6d4a6d37a91c8168c7","payload":[0,1450,0,1437,0,477,0,475,0,485,0,23102,0,23162,0,23264,0,40102,0,40124,0,40188,0,6355,65535,65535,65535,65535,65535,65535,0,5000,32768,0,65535,65441,65535,65435,65535,65440,0,1466,0,489,0,488,0,497,65535,65535,255,65533,255,65533,0,0,0,0,32768,0,255,65533,0,1079,0,6000,0,100,65535,65535,32768,0,65535,65535,65535,65535,32768,0,65535,65535,255,65533,65535,65535,32768,0,255,65533,32768,0,65535,65535,0,0,0,1697],"queueLengthByUnitId":{"unitId":3,"queueLength":0},"queueUnitId":3,"unitId":3,"modbusRequest":{"value":1601121133656,"unitid":"","fc":4,"address":"30773","quantity":"96","messageId":"5f6f2b6d4a6d37a91c8168c7"},"responseBuffer":{"data":[0,1450,0,1437,0,477,0,475,0,485,0,23102,0,23162,0,23264,0,40102,0,40124,0,40188,0,6355,65535,65535,65535,65535,65535,65535,0,5000,32768,0,65535,65441,65535,65435,65535,65440,0,1466,0,489,0,488,0,497,65535,65535,255,65533,255,65533,0,0,0,0,32768,0,255,65533,0,1079,0,6000,0,100,65535,65535,32768,0,65535,65535,65535,65535,32768,0,65535,65535,255,65533,65535,65535,32768,0,255,65533,32768,0,65535,65535,0,0,0,1697],"buffer":[0,0,5,170,0,0,5,157,0,0,1,221,0,0,1,219,0,0,1,229,0,0,90,62,0,0,90,122,0,0,90,224,0,0,156,166,0,0,156,188,0,0,156,252,0,0,24,211,255,255,255,255,255,255,255,255,255,255,255,255,0,0,19,136,128,0,0,0,255,255,255,161,255,255,255,155,255,255,255,160,0,0,5,186,0,0,1,233,0,0,1,232,0,0,1,241,255,255,255,255,0,255,255,253,0,255,255,253,0,0,0,0,0,0,0,0,128,0,0,0,0,255,255,253,0,0,4,55,0,0,23,112,0,0,0,100,255,255,255,255,128,0,0,0,255,255,255,255,255,255,255,255,128,0,0,0,255,255,255,255,0,255,255,253,255,255,255,255,128,0,0,0,0,255,255,253,128,0,0,0,255,255,255,255,0,0,0,0,0,0,6,161]},"_msgid":"69b494d7.52af2c"}

{"PDC2":95027200,"PAC2":94175232,"Pbez":0,"Pein":111214592}
{"topic":"5909172b.d6bb18","messageId":"5f6f2b6d4a6d37a91c8168c8","payload":[0,364],"queueLengthByUnitId":{"unitId":3,"queueLength":1},"queueUnitId":3,"unitId":3,"modbusRequest":{"value":1601121133656,"unitid":"","fc":4,"address":"30953","quantity":"2","messageId":"5f6f2b6d4a6d37a91c8168c8"},"responseBuffer":{"data":[0,364],"buffer":[0,0,1,108]},"_msgid":"251472d0.ce518e"}
{"T2":23855104}
{"topic":"5f9e2884.d556c8","messageId":"5f6f2b6d4a6d37a91c8168c9","payload":[0,23354,0,23378,0,23541],"queueLengthByUnitId":{"unitId":3,"queueLength":2},"queueUnitId":3,"unitId":3,"modbusRequest":{"value":1601121133656,"unitid":"","fc":4,"address":"31253","quantity":"6","messageId":"5f6f2b6d4a6d37a91c8168c9"},"responseBuffer":{"data":[0,23354,0,23378,0,23541],"buffer":[0,0,91,58,0,0,91,82,0,0,91,245]},"_msgid":"4b84a5f0.bf6a0c"}
{"UL1":1530527744,"UL2":1532100608,"UL3":1542782976}
{"topic":"b256ea3f.ead7c","messageId":"5f6f2b6d4a6d37a91c8168ca","payload":[0,4999,65535,65535,65535,65535,65535,65535,0,1875,65535,65535,65535,65535,32768,0,32768,0,65535,65535,65535,65535,255,65533,255,65533,32768,0,32768,0,65535,65535,65535,65535,0,0,0,0,255,65533,255,65533,255,65533,255,65533,255,65533,255,65533,65535,65244],"queueLengthByUnitId":{"unitId":3,"queueLength":3},"queueUnitId":3,"unitId":3,"modbusRequest":{"value":1601121133656,"unitid":"","fc":4,"address":"31447","quantity":"52","messageId":"5f6f2b6d4a6d37a91c8168ca"},"responseBuffer":{"data":[0,4999,65535,65535,65535,65535,65535,65535,0,1875,65535,65535,65535,65535,32768,0,32768,0,65535,65535,65535,65535,255,65533,255,65533,32768,0,32768,0,65535,65535,65535,65535,0,0,0,0,255,65533,255,65533,255,65533,255,65533,255,65533,255,65533,65535,65244],"buffer":[0,0,19,135,255,255,255,255,255,255,255,255,255,255,255,255,0,0,7,83,255,255,255,255,255,255,255,255,128,0,0,0,128,0,0,0,255,255,255,255,255,255,255,255,0,255,255,253,0,255,255,253,128,0,0,0,128,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,255,255,253,0,255,255,253,0,255,255,253,0,255,255,253,0,255,255,253,0,255,255,253,255,255,254,220]},"_msgid":"a5a6c72b.80cb98"}
{"Hz":327614464,"var":-33619840}

I hope I made it right now :pleading_face:

Hz should be 49,95 - 50,05
T2 should be 36°C
PDC2 1500-2000W
PAC2 same

Ok, now can you post a link to your manual that lists register 31447 as HZ value.

Never mind, found it.

So, in your linked doc...

Metering.GridMs.Hz 31447 2 U32 FIX2

it says 31447 Hz is U32 Unsigned Int 32. however, it then says FIX2 suggesting its a float.

its read as an int and then it needs to be divided by 100 ?

[OFF TOPIC] that would a nice feature for buffer parser to do a 'scaling' on the value for these cases

Same here.

Waaaaay ahead of ya :wink:

So the settings you need in the buffer parser are NO SWAP and use the BIG ENDIAN (be) functions...

Yes, yes, and yes...

[{"id":"dba0f9a0.21afa8","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":360,"wires":[["6eb5eb5c.6984c4","b4c957d.a86dba8","47286846.5b20c8","c938e90a.ef2b38"]]},{"id":"6eb5eb5c.6984c4","type":"modbus-getter","z":"a605bf7e.09445","name":"30773 ~ 30869","showStatusActivities":false,"showErrors":true,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"30773","quantity":"96","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":400,"y":280,"wires":[["c49c1095.5511b","841e26c7.739b58"],[]]},{"id":"b4c957d.a86dba8","type":"modbus-getter","z":"a605bf7e.09445","name":"30953 ~ 30955","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"30953","quantity":"2","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":400,"y":360,"wires":[["5db7c6a0.c8bbe8","929cd654.324a78"],[]]},{"id":"47286846.5b20c8","type":"modbus-getter","z":"a605bf7e.09445","name":"31253 ~ 31259","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"31253","quantity":"6","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":400,"y":440,"wires":[["c57020b8.f203f","e3a62aee.437e18"],[]]},{"id":"c938e90a.ef2b38","type":"modbus-getter","z":"a605bf7e.09445","name":"31447 ~ 31499","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"","dataType":"InputRegister","adr":"31447","quantity":"52","server":"7b9a0315.71ca9c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":400,"y":520,"wires":[["1cbe3f09.d66c41","94e91a35.a25ff8"],[]]},{"id":"c49c1095.5511b","type":"buffer-parser","z":"a605bf7e.09445","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32be","name":"PDC2","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"PAC2","offset":4,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"Pbez","offset":184,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"Pein","offset":188,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":280,"wires":[["2dc6cfe8.e3b2a","e5a74da9.d9a4a","937504b6.9650e8","daf78158.70ee9","1b3a46a6.569529"]]},{"id":"5db7c6a0.c8bbe8","type":"buffer-parser","z":"a605bf7e.09445","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32be","name":"T2","offset":0,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"swap16","swap3":"swap32","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":360,"wires":[["da8c3c36.a8aa1","bdc43ef9.2684c"]]},{"id":"c57020b8.f203f","type":"buffer-parser","z":"a605bf7e.09445","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32le","name":"UL1","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"UL2","offset":4,"length":1,"offsetbit":0,"mask":""},{"type":"int32le","name":"UL3","offset":8,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":440,"wires":[["5d151875.5d3d48","b3c044a6.6e6458","436f3d5c.30be54","f4b04c08.49eb1"]]},{"id":"1cbe3f09.d66c41","type":"buffer-parser","z":"a605bf7e.09445","name":"","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"Hz","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"var","offset":100,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":520,"wires":[["b7049802.006068","63c9e641.965d88","d6bac605.18e9a8"]]},{"id":"2dc6cfe8.e3b2a","type":"debug","z":"a605bf7e.09445","name":"parser1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":840,"y":120,"wires":[]},{"id":"e5a74da9.d9a4a","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":1,"width":0,"height":0,"name":"P-ein","label":"<font color=green> Leistung Einspeisung","format":"{{msg.payload.Pein}} W","layout":"row-spread","x":830,"y":160,"wires":[]},{"id":"937504b6.9650e8","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":2,"width":0,"height":0,"name":"P-bez","label":"<font color=red> Leistung Bezug","format":"{{msg.payload.Pbez}} W","layout":"row-spread","x":830,"y":200,"wires":[]},{"id":"daf78158.70ee9","type":"ui_text","z":"a605bf7e.09445","group":"5be273cb.ceaddc","order":1,"width":0,"height":0,"name":"P-AC2","label":"Leistung AC","format":"{{msg.payload.PAC2}} W","layout":"row-spread","x":830,"y":240,"wires":[]},{"id":"1b3a46a6.569529","type":"ui_text","z":"a605bf7e.09445","group":"5be273cb.ceaddc","order":2,"width":0,"height":0,"name":"P-DC2","label":"<font color=orange> Leistung DC","format":"{{msg.payload.PDC2}} W","layout":"row-spread","x":830,"y":280,"wires":[]},{"id":"da8c3c36.a8aa1","type":"ui_text","z":"a605bf7e.09445","group":"5be273cb.ceaddc","order":3,"width":0,"height":0,"name":"T2","label":"Temperatur","format":"{{msg.payload.T2}} °C","layout":"row-spread","x":830,"y":380,"wires":[]},{"id":"bdc43ef9.2684c","type":"debug","z":"a605bf7e.09445","name":"parser2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":840,"y":340,"wires":[]},{"id":"5d151875.5d3d48","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":3,"width":0,"height":0,"name":"U-L1","label":"Spannung L1","format":"{{msg.payload.UL1}} V","layout":"row-spread","x":830,"y":480,"wires":[]},{"id":"b3c044a6.6e6458","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":4,"width":0,"height":0,"name":"U-L2","label":"Spannung L2","format":"{{msg.payload.UL2}} V","layout":"row-spread","x":830,"y":520,"wires":[]},{"id":"436f3d5c.30be54","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":5,"width":0,"height":0,"name":"U-L3","label":"Spannung L3","format":"{{msg.payload.UL3}} V","layout":"row-spread","x":830,"y":560,"wires":[]},{"id":"f4b04c08.49eb1","type":"debug","z":"a605bf7e.09445","name":"parser3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":840,"y":440,"wires":[]},{"id":"b7049802.006068","type":"ui_text","z":"a605bf7e.09445","group":"8a11e8c7.342528","order":6,"width":0,"height":0,"name":"Hz","label":"Frequenz","format":"{{msg.payload}} Hz","layout":"row-spread","x":830,"y":660,"wires":[]},{"id":"63c9e641.965d88","type":"ui_text","z":"a605bf7e.09445","group":"5be273cb.ceaddc","order":3,"width":0,"height":0,"name":"var","label":"Blindleistung","format":"{{msg.payload}} var","layout":"row-spread","x":830,"y":700,"wires":[]},{"id":"d6bac605.18e9a8","type":"debug","z":"a605bf7e.09445","name":"parser4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":840,"y":620,"wires":[]},{"id":"737d118c.a9597","type":"comment","z":"a605bf7e.09445","name":"STP6.0-3AV-40","info":"","x":140,"y":320,"wires":[]},{"id":"f6b1a0c2.05d6a","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":355,"y":240,"wires":[["e7e75d67.fa569"]],"l":false},{"id":"e7e75d67.fa569","type":"function","z":"a605bf7e.09445","name":"fake it","func":"\nreturn { \"topic\": \"df8249b3.d3713\", \n\"messageId\": \"5f6f2b6d4a6d37a91c8168c7\", \n\"payload\": [0, 1450, 0, 1437, 0, 477, 0, 475, 0, 485, 0, 23102, 0, 23162, 0, 23264, 0, 40102, 0, 40124, 0, 40188, 0, 6355, 65535, 65535, 65535, 65535, 65535, 65535, 0, 5000, 32768, 0, 65535, 65441, 65535, 65435, 65535, 65440, 0, 1466, 0, 489, 0, 488, 0, 497, 65535, 65535, 255, 65533, 255, 65533, 0, 0, 0, 0, 32768, 0, 255, 65533, 0, 1079, 0, 6000, 0, 100, 65535, 65535, 32768, 0, 65535, 65535, 65535, 65535, 32768, 0, 65535, 65535, 255, 65533, 65535, 65535, 32768, 0, 255, 65533, 32768, 0, 65535, 65535, 0, 0, 0, 1697], \"queueLengthByUnitId\": { \"unitId\": 3, \"queueLength\": 0 }, \"queueUnitId\": 3, \"unitId\": 3, \"modbusRequest\": { \"value\": 1601121133656, \"unitid\": \"\", \"fc\": 4, \"address\": \"30773\", \"quantity\": \"96\", \"messageId\": \"5f6f2b6d4a6d37a91c8168c7\" }, \"responseBuffer\": { \"data\": [0, 1450, 0, 1437, 0, 477, 0, 475, 0, 485, 0, 23102, 0, 23162, 0, 23264, 0, 40102, 0, 40124, 0, 40188, 0, 6355, 65535, 65535, 65535, 65535, 65535, 65535, 0, 5000, 32768, 0, 65535, 65441, 65535, 65435, 65535, 65440, 0, 1466, 0, 489, 0, 488, 0, 497, 65535, 65535, 255, 65533, 255, 65533, 0, 0, 0, 0, 32768, 0, 255, 65533, 0, 1079, 0, 6000, 0, 100, 65535, 65535, 32768, 0, 65535, 65535, 65535, 65535, 32768, 0, 65535, 65535, 255, 65533, 65535, 65535, 32768, 0, 255, 65533, 32768, 0, 65535, 65535, 0, 0, 0, 1697], \n\"buffer\": Buffer.from([0, 0, 5, 170, 0, 0, 5, 157, 0, 0, 1, 221, 0, 0, 1, 219, 0, 0, 1, 229, 0, 0, 90, 62, 0, 0, 90, 122, 0, 0, 90, 224, 0, 0, 156, 166, 0, 0, 156, 188, 0, 0, 156, 252, 0, 0, 24, 211, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 19, 136, 128, 0, 0, 0, 255, 255, 255, 161, 255, 255, 255, 155, 255, 255, 255, 160, 0, 0, 5, 186, 0, 0, 1, 233, 0, 0, 1, 232, 0, 0, 1, 241, 255, 255, 255, 255, 0, 255, 255, 253, 0, 255, 255, 253, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 255, 255, 253, 0, 0, 4, 55, 0, 0, 23, 112, 0, 0, 0, 100, 255, 255, 255, 255, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 128, 0, 0, 0, 255, 255, 255, 255, 0, 255, 255, 253, 255, 255, 255, 255, 128, 0, 0, 0, 0, 255, 255, 253, 128, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 6, 161]) }, \"_msgid\": \"69b494d7.52af2c\" };","outputs":1,"noerr":0,"x":430,"y":240,"wires":[["c49c1095.5511b","841e26c7.739b58"]]},{"id":"b55d4f3d.df621","type":"function","z":"a605bf7e.09445","name":"fake it","func":"\nvar m = {\"topic\":\"5909172b.d6bb18\",\"messageId\":\"5f6f2b6d4a6d37a91c8168c8\",\"payload\":[0,364],\"queueLengthByUnitId\":{\"unitId\":3,\"queueLength\":1},\"queueUnitId\":3,\"unitId\":3,\"modbusRequest\":{\"value\":1601121133656,\"unitid\":\"\",\"fc\":4,\"address\":\"30953\",\"quantity\":\"2\",\"messageId\":\"5f6f2b6d4a6d37a91c8168c8\"},\"responseBuffer\":{\"data\":[0,364],\"buffer\":[0,0,1,108]},\"_msgid\":\"251472d0.ce518e\"}\nm.responseBuffer.buffer = Buffer.from([0,0,1,108])\n\nreturn m;","outputs":1,"noerr":0,"x":430,"y":320,"wires":[["5db7c6a0.c8bbe8","929cd654.324a78"]]},{"id":"8c2e5572.2137c8","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":355,"y":320,"wires":[["b55d4f3d.df621"]],"l":false},{"id":"83a41576.2a8328","type":"function","z":"a605bf7e.09445","name":"fake it","func":"\nvar m = { \"topic\": \"5f9e2884.d556c8\", \n\"messageId\": \"5f6f2b6d4a6d37a91c8168c9\", \n\"payload\": [0, 23354, 0, 23378, 0, 23541], \"queueLengthByUnitId\": { \"unitId\": 3, \"queueLength\": 2 }, \"queueUnitId\": 3, \"unitId\": 3, \"modbusRequest\": { \"value\": 1601121133656, \"unitid\": \"\", \"fc\": 4, \"address\": \"31253\", \"quantity\": \"6\", \"messageId\": \"5f6f2b6d4a6d37a91c8168c9\" }, \"responseBuffer\": { \"data\": [0, 23354, 0, 23378, 0, 23541], \"buffer\": Buffer.from([0, 0, 91, 58, 0, 0, 91, 82, 0, 0, 91, 245]) }, \"_msgid\": \"4b84a5f0.bf6a0c\" }\n\n\nreturn m;","outputs":1,"noerr":0,"x":430,"y":400,"wires":[["c57020b8.f203f","e3a62aee.437e18"]]},{"id":"c88edd8e.40a5f","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":355,"y":400,"wires":[["83a41576.2a8328"]],"l":false},{"id":"459de81e.286c98","type":"function","z":"a605bf7e.09445","name":"fake it","func":"\n\n\n\n\nvar m = { \"topic\": \"b256ea3f.ead7c\", \n\"messageId\": \"5f6f2b6d4a6d37a91c8168ca\", \n\"payload\": [0, 4999, 65535, 65535, 65535, 65535, 65535, 65535, 0, 1875, 65535, 65535, 65535, 65535, 32768, 0, 32768, 0, 65535, 65535, 65535, 65535, 255, 65533, 255, 65533, 32768, 0, 32768, 0, 65535, 65535, 65535, 65535, 0, 0, 0, 0, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 65535, 65244], \"queueLengthByUnitId\": { \"unitId\": 3, \"queueLength\": 3 }, \"queueUnitId\": 3, \"unitId\": 3, \"modbusRequest\": { \"value\": 1601121133656, \"unitid\": \"\", \"fc\": 4, \"address\": \"31447\", \"quantity\": \"52\", \"messageId\": \"5f6f2b6d4a6d37a91c8168ca\" }, \"responseBuffer\": { \"data\": [0, 4999, 65535, 65535, 65535, 65535, 65535, 65535, 0, 1875, 65535, 65535, 65535, 65535, 32768, 0, 32768, 0, 65535, 65535, 65535, 65535, 255, 65533, 255, 65533, 32768, 0, 32768, 0, 65535, 65535, 65535, 65535, 0, 0, 0, 0, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 255, 65533, 65535, 65244], \"buffer\": [0, 0, 19, 135, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 7, 83, 255, 255, 255, 255, 255, 255, 255, 255, 128, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 253, 0, 255, 255, 253, 128, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 255, 255, 254, 220] }, \"_msgid\": \"a5a6c72b.80cb98\" }\nm.responseBuffer.buffer = Buffer.from([0, 0, 19, 135, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 7, 83, 255, 255, 255, 255, 255, 255, 255, 255, 128, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 253, 0, 255, 255, 253, 128, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 0, 255, 255, 253, 255, 255, 254, 220])\n\nreturn m;","outputs":1,"noerr":0,"x":430,"y":480,"wires":[["1cbe3f09.d66c41","94e91a35.a25ff8"]]},{"id":"690f13c8.cfb26c","type":"inject","z":"a605bf7e.09445","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":355,"y":480,"wires":[["459de81e.286c98"]],"l":false},{"id":"94e91a35.a25ff8","type":"debug","z":"a605bf7e.09445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":480,"wires":[]},{"id":"929cd654.324a78","type":"debug","z":"a605bf7e.09445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":320,"wires":[]},{"id":"841e26c7.739b58","type":"debug","z":"a605bf7e.09445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":240,"wires":[]},{"id":"e3a62aee.437e18","type":"debug","z":"a605bf7e.09445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":400,"wires":[]},{"id":"7b9a0315.71ca9c","type":"modbus-client","z":"","name":"STP6.0","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.168.50","tcpPort":"502","tcpType":"TPC-RTU-BUFFERED","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":3,"commandDelay":200,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true},{"id":"8a11e8c7.342528","type":"ui_group","z":"","name":"Energy Meter","tab":"78892c6f.892384","order":2,"disp":true,"width":"6","collapse":false},{"id":"5be273cb.ceaddc","type":"ui_group","z":"","name":"Sunny Tripower","tab":"78892c6f.892384","order":2,"disp":true,"width":"6","collapse":false},{"id":"78892c6f.892384","type":"ui_tab","z":"","name":"Photovoltaik","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

NOTES...

  • Read the manual - especially 3.5.7 SMA Data Types and 3.5.8 SMA Data Formats
  • the idea behind grouping modbus reads & using the buffer parser and using an offset reduces comms, improves performance and simplifies data - HOWEVER you need to be aware of the data sizes, data tyes & byte offsets to get the correct value.
    e.g. if you need 30447 (SINT) & 30449 (UINT32) then read 4 items, offset 0 will have the value of 30447 and offset 4 will have the value of 30449
2 Likes

you did it :kissing_heart:

but I don´t understand the logic how it works :confounded:

I need


31497

your flow got the right value with:
grafik
reading 31447 +52 to 31499

the buffer parser reads offset 100 :face_with_monocle: :face_with_raised_eyebrow:

don´t understand - but it is the right value :thinking:

offset it a byte value

FIRSTLY and most importantly, MODBUS registers are 16 bit values (2x 8bits) - bear that in mind for then following info...


In this particular part, we read 52 WORDS (16 bit values) (AKA 104 bytes) starting at address item 31447

therefore...

if START ADRRESS = 31447 and we get a 16 bit value then

  • byte 0 is lower 8 bits (lo byte) of 31447
  • byte 1 is the high byte (another 8 bits) of 31447

so the next value in 31448 MUST BE...

  • byte 2 is lower 8 bits (lo byte) of 31448
  • byte 3 is the high byte (another 8 bits) or 31448

NOW - you need 32 bit values (i.e. addresses 31447 and 31448 make up the UINT32)
In other words, you need bytes 0 ~ 3 to have the correct 32 bit value.

If you make the MODBUS read an ARRAY of 52 WORDS (AKA 104 bytes) then the very last byte is in position 103

Now, you need 4 bytes to make a 32 bit value so byte 100, 101, 102 and 103 are needed - hence the offset into the byte data is 100.


START ADRRESS = 31447
address Index byte offset Reason
31447 0 0 Start address + (index * 2 bytes)
31448 1 2 Start address + (index * 2 bytes)
31449 2 4 Start address + (index * 2 bytes)
- - - -
31497 50 100 Start address + (index * 2 bytes)

Does this look familiar...

... ^ look at the buf parser byte offset i wrote for var ^

I wrote that out to help you but I guess you didnt take the time to absorb it :frowning:


PS, read the built in help...

image

1 Like

Hats off .. we can surely say that the above is the correct solution.
you can freely move the solution to Steve's :wink:

even if i had my small contribution with the Join nodes haha

1 Like

I read his explanation 5 times, but I don´t understand it 100% and the problem I got. I'm too stupid for that sorry.

The Modbus Server (Inverter) don´t like multiple simultaneous requests, than he crashs.

how can I integrade Steves solution in the "Modbus Flex Getter" i build (every 5s one request of all) ?

I tried the value "var" to get in the buffer parser, but I dont work (yes I dont understand the logic behind, sorry).

2 alternatives...

1...
Do the reads in series...

2...
Where your join node connects to the multiple functions, you could replace them functions with buffer parser nodes with one entry in (zero offset) converting the ARRAY value to correct tpye

In the Modbus Flex Getter device configuration you can you try to increase the Queue delay ?
For example if you send the flex getter 4 messages .. the node has a built in queue that you can set its delay.

image

Also you may use the Modbus Queue Info node to monitor the queued messages. You dont need to wire this node to anyware .. but simply configure it to monitor your device.
image
and see how many messages are being handled there ?!

1 Like

@UnborN great minds think alike ...

image

I will publish an update to buffer-parser soon :slight_smile:

1 Like

I thought I understand it, but I don´t :sleepy:

==> 31435 (S32)


quantity to 4 => 32bit (2x 16bit)


don´t work :unamused:

:nauseated_face:

Show me the code in the function that feeds into the buffer parser.

read post 34 again

i hate to be the bearer of bad news .. but you have to start with a clean flow .. and copy paste any parts you may need from the old DISABLED flow :wink:

besides all important logic is from Steve's flow

1 Like

New Test Flow ---> till I understand it just easy going!


grafik

grafik

=>bullshit value

edit, i think I got my mistake: offset has to be 0 :face_with_hand_over_mouth:

tomorrow I can test the reactive power... now it´s dark outside :wink: -> no sun power

And what does the above value supposed to represent ?
what is the expected value ?

this ?
Metering.GridMs.A.phsA 31435 2 S32 FIX3 RO A Grid current phase L1

yes .. since you are only reading that specific value

and after, with a function, you have to divide it by 1000 to get the correct result because it says its FIX3
unless you updated to the latest version of buffer parser :wink: that has a scale option

In my old flow it doesn´t work - damn.

just the same as in the test flow:




but this time trash output