[{"id":"f5c32c9b.8a69f","type":"tab","label":"Trending_copy","disabled":true,"info":""},{"id":"403c887a.8cc7a8","type":"inject","z":"f5c32c9b.8a69f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":160,"wires":[["8a677f52.3039a","cdee1f90.ae9ae"]]},{"id":"8a677f52.3039a","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qView_TagsTrend","outField":"payload","returnType":0,"throwErrors":1,"query":"SELECT [id] as idTag\r\n ,[nome]\r\n ,[ip]\r\n ,[adress]\r\n ,[dtype]\r\n ,[hist]\r\n FROM [hmiFscam].[dbo].[tagsTrend]\r\n WHERE [ip] = '192.168.1.42'\r\n order by ip, id","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"none","params":[],"x":370,"y":160,"wires":[["8fb7268c.49b228"]]},{"id":"8fb7268c.49b228","type":"function","z":"f5c32c9b.8a69f","name":"","func":"flow.set(\"tagsTrendForno_fVal\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":160,"wires":[[]]},{"id":"cdee1f90.ae9ae","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qView_nRegsTagsTrend","outField":"payload","returnType":0,"throwErrors":1,"query":"SELECT COUNT(id) AS nReg\r\nFROM dbo.tagsTrend\r\nwhere [ip] = '192.168.1.42'","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"none","params":[],"x":390,"y":100,"wires":[["25abead0.c039a6"]]},{"id":"25abead0.c039a6","type":"function","z":"f5c32c9b.8a69f","name":"","func":"flow.set(\"nRegsTrendForno_fVal\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":100,"wires":[["5df3976c.0e3898"]]},{"id":"5df3976c.0e3898","type":"debug","z":"f5c32c9b.8a69f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":100,"wires":[]},{"id":"51cc7053.d6972","type":"modbus-flex-getter","z":"f5c32c9b.8a69f","name":"Forno","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"57332e15.d4ae5","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":510,"y":900,"wires":[["ba3cff0.dc59a"],[]]},{"id":"1c6841c.f103cbe","type":"inject","z":"f5c32c9b.8a69f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":false,"onceDelay":0.1,"topic":"leitOK","payload":"","payloadType":"date","x":150,"y":1120,"wires":[["f777fb3e.6ea2d8","fd96cb5b.3a9758","433a3c6a.39db54","57551078.7ed3b"]]},{"id":"fd96cb5b.3a9758","type":"function","z":"f5c32c9b.8a69f","name":"","func":"var id;\nvar nome;\nvar adress;\n\nvar numeroRegs = flow.get(\"nRegsTrendForno_fVal\")[0].nReg;\nfor (var i = 0 ; i < numeroRegs ; i++) {\n var j=1;\n id = flow.get(\"tagsTrendForno_fVal\")[i].idTag;\n nome = flow.get(\"tagsTrendForno_fVal\")[i].nome;\n adress = flow.get(\"tagsTrendForno_fVal\")[i].adress;\n dtype = flow.get(\"tagsTrendForno_fVal\")[i].dtype;\n switch(dtype){\n case \"int\":\n //node.send({\"payload\" : { value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1}}); Alternativa! \n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1};\n node.send(msg);\n break;\n case \"float\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 2};\n node.send(msg);\n break;\n case \"long\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 2};\n node.send(msg);\n break;\n case \"bool\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1};\n node.send(msg);\n }\n //node.send(msg);\n\n \n}\n\n/*\nvar id;\nvar nome;\nvar adress;\n\nvar numeroRegs = flow.get(\"nRegsTrend_fVal\")[0].nReg;\nfor (var i = 0 ; i < numeroRegs ; i++) { \n id = flow.get(\"tagsTrend_fVal\")[i].id;\n nome = flow.get(\"tagsTrend_fVal\")[i].nome;\n adress = flow.get(\"tagsTrend_fVal\")[i].adress;\n msg.payload = { value: id,'fc': 3, 'unitid': 1, 'address': adress-1 , 'quantity': 1 };\n node.send(msg)\n}\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":900,"wires":[["51cc7053.d6972","a0fe3079.b18fd"]]},{"id":"ba3cff0.dc59a","type":"function","z":"f5c32c9b.8a69f","name":"","func":"var idtag = msg.modbusRequest.unitid;\nvar val = msg.payload;\nvar dtype = msg.modbusRequest.value;\n\nvar msg1 = {payload:null};\nvar msg2 = {payload:null};\nvar msg3 = {payload:null};\n\nswitch(dtype){\n case \"int\" || \"bool\":\n msg1.payload = val;\n msg1.topic = idtag;\n node.send([[msg1],[null],[null]]);\n break;\n case \"float\":\n msg2.payload = val;\n msg2.topic = idtag;\n node.send([[null],[msg2],[null]]);\n break;\n case \"long\":\n msg3.payload = val;\n msg3.topic = idtag;\n node.send([[null],[null],[msg3]]);\n }","outputs":3,"noerr":0,"initialize":"","finalize":"","x":700,"y":900,"wires":[["98c704de.4c2fd8","2222bf63.7448b"],["a76e0e68.6dab8"],["b6e47112.e3e44"]]},{"id":"98c704de.4c2fd8","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qInsert_Trending","outField":"payload","returnType":"1","throwErrors":1,"query":"Insert into dbo.Trending(idtag,tempo,val)\nValues(@idtag,CURRENT_TIMESTAMP, @val)","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"editor","params":[{"output":false,"name":"SO2","type":"Int","valueType":"flow","value":"SO2_Value"},{"output":false,"name":"CO","type":"Int","valueType":"flow","value":"CO_Value"},{"output":false,"name":"idtag","type":"real","valueType":"msg","value":"topic"},{"output":false,"name":"val","type":"Real","valueType":"msg","value":"payload"}],"x":1150,"y":920,"wires":[[]]},{"id":"a76e0e68.6dab8","type":"buffer-parser","z":"f5c32c9b.8a69f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"payload","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":870,"y":940,"wires":[["98c704de.4c2fd8","2222bf63.7448b"]]},{"id":"b6e47112.e3e44","type":"buffer-parser","z":"f5c32c9b.8a69f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"payload","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"string","name":"topic","offset":0,"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":870,"y":980,"wires":[["98c704de.4c2fd8","2222bf63.7448b"]]},{"id":"c22bb5a7.8158a8","type":"comment","z":"f5c32c9b.8a69f","name":"Leitura de tags de trending / Forno","info":"","x":180,"y":60,"wires":[]},{"id":"433a3c6a.39db54","type":"function","z":"f5c32c9b.8a69f","name":"","func":"var id;\nvar nome;\nvar adress;\n\nvar numeroRegs = flow.get(\"nRegsTrendFieira_fVal\")[0].nReg;\nfor (var i = 0 ; i < numeroRegs ; i++) {\n var j=1;\n id = flow.get(\"tagsTrendFieira_fVal\")[i].idTag;\n nome = flow.get(\"tagsTrendFieira_fVal\")[i].nome;\n adress = flow.get(\"tagsTrendFieira_fVal\")[i].adress;\n dtype = flow.get(\"tagsTrendFieira_fVal\")[i].dtype;\n switch(dtype){\n case \"int\":\n //node.send({\"payload\" : { value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1}}); Alternativa! \n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1};\n node.send(msg);\n break;\n case \"float\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 2};\n node.send(msg);\n break;\n case \"long\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 2};\n node.send(msg);\n break;\n case \"bool\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1};\n node.send(msg);\n }\n //node.send(msg);\n\n \n}\n\n/*\nvar id;\nvar nome;\nvar adress;\n\nvar numeroRegs = flow.get(\"nRegsTrend_fVal\")[0].nReg;\nfor (var i = 0 ; i < numeroRegs ; i++) { \n id = flow.get(\"tagsTrend_fVal\")[i].id;\n nome = flow.get(\"tagsTrend_fVal\")[i].nome;\n adress = flow.get(\"tagsTrend_fVal\")[i].adress;\n msg.payload = { value: id,'fc': 3, 'unitid': 1, 'address': adress-1 , 'quantity': 1 };\n node.send(msg)\n}\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":1040,"wires":[["3ae06a17.092416","a69ccf95.527f4"]]},{"id":"3ae06a17.092416","type":"modbus-flex-getter","z":"f5c32c9b.8a69f","name":"Fieira","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"e8394247.b7eec","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":510,"y":1040,"wires":[["4484487b.77c178"],[]]},{"id":"4484487b.77c178","type":"function","z":"f5c32c9b.8a69f","name":"","func":"var idtag = msg.modbusRequest.unitid;\nvar val = msg.payload;\nvar dtype = msg.modbusRequest.value;\n\nvar msg1 = {payload:null};\nvar msg2 = {payload:null};\nvar msg3 = {payload:null};\n\nswitch(dtype){\n case \"int\" || \"bool\":\n msg1.payload = val;\n msg1.topic = idtag;\n node.send([[msg1],[null],[null]]);\n break;\n case \"float\":\n msg2.payload = val;\n msg2.topic = idtag;\n node.send([[null],[msg2],[null]]);\n break;\n case \"long\":\n msg3.payload = val;\n msg3.topic = idtag;\n node.send([[null],[null],[msg3]]);\n }","outputs":3,"noerr":0,"initialize":"","finalize":"","x":700,"y":1040,"wires":[["d90fbe64.27df9","4a667d1e.400e04"],["f6a32711.97d188"],["1dac9b5f.f9ad95"]]},{"id":"f6a32711.97d188","type":"buffer-parser","z":"f5c32c9b.8a69f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"payload","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":870,"y":1080,"wires":[["d90fbe64.27df9","4a667d1e.400e04"]]},{"id":"1dac9b5f.f9ad95","type":"buffer-parser","z":"f5c32c9b.8a69f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"payload","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"string","name":"topic","offset":0,"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":870,"y":1120,"wires":[["d90fbe64.27df9","4a667d1e.400e04"]]},{"id":"d90fbe64.27df9","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qInsert_Trending","outField":"payload","returnType":0,"throwErrors":1,"query":"Insert into dbo.Trending(idtag,tempo,val)\nValues(@idtag,CURRENT_TIMESTAMP, @val)","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"editor","params":[{"output":false,"name":"SO2","type":"Int","valueType":"flow","value":"SO2_Value"},{"output":false,"name":"CO","type":"Int","valueType":"flow","value":"CO_Value"},{"output":false,"name":"idtag","type":"real","valueType":"msg","value":"topic"},{"output":false,"name":"val","type":"Real","valueType":"msg","value":"payload"}],"x":1150,"y":1080,"wires":[[]]},{"id":"4a667d1e.400e04","type":"debug","z":"f5c32c9b.8a69f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1130,"y":1020,"wires":[]},{"id":"2222bf63.7448b","type":"debug","z":"f5c32c9b.8a69f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1130,"y":880,"wires":[]},{"id":"f777fb3e.6ea2d8","type":"debug","z":"f5c32c9b.8a69f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","statusVal":"","statusType":"auto","x":360,"y":840,"wires":[]},{"id":"1f579b94.e61314","type":"comment","z":"f5c32c9b.8a69f","name":"Insert de tags de trending","info":"","x":150,"y":840,"wires":[]},{"id":"a23c3094.960c2","type":"comment","z":"f5c32c9b.8a69f","name":"Leitura de tags de trending / Secador","info":"","x":180,"y":420,"wires":[]},{"id":"688d85ac.6452dc","type":"inject","z":"f5c32c9b.8a69f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":520,"wires":[["6ec6b99.b48b548","38b1158b.148e7a"]]},{"id":"6ec6b99.b48b548","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qView_TagsTrend","outField":"payload","returnType":0,"throwErrors":1,"query":"SELECT [id] as idTag\r\n ,[nome]\r\n ,[ip]\r\n ,[adress]\r\n ,[dtype]\r\n ,[hist]\r\n FROM [hmiFscam].[dbo].[tagsTrend]\r\n WHERE [ip] = '192.168.1.46'\r\n order by ip, id","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"none","params":[],"x":370,"y":520,"wires":[["fb7b9f2a.3910b"]]},{"id":"fb7b9f2a.3910b","type":"function","z":"f5c32c9b.8a69f","name":"","func":"flow.set(\"tagsTrendSecador_fVal\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":520,"wires":[[]]},{"id":"38b1158b.148e7a","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qView_nRegsTagsTrend","outField":"payload","returnType":0,"throwErrors":1,"query":"SELECT COUNT(id) AS nReg\r\nFROM dbo.tagsTrend\r\nwhere [ip] = '192.168.1.46'","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"none","params":[],"x":390,"y":460,"wires":[["a81282d8.08c0b"]]},{"id":"a81282d8.08c0b","type":"function","z":"f5c32c9b.8a69f","name":"","func":"flow.set(\"nRegsTrendSecador_fVal\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":460,"wires":[["c4acb0a8.5a326"]]},{"id":"c4acb0a8.5a326","type":"debug","z":"f5c32c9b.8a69f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":460,"wires":[]},{"id":"57551078.7ed3b","type":"function","z":"f5c32c9b.8a69f","name":"","func":"var id;\nvar nome;\nvar adress;\n\nvar numeroRegs = flow.get(\"nRegsTrendSecador_fVal\")[0].nReg;\nfor (var i = 0 ; i < numeroRegs ; i++) {\n var j=1;\n id = flow.get(\"tagsTrendSecador_fVal\")[i].idTag;\n nome = flow.get(\"tagsTrendSecador_fVal\")[i].nome;\n adress = flow.get(\"tagsTrendSecador_fVal\")[i].adress;\n dtype = flow.get(\"tagsTrendSecador_fVal\")[i].dtype;\n switch(dtype){\n case \"int\":\n //node.send({\"payload\" : { value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1}}); Alternativa! \n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1};\n node.send(msg);\n break;\n case \"float\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 2};\n node.send(msg);\n break;\n case \"long\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 2};\n node.send(msg);\n break;\n case \"bool\":\n msg.payload = {value: dtype,'fc': 3, 'unitid': id, 'address': adress-1 , 'quantity': 1};\n node.send(msg);\n }\n //node.send(msg);\n\n \n}\n\n/*\nvar id;\nvar nome;\nvar adress;\n\nvar numeroRegs = flow.get(\"nRegsTrend_fVal\")[0].nReg;\nfor (var i = 0 ; i < numeroRegs ; i++) { \n id = flow.get(\"tagsTrend_fVal\")[i].id;\n nome = flow.get(\"tagsTrend_fVal\")[i].nome;\n adress = flow.get(\"tagsTrend_fVal\")[i].adress;\n msg.payload = { value: id,'fc': 3, 'unitid': 1, 'address': adress-1 , 'quantity': 1 };\n node.send(msg)\n}\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":1180,"wires":[["26f9bd6a.d9aef2","af4d9152.af8db"]]},{"id":"26f9bd6a.d9aef2","type":"modbus-flex-getter","z":"f5c32c9b.8a69f","name":"Secador","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"24f82de6.9decb2","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":520,"y":1180,"wires":[["1f0012de.3a0e1d"],[]]},{"id":"1f0012de.3a0e1d","type":"function","z":"f5c32c9b.8a69f","name":"","func":"var idtag = msg.modbusRequest.unitid;\nvar val = msg.payload;\nvar dtype = msg.modbusRequest.value;\n\nvar msg1 = {payload:null};\nvar msg2 = {payload:null};\nvar msg3 = {payload:null};\n\nswitch(dtype){\n case \"int\" || \"bool\":\n msg1.payload = val;\n msg1.topic = idtag;\n node.send([[msg1],[null],[null]]);\n break;\n case \"float\":\n msg2.payload = val;\n msg2.topic = idtag;\n node.send([[null],[msg2],[null]]);\n break;\n case \"long\":\n msg3.payload = val;\n msg3.topic = idtag;\n node.send([[null],[null],[msg3]]);\n }","outputs":3,"noerr":0,"initialize":"","finalize":"","x":700,"y":1180,"wires":[["e3fbd85b.594b58","20b4412e.bdab3e"],["9bc5f144.dcbe2"],["55a0eda3.74f804"]]},{"id":"9bc5f144.dcbe2","type":"buffer-parser","z":"f5c32c9b.8a69f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"payload","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":870,"y":1220,"wires":[["e3fbd85b.594b58","20b4412e.bdab3e"]]},{"id":"55a0eda3.74f804","type":"buffer-parser","z":"f5c32c9b.8a69f","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"payload","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"string","name":"topic","offset":0,"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":870,"y":1260,"wires":[["e3fbd85b.594b58","20b4412e.bdab3e"]]},{"id":"e3fbd85b.594b58","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qInsert_Trending","outField":"payload","returnType":0,"throwErrors":1,"query":"Insert into dbo.Trending(idtag,tempo,val)\nValues(@idtag,CURRENT_TIMESTAMP, @val)","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"editor","params":[{"output":false,"name":"SO2","type":"Int","valueType":"flow","value":"SO2_Value"},{"output":false,"name":"CO","type":"Int","valueType":"flow","value":"CO_Value"},{"output":false,"name":"idtag","type":"real","valueType":"msg","value":"topic"},{"output":false,"name":"val","type":"Real","valueType":"msg","value":"payload"}],"x":1150,"y":1220,"wires":[[]]},{"id":"20b4412e.bdab3e","type":"debug","z":"f5c32c9b.8a69f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1130,"y":1160,"wires":[]},{"id":"b6dacaeb.738998","type":"comment","z":"f5c32c9b.8a69f","name":"Leitura de tags de trending / SecBiomassa","info":"","x":200,"y":600,"wires":[]},{"id":"2b2df37b.5b394c","type":"inject","z":"f5c32c9b.8a69f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":720,"wires":[["cbf6d0ac.3758c","1b1335e2.e6cc5a"]]},{"id":"cbf6d0ac.3758c","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qView_TagsTrend","outField":"payload","returnType":0,"throwErrors":1,"query":"SELECT [id] as idTag\r\n ,[nome]\r\n ,[ip]\r\n ,[adress]\r\n ,[dtype]\r\n ,[hist]\r\n FROM [hmiFscam].[dbo].[tagsTrend]\r\n WHERE [ip] = '192.168.1.35'\r\n order by ip, id","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"none","params":[],"x":370,"y":720,"wires":[["21e57f83.5a729"]]},{"id":"21e57f83.5a729","type":"function","z":"f5c32c9b.8a69f","name":"","func":"flow.set(\"tagsTrendSecBiomassa_fVal\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":720,"wires":[[]]},{"id":"1b1335e2.e6cc5a","type":"MSSQL","z":"f5c32c9b.8a69f","mssqlCN":"3222edfd.86f4d2","name":"qView_nRegsTagsTrend","outField":"payload","returnType":0,"throwErrors":1,"query":"SELECT COUNT(id) AS nReg\r\nFROM dbo.tagsTrend\r\nwhere [ip] = '192.168.1.35'","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"none","params":[],"x":390,"y":660,"wires":[["bb647503.68dfb8"]]},{"id":"bb647503.68dfb8","type":"function","z":"f5c32c9b.8a69f","name":"","func":"flow.set(\"nRegsTrendSecBiomassa_fVal\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":660,"wires":[["ed4eae9a.862e2"]]},{"id":"ed4eae9a.862e2","type":"debug","z":"f5c32c9b.8a69f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":660,"wires":[]},{"id":"a0fe3079.b18fd","type":"debug","z":"f5c32c9b.8a69f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":960,"wires":[]},{"id":"a69ccf95.527f4","type":"debug","z":"f5c32c9b.8a69f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":1100,"wires":[]},{"id":"af4d9152.af8db","type":"debug","z":"f5c32c9b.8a69f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":1240,"wires":[]},{"id":"3222edfd.86f4d2","type":"MSSQL-CN","tdsVersion":"7_4","name":"hmiFscam_cnn","server":"192.168.1.17\\sqlexpress","port":"1433","encyption":false,"database":"hmiFscam","useUTC":false,"connectTimeout":"15000","requestTimeout":"15000","cancelTimeout":"5000","pool":"5","parseJSON":false,"enableArithAbort":true},{"id":"57332e15.d4ae5","type":"modbus-client","name":"Forno","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.1.42","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":"e8394247.b7eec","type":"modbus-client","name":"Fieira","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.1.27","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"2","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"24f82de6.9decb2","type":"modbus-client","name":"Secador","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.1.46","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}]