Modbus Communication & Buffer Parser Related

Hi,

I need the expertise of yours regarding the challenges that I'm facing regarding Modbus Communication & Buffer Parser. List as follows:

  1. How can I continuously read Modbus register using Modbus Read?
  2. How do I process 16-bit unsigned data using buffer parser?
  3. What are the limitations of Modbus Read?
    3A. How many registers can be read simultaneously?
    3B. What all type of registers can be read simultaneously?
  4. How can I use the output from Buffer Parser for inserting data into SQL database?

Request you to please help.

Those questions are very open ended.

You are likely to get much better help if you actually try something, get stuck & ask a specifc question!

That said...

1 way would be to use an inject node set to repeat every 0.5seconds (or whatever you require)

Send the modbus data to a buffer parser node and add an entry in the UI set to UINT16 (be).

The buffer parser node has EXTENSIVE built in help AND a huge demo (node-red hamburger menu, import, examples, buffer parser)

See also the read me for a description of capabilities.

I think it is 100 WORDS (the library can do more but it crashes node-red when set above 100)

Doesnt matter if you use buffer parser. Just get a buffer and turn it into whatever you want.

This is a whole topic in its self (you dont even state what type of SQL!) however briefly, if you output key/value you can generate SQL INSERT statements in a number of ways. e.g. in a function...

var buff_parser_data = msg.payload;
var sql = `INSERT INTO mytable (col1, col2) VALUES (${buff_parser_data.sensor1},${buff_parser_data.sensor2})`
msg.topic = sql;
return msg;

Hi,

Thanks for your guidance. I'm able to make good progress for the project. I'd need your guidance for converting 32 bit Modbus Register into its actual data.

Please help

  • show us your flow
  • show us the data going in to the buffer-parser (use the "copy data" button that appears in the debug window then post that in your reply)
  • explain what part of the data (which bytes) should be used for your 32 bit data
  • tell us what the 32bit value you expect the data to end up as

e.g. bytes 4~7 should be made into a 32bit float and should read -33.7

Hi,

attached script for reference. for sample purpose, you can help me convert item8, item9, item10 (Unsigned 32-bit) Modbus readings into decimal float point.

{"item1":0,"item2":0,"item3":0,"item4":0,"item5":0,"item6":0,"item7":0,"item8":1724857813,"item9":2728148387,"item10":3669638410,"item11":0,"item12":0,"item13":0,"item14":0,"item15":0,"item16":0,"item17":0,"item18":16256,"item19":16256,"item20":16256,"item21":16256,"item22":0,"item23":0,"item24":0,"item25":0,"item26":0,"item27":0,"item28":0,"item29":0,"item30":0,"item31":0,"item32":0,"item33":0,"item34":3235266133,"item35":3858514867,"item36":0,"item37":0,"item38":2701082026,"item39":16928,"item40":0,"item41":0,"item42":0,"item43":0,"item44":0,"item45":0,"item46":0}

That data doesn't look like it is before buffer parser. You haven't included flow. You haven't explained what values should be. It is literally impossible to help you.

Flow:

