Hi there,
I would need your help please:
Reading 24 registers of a modbus TCP device:
And want to get the values. These are represented as followed:
How do I have setup the "puffer parser node", to get the values of the
current correctly? The output is an array of two words:
[
0,23758,
0,23817,
0,23873,
0,5000,
2,21400,
1,61664,
1,63560,
0,31044,
0,8869,
0,3992,
0,9726,
0,911
]
In Modbus Doctor, the setting of 32 bit word, unsigned and "swap words" is working well.
Flow:
[{"id":"a15ab1d7.fa063","type":"tab","label":"Stom","disabled":false,"info":""},{"id":"fa8953c2.b8e12","type":"function","z":"a15ab1d7.fa063","name":"Request","func":"msg.payload = { value: msg.payload,\n'fc': 3,\n'unitid': 255, \n'address': 50520 , \n'quantity': 24 }; \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":270,"y":38.00000762939453,"wires":[["4655e9ec.33a088"]]},{"id":"4655e9ec.33a088","type":"modbus-flex-getter","z":"a15ab1d7.fa063","name":"","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"d91e649d.344078","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":116.99998474121094,"y":94,"wires":[["209f93df.379b64","9dd4f771.e5aa88","66bdb7d5.b565d","b8e2078f.0334e8","cfb413bc.98f5d","e34f0bc5.81f57","6582ed29.ff8cbc","da1fff57.5f5da8"],[]]},{"id":"397df8c7.ed4e68","type":"inject","z":"a15ab1d7.fa063","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":111,"y":38.00000762939453,"wires":[["fa8953c2.b8e12"]]},{"id":"68912e04.eaf89","type":"debug","z":"a15ab1d7.fa063","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":334.25,"y":160.66666412353516,"wires":[]},{"id":"209f93df.379b64","type":"function","z":"a15ab1d7.fa063","name":"U Phase 1","func":"msg.payload=msg.payload[1]/100;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":124.16667175292969,"y":161.16665649414062,"wires":[["68912e04.eaf89"]]},{"id":"da1fff57.5f5da8","type":"debug","z":"a15ab1d7.fa063","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530.25,"y":82.66666412353516,"wires":[]},{"id":"9dd4f771.e5aa88","type":"function","z":"a15ab1d7.fa063","name":"U Phase 2","func":"msg.payload=msg.payload[3]/100;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":126.16667175292969,"y":206.1666488647461,"wires":[["36b0b5e0.6083ea"]]},{"id":"66bdb7d5.b565d","type":"function","z":"a15ab1d7.fa063","name":"U Phase 3","func":"msg.payload=msg.payload[5]/100;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":126.16667175292969,"y":253.1666488647461,"wires":[["74bb973e.9dc068"]]},{"id":"36b0b5e0.6083ea","type":"debug","z":"a15ab1d7.fa063","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":335.16668701171875,"y":207.16665649414062,"wires":[]},{"id":"74bb973e.9dc068","type":"debug","z":"a15ab1d7.fa063","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":335.16668701171875,"y":253.16665649414062,"wires":[]},{"id":"b8e2078f.0334e8","type":"function","z":"a15ab1d7.fa063","name":"Frequenz","func":"msg.payload=msg.payload[7]/100;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":117.16667175292969,"y":301.1666488647461,"wires":[["534780a1.52c43"]]},{"id":"e34f0bc5.81f57","type":"function","z":"a15ab1d7.fa063","name":"I Phase 2","func":"msg.payload=msg.payload[11]/1000;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":116.16667175292969,"y":395.1666488647461,"wires":[["3a5ece87.e14efa"]]},{"id":"cfb413bc.98f5d","type":"function","z":"a15ab1d7.fa063","name":"I Phase 3","func":"msg.payload=msg.payload[13]/1000;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":118.16667175292969,"y":443.1666564941406,"wires":[["761129e7.60ee68"]]},{"id":"534780a1.52c43","type":"debug","z":"a15ab1d7.fa063","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":333.16668701171875,"y":302.1666564941406,"wires":[]},{"id":"12fab663.b2db52","type":"debug","z":"a15ab1d7.fa063","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":428.16668701171875,"y":346.1666564941406,"wires":[]},{"id":"3a5ece87.e14efa","type":"debug","z":"a15ab1d7.fa063","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":331.16668701171875,"y":396.1666564941406,"wires":[]},{"id":"761129e7.60ee68","type":"debug","z":"a15ab1d7.fa063","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":330.16668701171875,"y":442.1666564941406,"wires":[]},{"id":"6582ed29.ff8cbc","type":"buffer-parser","z":"a15ab1d7.fa063","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32le","name":"item1","offset":9,"length":2,"offsetbit":0,"scale":1,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":126.33335876464844,"y":347,"wires":[["12fab663.b2db52"]]},{"id":"d91e649d.344078","type":"modbus-client","name":"Diris A30 HV linkes Feld","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.130.161","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"255","commandDelay":"1","clientTimeout":"500","reconnectOnTimeout":false,"reconnectTimeout":"500","parallelUnitIdsAllowed":true}]
Thanks, Frank