Hello friends,
I have prepared one flow where I am reading Energy Meter data through TCP.
I have used Modbus node and sending data to Azure Database. with MSSQL-UCG node.
I am reading total 11 parameters from the meter. When I tried individual parameters with different inject node and different table in Database, it works. But I want to get all the 11 parameter at same time and in on table only.
When i used only one inject node for all the parameters, when node start inject at particular time, it saves only one parameter to the table and all other parameters shows Null value.
Can anybody suggest what should I do to save all 11 parameters at a same time and in single table.
[{"id":"38e77ba6.f6e664","type":"tab","label":"Line_2","disabled":false,"info":""},{"id":"debdf0d1.3e5b2","type":"inject","z":"38e77ba6.f6e664","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":380,"wires":[["18124f38.7264f1","c5df9173.ec296","df127eec.906ca","2a92a902.761716","f54eba2d.e62878","d3bfe2ef.2ac28","6551e332.a3fc3c","71129627.de3808","471883e8.0abcbc","77041a1e.ba6564","f4e1e5d7.0de9f8"]]},{"id":"df127eec.906ca","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':147,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":120,"wires":[["a276c548.102068"]]},{"id":"a276c548.102068","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":120,"wires":[["d97fea33.e04338"],[]]},{"id":"2e032a7f.788ee6","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @KW FLOAT\nSET @KW = {{{payload}}};\n\nINSERT INTO Line_2\n (\n KW,\n Timestamp\n )\nVALUES\n (\n @KW,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":120,"wires":[[]]},{"id":"d97fea33.e04338","type":"function","z":"38e77ba6.f6e664","name":"Realtime_KW","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"KW\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":800,"y":120,"wires":[["2e032a7f.788ee6"]]},{"id":"5aa8df5c.4e205","type":"function","z":"38e77ba6.f6e664","name":"Energy_KWh","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"KWh\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":180,"wires":[["d45c4930.213f88"]]},{"id":"18124f38.7264f1","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':223,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":180,"wires":[["5bb4ea32.c10114"]]},{"id":"5bb4ea32.c10114","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":180,"wires":[["5aa8df5c.4e205"],[]]},{"id":"d45c4930.213f88","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @KWh FLOAT\nSET @KWh = {{{payload}}};\n\nINSERT INTO Line_2\n (\n KWh,\n Timestamp\n )\nVALUES\n (\n @KWh,\n CURRENT_TIMESTAMP\n )\n \n \n ","outField":"payload","x":1050,"y":180,"wires":[[]]},{"id":"978c8c31.31454","type":"comment","z":"38e77ba6.f6e664","name":"66 KV Switchyard Line-2","info":"","x":450,"y":60,"wires":[]},{"id":"3dce24fc.ffb22c","type":"function","z":"38e77ba6.f6e664","name":"Real_PF","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"PF\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":240,"wires":[["c7ea221e.9d132"]]},{"id":"2a92a902.761716","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':139,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":240,"wires":[["e24a91ea.49e4d"]]},{"id":"e24a91ea.49e4d","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":240,"wires":[["3dce24fc.ffb22c"],[]]},{"id":"c7ea221e.9d132","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @PF FLOAT\nSET @PF = {{{payload}}};\n\nINSERT INTO Line_2\n (\n PF,\n Timestamp\n )\nVALUES\n (\n @PF,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":240,"wires":[[]]},{"id":"bbec893c.dc63c8","type":"function","z":"38e77ba6.f6e664","name":"Energy_KVAh","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"KVAh\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":800,"y":300,"wires":[[]]},{"id":"c5df9173.ec296","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':225,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":300,"wires":[["9ec20f0.b422ef"]]},{"id":"9ec20f0.b422ef","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":300,"wires":[["bbec893c.dc63c8"],[]]},{"id":"8d8718a.ce739e8","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @KVAh FLOAT\nSET @KVAh = {{{payload}}};\n\nINSERT INTO Line_2\n (\n KVAh,\n Timestamp\n )\nVALUES\n (\n @KVAh,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":300,"wires":[[]]},{"id":"eb7b01d4.b3255","type":"function","z":"38e77ba6.f6e664","name":"Temperature","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"Temp\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":360,"wires":[["88453b5f.a31528"]]},{"id":"f54eba2d.e62878","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':175,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":360,"wires":[["d29e3f99.84784"]]},{"id":"d29e3f99.84784","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":360,"wires":[["eb7b01d4.b3255"],[]]},{"id":"88453b5f.a31528","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @Temperature FLOAT\nSET @Temperature = {{{payload}}};\n\nINSERT INTO Line_2\n (\n Temperature,\n Timestamp\n )\nVALUES\n (\n @Temperature,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":360,"wires":[[]]},{"id":"2c85caed.9140f6","type":"function","z":"38e77ba6.f6e664","name":"V-THD-R","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"VTHD-R\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":420,"wires":[["30d66d7d.4880f2"]]},{"id":"d3bfe2ef.2ac28","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':177,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":420,"wires":[["5d556345.81146c"]]},{"id":"5d556345.81146c","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":420,"wires":[["2c85caed.9140f6"],[]]},{"id":"30d66d7d.4880f2","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @VTHDR FLOAT\nSET @VTHDR = {{{payload}}};\n\nINSERT INTO Line_2\n (\n VTHDR,\n Timestamp\n )\nVALUES\n (\n @VTHDR,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":420,"wires":[[]]},{"id":"cc835742.345c08","type":"function","z":"38e77ba6.f6e664","name":"V-THD-Y","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"VTHD-Y\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":474,"wires":[["1f08dfe9.cef13"]]},{"id":"6551e332.a3fc3c","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':179,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":474,"wires":[["8e2fb450.6c79d8"]]},{"id":"8e2fb450.6c79d8","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":474,"wires":[["cc835742.345c08"],[]]},{"id":"1f08dfe9.cef13","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @VTHDY FLOAT\nSET @VTHDY = {{{payload}}};\n\nINSERT INTO Line_2\n (\n VTHDY,\n Timestamp\n )\nVALUES\n (\n @VTHDY,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":474,"wires":[[]]},{"id":"7dbdddd9.b83ff4","type":"function","z":"38e77ba6.f6e664","name":"V-THD-B","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"VTHD-B\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":540,"wires":[["57ca43fb.6487cc"]]},{"id":"71129627.de3808","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':181,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":540,"wires":[["db86a9ae.784188"]]},{"id":"db86a9ae.784188","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":540,"wires":[["7dbdddd9.b83ff4"],[]]},{"id":"57ca43fb.6487cc","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @VTHDB FLOAT\nSET @VTHDB = {{{payload}}};\n\nINSERT INTO Line_2\n (\n VTHDB,\n Timestamp\n )\nVALUES\n (\n @VTHDB,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":540,"wires":[[]]},{"id":"e37a70de.8a3f","type":"function","z":"38e77ba6.f6e664","name":"I-THD-R","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"ITHD-R\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":600,"wires":[["51d96671.a8c748"]]},{"id":"471883e8.0abcbc","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':183,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":600,"wires":[["2ebc8116.8d838e"]]},{"id":"2ebc8116.8d838e","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":600,"wires":[["e37a70de.8a3f"],[]]},{"id":"51d96671.a8c748","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @ITHDR FLOAT\nSET @ITHDR = {{{payload}}};\n\nINSERT INTO Line_2\n (\n ITHDR,\n Timestamp\n )\nVALUES\n (\n @ITHDR,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":600,"wires":[[]]},{"id":"29c5f4ae.1692dc","type":"function","z":"38e77ba6.f6e664","name":"I-THD-Y","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"ITHD-Y\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":660,"wires":[["b602408f.66154"]]},{"id":"77041a1e.ba6564","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':185,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":660,"wires":[["868829b1.0d48c8"]]},{"id":"868829b1.0d48c8","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":660,"wires":[["29c5f4ae.1692dc"],[]]},{"id":"b602408f.66154","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @ITHDY FLOAT\nSET @ITHDY = {{{payload}}};\n\nINSERT INTO Line_2\n (\n ITHDY,\n Timestamp\n )\nVALUES\n (\n @ITHDY,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":660,"wires":[[]]},{"id":"a962cf34.2819f","type":"function","z":"38e77ba6.f6e664","name":"I-THD-B","func":"var rawData = new ArrayBuffer(4);\nvar intView = new Uint16Array(rawData);\nvar fltView = new Float32Array(rawData);\n\nintView[1] = msg.payload[1]; //low\nintView[0] = msg.payload[0]; //high\n\nmsg.payload = parseFloat(fltView[0].toFixed(1));\nmsg.topic = \"ITHD-B\";\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.topic + \":\" + msg.payload}); \n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":720,"wires":[["e145b5bd.a50fa8"]]},{"id":"f4e1e5d7.0de9f8","type":"function","z":"38e77ba6.f6e664","name":"Modbus Message","func":"msg.payload ={\n 'fc':3,\n 'unitid':11,\n 'address':187,\n 'quantity':2\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":720,"wires":[["cb67652d.fd5af8"]]},{"id":"cb67652d.fd5af8","type":"modbus-flex-getter","z":"38e77ba6.f6e664","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"6865214d.7a7c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":620,"y":720,"wires":[["a962cf34.2819f"],[]]},{"id":"e145b5bd.a50fa8","type":"MSSQL-UCG","z":"38e77ba6.f6e664","mssqlCN":"c1ab4256.91de3","name":"SQL Query for Remote server","query":"DECLARE @ITHDB FLOAT\nSET @ITHDB = {{{payload}}};\n\nINSERT INTO Line_2\n (\n ITHDB,\n Timestamp\n )\nVALUES\n (\n @ITHDB,\n CURRENT_TIMESTAMP\n )","outField":"payload","x":1050,"y":720,"wires":[[]]},{"id":"6865214d.7a7c","type":"modbus-client","z":"","name":"24Hrs Snap","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"192.168.1.9","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},{"id":"c1ab4256.91de3","type":"MSSQL-UCG-CN","z":"","name":"Azure Line_2","server":"aissqltemp.database.windows.net","port":"","encyption":true,"database":"AHU_1"}]