[{"id":"ba7f5d09.f1c71","type":"tab","label":"Meter Reading Main","disabled":false,"info":""},{"id":"280f48bf.e28168","type":"catch","z":"ba7f5d09.f1c71","name":"Error Messages","scope":null,"uncaught":false,"x":200,"y":60,"wires":[["18a1c441.f17c6c"]]},{"id":"18a1c441.f17c6c","type":"debug","z":"ba7f5d09.f1c71","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":390,"y":80,"wires":[]},{"id":"79ea06e6.5e4528","type":"ping","z":"ba7f5d09.f1c71","mode":"timed","name":"Energy Meter Communication","host":"169.254.101.100","timer":"1","inputs":0,"x":160,"y":220,"wires":[["a2342d4.0895ad"]]},{"id":"b159f4c0.f7ee18","type":"switch","z":"ba7f5d09.f1c71","name":"EM Ping Successful Check","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"20","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":580,"y":220,"wires":[["6ce3173.6ceffe8"],[]]},{"id":"a2342d4.0895ad","type":"counter","z":"ba7f5d09.f1c71","name":"Ping Count","init":"0","step":"1","lower":"0","upper":"30","mode":"increment","outputs":2,"x":370,"y":220,"wires":[["b159f4c0.f7ee18"],[]]},{"id":"4574127e.047a0c","type":"ping","z":"ba7f5d09.f1c71","mode":"timed","name":"Wi-Fi Gateway Communication","host":"172.20.188.1","timer":"1","inputs":0,"x":150,"y":280,"wires":[["9e580d9.fc824f"]]},{"id":"9e580d9.fc824f","type":"counter","z":"ba7f5d09.f1c71","name":"Ping Count","init":"0","step":"1","lower":"0","upper":"5","mode":"increment","outputs":2,"x":370,"y":280,"wires":[["96f23bb5.302c78"],[]]},{"id":"96f23bb5.302c78","type":"switch","z":"ba7f5d09.f1c71","name":"Wi-Fi Ping Successful Check","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"5","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":580,"y":280,"wires":[["48b141bc.fc933"],[]]},{"id":"6ee6ffe4.732f4","type":"ping","z":"ba7f5d09.f1c71","mode":"timed","name":"SQL Database Communication","host":"10.15.1.207","timer":"1","inputs":0,"x":150,"y":340,"wires":[["c07f7271.1714f"]]},{"id":"c07f7271.1714f","type":"counter","z":"ba7f5d09.f1c71","name":"Ping Count","init":"0","step":"1","lower":"0","upper":"5","mode":"increment","outputs":2,"x":370,"y":340,"wires":[["8dab4e46.d77e"],[]]},{"id":"8dab4e46.d77e","type":"switch","z":"ba7f5d09.f1c71","name":"DB Ping Successful Check","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"5","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":580,"y":340,"wires":[["977421b2.7f7db"],[]]},{"id":"48b141bc.fc933","type":"function","z":"ba7f5d09.f1c71","name":"Wi-Fi Connectivity","func":"msg = {\n    payload : \"Wireless Data Transmission Connectivity Success\" + msg.WiFi_Gateway_Count\n    \n}\nreturn msg;","outputs":1,"noerr":0,"x":810,"y":280,"wires":[[]]},{"id":"977421b2.7f7db","type":"function","z":"ba7f5d09.f1c71","name":"Database Connectivity","func":"msg.payload = {payload : \"SQL Database Connectivity Success\"}\nreturn msg;","outputs":1,"noerr":0,"x":820,"y":340,"wires":[[]]},{"id":"58e564c8.351b2c","type":"inject","z":"ba7f5d09.f1c71","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":400,"wires":[["f5a95e9f.f4f65"]]},{"id":"f5a95e9f.f4f65","type":"exec","z":"ba7f5d09.f1c71","command":"vcgencmd measure_temp","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Raspberry CPU Temperature","x":420,"y":400,"wires":[["88b8784c.5f7098"],[],[]]},{"id":"88b8784c.5f7098","type":"function","z":"ba7f5d09.f1c71","name":"Extract CPU Temp","func":"const re = /^temp=(.*)'C$/gm;\nmsg.payload = msg.payload.replace(re, '$1');\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":400,"wires":[["54ad6393.0e63bc"]]},{"id":"54ad6393.0e63bc","type":"debug","z":"ba7f5d09.f1c71","name":"","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":860,"y":400,"wires":[]},{"id":"6f5b3ac2.d0fdc4","type":"debug","z":"ba7f5d09.f1c71","name":"","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":1710,"y":220,"wires":[]},{"id":"fff02be9.f196b8","type":"trigger","z":"ba7f5d09.f1c71","op1":"","op2":"","op1type":"pay","op2type":"payl","duration":"1","extend":false,"units":"min","reset":"","bytopic":"all","name":"","x":1690,"y":340,"wires":[[]]},{"id":"4b5523b8.b1a0bc","type":"buffer-parser","z":"ba7f5d09.f1c71","name":"32 bit Float Point Data from Meter","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"item1","offset":0,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item2","offset":4,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item3","offset":8,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item4","offset":12,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item5","offset":16,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item6","offset":20,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item7","offset":24,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item8","offset":28,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item9","offset":32,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item10","offset":36,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item11","offset":40,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item12","offset":44,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item13","offset":48,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item14","offset":52,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item15","offset":56,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item16","offset":60,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item17","offset":64,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item18","offset":68,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item19","offset":72,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item20","offset":76,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item21","offset":80,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item22","offset":84,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item23","offset":88,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item24","offset":92,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item25","offset":96,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item26","offset":100,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item27","offset":104,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item28","offset":108,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item29","offset":112,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item30","offset":116,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item31","offset":120,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item32","offset":124,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item33","offset":128,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item34","offset":132,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item35","offset":136,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item36","offset":140,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item37","offset":144,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item38","offset":148,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item39","offset":152,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item40","offset":156,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item41","offset":160,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item42","offset":164,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item43","offset":168,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item44","offset":172,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item45","offset":176,"length":1,"offsetbit":0,"mask":""},{"type":"uint32be","name":"item46","offset":180,"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":1440,"y":220,"wires":[["fff02be9.f196b8","6f5b3ac2.d0fdc4"]]},{"id":"8edec875.685608","type":"modbus-response","z":"ba7f5d09.f1c71","name":"Modbus Readings from Meter","registerShowMax":"2000","x":1430,"y":160,"wires":[]},{"id":"312979ea.14b816","type":"modbus-flex-getter","z":"ba7f5d09.f1c71","name":"Modbus Comm & Data from Meter","showStatusActivities":true,"showErrors":true,"logIOActivities":false,"server":"24e75c93.1360a4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":1140,"y":220,"wires":[["8edec875.685608","4b5523b8.b1a0bc","a415426.c2db9c","7e5519fe.ca5468"],[]]},{"id":"6ce3173.6ceffe8","type":"function","z":"ba7f5d09.f1c71","name":"Modbus Data Reading Function ","func":"msg.payload = { \n    'fc': 3, \n    'unitid': 1, \n    'address': 99 , \n    'quantity': 96\n}\nreturn msg;","outputs":1,"noerr":0,"x":850,"y":220,"wires":[["312979ea.14b816"]]},{"id":"db6bc8e8.40b878","type":"tcp in","z":"ba7f5d09.f1c71","name":"","server":"client","host":"10.15.1.207","port":"1433","datamode":"stream","datatype":"buffer","newline":"","topic":"","base64":false,"x":180,"y":100,"wires":[["18a1c441.f17c6c"]]},{"id":"5ef7d9cd.a72968","type":"function","z":"ba7f5d09.f1c71","name":"Sending Data into SQL","func":"var buff_parser_data = msg.payload;\nvar sql = 'INSERT INTO dbo.NODE_RED_TEST (ID,METER_TYPE)VALUES(${buff_parser_data.item8},${buff_parser_data.item9});'\nmsg.topic = sql;\nreturn msg;","outputs":1,"noerr":0,"x":1720,"y":420,"wires":[[]]},{"id":"a415426.c2db9c","type":"file","z":"ba7f5d09.f1c71","name":"","filename":"Modbus Compare.xlsx","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":1400,"y":120,"wires":[[]]},{"id":"b9ae8df0.9568a","type":"exec","z":"ba7f5d09.f1c71","command":"date","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Raspberry CPU Temperature","x":1140,"y":140,"wires":[["a415426.c2db9c","a78a4a2f.5e0338"],[],[]]},{"id":"3e13e14d.dfb3ee","type":"inject","z":"ba7f5d09.f1c71","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":930,"y":140,"wires":[["b9ae8df0.9568a"]]},{"id":"a78a4a2f.5e0338","type":"debug","z":"ba7f5d09.f1c71","name":"","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":1390,"y":60,"wires":[]},{"id":"7e5519fe.ca5468","type":"debug","z":"ba7f5d09.f1c71","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":1370,"y":280,"wires":[]},{"id":"24e75c93.1360a4","type":"modbus-client","z":"","name":"Secure Elite 440-447 Energy Meter","clienttype":"tcp","bufferCommands":false,"stateLogEnabled":false,"queueLogEnabled":true,"tcpHost":"169.254.101.100","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":false}]

Expected value in 0.01 to 0.9

Again, without data it is impossible to help you.

In order to simulate what you have i need a copy of the data from before the buffer parser...

Which one?

The point was - if you copy data as it leaves the modbus node, I can inject it into the buffer parser without having any of your equipment.

The point of having source data and expected results is so I can check the copied data comes out of the buffer parser correctly.

Change the debug to sho complete message...
image

Copy the full msg as it leaves the modbus node (before the buffer parser)
image

Source data is real time from end-device. Data is getting polled at every 1 second so I suggest if you can put some dummy device or pass on random numbers which can give the expected output it would be great.

We can go for 0.01 for testing purpose.

Please help.

So stop it from polling or just grab one of the messages from debug like i have shown.

I dont have a problem figuring out data - you do - I have no idea what your data is, if it is byte reveresed what bytes contain which items. I am not going to invent some dummy data - because it will work for me - its YOUR data that matters

If you wont capture a single message and paste its value in a reply i cant help you.

Good luck.

1 Like

Msg object as required:

{"topic":"312979ea.14b816","messageId":"5f8714b17903fbeddd2c36d2","payload":{"item1":0,"item2":0,"item3":0,"item4":0,"item5":0,"item6":0,"item7":0,"item8":281755079,"item9":350502301,"item10":2528918800,"item11":0,"item12":0,"item13":0,"item14":0,"item15":0,"item16":0,"item17":0,"item18":16256,"item19":16256,"item20":16256,"item21":16256,"item22":0,"item23":0,"item24":0,"item25":0,"item26":0,"item27":0,"item28":0,"item29":0,"item30":0,"item31":0,"item32":0,"item33":0,"item34":3235266133,"item35":3858514867,"item36":0,"item37":0,"item38":2097692076,"item39":16928,"item40":0,"item41":0,"item42":0,"item43":0,"item44":0,"item45":0,"item46":0},"unitId":1,"modbusRequest":{"unitid":1,"fc":3,"address":99,"quantity":96,"emptyMsgOnFail":true,"keepMsgProperties":false,"messageId":"5f8714b17903fbeddd2c36d2"},"responseBuffer":{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,4299,15815,5348,15773,38588,15632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16256,0,16256,0,16256,0,16256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49366,15957,58876,17331,0,0,0,0,32008,15788,0,16928,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"buffer":[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,16,203,61,199,20,228,61,157,150,188,61,16,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,63,128,0,0,63,128,0,0,63,128,0,0,63,128,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,0,0,0,0,0,0,192,214,62,85,229,252,67,179,0,0,0,0,0,0,0,0,125,8,61,172,0,0,66,32,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]},"_msgid":"f2794381.55066","originalPayload":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,4299,15815,5348,15773,38588,15632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16256,0,16256,0,16256,0,16256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49366,15957,58876,17331,0,0,0,0,32008,15788,0,16928,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"specification":{"options":{"byteSwap":[],"resultType":"keyvalue","singleResult":true,"msgProperty":"payload","setTopic":true},"items":[{"type":"uint32be","name":"item1","offset":0,"length":1,"offsetbit":0,"mask":"","id":0,"value":0},{"type":"uint32be","name":"item2","offset":4,"length":1,"offsetbit":0,"mask":"","id":1,"value":0},{"type":"uint32be","name":"item3","offset":8,"length":1,"offsetbit":0,"mask":"","id":2,"value":0},{"type":"uint32be","name":"item4","offset":12,"length":1,"offsetbit":0,"mask":"","id":3,"value":0},{"type":"uint32be","name":"item5","offset":16,"length":1,"offsetbit":0,"mask":"","id":4,"value":0},{"type":"uint32be","name":"item6","offset":20,"length":1,"offsetbit":0,"mask":"","id":5,"value":0},{"type":"uint32be","name":"item7","offset":24,"length":1,"offsetbit":0,"mask":"","id":6,"value":0},{"type":"uint32be","name":"item8","offset":28,"length":1,"offsetbit":0,"mask":"","id":7,"value":281755079},{"type":"uint32be","name":"item9","offset":32,"length":1,"offsetbit":0,"mask":"","id":8,"value":350502301},{"type":"uint32be","name":"item10","offset":36,"length":1,"offsetbit":0,"mask":"","id":9,"value":2528918800},{"type":"uint32be","name":"item11","offset":40,"length":1,"offsetbit":0,"mask":"","id":10,"value":0},{"type":"uint32be","name":"item12","offset":44,"length":1,"offsetbit":0,"mask":"","id":11,"value":0},{"type":"uint32be","name":"item13","offset":48,"length":1,"offsetbit":0,"mask":"","id":12,"value":0},{"type":"uint32be","name":"item14","offset":52,"length":1,"offsetbit":0,"mask":"","id":13,"value":0},{"type":"uint32be","name":"item15","offset":56,"length":1,"offsetbit":0,"mask":"","id":14,"value":0},{"type":"uint32be","name":"item16","offset":60,"length":1,"offsetbit":0,"mask":"","id":15,"value":0},{"type":"uint32be","name":"item17","offset":64,"length":1,"offsetbit":0,"mask":"","id":16,"value":0},{"type":"uint32be","name":"item18","offset":68,"length":1,"offsetbit":0,"mask":"","id":17,"value":16256},{"type":"uint32be","name":"item19","offset":72,"length":1,"offsetbit":0,"mask":"","id":18,"value":16256},{"type":"uint32be","name":"item20","offset":76,"length":1,"offsetbit":0,"mask":"","id":19,"value":16256},{"type":"uint32be","name":"item21","offset":80,"length":1,"offsetbit":0,"mask":"","id":20,"value":16256},{"type":"uint32be","name":"item22","offset":84,"length":1,"offsetbit":0,"mask":"","id":21,"value":0},{"type":"uint32be","name":"item23","offset":88,"length":1,"offsetbit":0,"mask":"","id":22,"value":0},{"type":"uint32be","name":"item24","offset":92,"length":1,"offsetbit":0,"mask":"","id":23,"value":0},{"type":"uint32be","name":"item25","offset":96,"length":1,"offsetbit":0,"mask":"","id":24,"value":0},{"type":"uint32be","name":"item26","offset":100,"length":1,"offsetbit":0,"mask":"","id":25,"value":0},{"type":"uint32be","name":"item27","offset":104,"length":1,"offsetbit":0,"mask":"","id":26,"value":0},{"type":"uint32be","name":"item28","offset":108,"length":1,"offsetbit":0,"mask":"","id":27,"value":0},{"type":"uint32be","name":"item29","offset":112,"length":1,"offsetbit":0,"mask":"","id":28,"value":0},{"type":"uint32be","name":"item30","offset":116,"length":1,"offsetbit":0,"mask":"","id":29,"value":0},{"type":"uint32be","name":"item31","offset":120,"length":1,"offsetbit":0,"mask":"","id":30,"value":0},{"type":"uint32be","name":"item32","offset":124,"length":1,"offsetbit":0,"mask":"","id":31,"value":0},{"type":"uint32be","name":"item33","offset":128,"length":1,"offsetbit":0,"mask":"","id":32,"value":0},{"type":"uint32be","name":"item34","offset":132,"length":1,"offsetbit":0,"mask":"","id":33,"value":3235266133},{"type":"uint32be","name":"item35","offset":136,"length":1,"offsetbit":0,"mask":"","id":34,"value":3858514867},{"type":"uint32be","name":"item36","offset":140,"length":1,"offsetbit":0,"mask":"","id":35,"value":0},{"type":"uint32be","name":"item37","offset":144,"length":1,"offsetbit":0,"mask":"","id":36,"value":0},{"type":"uint32be","name":"item38","offset":148,"length":1,"offsetbit":0,"mask":"","id":37,"value":2097692076},{"type":"uint32be","name":"item39","offset":152,"length":1,"offsetbit":0,"mask":"","id":38,"value":16928},{"type":"uint32be","name":"item40","offset":156,"length":1,"offsetbit":0,"mask":"","id":39,"value":0},{"type":"uint32be","name":"item41","offset":160,"length":1,"offsetbit":0,"mask":"","id":40,"value":0},{"type":"uint32be","name":"item42","offset":164,"length":1,"offsetbit":0,"mask":"","id":41,"value":0},{"type":"uint32be","name":"item43","offset":168,"length":1,"offsetbit":0,"mask":"","id":42,"value":0},{"type":"uint32be","name":"item44","offset":172,"length":1,"offsetbit":0,"mask":"","id":43,"value":0},{"type":"uint32be","name":"item45","offset":176,"length":1,"offsetbit":0,"mask":"","id":44,"value":0},{"type":"uint32be","name":"item46","offset":180,"length":1,"offsetbit":0,"mask":"","id":45,"value":0}]},"values":[0,0,0,0,0,0,0,281755079,350502301,2528918800,0,0,0,0,0,0,0,16256,16256,16256,16256,0,0,0,0,0,0,0,0,0,0,0,0,3235266133,3858514867,0,0,2097692076,16928,0,0,0,0,0,0,0],"objectResults":{"item1":{"type":"uint32be","name":"item1","offset":0,"length":1,"offsetbit":0,"mask":"","id":0,"value":0},"item2":{"type":"uint32be","name":"item2","offset":4,"length":1,"offsetbit":0,"mask":"","id":1,"value":0},"item3":{"type":"uint32be","name":"item3","offset":8,"length":1,"offsetbit":0,"mask":"","id":2,"value":0},"item4":{"type":"uint32be","name":"item4","offset":12,"length":1,"offsetbit":0,"mask":"","id":3,"value":0},"item5":{"type":"uint32be","name":"item5","offset":16,"length":1,"offsetbit":0,"mask":"","id":4,"value":0},"item6":{"type":"uint32be","name":"item6","offset":20,"length":1,"offsetbit":0,"mask":"","id":5,"value":0},"item7":{"type":"uint32be","name":"item7","offset":24,"length":1,"offsetbit":0,"mask":"","id":6,"value":0},"item8":{"type":"uint32be","name":"item8","offset":28,"length":1,"offsetbit":0,"mask":"","id":7,"value":281755079},"item9":{"type":"uint32be","name":"item9","offset":32,"length":1,"offsetbit":0,"mask":"","id":8,"value":350502301},"item10":{"type":"uint32be","name":"item10","offset":36,"length":1,"offsetbit":0,"mask":"","id":9,"value":2528918800},"item11":{"type":"uint32be","name":"item11","offset":40,"length":1,"offsetbit":0,"mask":"","id":10,"value":0},"item12":{"type":"uint32be","name":"item12","offset":44,"length":1,"offsetbit":0,"mask":"","id":11,"value":0},"item13":{"type":"uint32be","name":"item13","offset":48,"length":1,"offsetbit":0,"mask":"","id":12,"value":0},"item14":{"type":"uint32be","name":"item14","offset":52,"length":1,"offsetbit":0,"mask":"","id":13,"value":0},"item15":{"type":"uint32be","name":"item15","offset":56,"length":1,"offsetbit":0,"mask":"","id":14,"value":0},"item16":{"type":"uint32be","name":"item16","offset":60,"length":1,"offsetbit":0,"mask":"","id":15,"value":0},"item17":{"type":"uint32be","name":"item17","offset":64,"length":1,"offsetbit":0,"mask":"","id":16,"value":0},"item18":{"type":"uint32be","name":"item18","offset":68,"length":1,"offsetbit":0,"mask":"","id":17,"value":16256},"item19":{"type":"uint32be","name":"item19","offset":72,"length":1,"offsetbit":0,"mask":"","id":18,"value":16256},"item20":{"type":"uint32be","name":"item20","offset":76,"length":1,"offsetbit":0,"mask":"","id":19,"value":16256},"item21":{"type":"uint32be","name":"item21","offset":80,"length":1,"offsetbit":0,"mask":"","id":20,"value":16256},"item22":{"type":"uint32be","name":"item22","offset":84,"length":1,"offsetbit":0,"mask":"","id":21,"value":0},"item23":{"type":"uint32be","name":"item23","offset":88,"length":1,"offsetbit":0,"mask":"","id":22,"value":0},"item24":{"type":"uint32be","name":"item24","offset":92,"length":1,"offsetbit":0,"mask":"","id":23,"value":0},"item25":{"type":"uint32be","name":"item25","offset":96,"length":1,"offsetbit":0,"mask":"","id":24,"value":0},"item26":{"type":"uint32be","name":"item26","offset":100,"length":1,"offsetbit":0,"mask":"","id":25,"value":0},"item27":{"type":"uint32be","name":"item27","offset":104,"length":1,"offsetbit":0,"mask":"","id":26,"value":0},"item28":{"type":"uint32be","name":"item28","offset":108,"length":1,"offsetbit":0,"mask":"","id":27,"value":0},"item29":{"type":"uint32be","name":"item29","offset":112,"length":1,"offsetbit":0,"mask":"","id":28,"value":0},"item30":{"type":"uint32be","name":"item30","offset":116,"length":1,"offsetbit":0,"mask":"","id":29,"value":0},"item31":{"type":"uint32be","name":"item31","offset":120,"length":1,"offsetbit":0,"mask":"","id":30,"value":0},"item32":{"type":"uint32be","name":"item32","offset":124,"length":1,"offsetbit":0,"mask":"","id":31,"value":0},"item33":{"type":"uint32be","name":"item33","offset":128,"length":1,"offsetbit":0,"mask":"","id":32,"value":0},"item34":{"type":"uint32be","name":"item34","offset":132,"length":1,"offsetbit":0,"mask":"","id":33,"value":3235266133},"item35":{"type":"uint32be","name":"item35","offset":136,"length":1,"offsetbit":0,"mask":"","id":34,"value":3858514867},"item36":{"type":"uint32be","name":"item36","offset":140,"length":1,"offsetbit":0,"mask":"","id":35,"value":0},"item37":{"type":"uint32be","name":"item37","offset":144,"length":1,"offsetbit":0,"mask":"","id":36,"value":0},"item38":{"type":"uint32be","name":"item38","offset":148,"length":1,"offsetbit":0,"mask":"","id":37,"value":2097692076},"item39":{"type":"uint32be","name":"item39","offset":152,"length":1,"offsetbit":0,"mask":"","id":38,"value":16928},"item40":{"type":"uint32be","name":"item40","offset":156,"length":1,"offsetbit":0,"mask":"","id":39,"value":0},"item41":{"type":"uint32be","name":"item41","offset":160,"length":1,"offsetbit":0,"mask":"","id":40,"value":0},"item42":{"type":"uint32be","name":"item42","offset":164,"length":1,"offsetbit":0,"mask":"","id":41,"value":0},"item43":{"type":"uint32be","name":"item43","offset":168,"length":1,"offsetbit":0,"mask":"","id":42,"value":0},"item44":{"type":"uint32be","name":"item44","offset":172,"length":1,"offsetbit":0,"mask":"","id":43,"value":0},"item45":{"type":"uint32be","name":"item45","offset":176,"length":1,"offsetbit":0,"mask":"","id":44,"value":0},"item46":{"type":"uint32be","name":"item46","offset":180,"length":1,"offsetbit":0,"mask":"","id":45,"value":0}},"keyvalues":{"item1":0,"item2":0,"item3":0,"item4":0,"item5":0,"item6":0,"item7":0,"item8":281755079,"item9":350502301,"item10":2528918800,"item11":0,"item12":0,"item13":0,"item14":0,"item15":0,"item16":0,"item17":0,"item18":16256,"item19":16256,"item20":16256,"item21":16256,"item22":0,"item23":0,"item24":0,"item25":0,"item26":0,"item27":0,"item28":0,"item29":0,"item30":0,"item31":0,"item32":0,"item33":0,"item34":3235266133,"item35":3858514867,"item36":0,"item37":0,"item38":2097692076,"item39":16928,"item40":0,"item41":0,"item42":0,"item43":0,"item44":0,"item45":0,"item46":0},"arrayResults":[{"type":"uint32be","name":"item1","offset":0,"length":1,"offsetbit":0,"mask":"","id":0,"value":0},{"type":"uint32be","name":"item2","offset":4,"length":1,"offsetbit":0,"mask":"","id":1,"value":0},{"type":"uint32be","name":"item3","offset":8,"length":1,"offsetbit":0,"mask":"","id":2,"value":0},{"type":"uint32be","name":"item4","offset":12,"length":1,"offsetbit":0,"mask":"","id":3,"value":0},{"type":"uint32be","name":"item5","offset":16,"length":1,"offsetbit":0,"mask":"","id":4,"value":0},{"type":"uint32be","name":"item6","offset":20,"length":1,"offsetbit":0,"mask":"","id":5,"value":0},{"type":"uint32be","name":"item7","offset":24,"length":1,"offsetbit":0,"mask":"","id":6,"value":0},{"type":"uint32be","name":"item8","offset":28,"length":1,"offsetbit":0,"mask":"","id":7,"value":281755079},{"type":"uint32be","name":"item9","offset":32,"length":1,"offsetbit":0,"mask":"","id":8,"value":350502301},{"type":"uint32be","name":"item10","offset":36,"length":1,"offsetbit":0,"mask":"","id":9,"value":2528918800},{"type":"uint32be","name":"item11","offset":40,"length":1,"offsetbit":0,"mask":"","id":10,"value":0},{"type":"uint32be","name":"item12","offset":44,"length":1,"offsetbit":0,"mask":"","id":11,"value":0},{"type":"uint32be","name":"item13","offset":48,"length":1,"offsetbit":0,"mask":"","id":12,"value":0},{"type":"uint32be","name":"item14","offset":52,"length":1,"offsetbit":0,"mask":"","id":13,"value":0},{"type":"uint32be","name":"item15","offset":56,"length":1,"offsetbit":0,"mask":"","id":14,"value":0},{"type":"uint32be","name":"item16","offset":60,"length":1,"offsetbit":0,"mask":"","id":15,"value":0},{"type":"uint32be","name":"item17","offset":64,"length":1,"offsetbit":0,"mask":"","id":16,"value":0},{"type":"uint32be","name":"item18","offset":68,"length":1,"offsetbit":0,"mask":"","id":17,"value":16256},{"type":"uint32be","name":"item19","offset":72,"length":1,"offsetbit":0,"mask":"","id":18,"value":16256},{"type":"uint32be","name":"item20","offset":76,"length":1,"offsetbit":0,"mask":"","id":19,"value":16256},{"type":"uint32be","name":"item21","offset":80,"length":1,"offsetbit":0,"mask":"","id":20,"value":16256},{"type":"uint32be","name":"item22","offset":84,"length":1,"offsetbit":0,"mask":"","id":21,"value":0},{"type":"uint32be","name":"item23","offset":88,"length":1,"offsetbit":0,"mask":"","id":22,"value":0},{"type":"uint32be","name":"item24","offset":92,"length":1,"offsetbit":0,"mask":"","id":23,"value":0},{"type":"uint32be","name":"item25","offset":96,"length":1,"offsetbit":0,"mask":"","id":24,"value":0},{"type":"uint32be","name":"item26","offset":100,"length":1,"offsetbit":0,"mask":"","id":25,"value":0},{"type":"uint32be","name":"item27","offset":104,"length":1,"offsetbit":0,"mask":"","id":26,"value":0},{"type":"uint32be","name":"item28","offset":108,"length":1,"offsetbit":0,"mask":"","id":27,"value":0},{"type":"uint32be","name":"item29","offset":112,"length":1,"offsetbit":0,"mask":"","id":28,"value":0},{"type":"uint32be","name":"item30","offset":116,"length":1,"offsetbit":0,"mask":"","id":29,"value":0},{"type":"uint32be","name":"item31","offset":120,"length":1,"offsetbit":0,"mask":"","id":30,"value":0},{"type":"uint32be","name":"item32","offset":124,"length":1,"offsetbit":0,"mask":"","id":31,"value":0},{"type":"uint32be","name":"item33","offset":128,"length":1,"offsetbit":0,"mask":"","id":32,"value":0},{"type":"uint32be","name":"item34","offset":132,"length":1,"offsetbit":0,"mask":"","id":33,"value":3235266133},{"type":"uint32be","name":"item35","offset":136,"length":1,"offsetbit":0,"mask":"","id":34,"value":3858514867},{"type":"uint32be","name":"item36","offset":140,"length":1,"offsetbit":0,"mask":"","id":35,"value":0},{"type":"uint32be","name":"item37","offset":144,"length":1,"offsetbit":0,"mask":"","id":36,"value":0},{"type":"uint32be","name":"item38","offset":148,"length":1,"offsetbit":0,"mask":"","id":37,"value":2097692076},{"type":"uint32be","name":"item39","offset":152,"length":1,"offsetbit":0,"mask":"","id":38,"value":16928},{"type":"uint32be","name":"item40","offset":156,"length":1,"offsetbit":0,"mask":"","id":39,"value":0},{"type":"uint32be","name":"item41","offset":160,"length":1,"offsetbit":0,"mask":"","id":40,"value":0},{"type":"uint32be","name":"item42","offset":164,"length":1,"offsetbit":0,"mask":"","id":41,"value":0},{"type":"uint32be","name":"item43","offset":168,"length":1,"offsetbit":0,"mask":"","id":42,"value":0},{"type":"uint32be","name":"item44","offset":172,"length":1,"offsetbit":0,"mask":"","id":43,"value":0},{"type":"uint32be","name":"item45","offset":176,"length":1,"offsetbit":0,"mask":"","id":44,"value":0},{"type":"uint32be","name":"item46","offset":180,"length":1,"offsetbit":0,"mask":"","id":45,"value":0}],"buffer":[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,16,203,61,199,20,228,61,157,150,188,61,16,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,63,128,0,0,63,128,0,0,63,128,0,0,63,128,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,0,0,0,0,0,0,192,214,62,85,229,252,67,179,0,0,0,0,0,0,0,0,125,8,61,172,0,0,66,32,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]} 

Output from buffer parser item 18, 19, 20, 21 expected value should be 1.0000. Likewise for item 8,9,10 value should be between 0.01 to 0.99

A few things...

  1. when you post flow code, please use the code button image or paste between backticks
    ```
    this like
    ```

  2. That JSON you posted above is NOT from BEFORE the buffer parser. It was taken from a message AFTER the buffer parser (I can see the items 1 ~ 42 in there!!!) I have stated this very clearly and EVEN sent a picture...

  3. I see in the flow you posted above you have specifed 42 items - all of them are set to UINT32


    yet in your question you say...

    clearly the values you expect are NOT UNSIGNED INTEGERS more likely FLOAT or some other scaled value.

  4. You request data from modbus ADDRESS 99
    image
    ... which means item8 (which has a byte offset of 28 / WORD offset of 14) meaning this item 8 would be data from modbus address 99+14 i.e. modbus address 113. Where is the manual that says this is the case and describes the data format?

1 Like

Here you go

image

[{"id":"49e1c7a.657d738","type":"inject","z":"10386968.8e87f7","name":"click me","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1190,"y":160,"wires":[["f51f0101.a590f"]]},{"id":"f51f0101.a590f","type":"function","z":"10386968.8e87f7","name":"fake modbus data","func":"msg={\"topic\":\"312979ea.14b816\",\"messageId\":\"5f8714b17903fbeddd2c36d2\",\"payload\":\"\",\"unitId\":1,\"modbusRequest\":{\"unitid\":1,\"fc\":3,\"address\":99,\"quantity\":96,\"emptyMsgOnFail\":true,\"keepMsgProperties\":false,\"messageId\":\"5f8714b17903fbeddd2c36d2\"},\"responseBuffer\":{\"data\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,4299,15815,5348,15773,38588,15632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16256,0,16256,0,16256,0,16256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49366,15957,58876,17331,0,0,0,0,32008,15788,0,16928,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"buffer\":Buffer.from([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,16,203,61,199,20,228,61,157,150,188,61,16,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,63,128,0,0,63,128,0,0,63,128,0,0,63,128,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,0,0,0,0,0,0,192,214,62,85,229,252,67,179,0,0,0,0,0,0,0,0,125,8,61,172,0,0,66,32,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])},\"_msgid\":\"f2794381.55066\",\"originalPayload\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,4299,15815,5348,15773,38588,15632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16256,0,16256,0,16256,0,16256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49366,15957,58876,17331,0,0,0,0,32008,15788,0,16928,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1230,"y":220,"wires":[["5666b369.94b85c"]]},{"id":"5666b369.94b85c","type":"buffer-parser","z":"10386968.8e87f7","name":"32 bit Float Point Data from Meter","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"item1","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item2","offset":4,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item3","offset":8,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item4","offset":12,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item5","offset":16,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item6","offset":20,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item7","offset":24,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"item8","offset":28,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"item9","offset":32,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"item10","offset":36,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item11","offset":40,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item12","offset":44,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item13","offset":48,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item14","offset":52,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item15","offset":56,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item16","offset":60,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item17","offset":64,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"item18","offset":68,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"item19","offset":72,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"item20","offset":76,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"item21","offset":80,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item22","offset":84,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item23","offset":88,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item24","offset":92,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item25","offset":96,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item26","offset":100,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item27","offset":104,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item28","offset":108,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item29","offset":112,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item30","offset":116,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item31","offset":120,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item32","offset":124,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item33","offset":128,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item34","offset":132,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item35","offset":136,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item36","offset":140,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item37","offset":144,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item38","offset":148,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item39","offset":152,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item40","offset":156,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item41","offset":160,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item42","offset":164,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item43","offset":168,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item44","offset":172,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item45","offset":176,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"uint32be","name":"item46","offset":180,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":1280,"y":280,"wires":[["5d76f097.95812"]]},{"id":"5d76f097.95812","type":"debug","z":"10386968.8e87f7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1350,"y":340,"wires":[]}]

The key to this is try stuff.

I found your data is byte reversed and I guessed the float le conversion...

2 Likes

Thanks for the guidance.

I'm trying to insert output of buffer parser into SQL, but I'm unable to insert it. I'm using MSSQL connector for it. I tried using JSON formatting, Mustache formatting, along with Insert statement. I'm trying to insert all the data outputted from Buffer Parser into SQL

Please help.

  1. Are you using MSSQL-PLUS node?

  2. share your flow
    ```
    paste it like this between 3 backticks
    ```

  3. share your SQL table details e.g.

    CREATE TABLE Persons (
        PersonID int,
        LastName varchar(255),
        FirstName varchar(255),
        Address varchar(255),
        City varchar(255)
    );

No. I'm using MSSQL node.

CREAT TABLE TEST (ID int Identity (1,1) not null Primary Key,
READING float not null,
DEVICE_ID int not null
);

Tried following statements:

  1. INSERT INTO TEST (READING, DEVICE_ID) VALUES ({{{msg.payload.L1}}},1)
  2. INSERT INTO TEST (READING, DEVICE_ID) VALUES ({{{payload}}},1)
  3. INSERT INTO TEST (READING, DEVICE_ID) VALUES (${msg.payload.L1},1)
  4. INSERT INTO TEST (READING, DEVICE_ID) VALUES (${buffer_parser_data.L1},1), etc.

I asked you to share your flow :man_shrugging: - never mind!!!

That version is unsupported and many limitations that i wont go into.

If you use mssql-plus you can use parameters like this...

proof...
image

Okay. I'll try this and get back to you. Thanks @Steve-Mcl

@Steve-Mcl,

Hi,

After configuring the SQL node, I'm stuck with error at SQL node:
Error 1: Error: read ECONNRESET
Error 2: Cannot read property 'name' of undefined.

Please help.

This will happen if you use an unsupported parameter type e.g. decimal(p,s) or numeric(p,s)

I updated mssql-plus yesterday to v0.6.1 that now supports these and also has better error information.

Please try the following...

  1. Update mssql-plus via palette
  2. Restart node-red
  3. Try the data insert again
  4. Let me know how it goes.