-
Yes - same as you can have bytes, ints UINTs 16bit/32bit whatever you want.
Yeah , i tried for 16bit/32bit, but my question is whether it works for biguint64(be) . i tried with Uint32(be) & biguint64(be ) output property - msg.payload and output as key/value
i got error for biguint64 as NAN
-
paste the full debug message into a reply formatted as code (between ````` backticks)
[{"id":"39389276.d99bfe","type":"inject","z":"8ace6ce4.5870f","name":"ENERGY_Test","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":160,"y":180,"wires":[["c9bf96ed.801f28","6435d039.e9a9a","7827f28b.08cf5c","2f67b1c0.9232ee","3fab6935.0ffff6"]]},{"id":"c9bf96ed.801f28","type":"function","z":"8ace6ce4.5870f","name":"address:0","func":"msg.payload ={\n 'fc':3,\n 'unitid':1,\n 'address':0,\n 'quantity':24\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":100,"wires":[["617bb675.945568"]]},{"id":"2f67b1c0.9232ee","type":"function","z":"8ace6ce4.5870f","name":"address:80","func":"msg.payload ={\n 'fc':3,\n 'unitid':1,\n 'address':80,\n 'quantity':50\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":180,"wires":[["53c48d6a.e5ee24"]]},{"id":"53c48d6a.e5ee24","type":"modbus-flex-getter","z":"8ace6ce4.5870f","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"84124d7e.073d7","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":540,"y":180,"wires":[["b824dca1.d8def"],[]]},{"id":"3fab6935.0ffff6","type":"function","z":"8ace6ce4.5870f","name":"address:1024","func":"msg.payload ={\n value: msg.payload,\n 'fc':3,\n 'unitid':1,\n 'address':1024,\n 'quantity':36\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":260,"wires":[["d747403d.71168"]]},{"id":"d747403d.71168","type":"modbus-flex-getter","z":"8ace6ce4.5870f","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"84124d7e.073d7","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":540,"y":260,"wires":[["c0b7df5f.e830d"],[]]},{"id":"b824dca1.d8def","type":"buffer-parser","z":"8ace6ce4.5870f","name":"DPF/TAN/THDV/THD","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32be","name":"DPF1","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"DPF2","offset":4,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"DPF3","offset":8,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"TAN1","offset":12,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"TAN2","offset":16,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"TAN3","offset":20,"length":1,"offsetbit":0,"mask":""},{"type":"int32be","name":"TANSys","offset":24,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDV1","offset":28,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDV2","offset":32,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDV3","offset":36,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDV12","offset":40,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDV23","offset":44,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDV31","offset":48,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDA1","offset":52,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDA2","offset":56,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDA3","offset":60,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"THDAN","offset":64,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"Freq","offset":68,"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":720,"y":180,"wires":[["9484b6e8.42c078"]]},{"id":"c0b7df5f.e830d","type":"buffer-parser","z":"8ace6ce4.5870f","name":"Energy","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"bigint64be","name":"KWH_1i","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"bigint64be","name":"KWH_1e","offset":8,"length":1,"offsetbit":0,"mask":""},{"type":"bigint64be","name":"KWH_2i","offset":16,"length":1,"offsetbit":0,"mask":""},{"type":"bigint64be","name":"KWH_2e","offset":24,"length":1,"offsetbit":0,"mask":""},{"type":"bigint64be","name":"KWH_3i","offset":32,"length":1,"offsetbit":0,"mask":""},{"type":"bigint64be","name":"KWH_3e","offset":40,"length":1,"offsetbit":0,"mask":""},{"type":"bigint64be","name":"KWH_Sysi","offset":48,"length":1,"offsetbit":0,"mask":""},{"type":"bigint64be","name":"KWH_Syse","offset":56,"length":1,"offsetbit":0,"mask":""},{"type":"bigint64be","name":"KWH_BAL","offset":64,"length":1,"offsetbit":0,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"bigValues","msgPropertyType":"str","resultType":"object","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":680,"y":260,"wires":[["93e621ee.5566"]]},{"id":"6435d039.e9a9a","type":"function","z":"8ace6ce4.5870f","name":"address:24","func":"msg.payload ={\n value: msg.payload,\n 'fc':3,\n 'unitid':1,\n 'address':24,\n 'quantity': 48\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":370,"y":220,"wires":[["a4811bce.1399b8"]]},{"id":"119bf36b.21c0ad","type":"function","z":"8ace6ce4.5870f","name":"ReadInt 64","func":" msg.payload = {\n \n P1 : Number(msg.bigValues.P1.value),\n P2 : Number(msg.bigValues.P2.value),\n P3 : Number(msg.bigValues.P3.value),\n Psys : Number(msg.bigValues.Psys.value), \n S1 : Number(msg.bigValues.S1.value),\n S2 : Number(msg.bigValues.S2.value), \n S3 : Number(msg.bigValues.S3.value),\n Ssys : Number(msg.bigValues.Ssys.value),\n Q1 : Number(msg.bigValues.Q1.value),\n Q2 : Number(msg.bigValues.Q2.value), \n Q3 : Number(msg.bigValues.Q3.value),\n Qsys : Number(msg.bigValues.Qsys.value),\n }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":790,"y":220,"wires":[["9484b6e8.42c078"]]},{"id":"74894602.da35b8","type":"buffer-parser","z":"8ace6ce4.5870f","name":"P/S/Q","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"biguint64be","name":"P1","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"P2","offset":8,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"P3","offset":16,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"Psys","offset":24,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"S1","offset":32,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"S2","offset":40,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"S3","offset":48,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Ssys","offset":56,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Q1","offset":64,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Q2","offset":72,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Q3","offset":80,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Qsys","offset":88,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"bigValues","msgPropertyType":"str","resultType":"object","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":650,"y":220,"wires":[["119bf36b.21c0ad"]]},{"id":"93e621ee.5566","type":"function","z":"8ace6ce4.5870f","name":"ReadInt 64","func":" msg.payload = \n {\n\nKWH_1i : Number(msg.bigValues.KWH_1i.value),\nKWH_1e : Number(msg.bigValues.KWH_1e.value),\nKWH_2i : Number(msg.bigValues.KWH_2i.value),\nKWH_2e : Number(msg.bigValues.KWH_2e.value), \nKWH_3i : Number(msg.bigValues.KWH_3i.value),\nKWH_3e : Number(msg.bigValues.KWH_3e.value),\nKWH_Sysi : Number(msg.bigValues.KWH_Sysi.value),\nKWH_Syse : Number(msg.bigValues.KWH_Syse.value), \nKWH_BAL : Number(msg.bigValues.KWH_BAL.value),\n\n }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":260,"wires":[["9484b6e8.42c078"]]},{"id":"9484b6e8.42c078","type":"join","z":"8ace6ce4.5870f","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"7","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":850,"y":120,"wires":[["4656a476.aad35c"]]},{"id":"a9e3215d.59886","type":"buffer-parser","z":"8ace6ce4.5870f","name":"PF","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32be","name":"PF1","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"int32be","name":"PF2","offset":4,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"int32be","name":"PF3","offset":8,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"int32be","name":"PFsys","offset":12,"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,"setTopic":true,"x":670,"y":140,"wires":[["9484b6e8.42c078"]]},{"id":"7827f28b.08cf5c","type":"function","z":"8ace6ce4.5870f","name":"address:72","func":"msg.payload ={\n 'fc':3,\n 'unitid':1,\n 'address':72,\n 'quantity':20\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":370,"y":140,"wires":[["9226d2b0.2614b"]]},{"id":"232681e6.a14f0e","type":"buffer-parser","z":"8ace6ce4.5870f","name":"Voltage","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"V1","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"V2","offset":4,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"V3","offset":8,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"V12","offset":12,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"V23","offset":16,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"V31","offset":20,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"Vsys","offset":24,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"A1","offset":28,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"A2","offset":32,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"A3","offset":36,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"AN","offset":40,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"Asys","offset":44,"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,"setTopic":true,"x":660,"y":100,"wires":[["9484b6e8.42c078"]]},{"id":"617bb675.945568","type":"modbus-flex-getter","z":"8ace6ce4.5870f","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"84124d7e.073d7","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":520,"y":100,"wires":[["232681e6.a14f0e"],[]]},{"id":"a4811bce.1399b8","type":"modbus-flex-getter","z":"8ace6ce4.5870f","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"84124d7e.073d7","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":520,"y":220,"wires":[["74894602.da35b8"],[]]},{"id":"9226d2b0.2614b","type":"modbus-flex-getter","z":"8ace6ce4.5870f","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"84124d7e.073d7","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":520,"y":140,"wires":[["a9e3215d.59886"],[]]},{"id":"84124d7e.073d7","type":"modbus-client","z":"","name":"seneca","clienttype":"simpleser","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.1.9","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","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}]
-
If there are 300+ bytes going in - yes
NOTE: You will probably crash node-red accessing more than 200 bytes
Any other possibility to use offset 300 , to prevent from crash
- Yes, but not in buffer parser (yet) - you can simply add a function node after the buffer parser and perform the math required.
I have used in a separate function node that can perform calculations . to make things simpler under 1 bufferparser , I raised that question